Update of /cvsroot/netrek/server/Vanilla/sequencer
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3659/sequencer
Modified Files:
roboshar.c sequencer.c
Log Message:
fix compilation errors on sequencer following previous commands.c change
Index: sequencer.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/sequencer/sequencer.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- sequencer.c 21 Mar 2005 05:23:46 -0000 1.1
+++ sequencer.c 6 May 2006 13:12:56 -0000 1.2
@@ -1,23 +1,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <signal.h>
-#include <sys/file.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <pwd.h>
-#include <math.h>
-#include <ctype.h>
-#include <time.h>
#include "defs.h"
#include "struct.h"
#include "data.h"
#include "planets.h"
#include "proto.h"
-#include INC_STRINGS
#define KTOURNSTART 0x0e
@@ -80,13 +68,6 @@
{
MCOPY (pdata, planets, sizeof (pdata));
-/*
- for (i = 0; i < MAXPLANETS; i++)
- {
- planets[i].pl_info = ALLTEAM;
- }
-*/
-
for (i = 0; i < 4; i++)
{
/* one core AGRI */
@@ -200,15 +181,18 @@
do_nuke ( void *nothing )
{
obliterate ( 0, KPROVIDENCE );
-
- /* get rid of annoying compiler warning, -O will remove this code */
- if (nothing) return;
}
/*
-** Balance the teams by statistics.
+** Balance the teams.
*/
-extern void do_balance(char *);
+#if defined (TRIPLE_PLANET_MAYHEM)
+void
+do_local_balance ( void *nothing )
+{
+ do_balance();
+}
+#endif
/*
** Reset planets, save planet state and player state for later scoring
@@ -218,9 +202,6 @@
{
doResources(1);
/* save planet/player state ? */
-
- /* get rid of annoying compiler warning, -O will remove this code */
- if (nothing) return;
}
/*
@@ -230,9 +211,6 @@
do_pause ( void *nothing )
{
status->gameup |= (GU_PRACTICE | GU_PAUSED);
-
- /* get rid of annoying compiler warning, -O will remove this code */
- if (nothing) return;
}
/*
@@ -242,9 +220,6 @@
do_continue ( void *nothing )
{
status->gameup &= ~(GU_PRACTICE | GU_PAUSED);
-
- /* get rid of annoying compiler warning, -O will remove this code */
- if (nothing) return;
}
/*
@@ -255,9 +230,6 @@
do_score ( char *nothing )
{
printf ( "Score...\n" );
-
- /* get rid of annoying compiler warning, -O will remove this code */
- if (nothing) return;
}
/*
@@ -267,9 +239,6 @@
do_eject ( void *nothing )
{
obliterate ( 0, KQUIT );
-
- /* get rid of annoying compiler warning, -O will remove this code */
- if (nothing) return;
}
/*
@@ -289,9 +258,6 @@
do_exit ( void *nothing )
{
exit(0);
-
- /* get rid of annoying compiler warning, -O will remove this code */
- if (nothing) return;
}
/*
@@ -329,7 +295,7 @@
COMMAND ( "say", do_say );
COMMAND ( "nuke", do_nuke );
#if defined (TRIPLE_PLANET_MAYHEM)
- COMMAND ( "balance", do_balance ); /* see commands.c */
+ COMMAND ( "balance", do_local_balance );
#endif
COMMAND ( "reset", do_reset );
COMMAND ( "pause", do_pause );
Index: roboshar.c
===================================================================
RCS file: /cvsroot/netrek/server/Vanilla/sequencer/roboshar.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- roboshar.c 21 Mar 2005 10:17:18 -0000 1.2
+++ roboshar.c 6 May 2006 13:12:56 -0000 1.3
@@ -3,6 +3,11 @@
#include "defs.h"
#include "struct.h"
#include "data.h"
+#include "proto.h"
+
+#ifndef M_PI
+#include <math.h>
+#endif
/* Each robot must declare the following variables as globals */
@@ -12,10 +17,7 @@
* The following routines are shared code
*/
-/* ARGSUSED */
-void message_flag(cur,address)
-struct message *cur;
-char *address;
+void message_flag(struct message *cur, char *address)
{
/* This is to prevent false sending with SP_S_WARNING */
cur->args[0] = DINVALID;
@@ -24,38 +26,29 @@
/*#include "warnings.h"*/
/* only the fct, robots cannot set send_short */
-/* ARGSUSED */
-void swarning( whichmessage, argument,argument2)
-unsigned char whichmessage,argument,argument2;
+void swarning(unsigned char whichmessage, unsigned char argument,
+ unsigned char argument2)
{
}
-/* ARGSUSED */
-void spwarning(text,index)
-char *text;
-int index;
+void spwarning(char *text, int index)
{
}
/* ARGSUSED */
-void s_warning(text,index)
-char *text;
-int index;
+void s_warning(char *text, int index)
{
} /* Only stubs to silence the linker */
-void new_warning(index,mess)
-int index;
-char *mess;
+void new_warning(int index, const char *mess, ...)
{
if (debug)
ERROR(1,("warning: (%d)%s\n", index,mess));
}
-void warning(mess)
-int mess;
+void warning(char *mess)
{
if (debug)
ERROR(1,("warning: %s\n", mess));
@@ -66,8 +59,7 @@
* This routine sets up the robot at nowhere name
*/
-void robonameset(myself)
-struct player *myself;
+void robonameset(struct player *myself)
{
(void) strncpy(myself->p_login, "Robot", sizeof (myself->p_login));
@@ -103,12 +95,12 @@
* c) Forge a message by setting mynum to whatever it wants.
*/
-void messAll(int mynum,char *name,...)
+void messAll(int mynum, char *name, const char *fmt, ...)
{
va_list args;
char addrbuf[15];
- va_start(args, name);
+ va_start(args, fmt);
/* +++ 2.6pl0 cameron at sna.dec.com */
#if defined(__alpha)
@@ -117,7 +109,7 @@
sprintf(addrbuf, "%s->ALL", name );
#endif
/* --- */
- do_message(0, MALL, addrbuf, mynum, args);
+ do_message(0, MALL, addrbuf, mynum, fmt, args);
va_end(args);
}
@@ -127,7 +119,7 @@
* The same comments as messAll apply here, too.
*/
-void messOne(int mynum,char *name,int who, ...)
+void messOne(int mynum, char *name, int who, const char *fmt, ...)
{
va_list args;
char addrbuf[15];
@@ -139,36 +131,39 @@
return; /* hack: don't message self :) */
}
sprintf(addrbuf, "%s->%2s", name, players[who].p_mapchars);
- va_start(args, who);
- do_message(who, MINDIV, addrbuf, mynum, args);
+ va_start(args, fmt);
+ do_message(who, MINDIV, addrbuf, mynum, fmt, args);
va_end(args);
}
-int game_pause(comm,mess)
-char *comm;
-struct message *mess;
+void game_pause(char *comm, struct message *mess)
{
status->gameup|=GU_PAUSED;
}
-int game_resume(comm,mess)
-char *comm;
-struct message *mess;
+int game_resume(char *comm, struct message *mess)
{
status->gameup&= ~GU_PAUSED;
+ return 1;
}
-#ifndef M_PI
-#include <math.h>
-#endif
-
/*
* This returns the direction needed to travel to get from
* (x1,y1) to (x2,y2). (x1,y1) are commonly me->p_x and me->p_y.
*/
-u_char getcourse2(int x1,int y1,int x2,int y2)
+u_char getcourse2(int x1, int y1, int x2, int y2)
{
return((u_char) nint((atan2((double) (x2 - x1),
(double) (y1 - y2)) / M_PI * 128.)));
}
+
+/*
+ * Null client packet sending function for ntserv specific code in
+ * enter.c and interface.c so that we can avoid compiling it in the
+ * robots directory, and use libnetrek instead.
+ */
+void sendClientPacket(void *ignored)
+{
+ return;
+}