attempt to fix ghost player issue

This commit is contained in:
Lion Kortlepel
2021-02-17 12:51:57 +01:00
committed by Anonymous275
parent 13f8be5d39
commit e04a569e33
8 changed files with 37 additions and 5 deletions

View File

@@ -70,3 +70,12 @@ TServer& TClient::Server() const {
TClient::TClient(TServer& Server)
: mServer(Server) {
}
void TClient::UpdatePingTime() {
mLastPingTime = std::chrono::high_resolution_clock::now();
}
int TClient::SecondsSinceLastPing() {
return std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::high_resolution_clock::now() - mLastPingTime)
.count();
}