Add keepalives for world > login and login > world

This commit is contained in:
Akkadius
2019-09-07 21:55:21 -05:00
parent 4b61d00dfe
commit 1bfbe51d89
4 changed files with 27 additions and 1 deletions
+8 -1
View File
@@ -446,7 +446,6 @@ bool LoginServer::Connect()
std::placeholders::_2
)
);
}
else {
client.reset(new EQ::Net::ServertalkClient(LoginServerAddress, LoginServerPort, false, "World", ""));
@@ -553,6 +552,8 @@ bool LoginServer::Connect()
);
}
m_keepalive.reset(new EQ::Timer(5000, true, std::bind(&LoginServer::OnKeepAlive, this, std::placeholders::_1)));
return true;
}
@@ -643,3 +644,9 @@ void LoginServer::SendAccountUpdate(ServerPacket *pack)
SendPacket(pack);
}
}
void LoginServer::OnKeepAlive(EQ::Timer *t)
{
ServerPacket pack(ServerOP_KeepAlive, 0);
SendPacket(&pack);
}
+3
View File
@@ -53,6 +53,9 @@ private:
void ProcessLSRemoteAddr(uint16_t opcode, EQ::Net::Packet &p);
void ProcessLSAccountUpdate(uint16_t opcode, EQ::Net::Packet &p);
void OnKeepAlive(EQ::Timer *t);
std::unique_ptr<EQ::Timer> m_keepalive;
std::unique_ptr<EQ::Net::ServertalkClient> client;
std::unique_ptr<EQ::Net::ServertalkLegacyClient> legacy_client;
std::unique_ptr<EQ::Timer> statusupdate_timer;