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

CVS update: Vanilla/ntserv



Date:	Friday June 11, 1999 @ 3:04
Author:	cameron

Update of /home/netrek/cvsroot/Vanilla/ntserv
In directory cvs.castle.real-time.com:/var/tmp/cvs-serv5942/ntserv

Modified Files:
	daemonII.c main.c 
Log Message:
	* ntserv/main.c (main): remove superfluous set of whydead on login.
	This will have caused ghostbusts on login in conjunction with the
	"in POUTFIT too long" handler in udplayers().

	* ntserv/daemonII.c (udplayers): ghostbusts on login are happening
	here, and the code still thinks the outfitdelay should be 300 despite
	whydead being set to KLOGIN by ntserv/main.c, so for the moment I've
	added also a dump of the whydead reason and a stdout flush.

	* ntserv/main.c (main): improve error messages for ntserv instances
	that quit due to lack of version packet or invalid packet format.


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

Index: Vanilla/ntserv/daemonII.c
diff -u Vanilla/ntserv/daemonII.c:1.22 Vanilla/ntserv/daemonII.c:1.23
--- Vanilla/ntserv/daemonII.c:1.22	Thu Jun  3 05:09:47 1999
+++ Vanilla/ntserv/daemonII.c	Fri Jun 11 03:04:10 1999
@@ -739,8 +739,12 @@
 		}
 
                 if (++(j->p_ghostbuster) > outfitdelay) {
-		    ERROR(4,("%s: ship in POUTFIT too (%d) long\n", 
-			     j->p_mapchars, outfitdelay));
+		    ERROR(4,("%s: ship in POUTFIT too long (of=%d,wd=%d)\n", 
+			     j->p_mapchars, outfitdelay, j->p_whydead));
+
+		    /* temporary */
+		    fflush(stdout);
+
 		    /* Force the player out of the game */
                     saveplayer(j);
                     if (j->p_process > 1) {
Index: Vanilla/ntserv/main.c
diff -u Vanilla/ntserv/main.c:1.12 Vanilla/ntserv/main.c:1.13
--- Vanilla/ntserv/main.c:1.12	Mon May 31 20:53:22 1999
+++ Vanilla/ntserv/main.c	Fri Jun 11 03:04:11 1999
@@ -153,12 +153,16 @@
 	 * We give him thirty seconds to do so...
 	 */
 	if (starttime+30 < time(NULL)) {
+	    ERROR(2,("ntserv/main.c: no version packet received\n"));
 	    exit(1);
 	}
 	socketPause();
 	readFromClient();
     }
-    if (!checkVersion()) exit(1);
+    if (!checkVersion()) {
+        ERROR(2,("ntserv/main.c: bad version packet from client\n"));
+	exit(1);
+    }
 
     SIGNAL(SIGALRM, SIG_IGN);
     SIGNAL(SIGTERM, forceShutdown);
@@ -188,6 +192,7 @@
     me->p_mapchars[0] = 'X';
     me->p_mapchars[1] = shipnos[pno];
     me->p_mapchars[2] = '\0';
+    me->p_whydead=KLOGIN;
 
     myship = &me->p_ship;
     mystats = &me->p_stats;
@@ -198,8 +203,6 @@
     /* erase prior slot login identity */
     me->p_login[0] = '\0';
 
-    me->p_whydead = KLOGIN;
-
     /* We set these so we won't bother updating him on the location of the
      *  other players in the galaxy which he is not near.  There is no
      *  real harm to doing this, except that he would then get more information
@@ -248,8 +251,6 @@
     me->p_genoplanets=0;
     me->p_armsbomb=0;
     me->p_genoarmsbomb=0;
-    /* Set up a reasonable default */
-    me->p_whydead=KQUIT;
 
     STRNCPY(me->p_login, login, NAME_LEN);
     me->p_login[NAME_LEN - 1] = '\0';