diff options
author | rubidium <rubidium@openttd.org> | 2007-02-02 23:16:58 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-02-02 23:16:58 +0000 |
commit | 500f9a971ac2d1a723fceaf499117de85396ff65 (patch) | |
tree | ece046363ec9db44c4f305a66b7863bd5113cfb2 /src/network/network_udp.cpp | |
parent | 9ddd227eb3757473bce23b4cafec894a4e4eaa36 (diff) | |
download | openttd-500f9a971ac2d1a723fceaf499117de85396ff65.tar.xz |
(svn r8546) -Codechange: add a seperate (wrapper) functions to send/receive booleans.
Diffstat (limited to 'src/network/network_udp.cpp')
-rw-r--r-- | src/network/network_udp.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
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); } |