summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-10-21 22:29:14 +0000
committerDarkvater <Darkvater@openttd.org>2006-10-21 22:29:14 +0000
commit5459f53c959a501c0aaae22415e74c6de496f9bc (patch)
tree1749ba1045f80bc6f9dc51f19f5c263d872aa0ae
parent5f9fcc5b21fbdc830fb14e4dc1858c86e0d8b768 (diff)
downloadopenttd-5459f53c959a501c0aaae22415e74c6de496f9bc.tar.xz
(svn r6876) -Codechange: Change the naming of _PLAYER in DESTTYPE_PLAYER/NETWORK_ACTION_CHAT_PLAYER
to _COMPANY as that is whom you are really addressing to. Also change some variable names, 'desttype' is confusing if there is also a parameter 'dest', so rename it to just type.
-rw-r--r--console_cmds.c4
-rw-r--r--network_client.c4
-rw-r--r--network_data.h4
-rw-r--r--network_gui.c6
-rw-r--r--network_server.c2
-rw-r--r--network_server.h2
6 files changed, 11 insertions, 11 deletions
diff --git a/console_cmds.c b/console_cmds.c
index 00bf220cb..aa7f44c84 100644
--- a/console_cmds.c
+++ b/console_cmds.c
@@ -1245,9 +1245,9 @@ DEF_CONSOLE_CMD(ConSayPlayer)
}
if (!_network_server) {
- SEND_COMMAND(PACKET_CLIENT_CHAT)(NETWORK_ACTION_CHAT_PLAYER, DESTTYPE_PLAYER, atoi(argv[1]), argv[2]);
+ SEND_COMMAND(PACKET_CLIENT_CHAT)(NETWORK_ACTION_CHAT_COMPANY, DESTTYPE_TEAM, atoi(argv[1]), argv[2]);
} else {
- NetworkServer_HandleChat(NETWORK_ACTION_CHAT_PLAYER, DESTTYPE_PLAYER, atoi(argv[1]), argv[2], NETWORK_SERVER_INDEX);
+ NetworkServer_HandleChat(NETWORK_ACTION_CHAT_COMPANY, DESTTYPE_TEAM, atoi(argv[1]), argv[2], NETWORK_SERVER_INDEX);
}
return true;
diff --git a/network_client.c b/network_client.c
index f0656a611..c9f5561cf 100644
--- a/network_client.c
+++ b/network_client.c
@@ -163,7 +163,7 @@ DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_COMMAND)(CommandPacket *cp)
}
// Send a chat-packet over the network
-DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_CHAT)(NetworkAction action, DestType desttype, int dest, const char *msg)
+DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_CHAT)(NetworkAction action, DestType type, int dest, const char *msg)
{
//
// Packet: CLIENT_CHAT
@@ -178,7 +178,7 @@ DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_CHAT)(NetworkAction action, DestType
Packet *p = NetworkSend_Init(PACKET_CLIENT_CHAT);
NetworkSend_uint8(p, action);
- NetworkSend_uint8(p, desttype);
+ NetworkSend_uint8(p, type);
NetworkSend_uint8(p, dest);
NetworkSend_string(p, msg);
NetworkSend_Packet(p, MY_CLIENT);
diff --git a/network_data.h b/network_data.h
index 6d8d4feb4..75259e9a6 100644
--- a/network_data.h
+++ b/network_data.h
@@ -99,7 +99,7 @@ typedef enum {
NETWORK_ACTION_JOIN,
NETWORK_ACTION_LEAVE,
NETWORK_ACTION_CHAT,
- NETWORK_ACTION_CHAT_PLAYER,
+ NETWORK_ACTION_CHAT_COMPANY,
NETWORK_ACTION_CHAT_CLIENT,
NETWORK_ACTION_GIVE_MONEY,
NETWORK_ACTION_NAME_CHANGE,
@@ -170,7 +170,7 @@ typedef enum {
typedef enum {
DESTTYPE_BROADCAST, ///< Send message/notice to all players (All)
- DESTTYPE_PLAYER, ///< Send message/notice to everyone playing the same company (Team)
+ DESTTYPE_TEAM, ///< Send message/notice to everyone playing the same company (Team)
DESTTYPE_CLIENT, ///< Send message/notice to only a certain player (Private)
} DestType;
diff --git a/network_gui.c b/network_gui.c
index 068f52116..9f46912cc 100644
--- a/network_gui.c
+++ b/network_gui.c
@@ -1091,10 +1091,10 @@ static void ClientList_SpeakToClient(byte client_no)
ShowNetworkChatQueryWindow(DESTTYPE_CLIENT, NetworkFindClientInfo(client_no)->client_index);
}
-static void ClientList_SpeakToPlayer(byte client_no)
+static void ClientList_SpeakToCompany(byte client_no)
{
if (NetworkFindClientInfo(client_no) != NULL)
- ShowNetworkChatQueryWindow(DESTTYPE_PLAYER, NetworkFindClientInfo(client_no)->client_playas);
+ ShowNetworkChatQueryWindow(DESTTYPE_TEAM, NetworkFindClientInfo(client_no)->client_playas);
}
static void ClientList_SpeakToAll(byte client_no)
@@ -1185,7 +1185,7 @@ static Window *PopupClientList(Window *w, int client_no, int x, int y)
if (IsValidPlayer(ci->client_playas)) {
GetString(_clientlist_action[i], STR_NETWORK_CLIENTLIST_SPEAK_TO_COMPANY);
- _clientlist_proc[i++] = &ClientList_SpeakToPlayer;
+ _clientlist_proc[i++] = &ClientList_SpeakToCompany;
}
GetString(_clientlist_action[i], STR_NETWORK_CLIENTLIST_SPEAK_TO_ALL);
_clientlist_proc[i++] = &ClientList_SpeakToAll;
diff --git a/network_server.c b/network_server.c
index 4ad123056..714daf9cc 100644
--- a/network_server.c
+++ b/network_server.c
@@ -1014,7 +1014,7 @@ void NetworkServer_HandleChat(NetworkAction action, DestType desttype, int dest,
}
}
break;
- case DESTTYPE_PLAYER: {
+ case DESTTYPE_TEAM: {
bool show_local = true; // If this is false, the message is already displayed
// on the client who did sent it.
/* Find all clients that belong to this player */
diff --git a/network_server.h b/network_server.h
index 66ea4704e..c5b2baade 100644
--- a/network_server.h
+++ b/network_server.h
@@ -13,7 +13,7 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_NEWGAME);
DEF_SERVER_SEND_COMMAND_PARAM(PACKET_SERVER_RCON)(NetworkClientState *cs, uint16 color, const char *command);
bool NetworkFindName(char new_name[NETWORK_CLIENT_NAME_LENGTH]);
-void NetworkServer_HandleChat(NetworkAction action, DestType desttype, int dest, const char *msg, uint16 from_index);
+void NetworkServer_HandleChat(NetworkAction action, DestType type, int dest, const char *msg, uint16 from_index);
bool NetworkServer_ReadPackets(NetworkClientState *cs);
void NetworkServer_Tick(bool send_frame);