(svn r11357) -Fix: NetworkUniqueID could be 80 chars, while the max size we generate is 32. So reduce the size a bit. Pointed out by dihedral, so give him a big hug ;)
authortruelight
Tue, 30 Oct 2007 11:29:01 +0000
changeset 7807 b10fc6c5d081
parent 7806 2876d9bfa05a
child 7808 07640f0ae961
(svn r11357) -Fix: NetworkUniqueID could be 80 chars, while the max size we generate is 32. So reduce the size a bit. Pointed out by dihedral, so give him a big hug ;)
src/network/core/config.h
src/network/network.h
src/network/network_client.cpp
src/network/network_server.cpp
--- a/src/network/core/config.h	Mon Oct 29 23:29:06 2007 +0000
+++ b/src/network/core/config.h	Tue Oct 30 11:29:01 2007 +0000
@@ -27,6 +27,7 @@
 
 	NETWORK_NAME_LENGTH           =   80, ///< The maximum length of the server name and map name, in bytes including '\0'
 	NETWORK_HOSTNAME_LENGTH       =   80, ///< The maximum length of the host name, in bytes including '\0'
+	NETWORK_UNIQUE_ID_LENGTH      =   33, ///< The maximum length of the unique id of the clients, in bytes including '\0'
 	NETWORK_REVISION_LENGTH       =   15, ///< The maximum length of the revision, in bytes including '\0'
 	NETWORK_PASSWORD_LENGTH       =   20, ///< The maximum length of the password, in bytes including '\0'
 	NETWORK_PLAYERS_LENGTH        =  200, ///< The maximum length for the list of players that controls a company, in bytes including '\0'
--- a/src/network/network.h	Mon Oct 29 23:29:06 2007 +0000
+++ b/src/network/network.h	Tue Oct 30 11:29:01 2007 +0000
@@ -71,7 +71,7 @@
 	PlayerID client_playas;                         // As which player is this client playing (PlayerID)
 	uint32 client_ip;                               // IP-address of the client (so he can be banned)
 	Date join_date;                                 // Gamedate the player has joined
-	char unique_id[NETWORK_NAME_LENGTH];            // Every play sends an unique id so we can indentify him
+	char unique_id[NETWORK_UNIQUE_ID_LENGTH];       // Every play sends an unique id so we can indentify him
 };
 
 enum NetworkJoinStatus {
@@ -127,7 +127,7 @@
 VARDEF char _network_default_ip[NETWORK_HOSTNAME_LENGTH];
 
 VARDEF uint16 _network_own_client_index;
-VARDEF char _network_unique_id[NETWORK_NAME_LENGTH]; // Our own unique ID
+VARDEF char _network_unique_id[NETWORK_UNIQUE_ID_LENGTH]; // Our own unique ID
 
 VARDEF uint32 _frame_counter_server; // The frame_counter of the server, if in network-mode
 VARDEF uint32 _frame_counter_max; // To where we may go with our clients
--- a/src/network/network_client.cpp	Mon Oct 29 23:29:06 2007 +0000
+++ b/src/network/network_client.cpp	Tue Oct 30 11:29:01 2007 +0000
@@ -341,7 +341,7 @@
 	uint16 index = p->Recv_uint16();
 	PlayerID playas = (Owner)p->Recv_uint8();
 	char name[NETWORK_NAME_LENGTH];
-	char unique_id[NETWORK_NAME_LENGTH];
+	char unique_id[NETWORK_UNIQUE_ID_LENGTH];
 
 	p->Recv_string(name, sizeof(name));
 	p->Recv_string(unique_id, sizeof(unique_id));
--- a/src/network/network_server.cpp	Mon Oct 29 23:29:06 2007 +0000
+++ b/src/network/network_server.cpp	Tue Oct 30 11:29:01 2007 +0000
@@ -619,7 +619,7 @@
 DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN)
 {
 	char name[NETWORK_CLIENT_NAME_LENGTH];
-	char unique_id[NETWORK_NAME_LENGTH];
+	char unique_id[NETWORK_UNIQUE_ID_LENGTH];
 	NetworkClientInfo *ci;
 	PlayerID playas;
 	NetworkLanguage client_lang;