summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-03 12:01:41 +0000
committerrubidium <rubidium@openttd.org>2011-01-03 12:01:41 +0000
commitb25cf57542dbf294a9de3f7a9910e1e08e6ed7a4 (patch)
treeac208841735480e0c06b3da6da55b33a1bbdc7c7 /src/network
parent1c2d56d314d5be9d228b08ca6eea8d988f2a389f (diff)
downloadopenttd-b25cf57542dbf294a9de3f7a9910e1e08e6ed7a4.tar.xz
(svn r21701) -Codechange: ConsoleColour = TextColour, so make it that way and remove some unneeded casts
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network.cpp2
-rw-r--r--src/network/network_admin.cpp2
-rw-r--r--src/network/network_admin.h2
-rw-r--r--src/network/network_client.cpp6
-rw-r--r--src/network/network_func.h2
-rw-r--r--src/network/network_internal.h2
-rw-r--r--src/network/network_server.cpp12
7 files changed, 14 insertions, 14 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 510d92a82..c304c1c22 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -163,7 +163,7 @@ bool NetworkCompanyIsPassworded(CompanyID company_id)
/* This puts a text-message to the console, or in the future, the chat-box,
* (to keep it all a bit more general)
* If 'self_send' is true, this is the client who is sending the message */
-void NetworkTextMessage(NetworkAction action, ConsoleColour colour, bool self_send, const char *name, const char *str, int64 data)
+void NetworkTextMessage(NetworkAction action, TextColour colour, bool self_send, const char *name, const char *str, int64 data)
{
StringID strid;
switch (action) {
diff --git a/src/network/network_admin.cpp b/src/network/network_admin.cpp
index fe76f164d..40085838d 100644
--- a/src/network/network_admin.cpp
+++ b/src/network/network_admin.cpp
@@ -783,7 +783,7 @@ void NetworkAdminChat(NetworkAction action, DestType desttype, ClientID client_i
* @param colour_code The colour of the string.
* @param string The string to show.
*/
-void NetworkServerSendAdminRcon(AdminIndex admin_index, ConsoleColour colour_code, const char *string)
+void NetworkServerSendAdminRcon(AdminIndex admin_index, TextColour colour_code, const char *string)
{
ServerNetworkAdminSocketHandler::Get(admin_index)->SendRcon(colour_code, string);
}
diff --git a/src/network/network_admin.h b/src/network/network_admin.h
index 501c91dc0..d9f64c73e 100644
--- a/src/network/network_admin.h
+++ b/src/network/network_admin.h
@@ -95,7 +95,7 @@ void NetworkAdminCompanyRemove(CompanyID company_id, AdminCompanyRemoveReason bc
void NetworkAdminChat(NetworkAction action, DestType desttype, ClientID client_id, const char *msg, int64 data = 0, bool from_admin = false);
void NetworkAdminUpdate(AdminUpdateFrequency freq);
-void NetworkServerSendAdminRcon(AdminIndex admin_index, ConsoleColour colour_code, const char *string);
+void NetworkServerSendAdminRcon(AdminIndex admin_index, TextColour colour_code, const char *string);
void NetworkAdminConsole(const char *origin, const char *string);
void NetworkAdminCmdLogging(const NetworkClientSocket *owner, const CommandPacket *cp);
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 326c3755a..b45b21fa5 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -981,7 +981,7 @@ DEF_GAME_RECEIVE_COMMAND(Client, PACKET_SERVER_CHAT)
}
if (ci != NULL) {
- NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), self_send, name, msg, data);
+ NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), self_send, name, msg, data);
}
return NETWORK_RECV_STATUS_OKAY;
}
@@ -1069,13 +1069,13 @@ DEF_GAME_RECEIVE_COMMAND(Client, PACKET_SERVER_RCON)
{
if (this->status < STATUS_AUTHORIZED) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
- uint colour_code = p->Recv_uint16();
+ TextColour colour_code = (TextColour)p->Recv_uint16();
if (!IsValidConsoleColour(colour_code)) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
char rcon_out[NETWORK_RCONCOMMAND_LENGTH];
p->Recv_string(rcon_out, sizeof(rcon_out));
- IConsolePrint((ConsoleColour)colour_code, rcon_out);
+ IConsolePrint(colour_code, rcon_out);
return NETWORK_RECV_STATUS_OKAY;
}
diff --git a/src/network/network_func.h b/src/network/network_func.h
index f9bbde778..29d924ae4 100644
--- a/src/network/network_func.h
+++ b/src/network/network_func.h
@@ -72,7 +72,7 @@ NetworkClientInfo *NetworkFindClientInfoFromClientID(ClientID client_id);
const char *GetClientIP(NetworkClientInfo *ci);
void NetworkServerDoMove(ClientID client_id, CompanyID company_id);
-void NetworkServerSendRcon(ClientID client_id, ConsoleColour colour_code, const char *string);
+void NetworkServerSendRcon(ClientID client_id, TextColour colour_code, const char *string);
void NetworkServerSendChat(NetworkAction action, DestType type, int dest, const char *msg, ClientID from_id, int64 data = 0, bool from_admin = false);
void NetworkServerKickClient(ClientID client_id);
diff --git a/src/network/network_internal.h b/src/network/network_internal.h
index 5373e4422..40391a7a8 100644
--- a/src/network/network_internal.h
+++ b/src/network/network_internal.h
@@ -163,7 +163,7 @@ void NetworkSyncCommandQueue(NetworkClientSocket *cs);
/* from network.c */
void NetworkError(StringID error_string);
-void NetworkTextMessage(NetworkAction action, ConsoleColour colour, bool self_send, const char *name, const char *str = "", int64 data = 0);
+void NetworkTextMessage(NetworkAction action, TextColour colour, bool self_send, const char *name, const char *str = "", int64 data = 0);
uint NetworkCalculateLag(const NetworkClientSocket *cs);
NetworkClientSocket *NetworkFindClientStateFromClientID(ClientID client_id);
StringID GetNetworkErrorMsg(NetworkErrorCode err);
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 7526d50fc..8ec5da468 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -1142,7 +1142,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
ci = NetworkFindClientInfoFromClientID(from_id);
/* Display the text locally, and that is it */
if (ci != NULL) {
- NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
+ NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
if (_settings_client.network.server_admin_chat) {
NetworkAdminChat(action, desttype, from_id, msg, data, from_admin);
@@ -1164,7 +1164,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
ci = NetworkFindClientInfoFromClientID(from_id);
ci_to = NetworkFindClientInfoFromClientID((ClientID)dest);
if (ci != NULL && ci_to != NULL) {
- NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), true, ci_to->client_name, msg, data);
+ NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), true, ci_to->client_name, msg, data);
}
} else {
FOR_ALL_CLIENT_SOCKETS(cs) {
@@ -1198,7 +1198,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
ci = NetworkFindClientInfoFromClientID(from_id);
ci_own = NetworkFindClientInfoFromClientID(CLIENT_ID_SERVER);
if (ci != NULL && ci_own != NULL && ci_own->client_playas == dest) {
- NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
+ NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
if (from_id == CLIENT_ID_SERVER) show_local = false;
ci_to = ci_own;
}
@@ -1213,7 +1213,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
StringID str = Company::IsValidID(ci_to->client_playas) ? STR_COMPANY_NAME : STR_NETWORK_SPECTATORS;
SetDParam(0, ci_to->client_playas);
GetString(name, str, lastof(name));
- NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci_own->client_playas), true, name, msg, data);
+ NetworkTextMessage(action, GetDrawStringCompanyColour(ci_own->client_playas), true, name, msg, data);
} else {
FOR_ALL_CLIENT_SOCKETS(cs) {
if (cs->client_id == from_id) {
@@ -1236,7 +1236,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
ci = NetworkFindClientInfoFromClientID(from_id);
if (ci != NULL) {
- NetworkTextMessage(action, (ConsoleColour)GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
+ NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
}
break;
}
@@ -1846,7 +1846,7 @@ void NetworkServerDoMove(ClientID client_id, CompanyID company_id)
NetworkServerSendChat(action, DESTTYPE_BROADCAST, 0, "", client_id, company_id + 1);
}
-void NetworkServerSendRcon(ClientID client_id, ConsoleColour colour_code, const char *string)
+void NetworkServerSendRcon(ClientID client_id, TextColour colour_code, const char *string)
{
NetworkFindClientStateFromClientID(client_id)->SendRConResult(colour_code, string);
}