Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26979/src

Modified Files:
	data.c local.c map.c socket.c 
Log Message:
First pass at generic 32 version b support.
Known issues: doesn't pass version b to server via value field yet.

Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- local.c	19 Apr 2008 20:03:03 -0000	1.112
+++ local.c	12 Jul 2008 03:49:45 -0000	1.113
@@ -699,7 +699,7 @@
         if ((showArmy == 1 || showArmy == 3) && (l->pl_info & me->p_team)
          && (paradise ? (PL_TYPE(*l) == PLPLANET) : 1)
          && (F_show_army_count || 
-           ( (me->p_flags & PFORBIT) && (F_sp_generic_32 ? me->pl_orbit : get_closest_planet(me->p_x, me->p_y)) == l->pl_no)
+           ( (me->p_flags & PFORBIT) && ((F_sp_generic_32 && me->pl_orbit != -1) ? me->pl_orbit : get_closest_planet(me->p_x, me->p_y)) == l->pl_no)
           || (!paradise && (me->p_flags & PFPLLOCK) && (me->p_flags & PFOBSERV) && (me->p_planet == l->pl_no)) ))
         {
             char armbuf[4];

Index: map.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- map.c	19 Apr 2008 20:03:04 -0000	1.65
+++ map.c	12 Jul 2008 03:49:45 -0000	1.66
@@ -544,7 +544,7 @@
         if (F_check_planets)
         {
             if ((me->p_flags & PFORBIT)
-            && (F_sp_generic_32 ? me->pl_orbit : get_closest_planet(me->p_x, me->p_y)) == l->pl_no)
+            && ((F_sp_generic_32 && me->pl_orbit != -1) ? me->pl_orbit : get_closest_planet(me->p_x, me->p_y)) == l->pl_no)
             {
                 orbit_planet_refresh++;
                 if ((orbit_planet_refresh * 10 / server_ups) >= 1)

Index: socket.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- socket.c	21 Jun 2008 13:31:41 -0000	1.47
+++ socket.c	12 Jul 2008 03:49:45 -0000	1.48
@@ -2818,10 +2818,28 @@
 #endif
     	return;
     }
-    if (packet->version < 'a') return;
-    me->p_repair_time = packet->repair_time;
-    me->pl_orbit = packet->pl_orbit;
-    if (packet->version < 'b') return;
+    if (packet->version < 'a')
+        return;
+    else if (packet->version == 'a')
+    {
+        me->p_repair_time = packet->repair_time;
+        me->pl_orbit = packet->pl_orbit;
+        return;
+    }
+    else if (packet->version == 'b') 
+    {
+        me->p_repair_time = ntohs (packet->repair_time);
+        me->pl_orbit = packet->pl_orbit;
+        context->gameup = ntohs(packet->gameup);
+        context->tournament_teams = packet->tournament_teams;
+        context->tournament_age = packet->tournament_age;
+        context->tournament_age_units = packet->tournament_age_units;
+        context->tournament_remain = packet->tournament_remain;
+        context->tournament_remain_units = packet->tournament_remain_units;
+        context->starbase_remain = packet->starbase_remain;
+        context->team_remain = packet->team_remain;
+        return;
+    }
 }
 
 void

Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- data.c	8 Jul 2008 01:40:21 -0000	1.111
+++ data.c	12 Jul 2008 03:49:45 -0000	1.112
@@ -927,3 +927,5 @@
 int mapscaleFactor = 40;        /* allows for scaling of galactic window, unused */
 int fullBitmapRotation = 1;     /* draw old bitmap sets to all angles */
 int hideConsole = 0;            /* show console window or not */
+
+struct context *context;