summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/network/network.cpp8
-rw-r--r--src/network/network_client.cpp2
-rw-r--r--src/network/network_gui.cpp4
-rw-r--r--src/network/network_internal.h2
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)