diff options
Diffstat (limited to 'src/network/core/core.h')
-rw-r--r-- | src/network/core/core.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/network/core/core.h b/src/network/core/core.h index c1605d46d..bc348255d 100644 --- a/src/network/core/core.h +++ b/src/network/core/core.h @@ -36,10 +36,9 @@ struct Packet; * SocketHandler for all network sockets in OpenTTD. */ class NetworkSocketHandler { -public: - /* TODO: make socket & has_quit protected once the TCP stuff - *is in a real class too */ bool has_quit; ///< Whether the current client has quit/send a bad packet +public: + /* TODO: make socket protected once the TCP stuff is in a real class too */ SOCKET sock; ///< The socket currently connected to public: /** Create a new unbound socket */ @@ -72,6 +71,11 @@ public: */ bool HasClientQuit() const { return this->has_quit; } + /** + * Reopen the socket so we can send/receive stuff again. + */ + void Reopen() { this->has_quit = false; } + void Send_GRFIdentifier(Packet *p, const GRFIdentifier *grf); void Recv_GRFIdentifier(Packet *p, GRFIdentifier *grf); void Send_CompanyInformation(Packet *p, const struct Company *c, const struct NetworkCompanyStats *stats); |