Author: cazfi
Date: Mon Apr 11 19:25:38 2016
New Revision: 32356

URL: http://svn.gna.org/viewcvs/freeciv?rev=32356&view=rev
Log:
Define array lengths with plain numbers in initial packets that
must remain backward compatible even if dynamic definitions change.

See patch #7092

Modified:
    trunk/common/packets.def

Modified: trunk/common/packets.def
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/packets.def?rev=32356&r1=32355&r2=32356&view=diff
==============================================================================
--- trunk/common/packets.def    (original)
+++ trunk/common/packets.def    Mon Apr 11 19:25:38 2016
@@ -359,10 +359,12 @@
 # client. The player hasn't been accepted yet.
 # For compatibility with older versions, this number cannot be changed.
 # Used in initial protocol.
+# 48 used instead of MAX_LEN_NAME to keep compatibility with old versions
+# even if MAX_LEN_NAME changes. Similarly 512 instead of MAX_LEN_CAPSTR.
 PACKET_SERVER_JOIN_REQ = 4; cs, dsend, no-delta, no-handle
-  STRING username[MAX_LEN_NAME];
-  STRING capability[MAX_LEN_CAPSTR];
-  STRING version_label[MAX_LEN_NAME];
+  STRING username[48];
+  STRING capability[512];
+  STRING version_label[48];
   UINT32 major_version, minor_version, patch_version;
 end
 
@@ -371,9 +373,9 @@
 # Used in initial protocol.
 PACKET_SERVER_JOIN_REPLY = 5; sc, no-delta, post-send, post-recv
   BOOL you_can_join;
-  STRING message[MAX_LEN_MSG];
-  STRING capability[MAX_LEN_CAPSTR];
-  STRING challenge_file[MAX_LEN_PATH];
+  STRING message[1536];        /* MAX_LEN_MSG */
+  STRING capability[512];      /* MAX_LEN_CAPSTR */
+  STRING challenge_file[4095]; /* MAX_LEN_PATH */
   # clients conn id as known in server
   CONNECTION conn_id;
 end


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to