Vanilla Development Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS update: Vanilla/ntserv



Date:	Friday February 25, 19100 @ 1:43
Author:	xyzzy

Update of /home/netrek/cvsroot/Vanilla/ntserv
In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv775

Modified Files:
	data.c feature.c features.c genspkt.c main.c struct.h 
Log Message:
Fix RCDs so they work again.  The server would think that the client couldn't
do RCDs, even when the client could.  For backward compatability, the server
would convert them into normal messages, which wouldn't be Receiver
Configurable.  The server will now remember the RC_DISTRESS feature packet
correctly.


****************************************

Index: Vanilla/ntserv/data.c
diff -u Vanilla/ntserv/data.c:1.11 Vanilla/ntserv/data.c:1.12
--- Vanilla/ntserv/data.c:1.11	Thu Dec 30 09:04:39 1999
+++ Vanilla/ntserv/data.c	Fri Feb 25 01:43:21 2000
@@ -1,4 +1,4 @@
-/* $Id: data.c,v 1.11 1999/12/30 15:04:39 xyzzy Exp $
+/* $Id: data.c,v 1.12 2000/02/25 07:43:21 xyzzy Exp $
  */
 
 #include "../ntserv/copyright.h"
@@ -282,12 +282,12 @@
 int     dogcounts=0;
 #endif
 
-#ifdef RCD
-int num_distress;
-
 char Cambot[FNAMESIZE];
 char Cambot_out[FNAMESIZE];
 
+#ifdef RCD
+int num_distress;
+
 /* the following copied out of BRM data.c */
 
 int num_distress;
@@ -323,6 +323,7 @@
 	{ 'E', "help", " %T%c->%O Help(%S)! %s%% shd, %d%% dmg, %f%% fuel,%?%S=SB%{ %w%% wtmp,%!%}%E%{ ETEMP!%}%W%{ WTEMP!%} %a armies!\0" },
 	{ '\0', '\0', '\0'},
 };
+#endif
 
 
 
@@ -377,7 +378,6 @@
 	{"tractrng",		FT_FLOAT, OFFSET_OF (s_tractrng)},
 	{0}
 };
-#endif
 
 #ifdef FEATURE_PACKETS
 int	F_client_feature_packets = 0;
@@ -385,7 +385,9 @@
 
 int F_ship_cap      = 0;
 int F_cloak_maxwarp = 0;
+#ifdef RCD
 int F_rc_distress   = 0;
+#endif
 int F_self_8flags   = 0;
 int F_19flags       = 0;	/* pack 19 flags into spare bytes */
 int sent_ship[NUM_TYPES];
Index: Vanilla/ntserv/feature.c
diff -u Vanilla/ntserv/feature.c:1.6 Vanilla/ntserv/feature.c:1.7
--- Vanilla/ntserv/feature.c:1.6	Thu Dec 30 09:04:39 1999
+++ Vanilla/ntserv/feature.c	Fri Feb 25 01:43:21 2000
@@ -46,7 +46,9 @@
    { "SBHOURS",			&SBhours },
    { "SELF_8FLAGS",		&F_self_8flags},
    { "19FLAGS", 		&F_19flags},
+#ifdef RCD
    { "RC_DISTRESS",		&F_rc_distress}, /* xx */
+#endif
    { "CLOAK_MAXWARP",		&F_cloak_maxwarp},
    { "SHIP_CAP",		&F_ship_cap},
    { "DEAD_WARP",		&dead_warp },
@@ -188,7 +190,7 @@
 
    /* server/client options that might need special variables */
    for(i=0; feature_vars[i].name ; i++){
-      if(feature_cmp(cpack->name, feature_vars[i].name)){
+      if(feature_cmp(cpack->name, feature_vars[i].name)) {
        if(feature_vars[i].var){
           if(cpack->value == 1)
              *feature_vars[i].var = (spack->value == 1);
@@ -200,18 +202,8 @@
        else {
           /* xx: special features that don't have a single variable
              associated: */
-          if(feature_cmp(cpack->name, "RC_DISTRESS")){
-             if(cpack->value == 1){
-                me->gen_distress = (spack->value == 1);
-             }
-             else {
-                spack->value =0;
-                me->gen_distress = 0;
-             }
-          }
-          else
-             /* client values mean nothing here */
-             spack->value = 1;
+	  /* client values mean nothing here */
+	  spack->value = 1;
        }
        return;
       }
Index: Vanilla/ntserv/features.c
diff -u Vanilla/ntserv/features.c:1.2 Vanilla/ntserv/features.c:1.3
--- Vanilla/ntserv/features.c:1.2	Fri Apr 30 15:18:43 1999
+++ Vanilla/ntserv/features.c	Fri Feb 25 01:43:21 2000
@@ -29,7 +29,7 @@
 
 #ifdef RCD
 	if (!strcmp(features,"RC_DISTRESS")) {
-            me->gen_distress = 1;
+            F_rc_distress = 1;
         }
 #endif
 	if (!strcmp(features,"SBHOURS")) {
Index: Vanilla/ntserv/genspkt.c
diff -u Vanilla/ntserv/genspkt.c:1.11 Vanilla/ntserv/genspkt.c:1.12
--- Vanilla/ntserv/genspkt.c:1.11	Thu Jan  6 14:50:38 2000
+++ Vanilla/ntserv/genspkt.c	Fri Feb 25 01:43:21 2000
@@ -948,7 +948,7 @@
 	/* if I understood heiko's short_packet code I would put this in
 	   the above ... but I dont - jmn */
 
-	if ((cur->m_recpt == me->p_team) && !me->gen_distress && 
+	if ((cur->m_recpt == me->p_team) && !F_rc_distress && 
 	    (cur->m_flags == (MTEAM | MDISTR | MVALID))) {
 
 	    struct distress dist;
Index: Vanilla/ntserv/main.c
diff -u Vanilla/ntserv/main.c:1.17 Vanilla/ntserv/main.c:1.18
--- Vanilla/ntserv/main.c:1.17	Sun Feb 20 07:05:00 2000
+++ Vanilla/ntserv/main.c	Fri Feb 25 01:43:21 2000
@@ -214,9 +214,6 @@
     me->p_x= -100000;	
     me->p_y= -100000;
     me->p_team=0;
-#ifdef RCD
-    me->gen_distress = 0;
-#endif
     updateSelf(FALSE);	/* so he gets info on who he is */
     			/* updateSelf(TRUE) shouldn't be necessary */
     updateShips();
Index: Vanilla/ntserv/struct.h
diff -u Vanilla/ntserv/struct.h:1.8 Vanilla/ntserv/struct.h:1.9
--- Vanilla/ntserv/struct.h:1.8	Thu Jan  6 14:45:25 2000
+++ Vanilla/ntserv/struct.h	Fri Feb 25 01:43:21 2000
@@ -370,9 +370,6 @@
 #endif
     int p_timerdelay;           /* updates per second */
     pid_t p_process;            /* process id number */
-#ifdef RCD
-    int gen_distress;		/* generate generic distress for client */
-#endif
 #ifdef BASEPRACTICE
     /* robot ogger variables */
     int p_df;			/* defense (0 unknown, 1 worst, 100 best) */