diff options
author | rubidium <rubidium@openttd.org> | 2008-12-23 10:42:06 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-12-23 10:42:06 +0000 |
commit | d501a20065a44c3a10b127d3f4842798d01a2d7f (patch) | |
tree | ff2d99344143cdf1a8877d775f511822b0696ff2 | |
parent | ae96ca635c9e5c22452acc0c1a473f339706fec3 (diff) | |
download | openttd-d501a20065a44c3a10b127d3f4842798d01a2d7f.tar.xz |
(svn r14722) -Codechange: s/DEREF_CLIENT/GetNetworkClientSocket/
-rw-r--r-- | src/network/network.cpp | 8 | ||||
-rw-r--r-- | src/network/network_client.cpp | 2 | ||||
-rw-r--r-- | src/network/network_gui.cpp | 4 | ||||
-rw-r--r-- | src/network/network_internal.h | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp index fb1c70ee9..ac49cb08b 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -318,7 +318,7 @@ static void NetworkClientError(NetworkRecvStatus res, NetworkClientSocket* cs) SEND_COMMAND(PACKET_CLIENT_ERROR)(errorno); // Dequeue all commands before closing the socket - DEREF_CLIENT(0)->Send_Packets(); + GetNetworkClientSocket(0)->Send_Packets(); } _switch_mode = SM_MENU; @@ -431,7 +431,7 @@ static NetworkClientSocket *NetworkAllocClient(SOCKET s) client_no = _network_clients_connected++; } - cs = DEREF_CLIENT(client_no); + cs = GetNetworkClientSocket(client_no); cs->Initialize(); cs->sock = s; cs->last_frame = _frame_counter; @@ -501,7 +501,7 @@ void NetworkCloseClient(NetworkClientSocket *cs) if (cs->status >= STATUS_AUTH) _network_game_info.clients_on--; _network_clients_connected--; - while ((cs + 1) != DEREF_CLIENT(MAX_CLIENTS) && (cs + 1)->sock != INVALID_SOCKET) { + while ((cs + 1) != GetNetworkClientSocket(MAX_CLIENTS) && (cs + 1)->sock != INVALID_SOCKET) { *cs = *(cs + 1); *ci = *(ci + 1); cs++; @@ -1043,7 +1043,7 @@ static bool NetworkDoClientLoop() NetworkError(STR_NETWORK_ERR_DESYNC); DebugDumpCommands("ddc:serr:%d;%d\n", _date, _date_fract); DEBUG(net, 0, "Sync error detected!"); - NetworkClientError(NETWORK_RECV_STATUS_DESYNC, DEREF_CLIENT(0)); + NetworkClientError(NETWORK_RECV_STATUS_DESYNC, GetNetworkClientSocket(0)); return false; } diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 4b9f9b99e..9c3e2639a 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -34,7 +34,7 @@ // So we don't make too much typos ;) -#define MY_CLIENT DEREF_CLIENT(0) +#define MY_CLIENT GetNetworkClientSocket(0) static uint32 last_ack_frame; diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index d3f7a4ca5..d0ea0551d 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1431,7 +1431,7 @@ static const NetworkClientInfo *NetworkFindClientInfo(byte client_no) static void ClientList_Kick(byte client_no) { if (client_no < MAX_CLIENTS) { - SEND_COMMAND(PACKET_SERVER_ERROR)(DEREF_CLIENT(client_no), NETWORK_ERROR_KICKED); + SEND_COMMAND(PACKET_SERVER_ERROR)(GetNetworkClientSocket(client_no), NETWORK_ERROR_KICKED); } } @@ -1447,7 +1447,7 @@ static void ClientList_Ban(byte client_no) } if (client_no < MAX_CLIENTS) { - SEND_COMMAND(PACKET_SERVER_ERROR)(DEREF_CLIENT(client_no), NETWORK_ERROR_KICKED); + SEND_COMMAND(PACKET_SERVER_ERROR)(GetNetworkClientSocket(client_no), NETWORK_ERROR_KICKED); } } diff --git a/src/network/network_internal.h b/src/network/network_internal.h index f7098c1f6..fdf44d249 100644 --- a/src/network/network_internal.h +++ b/src/network/network_internal.h @@ -148,7 +148,7 @@ NetworkClientSocket *NetworkFindClientStateFromClientID(ClientID client_id); char* GetNetworkErrorMsg(char* buf, NetworkErrorCode err, const char* last); bool NetworkFindName(char new_name[NETWORK_CLIENT_NAME_LENGTH]); -#define DEREF_CLIENT(i) (&_clients[i]) +#define GetNetworkClientSocket(i) (&_clients[i]) // Macros to make life a bit more easier #define DEF_CLIENT_RECEIVE_COMMAND(type) NetworkRecvStatus NetworkPacketReceive_ ## type ## _command(Packet *p) |