Author: sveinung
Date: Fri Oct  7 14:12:28 2016
New Revision: 34041

URL: http://svn.gna.org/viewcvs/freeciv?rev=34041&view=rev
Log:
Move old unit orders to savecompat.

Move the unit orders that have been replaced by ORDER_ACTION_MOVE from the
unit_orders enum to server/savecompat.h.

See patch #7780

Modified:
    trunk/common/unit.h
    trunk/fc_version
    trunk/server/savecompat.c
    trunk/server/savecompat.h
    trunk/server/savegame3.c
    trunk/server/unithand.c
    trunk/server/unittools.c

Modified: trunk/common/unit.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/unit.h?rev=34041&r1=34040&r2=34041&view=diff
==============================================================================
--- trunk/common/unit.h (original)
+++ trunk/common/unit.h Fri Oct  7 14:12:28 2016
@@ -35,13 +35,8 @@
   ORDER_MOVE = 0,
   ORDER_ACTIVITY = 1,
   ORDER_FULL_MP = 2,
-  ORDER_OLD_BUILD_CITY = 3,
-  ORDER_OLD_DISBAND = 4,
-  ORDER_OLD_BUILD_WONDER = 5,
-  ORDER_OLD_TRADE_ROUTE = 6,
-  ORDER_OLD_HOMECITY = 7,
-  ORDER_ACTION_MOVE = 8,
-  ORDER_PERFORM_ACTION = 9,
+  ORDER_ACTION_MOVE = 3,
+  ORDER_PERFORM_ACTION = 4,
   /* and plenty more for later... */
   ORDER_LAST
 };

Modified: trunk/fc_version
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=34041&r1=34040&r2=34041&view=diff
==============================================================================
--- trunk/fc_version    (original)
+++ trunk/fc_version    Fri Oct  7 14:12:28 2016
@@ -56,7 +56,7 @@
 #   - Avoid adding a new mandatory capability to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2016.Oct.06"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2016.Oct.07"
 NETWORK_CAPSTRING_OPTIONAL=""
 
 FREECIV_DISTRIBUTOR=""

Modified: trunk/server/savecompat.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savecompat.c?rev=34041&r1=34040&r2=34041&view=diff
==============================================================================
--- trunk/server/savecompat.c   (original)
+++ trunk/server/savecompat.c   Fri Oct  7 14:12:28 2016
@@ -1820,7 +1820,7 @@
   Should never be called from savegame3 after the 3.0 development version
   internal save game compatibility is removed.
 **************************************************************************/
-int sg_order_to_action(enum unit_orders order, struct unit *act_unit,
+int sg_order_to_action(int order, struct unit *act_unit,
                        struct tile *tgt_tile)
 {
   switch (order) {
@@ -1852,13 +1852,6 @@
     return ACTION_RECYCLE_UNIT;
   case ORDER_OLD_HOMECITY:
     return ACTION_HOME_CITY;
-  case ORDER_MOVE:
-  case ORDER_ACTION_MOVE:
-  case ORDER_FULL_MP:
-  case ORDER_ACTIVITY:
-  case ORDER_PERFORM_ACTION:
-  case ORDER_LAST:
-    break;
   }
 
   /* The order hasn't been replaced by an action. */

Modified: trunk/server/savecompat.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savecompat.h?rev=34041&r1=34040&r2=34041&view=diff
==============================================================================
--- trunk/server/savecompat.h   (original)
+++ trunk/server/savecompat.h   Fri Oct  7 14:12:28 2016
@@ -172,7 +172,12 @@
 enum ai_level ai_level_convert(int old_level);
 enum barbarian_type barb_type_convert(int old_type);
 
-int sg_order_to_action(enum unit_orders order, struct unit *act_unit,
+#define ORDER_OLD_BUILD_CITY (-1)
+#define ORDER_OLD_DISBAND (-2)
+#define ORDER_OLD_BUILD_WONDER (-3)
+#define ORDER_OLD_TRADE_ROUTE (-4)
+#define ORDER_OLD_HOMECITY (-5)
+int sg_order_to_action(int order, struct unit *act_unit,
                        struct tile *tgt_tile);
 
 #endif /* FC__SAVECOMPAT_H */

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=34041&r1=34040&r2=34041&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Fri Oct  7 14:12:28 2016
@@ -758,11 +758,6 @@
     return 'x';
   case ORDER_PERFORM_ACTION:
     return 'p';
-  case ORDER_OLD_HOMECITY:
-  case ORDER_OLD_DISBAND:
-  case ORDER_OLD_BUILD_CITY:
-  case ORDER_OLD_BUILD_WONDER:
-  case ORDER_OLD_TRADE_ROUTE:
   case ORDER_LAST:
     break;
   }
@@ -5783,11 +5778,6 @@
           }
           break;
         case ORDER_FULL_MP:
-        case ORDER_OLD_HOMECITY:
-        case ORDER_OLD_DISBAND:
-        case ORDER_OLD_BUILD_CITY:
-        case ORDER_OLD_BUILD_WONDER:
-        case ORDER_OLD_TRADE_ROUTE:
         case ORDER_LAST:
           break;
         }

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=34041&r1=34040&r2=34041&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Fri Oct  7 14:12:28 2016
@@ -4833,20 +4833,6 @@
       break;
     case ORDER_FULL_MP:
       break;
-    case ORDER_OLD_HOMECITY:
-    case ORDER_OLD_DISBAND:
-    case ORDER_OLD_BUILD_CITY:
-    case ORDER_OLD_BUILD_WONDER:
-    case ORDER_OLD_TRADE_ROUTE:
-      /* This order has been replaced with ORDER_PERFORM_ACTION and the
-       * action it performs. */
-      log_error("handle_unit_orders(): outdated client. "
-                "The order %d has been replaced. "
-                "Sent in order number %d from %s to unit number %d.",
-                packet->orders[i], i,
-                player_name(pplayer), packet->unit_id);
-
-      return;
     case ORDER_LAST:
       /* An invalid order.  This is handled in execute_orders. */
       break;

Modified: trunk/server/unittools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unittools.c?rev=34041&r1=34040&r2=34041&view=diff
==============================================================================
--- trunk/server/unittools.c    (original)
+++ trunk/server/unittools.c    Fri Oct  7 14:12:28 2016
@@ -4049,11 +4049,6 @@
       }
       break;
     case ORDER_ACTIVITY:
-    case ORDER_OLD_HOMECITY:
-    case ORDER_OLD_DISBAND:
-    case ORDER_OLD_BUILD_CITY:
-    case ORDER_OLD_BUILD_WONDER:
-    case ORDER_OLD_TRADE_ROUTE:
     case ORDER_LAST:
       /* Those actions don't require moves left. */
       break;
@@ -4382,11 +4377,6 @@
       }
 
       break;
-    case ORDER_OLD_HOMECITY:
-    case ORDER_OLD_DISBAND:
-    case ORDER_OLD_BUILD_CITY:
-    case ORDER_OLD_BUILD_WONDER:
-    case ORDER_OLD_TRADE_ROUTE:
     case ORDER_LAST:
       cancel_orders(punit, "  client sent invalid order!");
       notify_player(pplayer, unit_tile(punit), E_UNIT_ORDERS, ftc_server,


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

Reply via email to