mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
Keep alive implemented for world->zone
This commit is contained in:
parent
d2683022e1
commit
5060de9b58
@ -43,6 +43,7 @@ ZSList::ZSList()
|
|||||||
memset(pLockedZones, 0, sizeof(pLockedZones));
|
memset(pLockedZones, 0, sizeof(pLockedZones));
|
||||||
|
|
||||||
m_tick.reset(new EQ::Timer(5000, true, std::bind(&ZSList::OnTick, this, std::placeholders::_1)));
|
m_tick.reset(new EQ::Timer(5000, true, std::bind(&ZSList::OnTick, this, std::placeholders::_1)));
|
||||||
|
m_keepalive.reset(new EQ::Timer(2500, true, std::bind(&ZSList::OnKeepAlive, this, std::placeholders::_1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
ZSList::~ZSList() {
|
ZSList::~ZSList() {
|
||||||
@ -745,4 +746,11 @@ void ZSList::OnTick(EQ::Timer *t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
web_interface.SendEvent(out);
|
web_interface.SendEvent(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ZSList::OnKeepAlive(EQ::Timer *t)
|
||||||
|
{
|
||||||
|
for (auto &zone : list) {
|
||||||
|
zone->SendKeepAlive();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -63,6 +63,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void OnTick(EQ::Timer *t);
|
void OnTick(EQ::Timer *t);
|
||||||
|
void OnKeepAlive(EQ::Timer *t);
|
||||||
uint32 NextID;
|
uint32 NextID;
|
||||||
std::list<std::unique_ptr<ZoneServer>> list;
|
std::list<std::unique_ptr<ZoneServer>> list;
|
||||||
uint16 pLockedZones[MaxLockedZones];
|
uint16 pLockedZones[MaxLockedZones];
|
||||||
@ -70,6 +71,7 @@ private:
|
|||||||
uint16 LastAllocatedPort;
|
uint16 LastAllocatedPort;
|
||||||
|
|
||||||
std::unique_ptr<EQ::Timer> m_tick;
|
std::unique_ptr<EQ::Timer> m_tick;
|
||||||
|
std::unique_ptr<EQ::Timer> m_keepalive;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*ZONELIST_H_*/
|
#endif /*ZONELIST_H_*/
|
||||||
|
|||||||
@ -1400,6 +1400,13 @@ void ZoneServer::SendGroupIDs() {
|
|||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ZoneServer::SendKeepAlive()
|
||||||
|
{
|
||||||
|
ServerPacket pack(ServerOP_KeepAlive, 0);
|
||||||
|
SendPacket(&pack);
|
||||||
|
}
|
||||||
|
|
||||||
void ZoneServer::ChangeWID(uint32 iCharID, uint32 iWID) {
|
void ZoneServer::ChangeWID(uint32 iCharID, uint32 iWID) {
|
||||||
auto pack = new ServerPacket(ServerOP_ChangeWID, sizeof(ServerChangeWID_Struct));
|
auto pack = new ServerPacket(ServerOP_ChangeWID, sizeof(ServerChangeWID_Struct));
|
||||||
ServerChangeWID_Struct* scw = (ServerChangeWID_Struct*)pack->pBuffer;
|
ServerChangeWID_Struct* scw = (ServerChangeWID_Struct*)pack->pBuffer;
|
||||||
|
|||||||
@ -39,6 +39,7 @@ public:
|
|||||||
void SendPacket(ServerPacket* pack) { tcpc->SendPacket(pack); }
|
void SendPacket(ServerPacket* pack) { tcpc->SendPacket(pack); }
|
||||||
void SendEmoteMessage(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message, ...);
|
void SendEmoteMessage(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message, ...);
|
||||||
void SendEmoteMessageRaw(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message);
|
void SendEmoteMessageRaw(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message);
|
||||||
|
void SendKeepAlive();
|
||||||
bool SetZone(uint32 iZoneID, uint32 iInstanceID = 0, bool iStaticZone = false);
|
bool SetZone(uint32 iZoneID, uint32 iInstanceID = 0, bool iStaticZone = false);
|
||||||
void TriggerBootup(uint32 iZoneID = 0, uint32 iInstanceID = 0, const char* iAdminName = 0, bool iMakeStatic = false);
|
void TriggerBootup(uint32 iZoneID = 0, uint32 iInstanceID = 0, const char* iAdminName = 0, bool iMakeStatic = false);
|
||||||
void Disconnect() { auto handle = tcpc->Handle(); if (handle) { handle->Disconnect(); } }
|
void Disconnect() { auto handle = tcpc->Handle(); if (handle) { handle->Disconnect(); } }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user