diff options
Diffstat (limited to 'src/network/core/tcp_game.h')
-rw-r--r-- | src/network/core/tcp_game.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index afa2879cb..53d6df892 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -525,11 +525,32 @@ public: uint last_packet; ///< Time we received the last frame. NetworkRecvStatus CloseConnection(bool error = true); + + /** + * Close the network connection due to the given status. + * @param status The reason the connection got closed. + */ virtual NetworkRecvStatus CloseConnection(NetworkRecvStatus status) = 0; virtual ~NetworkGameSocketHandler() {} - inline void SetInfo(NetworkClientInfo *info) { assert(info != NULL && this->info == NULL); this->info = info; } - inline NetworkClientInfo *GetInfo() const { return this->info; } + /** + * Sets the client info for this socket handler. + * @param info The new client info. + */ + inline void SetInfo(NetworkClientInfo *info) + { + assert(info != NULL && this->info == NULL); + this->info = info; + } + + /** + * Gets the client info of this socket handler. + * @return The client info. + */ + inline NetworkClientInfo *GetInfo() const + { + return this->info; + } NetworkRecvStatus ReceivePackets(); |