981 ci = NetworkFindClientInfo(client_no); |
981 ci = NetworkFindClientInfo(client_no); |
982 if (ci == NULL) return NULL; |
982 if (ci == NULL) return NULL; |
983 |
983 |
984 i = 0; |
984 i = 0; |
985 if (_network_own_client_index != ci->client_index) { |
985 if (_network_own_client_index != ci->client_index) { |
986 sprintf(_clientlist_action[i],"Private message"); |
986 GetString(_clientlist_action[i], STR_NETWORK_CLIENTLIST_SPEAK_TO_CLIENT); |
987 _clientlist_proc[i++] = &ClientList_SpeakToClient; |
987 _clientlist_proc[i++] = &ClientList_SpeakToClient; |
988 } |
988 } |
989 |
989 |
990 if (ci->client_playas >= 1 && ci->client_playas <= MAX_PLAYERS) { |
990 if (ci->client_playas >= 1 && ci->client_playas <= MAX_PLAYERS) { |
991 sprintf(_clientlist_action[i],"Speak to company"); |
991 GetString(_clientlist_action[i], STR_NETWORK_CLIENTLIST_SPEAK_TO_COMPANY); |
992 _clientlist_proc[i++] = &ClientList_SpeakToPlayer; |
992 _clientlist_proc[i++] = &ClientList_SpeakToPlayer; |
993 } |
993 } |
994 sprintf(_clientlist_action[i],"Speak to all"); |
994 GetString(_clientlist_action[i], STR_NETWORK_CLIENTLIST_SPEAK_TO_ALL); |
995 _clientlist_proc[i++] = &ClientList_SpeakToAll; |
995 _clientlist_proc[i++] = &ClientList_SpeakToAll; |
996 |
996 |
997 if (_network_own_client_index != ci->client_index) { |
997 if (_network_own_client_index != ci->client_index) { |
998 if (_network_playas >= 1 && _network_playas <= MAX_PLAYERS) { |
998 if (_network_playas >= 1 && _network_playas <= MAX_PLAYERS) { |
999 // We are no spectator |
999 // We are no spectator |
1000 if (ci->client_playas >= 1 && ci->client_playas <= MAX_PLAYERS) { |
1000 if (ci->client_playas >= 1 && ci->client_playas <= MAX_PLAYERS) { |
1001 sprintf(_clientlist_action[i],"Give money"); |
1001 GetString(_clientlist_action[i], STR_NETWORK_CLIENTLIST_GIVE_MONEY); |
1002 _clientlist_proc[i++] = &ClientList_GiveMoney; |
1002 _clientlist_proc[i++] = &ClientList_GiveMoney; |
1003 } |
1003 } |
1004 } |
1004 } |
1005 } |
1005 } |
1006 |
1006 |
1007 // A server can kick clients (but not hisself) |
1007 // A server can kick clients (but not hisself) |
1008 if (_network_server && _network_own_client_index != ci->client_index) { |
1008 if (_network_server && _network_own_client_index != ci->client_index) { |
1009 sprintf(_clientlist_action[i],"Kick"); |
1009 GetString(_clientlist_action[i], STR_NETWORK_CLIENTLIST_KICK); |
1010 _clientlist_proc[i++] = &ClientList_Kick; |
1010 _clientlist_proc[i++] = &ClientList_Kick; |
1011 |
1011 |
1012 /* sprintf(clientlist_action[i],"Ban"); |
1012 /* sprintf(clientlist_action[i],"Ban"); |
1013 clientlist_proc[i++] = &ClientList_Ban;*/ |
1013 clientlist_proc[i++] = &ClientList_Ban;*/ |
1014 } |
1014 } |
1015 |
1015 |
1016 if (i == 0) { |
1016 if (i == 0) { |
1017 sprintf(_clientlist_action[i],"(none)"); |
1017 GetString(_clientlist_action[i], STR_NETWORK_CLIENTLIST_NONE); |
1018 _clientlist_proc[i++] = &ClientList_None; |
1018 _clientlist_proc[i++] = &ClientList_None; |
1019 } |
1019 } |
1020 |
1020 |
1021 |
1021 |
1022 // Find the right height for the popup |
1022 // Find the right height for the popup |
1114 colour = 0xC; |
1114 colour = 0xC; |
1115 } else |
1115 } else |
1116 colour = 0x10; |
1116 colour = 0x10; |
1117 |
1117 |
1118 if (ci->client_index == NETWORK_SERVER_INDEX) { |
1118 if (ci->client_index == NETWORK_SERVER_INDEX) { |
1119 DoDrawString("Server", 4, y, colour); |
1119 DrawString(4, y, STR_NETWORK_SERVER, colour); |
1120 } else |
1120 } else |
1121 DoDrawString("Client", 4, y, colour); |
1121 DrawString(4, y, STR_NETWORK_CLIENT, colour); |
1122 |
1122 |
1123 // Filter out spectators |
1123 // Filter out spectators |
1124 if (ci->client_playas > 0 && ci->client_playas <= MAX_PLAYERS) |
1124 if (ci->client_playas > 0 && ci->client_playas <= MAX_PLAYERS) |
1125 DrawPlayerIcon(ci->client_playas - 1, 44, y + 1); |
1125 DrawPlayerIcon(ci->client_playas - 1, 44, y + 1); |
1126 |
1126 |