Vanilla Development Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS update: Vanilla/ntserv
Date: Tuesday May 23, 2000 @ 20:16
Author: jeffno
Update of /home/netrek/cvsroot/Vanilla/ntserv
In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv6307
Modified Files:
daemonII.c data.c data.h defs.h getpath.c packets.h socket.c
struct.h sysdefaults.h
Log Message:
Added newbie server mode.
****************************************
Index: Vanilla/ntserv/daemonII.c
diff -u Vanilla/ntserv/daemonII.c:1.31 Vanilla/ntserv/daemonII.c:1.32
--- Vanilla/ntserv/daemonII.c:1.31 Tue Jan 11 20:29:52 2000
+++ Vanilla/ntserv/daemonII.c Tue May 23 20:16:31 2000
@@ -3600,6 +3600,10 @@
conquerMessage(winner->p_team);
for (h = 0, j = &players[0]; h < MAXPLAYER; h++, j++) {
if (j->p_status == PFREE) continue;
+#ifdef NEWBIESERVER
+ /* Don't kill newbie robot. */
+ if (status->gameup & GU_NEWBIE && j->p_flags & PFROBOT) continue;
+#endif
j->p_status = PEXPLODE;
j->p_whydead = KWINNER;
j->p_whodead = winner->p_no;
@@ -4088,6 +4092,12 @@
case BASEP_ROBOT:
execl(Basep, "basep", 0);
perror(Basep);
+ break;
+#endif
+#ifdef NEWBIESERVER
+ case NEWBIE_ROBOT:
+ execl(Newbie, "newbie", 0);
+ perror(Newbie);
break;
#endif
#ifdef DOGFIGHT
Index: Vanilla/ntserv/data.c
diff -u Vanilla/ntserv/data.c:1.13 Vanilla/ntserv/data.c:1.14
--- Vanilla/ntserv/data.c:1.13 Sun Mar 19 03:20:02 2000
+++ Vanilla/ntserv/data.c Tue May 23 20:16:31 2000
@@ -1,4 +1,4 @@
-/* $Id: data.c,v 1.13 2000/03/19 09:20:02 xyzzy Exp $
+/* $Id: data.c,v 1.14 2000/05/24 01:16:31 jeffno Exp $
*/
#include "../ntserv/copyright.h"
@@ -259,6 +259,11 @@
#endif
#ifdef BASEPRACTICE
char Basep[FNAMESIZE];
+#endif
+#ifdef NEWBIESERVER
+char Newbie[FNAMESIZE];
+#endif
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
char Robodir[FNAMESIZE];
char robofile[FNAMESIZE];
char robot_host[FNAMESIZE];
Index: Vanilla/ntserv/data.h
diff -u Vanilla/ntserv/data.h:1.10 Vanilla/ntserv/data.h:1.11
--- Vanilla/ntserv/data.h:1.10 Sun Mar 19 03:20:02 2000
+++ Vanilla/ntserv/data.h Tue May 23 20:16:31 2000
@@ -1,4 +1,4 @@
-/* $Id: data.h,v 1.10 2000/03/19 09:20:02 xyzzy Exp $
+/* $Id: data.h,v 1.11 2000/05/24 01:16:31 jeffno Exp $
*/
#ifndef _h_data
@@ -280,6 +280,11 @@
#endif
#ifdef BASEPRACTICE
extern char Basep[FNAMESIZE];
+#endif
+#ifdef NEWBIESERVER
+extern char Newbie[FNAMESIZE];
+#endif
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
extern char Robodir[FNAMESIZE];
extern char robofile[FNAMESIZE];
extern char robot_host[FNAMESIZE];
Index: Vanilla/ntserv/defs.h
diff -u Vanilla/ntserv/defs.h:1.17 Vanilla/ntserv/defs.h:1.18
--- Vanilla/ntserv/defs.h:1.17 Thu Mar 23 20:37:34 2000
+++ Vanilla/ntserv/defs.h Tue May 23 20:16:31 2000
@@ -1,4 +1,4 @@
-/* $Id: defs.h,v 1.17 2000/03/24 02:37:34 karthik Exp $
+/* $Id: defs.h,v 1.18 2000/05/24 01:16:31 jeffno Exp $
*/
#ifndef _h_defs
@@ -242,9 +242,17 @@
#ifdef BASEPRACTICE
#define N_BASEP "basep"
-#define N_ROBODIR "og"
#define BASEP_ROBOT 1
#define N_MOTD_BASEP ".motd_basep"
+#endif
+
+#ifdef NEWBIESERVER
+#define N_NEWBIE "newbie"
+#define NEWBIE_ROBOT 5
+#endif
+
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
+#define N_ROBODIR "og"
#endif
#ifdef DOGFIGHT
Index: Vanilla/ntserv/getpath.c
diff -u Vanilla/ntserv/getpath.c:1.3 Vanilla/ntserv/getpath.c:1.4
--- Vanilla/ntserv/getpath.c:1.3 Sun Jun 6 17:38:25 1999
+++ Vanilla/ntserv/getpath.c Tue May 23 20:16:31 2000
@@ -80,8 +80,16 @@
#ifdef BASEPRACTICE
sprintf(Basep,"%s/%s",path,N_BASEP);
+#endif
+
+#ifdef NEWBIESERVER
+ sprintf(Newbie,"%s/%s",path,N_NEWBIE);
+#endif
+
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
sprintf(Robodir,"%s/%s",path,N_ROBODIR);
#endif
+
#ifdef DOGFIGHT
sprintf(Mars,"%s/%s",path,N_MARS);
#endif
Index: Vanilla/ntserv/packets.h
diff -u Vanilla/ntserv/packets.h:1.3 Vanilla/ntserv/packets.h:1.4
--- Vanilla/ntserv/packets.h:1.3 Fri Apr 30 15:18:45 1999
+++ Vanilla/ntserv/packets.h Tue May 23 20:16:31 2000
@@ -1,4 +1,4 @@
-/* $Id: packets.h,v 1.3 1999/04/30 20:18:45 ahn Exp $
+/* $Id: packets.h,v 1.4 2000/05/24 01:16:31 jeffno Exp $
*/
/*
@@ -136,7 +136,7 @@
#define CP_S_RESERVED 46
#define CP_S_DUMMY 47
-#ifdef BASEPRACTICE
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
#define CP_OGGV 50
#endif
@@ -910,7 +910,7 @@
};
-#ifdef BASEPRACTICE
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
struct oggv_cpacket {
char type; /* CP_OGGV */
u_char def; /* defense 1-100 */
Index: Vanilla/ntserv/socket.c
diff -u Vanilla/ntserv/socket.c:1.23 Vanilla/ntserv/socket.c:1.24
--- Vanilla/ntserv/socket.c:1.23 Thu Mar 9 20:27:15 2000
+++ Vanilla/ntserv/socket.c Tue May 23 20:16:31 2000
@@ -1,4 +1,4 @@
-/* $Id: socket.c,v 1.23 2000/03/10 02:27:15 cameron Exp $
+/* $Id: socket.c,v 1.24 2000/05/24 01:16:31 jeffno Exp $
*/
/*
@@ -99,7 +99,7 @@
static void handleThresh(struct threshold_cpacket *packet);
static void handleSMessageReq(struct mesg_s_cpacket *packet);
-#ifdef BASEPRACTICE
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
static void handleOggV(struct oggv_cpacket *packet);
#endif
#ifdef FEATURE_PACKETS
@@ -197,7 +197,7 @@
{0, NULL}, /* 47 */
{0, NULL}, /* 48 */
{0, NULL}, /* 49 */
-#ifdef BASEPRACTICE
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
{sizeof(struct oggv_cpacket), handleOggV}, /* CP_OGGV */
#else
{0, NULL}, /* 50 */
@@ -2021,7 +2021,7 @@
}
#endif /*PING*/
-#ifdef BASEPRACTICE
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
/* these are sent by the robots when a parameter changes */
static void handleOggV(struct oggv_cpacket *packet)
{
@@ -2040,7 +2040,7 @@
fflush(stdout);
#endif
}
-#endif /* BASEPRACTICE */
+#endif /* BASEPRACTICE || NEWBIESERVER */
#ifdef FEATURE_PACKETS
Index: Vanilla/ntserv/struct.h
diff -u Vanilla/ntserv/struct.h:1.9 Vanilla/ntserv/struct.h:1.10
--- Vanilla/ntserv/struct.h:1.9 Fri Feb 25 01:43:21 2000
+++ Vanilla/ntserv/struct.h Tue May 23 20:16:31 2000
@@ -84,6 +84,9 @@
#define GU_PAUSED 8
#define ispaused ((status->gameup) & GU_PAUSED)
#define GU_INROBOT 16
+#ifdef NEWBIESERVER
+#define GU_NEWBIE 32
+#endif
/* changed these so we can use and and or functions on them in future */
#define PFREE 0x0000
@@ -128,7 +131,7 @@
#define PFTWARP 0x40000000 /* isae -- SB transwarp */
#endif
-#ifdef BASEPRACTICE
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
#define PFBPROBOT 0x80000000
#endif
@@ -370,7 +373,7 @@
#endif
int p_timerdelay; /* updates per second */
pid_t p_process; /* process id number */
-#ifdef BASEPRACTICE
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
/* robot ogger variables */
int p_df; /* defense (0 unknown, 1 worst, 100 best) */
int p_tg; /* target+1 */
Index: Vanilla/ntserv/sysdefaults.h
diff -u Vanilla/ntserv/sysdefaults.h:1.7 Vanilla/ntserv/sysdefaults.h:1.8
--- Vanilla/ntserv/sysdefaults.h:1.7 Sun Jun 6 17:38:25 1999
+++ Vanilla/ntserv/sysdefaults.h Tue May 23 20:16:31 2000
@@ -1,4 +1,4 @@
-/* $Id: sysdefaults.h,v 1.7 1999/06/06 22:38:25 jeffno Exp $ */
+/* $Id: sysdefaults.h,v 1.8 2000/05/24 01:16:31 jeffno Exp $ */
/* structure for default values that are represented as array of flags */
struct sysdef_array {
@@ -147,6 +147,12 @@
#ifdef BASEPRACTICE
{ "BASEPRACTICE", SYSDEF_ROBOT, (void *) BASEP_ROBOT,
"Enable base practice robot on startup" },
+#endif
+#ifdef NEWBIESERVER
+ { "NEWBIE", SYSDEF_ROBOT, (void *) NEWBIE_ROBOT,
+ "Enable newbie server robot on startup" },
+#endif
+#if defined(BASEPRACTICE) || defined(NEWBIESERVER)
{ "ROBOTHOST", SYSDEF_CHAR, robot_host,
"Robot host" },
#endif