Author: cazfi
Date: Mon Apr 11 19:25:46 2016
New Revision: 32357

URL: http://svn.gna.org/viewcvs/freeciv?rev=32357&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:
    branches/S2_6/common/packets.def

Modified: branches/S2_6/common/packets.def
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/packets.def?rev=32357&r1=32356&r2=32357&view=diff
==============================================================================
--- branches/S2_6/common/packets.def    (original)
+++ branches/S2_6/common/packets.def    Mon Apr 11 19:25:46 2016
@@ -348,10 +348,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
 
@@ -360,9 +362,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