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

CVS update: Vanilla/ntserv



Date:	Friday May 28, 1999 @ 8:35
Author:	cameron

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

Modified Files:
	daemonII.c defs.h interface.c main.c socket.c 
Log Message:
various changes, see ChangeLog

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

Index: Vanilla/ntserv/daemonII.c
diff -u Vanilla/ntserv/daemonII.c:1.18 Vanilla/ntserv/daemonII.c:1.19
--- Vanilla/ntserv/daemonII.c:1.18	Wed May  5 18:54:25 1999
+++ Vanilla/ntserv/daemonII.c	Fri May 28 08:35:06 1999
@@ -732,10 +732,12 @@
 		}
 
                 if (++(j->p_ghostbuster) > outfitdelay) {
-		    ERROR(4,("daemonII/udplayers:  in POUTFIT too long\n"));
+		    ERROR(4,("%s: ship in POUTFIT too long\n", j->p_mapchars));
 		    /* Force the player out of the game */
                     saveplayer(j);
                     if (j->p_process > 1) {
+			ERROR(8,("%s: sending SIGTERM to %d\n", 
+				 j->p_mapchars, j->p_process));
                         if (kill (j->p_process, SIGTERM) < 0)
 			    ERROR(1,("daemonII/udplayers:  kill failed!\n"));
                     } else {
@@ -2736,13 +2738,14 @@
     /* Send in a robot if there are no other defenders (or not Tmode)
        and the planet is in the team's home space */
     
-    if (((tcount[l->pl_owner] == 0) || (NotTmode(ticks))) && 
+    if (!(status->gameup & GU_INROBOT)) {
+      if (((tcount[l->pl_owner] == 0) || (NotTmode(ticks))) && 
 	(l->pl_flags & l->pl_owner) &&
 	tm_robots[l->pl_owner] == 0) {
-      rescue(l->pl_owner, NotTmode(ticks));
-      tm_robots[l->pl_owner] = (1800 + 
-				(random() % 1800)) /
-				  TEAMFUSE;
+
+	rescue(l->pl_owner, NotTmode(ticks));
+	tm_robots[l->pl_owner] = (1800 + (random() % 1800)) / TEAMFUSE;
+      }
     }
   }
 }
@@ -3276,8 +3279,10 @@
         j->p_ntorp = 0;
         j->p_nplasmatorp = 0;
         j->p_explode = 600/PLAYERFUSE; /* ghost buster was leaving players in */
-        if (j->p_process > 1)
+        if (j->p_process > 1) {
+	    ERROR(8,("%s: sending SIGTERM\n", j->p_mapchars));
             (void) kill (j->p_process, SIGTERM);
+	}
     }
 
     status->gameup &= ~(GU_GAMEOK); /* say goodbye to xsg et. al. 4/10/92 TC */
Index: Vanilla/ntserv/defs.h
diff -u Vanilla/ntserv/defs.h:1.6 Vanilla/ntserv/defs.h:1.7
--- Vanilla/ntserv/defs.h:1.6	Fri Apr 30 15:18:42 1999
+++ Vanilla/ntserv/defs.h	Fri May 28 08:35:06 1999
@@ -1,4 +1,4 @@
-/* $Id: defs.h,v 1.6 1999/04/30 20:18:42 ahn Exp $
+/* $Id: defs.h,v 1.7 1999/05/28 13:35:06 cameron Exp $
  */
 
 #ifndef _h_defs
@@ -391,8 +391,8 @@
 
 /* server version of UDPDIAG */
 /* (change these to "#define UDPDIAG(x) <return>" for smaller & faster code) */
-#define UDPDIAG(x)	{ if (udpAllowed > 1) { printf("UDP: "); printf x; }}
-#define V_UDPDIAG(x)	{ if (udpAllowed > 2) { printf("UDP: "); printf x; }}
+#define UDPDIAG(x)	{ if (udpAllowed > 1) { printf("%s: UDP: ", me->p_mapchars); printf x; }}
+#define V_UDPDIAG(x)	{ if (udpAllowed > 2) { printf("%s: UDP: ", me->p_mapchars); printf x; }}
 
 
 #if WINSIDE > 500
Index: Vanilla/ntserv/interface.c
diff -u Vanilla/ntserv/interface.c:1.2 Vanilla/ntserv/interface.c:1.3
--- Vanilla/ntserv/interface.c:1.2	Fri Apr 30 15:18:44 1999
+++ Vanilla/ntserv/interface.c	Fri May 28 08:35:07 1999
@@ -575,6 +575,7 @@
     if (type == STARBASE) {
 	me->p_docked = 0;
 	for (i=0; i<4; i++) me->p_port[i] = VACANT;
+	me->p_flags |= PFDOCKOK;
     }
 
     me->p_flags &= ~(PFREFIT|PFWEP|PFENG);
Index: Vanilla/ntserv/main.c
diff -u Vanilla/ntserv/main.c:1.10 Vanilla/ntserv/main.c:1.11
--- Vanilla/ntserv/main.c:1.10	Fri May 28 04:22:33 1999
+++ Vanilla/ntserv/main.c	Fri May 28 08:35:07 1999
@@ -189,7 +189,9 @@
 
     me->p_process = getpid ();
     me->p_timerdelay = defskip;
