Codechange: Remove ZeroedMemoryAllocator from network socket handlers. (#13377)

Prefer member default initialisation instead.
This commit is contained in:
Peter Nelson
2025-01-28 19:10:00 +00:00
committed by GitHub
parent 4099acb946
commit 77f4d776c4
14 changed files with 43 additions and 60 deletions
+8 -8
View File
@@ -23,7 +23,7 @@ extern NetworkClientSocketPool _networkclientsocket_pool;
/** Class for handling the server side of the game connection. */
class ServerNetworkGameSocketHandler : public NetworkClientSocketPool::PoolItem<&_networkclientsocket_pool>, public NetworkGameSocketHandler, public TCPListenHandler<ServerNetworkGameSocketHandler, PACKET_SERVER_FULL, PACKET_SERVER_BANNED> {
protected:
std::unique_ptr<class NetworkAuthenticationServerHandler> authentication_handler; ///< The handler for the authentication.
std::unique_ptr<class NetworkAuthenticationServerHandler> authentication_handler = nullptr; ///< The handler for the authentication.
std::string peer_public_key; ///< The public key of our client.
NetworkRecvStatus Receive_CLIENT_JOIN(Packet &p) override;
@@ -64,15 +64,15 @@ public:
STATUS_END, ///< Must ALWAYS be on the end of this list!! (period).
};
uint8_t lag_test; ///< Byte used for lag-testing the client
uint8_t last_token; ///< The last random token we did send to verify the client is listening
uint32_t last_token_frame; ///< The last frame we received the right token
ClientStatus status; ///< Status of this client
uint8_t lag_test = 0; ///< Byte used for lag-testing the client
uint8_t last_token = 0; ///< The last random token we did send to verify the client is listening
uint32_t last_token_frame = 0; ///< The last frame we received the right token
ClientStatus status = STATUS_INACTIVE; ///< Status of this client
CommandQueue outgoing_queue; ///< The command-queue awaiting delivery; conceptually more a bucket to gather commands in, after which the whole bucket is sent to the client.
size_t receive_limit; ///< Amount of bytes that we can receive at this moment
size_t receive_limit = 0; ///< Amount of bytes that we can receive at this moment
std::shared_ptr<struct PacketWriter> savegame; ///< Writer used to write the savegame.
NetworkAddress client_address; ///< IP-address of the client (so they can be banned)
std::shared_ptr<struct PacketWriter> savegame = nullptr; ///< Writer used to write the savegame.
NetworkAddress client_address{}; ///< IP-address of the client (so they can be banned)
ServerNetworkGameSocketHandler(SOCKET s);
~ServerNetworkGameSocketHandler();