diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index 5795221a2e..a438545779 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -141,7 +141,7 @@ using CommandQueue = std::vector; class NetworkGameSocketHandler : public NetworkTCPSocketHandler { /* TODO: rewrite into a proper class */ private: - NetworkClientInfo *info; ///< Client info related to this socket + NetworkClientInfo *info = nullptr; ///< Client info related to this socket bool is_pending_deletion = false; ///< Whether this socket is pending deletion protected: @@ -483,9 +483,9 @@ protected: NetworkGameSocketHandler(SOCKET s); public: - ClientID client_id; ///< Client identifier - uint32_t last_frame; ///< Last frame we have executed - uint32_t last_frame_server; ///< Last frame the server has executed + ClientID client_id = INVALID_CLIENT_ID; ///< Client identifier + uint32_t last_frame = 0; ///< Last frame we have executed + uint32_t last_frame_server = 0; ///< Last frame the server has executed CommandQueue incoming_queue; ///< The command-queue awaiting handling std::chrono::steady_clock::time_point last_packet; ///< Time we received the last frame. diff --git a/src/network/network_client.h b/src/network/network_client.h index 75a1ce4dd3..c187214870 100644 --- a/src/network/network_client.h +++ b/src/network/network_client.h @@ -13,12 +13,12 @@ #include "network_internal.h" /** Class for handling the client side of the game connection. */ -class ClientNetworkGameSocketHandler : public ZeroedMemoryAllocator, public NetworkGameSocketHandler { +class ClientNetworkGameSocketHandler : public NetworkGameSocketHandler { private: std::unique_ptr authentication_handler; ///< The handler for the authentication. std::string connection_string; ///< Address we are connected to. std::shared_ptr savegame; ///< Packet reader for reading the savegame. - uint8_t token; ///< The token we need to send back to the server to prove we're the right client. + uint8_t token = 0; ///< The token we need to send back to the server to prove we're the right client. /** Status of the connection with the server. */ enum ServerStatus { diff --git a/src/network/network_query.h b/src/network/network_query.h index 0f7348838f..59db813f65 100644 --- a/src/network/network_query.h +++ b/src/network/network_query.h @@ -13,7 +13,7 @@ #include "network_internal.h" /** Class for handling the client side of quering a game server. */ -class QueryNetworkGameSocketHandler : public ZeroedMemoryAllocator, public NetworkGameSocketHandler { +class QueryNetworkGameSocketHandler : public NetworkGameSocketHandler { private: static std::vector> queries; ///< Pending queries. std::string connection_string; ///< Address we are connected to.