mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 15:26:59 +00:00
add debug print in timeout ping update
This commit is contained in:
parent
e35d1b5457
commit
b524aa67de
@ -22,6 +22,8 @@ public:
|
||||
};
|
||||
|
||||
explicit TClient(TServer& Server);
|
||||
TClient(const TClient&) = delete;
|
||||
TClient& operator=(const TClient&) = delete;
|
||||
|
||||
void AddNewCar(int Ident, const std::string& Data);
|
||||
void SetCarData(int Ident, const std::string& Data);
|
||||
|
@ -69,7 +69,7 @@ TServer& TClient::Server() const {
|
||||
return mServer;
|
||||
}
|
||||
|
||||
void TClient::EnqueueMissedPacketDuringSyncing(const std::string& Packet){
|
||||
void TClient::EnqueueMissedPacketDuringSyncing(const std::string& Packet) {
|
||||
std::unique_lock Lock(mMissedPacketsMutex);
|
||||
mMissedPacketsDuringSyncing.push(Packet);
|
||||
}
|
||||
@ -81,6 +81,7 @@ TClient::TClient(TServer& Server)
|
||||
|
||||
void TClient::UpdatePingTime() {
|
||||
mLastPingTime = std::chrono::high_resolution_clock::now();
|
||||
debug(std::string("ping time updated!: ") + ((SecondsSinceLastPing() == 0) ? "OK" : "ERR"));
|
||||
}
|
||||
int TClient::SecondsSinceLastPing() {
|
||||
auto seconds = std::chrono::duration_cast<std::chrono::seconds>(
|
||||
|
@ -489,7 +489,8 @@ void TNetwork::TCPClient(const std::weak_ptr<TClient>& c) {
|
||||
if (c.expired())
|
||||
break;
|
||||
auto Client = c.lock();
|
||||
if (Client->GetStatus() <= -1) {
|
||||
if (Client->GetStatus() < 0) {
|
||||
debug("client status < 0, breaking client loop");
|
||||
break;
|
||||
}
|
||||
TServer::GlobalParser(c, TCPRcv(*Client), mPPSMonitor, *this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user