From 500f9a971ac2d1a723fceaf499117de85396ff65 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 2 Feb 2007 23:16:58 +0000 Subject: (svn r8546) -Codechange: add a seperate (wrapper) functions to send/receive booleans. --- src/network/network_udp.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/network/network_udp.cpp') diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index 3517b4918..81f93d32d 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -124,7 +124,7 @@ DEF_UDP_RECEIVE_COMMAND(Server, PACKET_UDP_CLIENT_DETAIL_INFO) packet.Send_uint16(_network_player_info[player->index].performance); /* Send 1 if there is a passord for the company else send 0 */ - packet.Send_uint8 (StrEmpty(_network_player_info[player->index].password) ? 0 : 1); + packet.Send_bool (StrEmpty(_network_player_info[player->index].password)); for (i = 0; i < NETWORK_VEHICLE_TYPES; i++) packet.Send_uint16(_network_player_info[player->index].num_vehicle[i]); @@ -136,8 +136,7 @@ DEF_UDP_RECEIVE_COMMAND(Server, PACKET_UDP_CLIENT_DETAIL_INFO) FOR_ALL_CLIENTS(cs) { ci = DEREF_CLIENT_INFO(cs); if (ci->client_playas == player->index) { - /* The uint8 == 1 indicates that a client is following */ - packet.Send_uint8 (1); + packet.Send_bool (true); packet.Send_string(ci->client_name); packet.Send_string(ci->unique_id); packet.Send_uint32(ci->join_date); @@ -146,23 +145,21 @@ DEF_UDP_RECEIVE_COMMAND(Server, PACKET_UDP_CLIENT_DETAIL_INFO) /* Also check for the server itself */ ci = NetworkFindClientInfoFromIndex(NETWORK_SERVER_INDEX); if (ci->client_playas == player->index) { - /* The uint8 == 1 indicates that a client is following */ - packet.Send_uint8 (1); + packet.Send_bool (true); packet.Send_string(ci->client_name); packet.Send_string(ci->unique_id); packet.Send_uint32(ci->join_date); } /* Indicates end of client list */ - packet.Send_uint8(0); + packet.Send_bool(false); } /* And check if we have any spectators */ FOR_ALL_CLIENTS(cs) { ci = DEREF_CLIENT_INFO(cs); if (!IsValidPlayer(ci->client_playas)) { - /* The uint8 == 1 indicates that a client is following */ - packet.Send_uint8 (1); + packet.Send_bool (true); packet.Send_string(ci->client_name); packet.Send_string(ci->unique_id); packet.Send_uint32(ci->join_date); @@ -172,15 +169,14 @@ DEF_UDP_RECEIVE_COMMAND(Server, PACKET_UDP_CLIENT_DETAIL_INFO) /* Also check for the server itself */ ci = NetworkFindClientInfoFromIndex(NETWORK_SERVER_INDEX); if (!IsValidPlayer(ci->client_playas)) { - /* The uint8 == 1 indicates that a client is following */ - packet.Send_uint8 (1); + packet.Send_bool (true); packet.Send_string(ci->client_name); packet.Send_string(ci->unique_id); packet.Send_uint32(ci->join_date); } /* Indicates end of client list */ - packet.Send_uint8(0); + packet.Send_bool(false); this->SendPacket(&packet, client_addr); } -- cgit v1.2.3-70-g09d2