players.c
changeset 1820 9b6458526480
parent 1812 5b4d1af6b904
child 1834 33612fb9c7d7
--- a/players.c	Sun May 15 18:43:36 2005 +0000
+++ b/players.c	Sun May 15 18:50:55 2005 +0000
@@ -691,16 +691,18 @@
 					PlayerID player_backup = _local_player;
 					_network_player_info[p->index].months_empty = 0;
 
-					/* XXX - When a client joins, we automatically set it's name to the player's
-      		 * name (for some reason). As it stands now only the server knows the client's
-					 * name, so it needs to send out a "broadcast" to do this. To achieve this we send
-					 * a network command. However, it uses _local_player to execute the command as.
-					 * To prevent abuse (eg. only yourself can change your name/company), we 'cheat'
-					 * by impersonation _local_player as the server. Not the best solution; but it
-					 * works.
-					 * TODO: Perhaps this could be improved by when the client is ready with joining
-					 * to let it send itself the command, and not the server? For example in network_client.c:534? */
-					memcpy(_decode_parameters, ci->client_name, 32);
+					/* XXX - When a client joins, we automatically set its name to the
+					 * player's name (for some reason). As it stands now only the server
+					 * knows the client's name, so it needs to send out a "broadcast" to
+					 * do this. To achieve this we send a network command. However, it
+					 * uses _local_player to execute the command as.  To prevent abuse
+					 * (eg. only yourself can change your name/company), we 'cheat' by
+					 * impersonation _local_player as the server. Not the best solution;
+					 * but it works.
+					 * TODO: Perhaps this could be improved by when the client is ready
+					 * with joining to let it send itself the command, and not the server?
+					 * For example in network_client.c:534? */
+					_cmd_text = ci->client_name;
 					_local_player = ci->client_playas - 1;
 					NetworkSend_Command(0, 0, 0, CMD_CHANGE_PRESIDENT_NAME, NULL);
 					_local_player = player_backup;