-    me->p_mapchars[0] = 'L';
+
+    me->p_mapchars[0] = 'X';
+    me->p_mapchars[1] = shipnos[pno];
     me->p_mapchars[2] = '\0';
 
     myship = &me->p_ship;
@@ -235,6 +237,8 @@
     me->p_team=ALLTEAM;
     getname();
     strcpy(pseudo, me->p_name);
+
+    ERROR(7,("%s: is %s@%s as %s\n", me->p_mapchars, login, host, pseudo));
 
     keeppeace = (me->p_stats.st_flags / ST_KEEPPEACE) & 1;
 /*    showgalactic = 1 + (me->p_stats.st_flags / ST_GALFREQUENT) & 1;*/
Index: Vanilla/ntserv/socket.c
diff -u Vanilla/ntserv/socket.c:1.11 Vanilla/ntserv/socket.c:1.12
--- Vanilla/ntserv/socket.c:1.11	Fri May 28 03:40:42 1999
+++ Vanilla/ntserv/socket.c	Fri May 28 08:35:07 1999
@@ -1,4 +1,4 @@
-/* $Id: socket.c,v 1.11 1999/05/28 08:40:42 cameron Exp $
+/* $Id: socket.c,v 1.12 1999/05/28 13:35:07 cameron Exp $
  */
 
 /*
@@ -347,7 +347,7 @@
 	shutdown(sock,2);
 	sock= -1;
     }
-    ERROR(3,("%s:%s:%d start connect\n", me->p_mapchars, machine, port)); 
+    ERROR(3,("%s start connect to %s:%d\n", me->p_mapchars, machine, port)); 
 
     if ((ns=socket(AF_INET, SOCK_STREAM, 0)) < 0) {
 	ERROR(1,("%s: socket() failed, %s\n", me->p_mapchars, strerror(errno)));
@@ -1839,7 +1839,7 @@
     struct reserved_cpacket mycp;
     struct reserved_spacket mysp;
     struct rsa_key_spacket   rsp;
-    char serverName[64]; /* now get serverName from system 8/2/92 TC */
+    char serverName[64];
 
     if (testtime==1) return;
     if (MCMP(packet->data, testdata, RESERVED_SIZE) != 0) {
@@ -1862,10 +1862,13 @@
 	return;
     }
     MCOPY(testdata, mysp.data, RESERVED_SIZE);
-    if (gethostname(serverName, 64)) fprintf(stderr, "gethostname() error\n"); /* 8/2/92 TC */
+    serverName[0] = '\0';
+    if (gethostname(serverName, 64))
+	ERROR(1,( "%s: gethostname() failed\n", me->p_mapchars, 
+		  strerror(errno)));
     encryptReservedPacket(&mysp, &mycp, serverName, me->p_no);
     if (MCMP(packet->resp, mycp.resp, RESERVED_SIZE) != 0) {
-        ERROR(3, ("User verified incorrectly.\n"));
+        ERROR(3, ("%s: user verified incorrectly.\n", me->p_mapchars));
         testtime=1;
         return;
     }
@@ -1885,10 +1888,14 @@
     if (testtime==1) return;
     if (RSA_Client != 1) return;
     MCOPY(testdata, mysp.data, KEY_SIZE);
-    if (gethostname(serverName, 64)) ERROR(1,( "gethostname() error\n"));
+
+    serverName[0] = '\0';
+    if (gethostname(serverName, 64))
+	ERROR(1,( "%s: gethostname() failed\n", me->p_mapchars, 
+		  strerror(errno)));
     if (decryptRSAPacket(&mysp, packet, serverName))
     {
-        ERROR(3,("User verified incorrectly.\n"));
+        ERROR(3,("%s: user verified incorrectly.\n", me->p_mapchars));
         testtime=1;
         return;
     }
@@ -1900,10 +1907,9 @@
 
 static void handleReserved(struct reserved_cpacket *packet)
 {
-/*    char temp[20];*/
     struct reserved_cpacket mycp;
     struct reserved_spacket mysp;
-    char serverName[64]; /* now get serverName from system 8/2/92 TC */
+    char serverName[64];
 
     if (testtime==1) return;
     if (MCMP(packet->data, testdata, 16) != 0) {
@@ -1911,10 +1917,13 @@
 	return;
     }
     MCOPY(testdata, mysp.data, 16);
-    if (gethostname(serverName, 64)) fprintf(stderr, "gethostname() error\n"); /* 8/2/92 TC */
+    serverName[0] = '\0';
+    if (gethostname(serverName, 64))
+	ERROR(1,( "%s: gethostname() failed\n", me->p_mapchars, 
+		  strerror(errno)));
     encryptReservedPacket(&mysp, &mycp, serverName, me->p_no);
     if (MCMP(packet->resp, mycp.resp, 16) != 0) {
-	ERROR(3,("User verified incorrectly.\n"));
+        ERROR(3,("%s: user verified incorrectly.\n", me->p_mapchars));
 	testtime=1;
 	return;
     }