mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-28 20:07:56 +00:00
Add DynamicZone class for expedition instancing
Add DynamicZone sql table schema Add DynamicZones logging category Modify CreateExpedition to take DynamicZone and ExpeditionRequest objects Implement DynamicZone compass, safereturn, and zone-in coordinates. Implement live-like DynamicZone instance kick timer for removed members Implement updating multiple client compasses (supports existing quest compass) fix: Send client compass update after entering zones to clear existing compass Implement Client::MovePCDynamicZone to invoke DynamicZoneSwitchListWnd when entering a zone where client has multiple dynamic zones assigned Implement OP_DzChooseZoneReply handling Add Lua api methods for expedition's associated dynamic zone Add #dz list gm command to list current DynamicZone instances from database
This commit is contained in:
@@ -30,23 +30,27 @@
|
||||
extern ClientList client_list;
|
||||
extern ZSList zoneserver_list;
|
||||
|
||||
void Expedition::PurgeEmptyExpeditions()
|
||||
void Expedition::PurgeExpiredExpeditions()
|
||||
{
|
||||
std::string query = SQL(
|
||||
DELETE expedition FROM expedition_details expedition
|
||||
LEFT JOIN instance_list ON expedition.instance_id = instance_list.id
|
||||
LEFT JOIN (
|
||||
SELECT expedition_id, COUNT(IF(is_current_member = TRUE, 1, NULL)) member_count
|
||||
FROM expedition_members
|
||||
GROUP BY expedition_id
|
||||
) AS expedition_members
|
||||
ON expedition_members.expedition_id = expedition.id
|
||||
WHERE expedition_members.expedition_id IS NULL OR expedition_members.member_count <= 0
|
||||
WHERE
|
||||
expedition.instance_id IS NULL
|
||||
OR expedition_members.member_count = 0
|
||||
OR (instance_list.start_time + instance_list.duration) <= UNIX_TIMESTAMP();
|
||||
);
|
||||
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
{
|
||||
LogExpeditions("Failed to purge empty expeditions");
|
||||
LogExpeditions("Failed to purge expired and empty expeditions");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ class ServerPacket;
|
||||
|
||||
namespace Expedition
|
||||
{
|
||||
void PurgeEmptyExpeditions();
|
||||
void PurgeExpiredExpeditions();
|
||||
void PurgeExpiredCharacterLockouts();
|
||||
void AddPlayer(ServerPacket* pack);
|
||||
void MakeLeader(ServerPacket* pack);
|
||||
|
||||
+2
-2
@@ -431,7 +431,7 @@ int main(int argc, char** argv) {
|
||||
PurgeInstanceTimer.Start(450000);
|
||||
|
||||
LogInfo("Purging expired expeditions");
|
||||
Expedition::PurgeEmptyExpeditions(); //database.PurgeExpiredExpeditions();
|
||||
Expedition::PurgeExpiredExpeditions();
|
||||
Expedition::PurgeExpiredCharacterLockouts();
|
||||
|
||||
LogInfo("Loading char create info");
|
||||
@@ -604,7 +604,7 @@ int main(int argc, char** argv) {
|
||||
if (PurgeInstanceTimer.Check()) {
|
||||
database.PurgeExpiredInstances();
|
||||
database.PurgeAllDeletedDataBuckets();
|
||||
Expedition::PurgeEmptyExpeditions();
|
||||
Expedition::PurgeExpiredExpeditions();
|
||||
Expedition::PurgeExpiredCharacterLockouts();
|
||||
}
|
||||
|
||||
|
||||
@@ -1375,6 +1375,9 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
case ServerOP_ExpeditionMemberChange:
|
||||
case ServerOP_ExpeditionMemberSwap:
|
||||
case ServerOP_ExpeditionMemberStatus:
|
||||
case ServerOP_ExpeditionDzCompass:
|
||||
case ServerOP_ExpeditionDzSafeReturn:
|
||||
case ServerOP_ExpeditionDzZoneIn:
|
||||
{
|
||||
zoneserver_list.SendPacket(pack);
|
||||
break;
|
||||
@@ -1394,6 +1397,16 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
Expedition::MakeLeader(pack);
|
||||
break;
|
||||
}
|
||||
case ServerOP_DzCharacterChange:
|
||||
{
|
||||
auto buf = reinterpret_cast<ServerDzCharacter_Struct*>(pack->pBuffer);
|
||||
ZoneServer* instance_zs = zoneserver_list.FindByInstanceID(buf->instance_id);
|
||||
if (instance_zs)
|
||||
{
|
||||
instance_zs->SendPacket(pack);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
LogInfo("Unknown ServerOPcode from zone {:#04x}, size [{}]", pack->opcode, pack->size);
|
||||
|
||||
Reference in New Issue
Block a user