diff options
author | Patric Stout <truebrain@openttd.org> | 2021-02-25 20:30:16 +0100 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-02-27 00:36:14 +0100 |
commit | 53c28a8ec9845a90f0c9e1ed83a87dbb7959d14d (patch) | |
tree | ec8b01761fd3c819d4e1317c86e7da37070b1152 /src/network/core/tcp_game.cpp | |
parent | dc7ba33b515c83ec0ebd9cb1789fd20294dee4ec (diff) | |
download | openttd-53c28a8ec9845a90f0c9e1ed83a87dbb7959d14d.tar.xz |
Codechange: [Network] replace _realtime_tick with std::chrono
Diffstat (limited to 'src/network/core/tcp_game.cpp')
-rw-r--r-- | src/network/core/tcp_game.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/core/tcp_game.cpp b/src/network/core/tcp_game.cpp index e0835771e..06e56e229 100644 --- a/src/network/core/tcp_game.cpp +++ b/src/network/core/tcp_game.cpp @@ -25,9 +25,10 @@ * @param s The socket to connect with. */ NetworkGameSocketHandler::NetworkGameSocketHandler(SOCKET s) : info(nullptr), client_id(INVALID_CLIENT_ID), - last_frame(_frame_counter), last_frame_server(_frame_counter), last_packet(_realtime_tick) + last_frame(_frame_counter), last_frame_server(_frame_counter) { this->sock = s; + this->last_packet = std::chrono::steady_clock::now(); } /** @@ -63,7 +64,7 @@ NetworkRecvStatus NetworkGameSocketHandler::HandlePacket(Packet *p) { PacketGameType type = (PacketGameType)p->Recv_uint8(); - this->last_packet = _realtime_tick; + this->last_packet = std::chrono::steady_clock::now(); switch (this->HasClientQuit() ? PACKET_END : type) { case PACKET_SERVER_FULL: return this->Receive_SERVER_FULL(p); |