mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-25 13:32:26 +00:00
Implement Zone -> World keepalive so that Zone reconnects to world in the case of a world crash / reset
This commit is contained in:
parent
4cba9439b9
commit
4b61d00dfe
@ -85,6 +85,8 @@ void WorldServer::Connect()
|
||||
});
|
||||
|
||||
m_connection->OnMessage(std::bind(&WorldServer::HandleMessage, this, std::placeholders::_1, std::placeholders::_2));
|
||||
|
||||
m_keepalive.reset(new EQ::Timer(2500, true, std::bind(&WorldServer::OnKeepAlive, this, std::placeholders::_1)));
|
||||
}
|
||||
|
||||
bool WorldServer::SendPacket(ServerPacket *pack)
|
||||
@ -563,7 +565,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
ServerZoneDropClient_Struct* drop = (ServerZoneDropClient_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
zone->RemoveAuth(drop->lsid);
|
||||
|
||||
|
||||
auto client = entity_list.GetClientByLSID(drop->lsid);
|
||||
if (client) {
|
||||
client->Kick("Dropped by world CLE subsystem");
|
||||
@ -2352,3 +2354,9 @@ void WorldServer::RequestTellQueue(const char *who)
|
||||
safe_delete(pack);
|
||||
return;
|
||||
}
|
||||
|
||||
void WorldServer::OnKeepAlive(EQ::Timer *t)
|
||||
{
|
||||
ServerPacket pack(ServerOP_KeepAlive, 0);
|
||||
SendPacket(&pack);
|
||||
}
|
||||
|
||||
@ -72,7 +72,10 @@ private:
|
||||
uint32 cur_groupid;
|
||||
uint32 last_groupid;
|
||||
|
||||
void OnKeepAlive(EQ::Timer *t);
|
||||
|
||||
std::unique_ptr<EQ::Net::ServertalkClient> m_connection;
|
||||
std::unique_ptr<EQ::Timer> m_keepalive;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user