mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-11 08:52:27 +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_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)
|
bool WorldServer::SendPacket(ServerPacket *pack)
|
||||||
@ -2352,3 +2354,9 @@ void WorldServer::RequestTellQueue(const char *who)
|
|||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WorldServer::OnKeepAlive(EQ::Timer *t)
|
||||||
|
{
|
||||||
|
ServerPacket pack(ServerOP_KeepAlive, 0);
|
||||||
|
SendPacket(&pack);
|
||||||
|
}
|
||||||
|
|||||||
@ -72,7 +72,10 @@ private:
|
|||||||
uint32 cur_groupid;
|
uint32 cur_groupid;
|
||||||
uint32 last_groupid;
|
uint32 last_groupid;
|
||||||
|
|
||||||
|
void OnKeepAlive(EQ::Timer *t);
|
||||||
|
|
||||||
std::unique_ptr<EQ::Net::ServertalkClient> m_connection;
|
std::unique_ptr<EQ::Net::ServertalkClient> m_connection;
|
||||||
|
std::unique_ptr<EQ::Timer> m_keepalive;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user