(svn r20929) -Codechange: make NetworkCloseClient a class method

This commit is contained in:
rubidium
2010-10-15 18:42:52 +00:00
parent 470312cf35
commit 6ff39fc5ec
8 changed files with 88 additions and 70 deletions

View File

@@ -47,7 +47,6 @@ NetworkGameSocketHandler::NetworkGameSocketHandler(SOCKET s)
* For clients: close connection and drop back to main-menu
* For servers: close connection and that is it
* @return the new status
* TODO: needs to be splitted when using client and server socket packets
*/
NetworkRecvStatus NetworkGameSocketHandler::CloseConnection(bool error)
{
@@ -61,7 +60,7 @@ NetworkRecvStatus NetworkGameSocketHandler::CloseConnection(bool error)
return NETWORK_RECV_STATUS_CONN_LOST;
}
return NetworkCloseClient(this, error ? NETWORK_RECV_STATUS_SERVER_ERROR : NETWORK_RECV_STATUS_CONN_LOST);
return this->CloseConnection(error ? NETWORK_RECV_STATUS_SERVER_ERROR : NETWORK_RECV_STATUS_CONN_LOST);
}

View File

@@ -179,6 +179,7 @@ public:
CommandQueue outgoing_queue; ///< The command-queue awaiting delivery
NetworkRecvStatus CloseConnection(bool error = true);
virtual NetworkRecvStatus CloseConnection(NetworkRecvStatus status) = 0;
virtual ~NetworkGameSocketHandler() {}
inline void SetInfo(NetworkClientInfo *info) { assert(info != NULL && this->info == NULL); this->info = info; }