summaryrefslogtreecommitdiff
path: root/src/network/network_server.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-07-24 10:14:39 +0000
committeralberth <alberth@openttd.org>2010-07-24 10:14:39 +0000
commitbe6c0584240caf420b2475a0be036391e842e8af (patch)
tree6111751cf5526e1eb41176782d84766c4e9ed185 /src/network/network_server.cpp
parent645b6ce77345867fa96861843197481131566c46 (diff)
downloadopenttd-be6c0584240caf420b2475a0be036391e842e8af.tar.xz
(svn r20211) -Codechange: Indented code should have curly braces around it.
Diffstat (limited to 'src/network/network_server.cpp')
-rw-r--r--src/network/network_server.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 64b86c151..3178df8d2 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -166,9 +166,9 @@ DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_ERROR)(NetworkClientSocket *cs, Netw
if (new_cs->status > STATUS_AUTHORIZED && new_cs != cs) {
/* Some errors we filter to a more general error. Clients don't have to know the real
* reason a joining failed. */
- if (error == NETWORK_ERROR_NOT_AUTHORIZED || error == NETWORK_ERROR_NOT_EXPECTED || error == NETWORK_ERROR_WRONG_REVISION)
+ if (error == NETWORK_ERROR_NOT_AUTHORIZED || error == NETWORK_ERROR_NOT_EXPECTED || error == NETWORK_ERROR_WRONG_REVISION) {
error = NETWORK_ERROR_ILLEGAL_PACKET;
-
+ }
SEND_COMMAND(PACKET_SERVER_ERROR_QUIT)(new_cs, cs->client_id, error);
}
}
@@ -274,8 +274,9 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_WELCOME)
/* Transmit info about all the active clients */
FOR_ALL_CLIENT_SOCKETS(new_cs) {
- if (new_cs != cs && new_cs->status > STATUS_AUTHORIZED)
+ if (new_cs != cs && new_cs->status > STATUS_AUTHORIZED) {
SEND_COMMAND(PACKET_SERVER_CLIENT_INFO)(cs, new_cs->GetInfo());
+ }
}
/* Also send the info of the server */
return SEND_COMMAND(PACKET_SERVER_CLIENT_INFO)(cs, NetworkFindClientInfoFromClientID(CLIENT_ID_SERVER));
@@ -1076,8 +1077,9 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
if ((ClientID)dest == CLIENT_ID_SERVER) {
ci = NetworkFindClientInfoFromClientID(from_id);
/* Display the text locally, and that is it */
- if (ci != NULL)
+ if (ci != NULL) {
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
+ }
} else {
/* Else find the client to send the message to */
FOR_ALL_CLIENT_SOCKETS(cs) {
@@ -1093,8 +1095,9 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
if (from_id == CLIENT_ID_SERVER) {
ci = NetworkFindClientInfoFromClientID(from_id);
ci_to = NetworkFindClientInfoFromClientID((ClientID)dest);
- if (ci != NULL && ci_to != NULL)
+ if (ci != NULL && ci_to != NULL) {
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), true, ci_to->client_name, msg, data);
+ }
} else {
FOR_ALL_CLIENT_SOCKETS(cs) {
if (cs->client_id == from_id) {
@@ -1156,8 +1159,9 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
SEND_COMMAND(PACKET_SERVER_CHAT)(cs, action, from_id, false, msg, data);
}
ci = NetworkFindClientInfoFromClientID(from_id);
- if (ci != NULL)
+ if (ci != NULL) {
NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
+ }
break;
}
}