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

Modified Files:
        dashboard.c local.c socket.c 
Log Message:
Check on size of generic32 packet.
New player field p_orbit, to hold planet# that server tells you that you are 
orbitting.
Updated generic32 structure to include p_orbit.

Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- local.c     13 Dec 2006 00:00:00 -0000      1.49
+++ local.c     13 Dec 2006 09:03:01 -0000      1.50
@@ -528,7 +528,7 @@
         }
         
         if (showArmy && (me->p_flags & PFORBIT)
-        && (get_closest_planet(me->p_x, me->p_y) == l->pl_no))
+        && (F_sp_generic_32 ? me->pl_orbit : get_closest_planet(me->p_x, 
me->p_y)) == l->pl_no)
         {
             char armbuf[4];
             int armbuflen;

Index: dashboard.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- dashboard.c 13 Dec 2006 00:00:00 -0000      1.14
+++ dashboard.c 13 Dec 2006 09:03:01 -0000      1.15
@@ -884,7 +884,7 @@
 /***  repair_time() - calculate time left till ship is fully repaired
                       using server defined repair rates.  Only called when
                       ship is at warp 0 and under repair.  Made obsolete by
-                      F_sp_generic_32 feature packet                        
***/
+                      F_sp_generic_32 feature packet.                       
***/
 
/******************************************************************************/
 int
 repair_time (void)
@@ -956,7 +956,8 @@
 
 
/******************************************************************************/
 /***  get_closest_planet() - find closest planet to given location
-      Useful for determining which planet you are orbitting                 
***/
+      Useful for determining which planet you are orbitting.
+      Made obsolete by F_sp_generic_32 feature packet.                      
***/
 
/******************************************************************************/
 int get_closest_planet(int x, int y)
 {

Index: socket.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- socket.c    13 Dec 2006 00:00:00 -0000      1.12
+++ socket.c    13 Dec 2006 09:03:01 -0000      1.13
@@ -2368,8 +2368,16 @@
     char version;
 //    char unused;
 
+    if (sizeof(*packet) != GENERIC_32_LENGTH)
+    {
+#ifdef DEBUG
+       LineToConsole("Generic32 packet length of %d, ignoring packet.\n", 
sizeof(*packet));
+#endif
+       return;
+    }
     version = packet->version;
     me->p_repair_time = packet->repair_time;
+    me->pl_orbit = packet->pl_orbit;
    // unused = packet->pad1;
 }
 


_______________________________________________
netrek-cvs mailing list
[email protected]
http://mailman.us.netrek.org/mailman/listinfo/netrek-cvs

Reply via email to