Vanilla Netrek Server Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[VANILLA-L:465] INL Robot server mods - part 2
*** ntserv/gencmds.h.orig Thu Feb 22 23:24:31 1996
--- ntserv/gencmds.h Thu Feb 22 23:04:22 1996
***************
*** 0 ****
--- 1,58 ----
+ /***** Command Interface Defines *****/
+ /* The lowest byte is used for message flags. This is used mostly by the */
+ /* voting code. */
+
+ #define C_PLAYER 0x0001
+ #define C_DESC 0x0008
+ #define C_GLOG 0x0010 /* Write request to God Log */
+
+ /* Prerequisites for command to succeed: */
+ /* This is determined when the command is run. It is extremely usefull
+ when listing commands through help. Commands not currently available
+ will not be listed. */
+ #define C_PR_MASK 0xff00 /* Prereq mask */
+
+ #define C_PR_NOONE 0x0100 /* Command deactivated */
+ #define C_PR_GOD 0xff00 /* Only god can use the command */
+
+ #define C_PR_1 0x0400 /* Future use */
+ #define C_PR_2 0x0800
+ #define C_PR_3 0x1000
+
+ #ifdef VOTING
+ #define C_VC_ALL 0x0020 /* Command only passes with Majority concensus */
+ #define C_VC_TEAM 0x0040 /* Command passes with agreement from Team */
+ /* #define C_VC_PLAYER 0x0080 /* Each player can be voted on, like eject */
+ #endif /* VOTING */
+
+ /* Integrate Voting commands and generic commands into the same
+ structure. The two only differ slightly */
+ struct command_handler_2 {
+ char *command;
+ int tag;
+ char *desc;
+ int (*handler)();
+
+ /* Data specific to voting commands. */
+ int minpass; /* Minimum required votes needed to pass vote */
+ int start; /* Offset into player voting array */
+ int frequency; /* How often the command can be used (0 = anytime) */
+ int expiretime; /* time before before votes expire */
+ };
+
+ extern const char myname[];
+ extern struct command_handler_2 nts_commands[];
+
+ #define _PROTO(r) r
+
+ extern char * addr_mess _PROTO((int who, int type));
+
+ extern int check_2_command _PROTO((struct message *mess,
+ struct command_handler_2 *cmds,
+ int prereqs));
+
+ extern int do_help _PROTO((char *comm,
+ struct message *mess,
+ struct command_handler_2 *cmds,
+ int cmdnum,
+ int prereqs));
*** robots/inl.c.orig Tue Dec 26 04:20:12 1995
--- robots/inl.c Thu Feb 22 23:08:07 1996
***************
*** 24,30 ****
#include INC_STRINGS
int debug=0;
- int inl_count = 0;
struct planet *oldplanets; /* for restoring galaxy */
struct planet *inl_planets;
--- 24,29 ----
***************
*** 33,59 ****
int oldmctl;
FILE *inl_log;
Team inl_teams[INLTEAM+1] = {
{ HOME, "home", "Home", NONE, HOMETEAM, NOT_CHOOSEN, 17,
! 90, 30, 0, 0 ,10},
{ AWAY, "away", "Away", NONE, AWAYTEAM, NOT_CHOOSEN, 17,
! 90, 30, 0, 0, 10}
};
Sides sides[MAXTEAM+1] = { {"FED", FED, 2},
{"ROM", ROM, 3},
{"KLI", KLI, 0},
{"ORI", ORI, 1}};
char *roboname = "INL";
char *inl_from = {"INL->ALL"};
! Inl_stats inl_stat = { 17, 1, 0, 0 , 0, 0};
Inl_countdown inl_countdown =
{0,{60,30,10,5,4,3,2,1,0,-1},8,0,PERSEC,NULL,""};
! int end_countdown();
Inl_countdown inl_game =
! {0,{45,10,5,2,1,-1},4,0,PERMIN,end_countdown,""};
/* XXX Gag me! */
/* the four close planets to the home planet */
--- 32,73 ----
int oldmctl;
FILE *inl_log;
+ char time_msg[4][10] = {"seconds", "second", "minutes", "minute"};
+
Team inl_teams[INLTEAM+1] = {
{ HOME, "home", "Home", NONE, HOMETEAM, NOT_CHOOSEN, 17,
! 90, 30, 0, 1 ,10},
{ AWAY, "away", "Away", NONE, AWAYTEAM, NOT_CHOOSEN, 17,
! 90, 30, 0, 1, 10}
};
Sides sides[MAXTEAM+1] = { {"FED", FED, 2},
{"ROM", ROM, 3},
{"KLI", KLI, 0},
{"ORI", ORI, 1}};
+ int cbounds[9][4] =
+ {
+ {0, 0, 0, 0},
+ {0, 45000, 55000, 100000},
+ {0, 0, 55000, 55000},
+ {0, 0, 0, 0},
+ {45000, 0, 100000, 55000},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {45000, 45000, 100000, 100000}
+ };
+
char *roboname = "INL";
char *inl_from = {"INL->ALL"};
! Inl_stats inl_stat = { 17, 1, S_PREGAME, 0 , 0, 0, 0, 0};
Inl_countdown inl_countdown =
{0,{60,30,10,5,4,3,2,1,0,-1},8,0,PERSEC,NULL,""};
! int end_tourney();
Inl_countdown inl_game =
! {0,{2700,600,300,120,60,30,10,5,4,3,2,1,0,-1},12,0,PERSEC,end_tourney,""};
/* XXX Gag me! */
/* the four close planets to the home planet */
***************
*** 74,79 ****
--- 88,94 ----
};
void cleanup();
+ void reset_inl();
int checkmess();
void inlmove();
int end_tourney();
***************
*** 102,108 ****
SIGNAL(SIGALRM, inlmove); /*the def signal is needed - MK */
if (!debug)
! SIGNAL(SIGINT, cleanup);
oldmctl = mctl->mc_current;
#ifdef nodef
--- 117,126 ----
SIGNAL(SIGALRM, inlmove); /*the def signal is needed - MK */
if (!debug)
! {
! SIGNAL(SIGINT, cleanup);
! SIGNAL(SIGTERM, cleanup);
! }
oldmctl = mctl->mc_current;
#ifdef nodef
***************
*** 116,121 ****
--- 134,140 ----
pmessage(0, MALL, inl_from, "###############################");
init_server();
+ reset_inl();
udt.it_interval.tv_sec = 0; /* Robots move PERSEC times/sec */
udt.it_interval.tv_usec = 1000000 / PERSEC;
***************
*** 135,142 ****
--- 154,201 ----
}
}
+ void inl_freeze(void)
+ {
+ int c;
+ struct player *j;
+
+ for (c=0; c < INLTEAM; c++)
+ inl_teams[c].flags |= T_PAUSE;
+
+ inl_stat.flags |= S_FREEZE;
+ status->gameup |= (GU_PRACTICE | GU_PAUSED);
+
+ for (j = firstPlayer; j <= lastPlayer; j++)
+ {
+ j->p_flags &= ~(PFSEEN);
+ j->p_lastseenby = VACANT; /* if left non-vacant the daemon might */
+ } /* not reinitalize PFSEEN automaticly */
+
+ pmessage(0, MALL, inl_from, "-------- Game is paused -------");
+
+ }
+
+ void inl_confine(void)
+ {
+ struct player *j;
+
+ for (j = firstPlayer; j <= lastPlayer; j++)
+ {
+ if (j->p_x < cbounds[j->p_team][0])
+ j->p_x = cbounds[j->p_team][0];
+ if (j->p_y < cbounds[j->p_team][1])
+ j->p_y = cbounds[j->p_team][1];
+ if (j->p_x > cbounds[j->p_team][2])
+ j->p_x = cbounds[j->p_team][2];
+ if (j->p_y > cbounds[j->p_team][3])
+ j->p_y = cbounds[j->p_team][3];
+ }
+ }
+
void inlmove()
{
+ int c;
+
/***** Start The Code Here *****/
HANDLE_SIG(SIGALRM,inlmove);
***************
*** 147,177 ****
inl_stat.ticks++;
player_maint(); /* update necessary stats and info */
- /* Moved is up from after mars_rules */
if (inl_stat.flags & S_COUNTDOWN )
countdown(inl_stat.ticks,&inl_countdown);
else if (! (inl_stat.ticks % (PERSEC*2))) /* no com. during countdown */
checkmess();
if (!(inl_stat.flags & (S_TOURNEY | S_OVERTIME)) ||
(inl_stat.flags & S_FREEZE ))
return;
/* printf("Setting tourn\n"); */
status->tourn = 1; /* paranoia? */
! if (!(inl_stat.ticks % PLANETFUSE))
! checkplanets();
! inl_count++;
#ifdef INLDEBUG
! ERROR(2,(" inl_count = %d\n", inl_count));
#endif
-
- if (inl_count % (TIMEFUSE)) countdown(inl_count, &inl_game);
- if ((inl_stat.flags & S_OVERTIME) &&
- (inl_count % PERSEC))
- end_tourney();
}
player_maint()
--- 206,261 ----
inl_stat.ticks++;
player_maint(); /* update necessary stats and info */
if (inl_stat.flags & S_COUNTDOWN )
countdown(inl_stat.ticks,&inl_countdown);
else if (! (inl_stat.ticks % (PERSEC*2))) /* no com. during countdown */
checkmess();
+ if (inl_stat.flags & S_CONFINE)
+ inl_confine();
+
if (!(inl_stat.flags & (S_TOURNEY | S_OVERTIME)) ||
(inl_stat.flags & S_FREEZE ))
return;
+ inl_stat.game_ticks++;
+
+ /* check for timeout */
+ if (inl_stat.flags & S_TMOUT)
+ {
+ inl_stat.tmout_ticks++;
+ if ((inl_stat.tmout_ticks > 1300) || all_alert(PFGREEN)
+ || ((inl_stat.tmout_ticks > 800) && all_alert(PFYELLOW)))
+ /* This is a loose approximation
+ of the INL source code.. */
+ {
+ inl_stat.flags &= ~(S_TMOUT);
+ inl_stat.tmout_ticks = 0;
+
+ for (c=0; c < INLTEAM; c++)
+ inl_teams[c].flags &= ~(T_TIMEOUT);
+
+ inl_freeze();
+ }
+ }
+
/* printf("Setting tourn\n"); */
status->tourn = 1; /* paranoia? */
! if (!(inl_stat.game_ticks % PLANETFUSE))
! checkplanets();
!
! /* check for sudden death overtime */
! if ((inl_stat.flags & S_OVERTIME) && (inl_stat.game_ticks % PERSEC))
! end_tourney();
!
! /* display periodic countdown */
! if (!(inl_stat.game_ticks % TIMEFUSE))
! countdown(inl_stat.game_ticks, &inl_game);
#ifdef INLDEBUG
! ERROR(2,(" game ticks = %d\n", inl_stat.game_ticks));
#endif
}
player_maint()
***************
*** 181,186 ****
--- 265,281 ----
#endif
}
+ int all_alert(int stat)
+ {
+ struct player *j;
+
+ for (j = firstPlayer; j <= lastPlayer; j++)
+ if ((j->p_status == PALIVE) && !(j->p_flags & stat))
+ return 0;
+
+ return 1;
+ }
+
log(m)
struct message *m;
{
***************
*** 242,247 ****
--- 337,343 ----
{
int c;
int size;
+ int i;
#ifdef INLDEBUG
ERROR(2,("Enter checkplanets\n"));
***************
*** 262,267 ****
--- 358,375 ----
fprintf(inl_log,"PLANET: %s was taken by the %s from %s\n",
inl_planets[c].pl_name, teamshort[planets[c].pl_owner],
teamshort[inl_planets[c].pl_owner]);
+
+ /* Keep team[x].planets up to date */
+ for (i=0; i < INLTEAM; i++)
+ {
+ if (sides[inl_teams[i].side_index].flag
+ == inl_planets[c].pl_owner)
+ inl_teams[i].planets--;
+ if (sides[inl_teams[i].side_index].flag
+ == planets[c].pl_owner)
+ inl_teams[i].planets++;
+ }
+
inl_planets[c].pl_owner = planets[c].pl_owner;
}
if (inl_planets[c].pl_armies != planets[c].pl_armies) {
***************
*** 297,410 ****
}
}
! int end_countdown()
{
! inl_stat.flags |= S_COUNTDOWN;
! inl_countdown.idx = 0;
! inl_countdown.end = inl_stat.ticks+PERMIN;
! inl_countdown.action = end_tourney;
! if (inl_stat.flags & S_TOURNEY)
! inl_countdown.message = "%i seconds left in regulation time";
! else inl_countdown.message = "%i seconds left in overtime";
}
! int end_tourney()
{
! register i,c;
! for (i = 0; i < INLTEAM; i++) {
! inl_teams[i].planets=0;
! for (c=0; c<MAXPLANETS; c++) {
! if (inl_planets[c].pl_owner== inl_teams[i].side)
! inl_teams[i].planets++;
! }
! }
! if ((inl_teams[HOME].planets < 9) || (inl_teams[AWAY].planets < 9)) {
! pmessage(0, MALL, inl_from, "---------- Game Over ----------");
! pmessage(0, MALL, inl_from, "Result: %i - %i",
! inl_teams[HOME].planets, inl_teams[AWAY].planets);
! status->tourn =0 ;
! cleanup();
! }
!
! if (inl_stat.flags & S_TOURNEY) {
! inl_stat.flags &= ~(S_TOURNEY | S_COUNTDOWN);
! inl_stat.flags |= S_OVERTIME;
! obliterate(0,KSHIP);
!
! inl_game.idx = 0;
! inl_game.end += inl_stat.overtime;
! inl_game.counts[0] = inl_stat.overtime / (PERMIN*2);
! inl_game.message = "%i minutes left in overtime";
!
! } else if (inl_game.end <= inl_count) {
! pmessage(0, MALL, inl_from,
! "------ Game ran out of time without a winner ------");
! status->tourn = 0;
! cleanup();
! }
! }
init_server()
{
register i;
register struct planet *j;
- /* Tourn off t-mode */
- status->gameup |= (GU_CHAOS | GU_PRACTICE);
-
/* Fix planets */
oldplanets = (struct planet *) malloc(sizeof(struct planet) * MAXPLANETS);
MCOPY(planets, oldplanets, sizeof(struct planet) * MAXPLANETS);
! inl_stat.ticks = 0;
!
! for (i = 0, j = planets; i < MAXPLANETS; i++, j++) {
! j->pl_info |= ALLTEAM;
! }
!
/* Split the Waitqueues */
/* Change the regular port to an observer port */
! queues[QU_PICKUP].tournmask = (HOMETEAM | AWAYTEAM);
! queues[QU_PICKUP].q_flags |= QU_OBSERVER;
! queues[QU_PICKUP_OBS].tournmask = (HOMETEAM | AWAYTEAM);
/* Ensure some inl queue initialization */
- queues[QU_HOME].free_slots = TEAMSIZE;
queues[QU_HOME].max_slots = TEAMSIZE;
queues[QU_HOME].tournmask = HOMETEAM;
- queues[QU_HOME].q_flags |= QU_OPEN;
- queues[QU_AWAY].free_slots = TEAMSIZE;
queues[QU_AWAY].max_slots = TEAMSIZE;
queues[QU_AWAY].tournmask = AWAYTEAM;
queues[QU_AWAY].q_flags |= QU_OPEN;
status->tourn = 0;
/* If players are in game select teams alternately */
for (i = 0; i<(MAXPLAYER-TESTERS); i++) {
/* Don't change any pickup observers */
if (players[i].p_status == POBSERV) continue;
! if (players[i].p_status != PFREE) {
! int old_queue = players[i].w_queue;
! if (i%2) {
! players[i].w_queue = QU_HOME;
! queues[QU_HOME].free_slots--;
! queues[old_queue].free_slots++;
! } else {
! players[i].w_queue = QU_AWAY;
! queues[QU_AWAY].free_slots--;
! queues[old_queue].free_slots++;
! }
! obliterate(i, KSHIP);
}
}
! queues[QU_PICKUP].free_slots = TESTERS;
queues[QU_PICKUP].low_slot = MAXPLAYER-TESTERS;
queues[QU_PICKUP].max_slots = TESTERS;
queues[QU_PICKUP].high_slot = MAXPLAYER;
}
--- 405,586 ----
}
}
! int end_tourney()
{
! if ((inl_teams[HOME].planets > inl_teams[AWAY].planets+2)
! || (inl_teams[AWAY].planets > inl_teams[HOME].planets+2))
! {
! pmessage(0, MALL, inl_from, "---------- Game Over ----------");
! pmessage(0, MALL, inl_from, "Result: %i - %i - %i",
! inl_teams[HOME].planets, inl_teams[AWAY].planets,
! (20 - inl_teams[HOME].planets - inl_teams[AWAY].planets));
! status->tourn = 0;
! reset_inl();
! }
!
! if (inl_stat.flags & S_TOURNEY)
! {
! inl_stat.flags &= ~(S_TOURNEY | S_COUNTDOWN);
! inl_stat.flags |= S_OVERTIME;
! pmessage(0, MALL, inl_from, "---------- Overtime ----------");
! obliterate(0,KSHIP);
!
! inl_game.idx = 0;
! inl_game.end += inl_stat.overtime;
! /* inl_game.counts[0] = inl_stat.overtime / (PERMIN*2); */
! inl_game.message = "%i %s left in overtime";
!
! }
! else if (inl_game.end <= inl_stat.game_ticks)
! {
! pmessage(0, MALL, inl_from,
! "------ Game ran out of time without a winner ------");
! status->tourn = 0;
! reset_inl();
! }
}
! void reset_inl()
{
! int c;
! /* Tourn off t-mode */
! status->gameup |= (GU_CHAOS | GU_PRACTICE);
! status->gameup &= ~(GU_PAUSED);
!
! inl_stat.ticks = 0;
! for (c=0; c < INLTEAM; c++) {
! inl_teams[c].flags = 0; /* reset all flags */
! }
!
! inl_stat.start_armies = 17;
! inl_stat.change = 1;
! inl_stat.flags = S_PREGAME;
! inl_stat.ticks = 0;
! inl_stat.game_ticks = 0;
! inl_stat.tmout_ticks = 0;
! inl_stat.time = 0;
! inl_stat.overtime = 0;
!
! inl_teams[HOME].team = HOME;
! inl_teams[HOME].name = "home";
! inl_teams[HOME].t_name = "Home";
! inl_teams[HOME].captain = NONE;
! inl_teams[HOME].side = HOMETEAM;
! inl_teams[HOME].side_index = NOT_CHOOSEN;
! inl_teams[HOME].start_armies = 17;
! inl_teams[HOME].time = 90;
! inl_teams[HOME].overtime = 30;
! inl_teams[HOME].flags = 0;
! inl_teams[HOME].tmout = 1;
! inl_teams[HOME].planets = 10;
!
! inl_teams[AWAY].team = AWAY;
! inl_teams[AWAY].name = "away";
! inl_teams[AWAY].t_name = "Away";
! inl_teams[AWAY].captain = NONE;
! inl_teams[AWAY].side = AWAYTEAM;
! inl_teams[AWAY].side_index = NOT_CHOOSEN;
! inl_teams[AWAY].start_armies = 17;
! inl_teams[AWAY].time = 90;
! inl_teams[AWAY].overtime = 30;
! inl_teams[AWAY].flags = 0;
! inl_teams[AWAY].tmout = 1;
! inl_teams[AWAY].planets = 10;
!
! /* Set player queues back to standard starting teams */
! queues[QU_HOME].tournmask = FED;
! queues[QU_AWAY].tournmask = ROM;
! queues[QU_HOME_OBS].tournmask = FED;
! queues[QU_AWAY_OBS].tournmask = ROM;
+ doResources(1);
+
+ obliterate(1, KSHIP);
+
+ }
init_server()
{
register i;
register struct planet *j;
/* Fix planets */
oldplanets = (struct planet *) malloc(sizeof(struct planet) * MAXPLANETS);
MCOPY(planets, oldplanets, sizeof(struct planet) * MAXPLANETS);
! /* Dont change the pickup queues around - just close them. */
! #ifdef nodef
/* Split the Waitqueues */
/* Change the regular port to an observer port */
! queues[QU_PICKUP].tournmask = (HOMETEAM | AWAYTEAM);
! #endif
+ /* Nah, just close them down.. */
+ queues[QU_PICKUP].q_flags &= ~(QU_OPEN);
+ queues[QU_PICKUP_OBS].q_flags &= ~(QU_OPEN);
+
+ /* these already set in queue.c - assume they are correct */
+ #ifdef nodef
/* Ensure some inl queue initialization */
queues[QU_HOME].max_slots = TEAMSIZE;
queues[QU_HOME].tournmask = HOMETEAM;
queues[QU_AWAY].max_slots = TEAMSIZE;
queues[QU_AWAY].tournmask = AWAYTEAM;
+ queues[QU_HOME_OBS].max_slots = TESTERS;
+ queues[QU_HOME_OBS].tournmask = HOMETEAM;
+ queues[QU_HOME_OBS].low_slot = MAXPLAYER-TESTERS;
+ queues[QU_AWAY_OBS].max_slots = TESTERS;
+ queues[QU_AWAY_OBS].tournmask = AWAYTEAM;
+ queues[QU_AWAY_OBS].low_slot = MAXPLAYER-TESTERS;
+ #endif
+
+ /* Open INL ports */
+ queues[QU_HOME].q_flags |= QU_OPEN;
+ queues[QU_HOME].free_slots = queues[QU_HOME].max_slots;
queues[QU_AWAY].q_flags |= QU_OPEN;
+ queues[QU_AWAY].free_slots = queues[QU_AWAY].max_slots;
+ queues[QU_HOME_OBS].q_flags |= QU_OPEN;
+ queues[QU_HOME_OBS].free_slots = queues[QU_HOME_OBS].max_slots;
+ queues[QU_AWAY_OBS].q_flags |= QU_OPEN;
+ queues[QU_AWAY_OBS].free_slots = queues[QU_AWAY_OBS].max_slots;
+
status->tourn = 0;
+ obliterate(1, KSHIP);
+
/* If players are in game select teams alternately */
for (i = 0; i<(MAXPLAYER-TESTERS); i++) {
+ /* Let's deactivate the pickup slots and move pickup observers
+ to the INL observer slots */
+ #ifdef nodef
/* Don't change any pickup observers */
if (players[i].p_status == POBSERV) continue;
! #endif
! if (players[i].p_status != PFREE)
! {
! queues[players[i].w_queue].free_slots++;
!
! if (i%2)
! players[i].w_queue = (players[i].p_status == POBSERV)
! ? QU_HOME_OBS : QU_HOME;
! else
! players[i].w_queue = (players[i].p_status == POBSERV)
! ? QU_AWAY_OBS : QU_AWAY;
!
! queues[players[i].w_queue].free_slots--;
}
}
! /* dont set all the info - just what is neccessary */
! queues[QU_PICKUP].free_slots = 0;
! queues[QU_PICKUP_OBS].free_slots = 0;
! #ifdef nodef
queues[QU_PICKUP].low_slot = MAXPLAYER-TESTERS;
queues[QU_PICKUP].max_slots = TESTERS;
queues[QU_PICKUP].high_slot = MAXPLAYER;
+ #endif
}
***************
*** 416,445 ****
SIGNAL(SIGALRM, SIG_IGN);
status->gameup &= ~(GU_CHAOS | GU_PRACTICE);
/* restore galaxy */
MCOPY(oldplanets, planets, sizeof(struct planet) * MAXPLANETS);
!
/* restore old wait queue */
queues[QU_PICKUP].tournmask=ALLTEAM;
! queues[QU_PICKUP].q_flags &= ~(QU_OBSERVER);
! queues[QU_PICKUP_OBS].tournmask=ALLTEAM;
! queues[QU_HOME].q_flags = 0;
! queues[QU_AWAY].q_flags = 0;
! for (i = 0, j = &players[i]; i < MAXPLAYER-TESTERS; i++, j++) {
! if (j->p_status != PFREE) {
! j->w_queue = QU_PICKUP;
! queues[QU_PICKUP].free_slots--;
! }
! if (j->p_status != PALIVE) continue;
! getship(&(j->p_ship), j->p_ship.s_type);
}
queues[QU_HOME].free_slots=0;
queues[QU_AWAY].free_slots=0;
queues[QU_PICKUP].free_slots += MAXPLAYER-TESTERS;
queues[QU_PICKUP].low_slot = 0;
queues[QU_PICKUP].high_slot = MAXPLAYER-TESTERS;
queues[QU_PICKUP].max_slots = MAXPLAYER-TESTERS;
pmessage(0, MALL, inl_from, "##########################");
pmessage(0, MALL, inl_from, "# The inl robot has left");
--- 592,650 ----
SIGNAL(SIGALRM, SIG_IGN);
status->gameup &= ~(GU_CHAOS | GU_PRACTICE);
+ status->gameup &= ~(GU_PAUSED);
/* restore galaxy */
MCOPY(oldplanets, planets, sizeof(struct planet) * MAXPLANETS);
!
! /* Dont mess with the queue information - it is set correctly in queue.c */
! #ifdef nodef
/* restore old wait queue */
queues[QU_PICKUP].tournmask=ALLTEAM;
! #endif
!
! /* Open Pickup ports */
! queues[QU_PICKUP].q_flags |= QU_OPEN;
! queues[QU_PICKUP].free_slots = queues[QU_PICKUP].max_slots;
! queues[QU_PICKUP_OBS].q_flags |= QU_OPEN;
! queues[QU_PICKUP_OBS].free_slots = queues[QU_PICKUP_OBS].max_slots;
!
! /* Close INL ports */
! queues[QU_HOME].q_flags &= ~(QU_OPEN);
! queues[QU_AWAY].q_flags &= ~(QU_OPEN);
! queues[QU_HOME_OBS].q_flags &= ~(QU_OPEN);
! queues[QU_AWAY_OBS].q_flags &= ~(QU_OPEN);
! /* Set player queues back to standard starting teams */
! queues[QU_HOME_OBS].tournmask = HOMETEAM;
! queues[QU_AWAY_OBS].tournmask = AWAYTEAM;
!
! for (i = 0, j = &players[i]; i < MAXPLAYER; i++)
! {
! j = &players[i];
! if (j->p_status != PFREE)
! {
! queues[j->w_queue].free_slots++;
! if (players[i].p_status == POBSERV)
! j->w_queue = QU_PICKUP_OBS;
! else
! j->w_queue = QU_PICKUP;
! queues[j->w_queue].free_slots--;
! }
! if (j->p_status != PALIVE) continue;
! getship(&(j->p_ship), j->p_ship.s_type);
}
+
queues[QU_HOME].free_slots=0;
queues[QU_AWAY].free_slots=0;
+ queues[QU_HOME_OBS].free_slots=0;
+ queues[QU_AWAY_OBS].free_slots=0;
+
+ #ifdef nodef
queues[QU_PICKUP].free_slots += MAXPLAYER-TESTERS;
queues[QU_PICKUP].low_slot = 0;
queues[QU_PICKUP].high_slot = MAXPLAYER-TESTERS;
queues[QU_PICKUP].max_slots = MAXPLAYER-TESTERS;
+ #endif
pmessage(0, MALL, inl_from, "##########################");
pmessage(0, MALL, inl_from, "# The inl robot has left");
***************
*** 457,469 ****
--- 662,680 ----
inl_teams[HOME].side = sides[inl_teams[HOME].side_index].flag;
inl_teams[AWAY].side = sides[inl_teams[AWAY].side_index].flag;
+
+ /* Set the queues so players go to correct side */
queues[QU_HOME].tournmask = inl_teams[HOME].side;
queues[QU_AWAY].tournmask = inl_teams[AWAY].side;
queues[QU_HOME_OBS].tournmask = inl_teams[HOME].side;
queues[QU_AWAY_OBS].tournmask = inl_teams[AWAY].side;
+
+ /* Nah.. just deactivate pickup queus.. */
+ #ifdef nodef
queues[QU_PICKUP].tournmask = inl_teams[HOME].side | inl_teams[AWAY].side;
queues[QU_PICKUP_OBS].tournmask =
inl_teams[HOME].side | inl_teams[AWAY].side;
+ #endif
obliterate(2, KSHIP);
***************
*** 485,491 ****
inl_countdown.idx = 0;
inl_countdown.end = inl_stat.ticks+INLSTARTFUSE;
inl_countdown.action = start_tourney;
! inl_countdown.message = "Game start in %i seconds";
}
--- 696,702 ----
inl_countdown.idx = 0;
inl_countdown.end = inl_stat.ticks+INLSTARTFUSE;
inl_countdown.action = start_tourney;
! inl_countdown.message = "Game start in %i %s";
}
***************
*** 527,540 ****
inl_planets = (struct planet *) malloc(sizeof(struct planet) * MAXPLANETS);
/* MCOPY(planets, oldplanets, sizeof(struct planet) * MAXPLANETS); */
MCOPY(planets, inl_planets, sizeof(struct planet) * MAXPLANETS);
!
! inl_stat.flags = S_TOURNEY;
obliterate(1,KTOURNSTART);
inl_stat.time = inl_teams[0].time * PERMIN;
inl_stat.overtime = inl_teams[0].overtime * PERMIN;
! inl_count = 0;
status->gameup &= ~(GU_CHAOS | GU_PRACTICE);
#ifdef DEBUG
--- 738,752 ----
inl_planets = (struct planet *) malloc(sizeof(struct planet) * MAXPLANETS);
/* MCOPY(planets, oldplanets, sizeof(struct planet) * MAXPLANETS); */
MCOPY(planets, inl_planets, sizeof(struct planet) * MAXPLANETS);
!
! inl_stat.flags |= S_TOURNEY;
! inl_stat.flags &= ~(S_PREGAME | S_COUNTDOWN | S_CONFINE);
obliterate(1,KTOURNSTART);
inl_stat.time = inl_teams[0].time * PERMIN;
inl_stat.overtime = inl_teams[0].overtime * PERMIN;
! inl_stat.game_ticks = 0;
status->gameup &= ~(GU_CHAOS | GU_PRACTICE);
#ifdef DEBUG
***************
*** 543,550 ****
status->tourn = 1;
inl_game.idx=0;
inl_game.end= inl_stat.time;
! inl_game.counts[0] = inl_stat.time / ( PERMIN * 2);
! inl_game.message = "%i minutes left in regulation time";
}
--- 755,762 ----
status->tourn = 1;
inl_game.idx=0;
inl_game.end= inl_stat.time;
! /* inl_game.counts[0] = inl_stat.time / ( PERMIN * 2); */
! inl_game.message = "%i %s left in regulation time";
}
***************
*** 582,592 ****
int counter;
Inl_countdown *cnt;
{
! int t;
! if (cnt->end - (cnt->counts[cnt->idx])*cnt->unit > counter) return;
! pmessage(0, MALL, inl_from, cnt->message, cnt->counts[cnt->idx]);
if (cnt->idx++ == cnt->act) (*(cnt->action))();
}
--- 794,823 ----
int counter;
Inl_countdown *cnt;
{
! int i = 0;
! int j = 0;
! char *ms;
!
! if (cnt->end - cnt->counts[cnt->idx]*cnt->unit > counter)
! return;
!
! while ((cnt->idx != cnt->act) &&
! (cnt->end - cnt->counts[cnt->idx+1]*cnt->unit <= counter))
! {
! cnt->idx++;
! }
!
! i = cnt->counts[cnt->idx];
! if (i > 60)
! {
! i = i / 60;
! j = 2;
! }
! if (i == 1)
! j++;
! pmessage(0, MALL, inl_from, cnt->message, i, time_msg[j]);
if (cnt->idx++ == cnt->act) (*(cnt->action))();
}
*** robots/inlcmds.c.orig Thu Feb 22 23:23:33 1996
--- robots/inlcmds.c Thu Feb 22 23:44:19 1996
***************
*** 0 ****
--- 1,178 ----
+ /*
+ * inlcmds.c
+ */
+
+ /*
+ Command interface routines specific to the INL robot. This is a
+ replacement for the spagetti compile method used previously in
+ commands.c . By seperating the code it will be possible to list
+ only those commands relevant at any given moment. Something that
+ would be a horror to implement in the old scheme..
+ */
+
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <string.h>
+ #include <time.h>
+ #include <signal.h>
+ #include "defs.h"
+ #include "struct.h"
+ #include "data.h"
+
+ #include "gencmds.h"
+ #include "inldefs.h"
+
+ const char myname[] = {"INL"};
+
+ extern int do_home();
+ extern int do_away();
+ extern int do_start();
+ extern int do_captain();
+ extern int do_uncaptain();
+ extern int do_tname();
+ extern int do_pickside();
+ extern int do_resetgalaxy();
+ extern int do_switchside();
+ extern int do_pause();
+ extern int do_free();
+ extern int do_gametime();
+ extern int do_timeout();
+ extern int do_confine();
+
+ extern int cleanup();
+
+
+ /********* COMMANDS LIST ********
+ Note: - The commands *must* be in upper case. All commands are converted
+ to upper case before be checked.
+ - Votes are entered in the Voting list.
+ The first field is the command, the second is a description string
+ (up to 50 chars.), lastly is the function to call.
+ */
+
+ struct command_handler_2 inl_commands[] = {
+ { "INL server commands.", C_DESC },
+ { "Possible commands are:", C_DESC },
+ { "HELP",
+ 0,
+ "Show this help information",
+ do_help }, /* HELP */
+ { "GAMETIME",
+ 0,
+ "Shows the game time or sets it. Ex: 'GAMETIME 30 10'",
+ do_gametime }, /* GAMETIME */
+ { "CAPTAIN",
+ 0,
+ "Make yourself captain of team.",
+ do_captain }, /* CAPTAIN */
+ { "|Pregame commands:", C_DESC | C_PR_PREGAME },
+ { "HOME",
+ C_PR_PREGAME,
+ "Switch to home team.",
+ do_switchside }, /* HOME */
+ { "AWAY",
+ C_PR_PREGAME,
+ "Switch to away team.",
+ do_switchside }, /* AWAY */
+ { "TNAME",
+ C_PR_CAPTAIN | C_PR_PREGAME,
+ "Change the name of your team.",
+ do_tname }, /* TNAME */
+ { "NEWGALAXY",
+ C_PR_CAPTAIN | C_PR_PREGAME,
+ "Reset the galaxy.",
+ do_resetgalaxy }, /* RESETGALAXY */
+ { "CONFINE",
+ C_PR_CAPTAIN | C_PR_PREGAME,
+ "Confine teams from other races cores.",
+ do_confine }, /* CONFINE */
+ { "START",
+ C_PR_CAPTAIN | C_PR_PREGAME,
+ "Start tournament.",
+ do_start }, /* START */
+ { "|Team selection commands:", C_DESC | C_PR_CAPTAIN | C_PR_PREGAME},
+ { "FED",
+ C_PR_CAPTAIN | C_PR_PREGAME,
+ "Change your side to Federation.",
+ do_pickside }, /* FED */
+ { "ROM",
+ C_PR_CAPTAIN | C_PR_PREGAME,
+ "Change your side to Romulan.",
+ do_pickside }, /* ROM */
+ { "KLI",
+ C_PR_CAPTAIN | C_PR_PREGAME,
+ "Change your side to Klingon.",
+ do_pickside }, /* KLI */
+ { "ORI",
+ C_PR_CAPTAIN | C_PR_PREGAME,
+ "Change your side to Orion.",
+ do_pickside }, /* ORI */
+ { "PASS",
+ C_PR_CAPTAIN | C_PR_PREGAME,
+ "Pass the first choice of sides to the home team.",
+ do_pickside }, /* PASS */
+ { "|Captain commands:", C_DESC | C_PR_CAPTAIN},
+ { "UNCAPTAIN",
+ C_PR_CAPTAIN,
+ "Release captain duties.",
+ do_uncaptain }, /* UNCAPTAIN */
+ { "FREE",
+ C_PR_CAPTAIN | C_PLAYER,
+ "Frees a slot. Ex: 'FREE 0'",
+ do_free }, /* FREE */
+ { "PAUSE",
+ C_PR_CAPTAIN | C_PR_INGAME,
+ "Requests a pause.",
+ do_pause }, /* PAUSE */
+ { "PAUSENOW",
+ C_PR_CAPTAIN | C_PR_INGAME,
+ "Imediately pauses the game.",
+ do_pause }, /* PAUSENOW */
+ { "TOUT",
+ C_PR_CAPTAIN | C_PR_INGAME,
+ "Call a timeout.",
+ do_timeout }, /* TIMEOUT */
+ { "CONTINUE",
+ C_PR_CAPTAIN | C_PR_INGAME,
+ "Requests that the game continues.",
+ do_pause }, /* CONTINUE */
+ { "The following votes can be used: (M=Majority, T=Team vote)", C_DESC },
+ { "EXIT",
+ C_VC_ALL,
+ "Terminate robot by majority vote.",
+ cleanup,
+ 1, 20, 0 },
+ { NULL }
+ };
+
+ extern Inl_stats inl_stat;
+ extern Team inl_teams[];
+
+ int
+ check_command(mess)
+ struct message *mess;
+ {
+ int flags = 0;
+ int c;
+ int num = -1;
+
+ for (c=0; c < INLTEAM; c++)
+ {
+ if (players[mess->m_from].p_team == inl_teams[c].side)
+ {
+ num = c;
+ break;
+ }
+ }
+
+ if (num != -1)
+ {
+ if (inl_teams[num].captain == mess->m_from)
+ flags |= C_PR_CAPTAIN;
+ if (inl_stat.flags & S_PREGAME)
+ flags |= C_PR_PREGAME;
+ if (inl_stat.flags & (S_TOURNEY | S_OVERTIME))
+ flags |= C_PR_INGAME;
+ }
+ return check_2_command(mess, inl_commands, flags);
+ }
*** robots/inlcomm.c.orig Sat Feb 18 01:00:45 1995
--- robots/inlcomm.c Thu Feb 22 14:35:51 1996
***************
*** 35,40 ****
--- 35,41 ----
extern char *addr_mess();
extern int doResources();
+ extern void inl_freeze();
int check_player(who, captain)
int who, captain;
***************
*** 156,165 ****
if ((num = check_player(who, 1)) == NONE) return 0;
! if (inl_teams[num].side_index == NOT_CHOOSEN) {
! pmessage(who, MINDIV, addr_mess(who),
! "You have to pick a side first");
! return 0;
}
inl_teams[num].flags |= T_START;
--- 157,168 ----
if ((num = check_player(who, 1)) == NONE) return 0;
! if ((inl_teams[num].side_index == NOT_CHOOSEN)
! || (inl_teams[num].side_index == RELINQUISH))
! {
! pmessage(who, MINDIV, addr_mess(who),
! "You have to pick a side first");
! return 0;
}
inl_teams[num].flags |= T_START;
***************
*** 209,214 ****
--- 212,229 ----
who = mess->m_from;
+ if (!(inl_stat.flags & S_PREGAME))
+ {
+ time = inl_stat.time;
+ if (inl_stat.flags & S_OVERTIME)
+ time += inl_stat.overtime;
+ pmessage(who, MINDIV, addr_mess(who),
+ "Minutes remaining: %i Planet tally: %i - %i - %i",
+ ((time - inl_stat.game_ticks) / PERMIN ),
+ inl_teams[HOME].planets, inl_teams[AWAY].planets,
+ (20 - inl_teams[HOME].planets - inl_teams[AWAY].planets));
+ return 1;
+ }
if ((num = check_player(who, 1)) == NONE) return 0;
***************
*** 239,245 ****
inl_teams[num].time = time;
inl_teams[num].overtime = overtime;
! pmessage(who, MINDIV, addr_mess(who),
"%s (%s) has requested %d mins regulation and %d overtime",
inl_teams[num].t_name, inl_teams[num].name,
inl_teams[num].time, inl_teams[num].overtime);
--- 254,260 ----
inl_teams[num].time = time;
inl_teams[num].overtime = overtime;
! pmessage(who, MALL, inl_from,
"%s (%s) has requested %d mins regulation and %d overtime",
inl_teams[num].t_name, inl_teams[num].name,
inl_teams[num].time, inl_teams[num].overtime);
***************
*** 381,424 ****
if ((num = check_player(who, 1)) == NONE) return 0;
for (c=0; c < INLTEAM; c++) {
! if (inl_teams[num].team != inl_teams[c].team)
! other_side = inl_teams[c].team;
}
! if ((num == HOME) && (inl_teams[other_side].side_index == NOT_CHOOSEN)) {
pmessage(who, MINDIV, addr_mess(who),
! "The away team needs to pick a side first");
return 0;
! }
!
! for (c = 0; c < NUMTEAM; c++) {
! if (strcmp(comm, sides[c].name) == 0) {
! if (inl_teams[other_side].side_index == c &&
! (inl_teams[other_side].side_index == NOT_CHOOSEN)) {
pmessage(who, MINDIV, addr_mess(who),
! "The %s team already choose %s",
! inl_teams[other_side].name,
! sides[inl_teams[other_side].side_index].name);
return 0;
! }
!
! if (sides[inl_teams[other_side].side_index].diagonal == c &&
! num != AWAY) {
pmessage(who, MINDIV, addr_mess(who),
! "The %s team cannot choose diagonal race to %s",
! inl_teams[num].name,
! sides[inl_teams[other_side].side_index].name);
return 0;
! }
!
! inl_teams[num].side_index = c;
! inl_teams[num].name = strdup(sides[c].name);
! pmessage(0, MALL, inl_from, "The %s team, %s, picks %s",
! inl_teams[num].name,
! inl_teams[num].t_name,
! sides[inl_teams[num].side_index].name);
}
! }
return 1;
}
--- 396,465 ----
if ((num = check_player(who, 1)) == NONE) return 0;
for (c=0; c < INLTEAM; c++) {
! if (inl_teams[num].team != inl_teams[c].team)
! other_side = inl_teams[c].team;
! }
!
! if (inl_teams[num].flags & T_SIDELOCKED)
! {
! pmessage(who, MINDIV, addr_mess(who),
! "Choice of sides is no longer available.");
! return 0;
}
! if ((num == HOME) && (inl_teams[other_side].side_index == NOT_CHOOSEN))
! {
! pmessage(who, MINDIV, addr_mess(who),
! "The away team needs to pick a side first");
! return 0;
! }
!
! if (strcmp(comm, "PASS") == 0)
! if (num == HOME)
! {
pmessage(who, MINDIV, addr_mess(who),
! " Hey!! Only the Away team captain uses this!");
return 0;
! }
! else
! {
! inl_teams[num].side_index = RELINQUISH;
! pmessage(0, MALL, inl_from,
! "Away team (%s) passes first race choice to home team!",
! inl_teams[num].name);
! }
! else
! for (c = 0; c < NUMTEAM; c++) {
! if (strcmp(comm, sides[c].name) == 0)
! {
! if (inl_teams[other_side].side_index != NOT_CHOOSEN
! && inl_teams[other_side].side_index != RELINQUISH)
! {
! if (inl_teams[other_side].side_index == c)
! {
pmessage(who, MINDIV, addr_mess(who),
! "The %s team already choose %s",
! inl_teams[other_side].name,
! sides[inl_teams[other_side].side_index].name);
return 0;
! }
! if (sides[inl_teams[other_side].side_index].diagonal == c)
! {
pmessage(who, MINDIV, addr_mess(who),
! "Cannot choose diagonal race to %s",
! sides[inl_teams[other_side].side_index].name);
return 0;
! }
! inl_teams[other_side].flags |= T_SIDELOCKED;
! }
!
! inl_teams[num].side_index = c;
! inl_teams[num].name = strdup(sides[c].name);
! pmessage(0, MALL, inl_from, "The %s team picks %s",
! inl_teams[num].t_name,
! sides[inl_teams[num].side_index].name);
}
! }
return 1;
}
***************
*** 488,493 ****
--- 529,540 ----
if ((num = check_player(who, 1)) == NONE) return 0;
+ if (inl_stat.flags & S_PREGAME)
+ {
+ pmessage(who, MINDIV, addr_mess(who), "You aren't even PLAYING!");
+ return 0;
+ }
+
if (strcmp(comm, "PAUSE") == 0) {
inl_teams[num].flags |= T_PAUSE;
pmessage(0, MALL, inl_from, "%s (%s) requests a pause.",
***************
*** 521,532 ****
if (inl_teams[c].flags & T_PAUSE) begin++;
}
! if (begin == 2) {
! inl_stat.flags |= S_FREEZE;
! status->gameup |= (GU_PRACTICE | GU_PAUSED);
! pmessage(0, MALL, inl_from, "-------- Game is paused -------");
}
! else if (begin == 0) {
inl_stat.flags |= S_COUNTDOWN;
inl_countdown.idx=2; /* 10 Second mark */
inl_countdown.end=inl_stat.ticks+10*PERSEC;
--- 568,579 ----
if (inl_teams[c].flags & T_PAUSE) begin++;
}
! if (begin == 2)
! {
! inl_freeze();
}
! else if (begin == 0)
! {
inl_stat.flags |= S_COUNTDOWN;
inl_countdown.idx=2; /* 10 Second mark */
inl_countdown.end=inl_stat.ticks+10*PERSEC;
***************
*** 534,539 ****
--- 581,698 ----
inl_countdown.message="Game continues in %i seconds";
}
+ }
+
+ do_timeout(char *comm, struct message *mess)
+ {
+ int who;
+ int other_side;
+ int c, num=-1;
+
+ #ifdef INLDEBUG
+ ERROR(2,(" Enter do_pause\n"));
+ #endif
+
+ who = mess->m_from;
+
+ if ((num = check_player(who, 1)) == NONE) return 0; /* captain? */
+
+ if (inl_stat.flags & S_PREGAME)
+ {
+ pmessage(who, MINDIV, addr_mess(who), "You aren't even PLAYING!");
+ return 0;
+ }
+
+ for (c=0; c < INLTEAM; c++)
+ {
+ if (inl_teams[num].team != inl_teams[c].team)
+ other_side = inl_teams[c].team;
+ }
+
+ if (inl_teams[num].flags & T_TIMEOUT)
+ {
+ inl_teams[num].flags &= ~(T_TIMEOUT);
+ inl_teams[num].tmout++;
+
+ if (!(inl_teams[other_side].flags & T_TIMEOUT))
+ {
+ inl_stat.flags &= ~(S_TMOUT);
+ inl_stat.tmout_ticks = 0;
+ }
+
+ pmessage(0, MALL, inl_from,
+ "%s team (%s) has cancelled their timeout request!",
+ inl_teams[num].t_name,
+ players[who].p_mapchars);
+ }
+ else if (inl_teams[num].tmout <= 0)
+ {
+ pmessage(who, MINDIV, addr_mess(who),
+ "You have exhausted your timeout allowance for this game.");
+ }
+ else
+ {
+ inl_teams[num].flags |= T_TIMEOUT;
+ inl_teams[num].tmout--;
+ inl_stat.flags |= S_TMOUT;
+
+ pmessage(0, MALL, inl_from,
+ "**********************************************************");
+ pmessage(0, MALL, inl_from, "%s team (%s) has called a timeout!",
+ inl_teams[num].t_name,
+ players[who].p_mapchars);
+ pmessage(0, MALL, inl_from,
+ "**********************************************************");
+ }
+ }
+
+ do_confine(char *comm, struct message *mess)
+ {
+ int who;
+ int c, other_side, num=-1;
+
+ #ifdef INLDEBUG
+ ERROR(2,(" Enter do_confine\n"));
+ #endif
+ who = mess->m_from;
+
+ if ((num = check_player(who, 1)) == NONE) return 0;
+
+ if (!(inl_stat.flags & S_PREGAME))
+ {
+ pmessage(who, MINDIV, addr_mess(who),
+ "Weenie. You can't do a confine in tmode!!");
+ return 0;
+ }
+
+ for (c=0; c < INLTEAM; c++)
+ {
+ if (inl_teams[num].team != inl_teams[c].team)
+ other_side = inl_teams[c].team;
+ }
+
+ if (inl_teams[num].flags & T_CONFINE)
+ {
+ inl_teams[num].flags &= ~(T_CONFINE);
+
+ if (!(inl_teams[other_side].flags & T_CONFINE))
+ inl_stat.flags &= ~(S_CONFINE);
+
+ pmessage(0, MALL, inl_from,
+ "%s team (%s) has toggled confine OFF (confine is an OR function)",
+ inl_teams[num].t_name,
+ players[who].p_mapchars);
+ }
+ else
+ {
+ inl_teams[num].flags |= T_CONFINE;
+ inl_stat.flags |= S_CONFINE;
+
+ pmessage(0, MALL, inl_from,
+ "%s team (%s) has toggled confine ON (confine is an OR function)",
+ inl_teams[num].t_name,
+ players[who].p_mapchars);
+ }
}
do_free(comm,mess,who)
*** robots/roboshar.c.orig Thu Jun 15 23:22:48 1995
--- robots/roboshar.c Thu Feb 22 14:35:51 1996
***************
*** 11,19 ****
* The following routines are shared code
*/
! message_flag() /* To trick smessage */
! {}
!
#ifdef SHORT_PACKETS
/*#include "warnings.h"*/
--- 11,26 ----
* The following routines are shared code
*/
! #ifdef SHORT_PACKETS
! /* ARGSUSED */
! message_flag(cur,address)
! struct message *cur;
! char *address;
! {
! /* This is to prevent false sending with SP_S_WARNING */
! cur->args[0] = DINVALID;
! }
! #endif
#ifdef SHORT_PACKETS
/*#include "warnings.h"*/
*** robots/inldefs.h.orig Fri Feb 17 23:43:11 1995
--- robots/inldefs.h Thu Feb 22 22:10:47 1996
***************
*** 22,37 ****
/* Fuses. These are used to control the timing of events */
#define PLAYERFUSE 1
! #define PLANETFUSE 400/MAXPLANETS /* INL 3.9 POP */
! #define INLSTARTFUSE 60*PERSEC /* 1 minute fuse */
! #define TIMEFUSE 60*PERSEC
/* System dependent setups */
#define PERSEC 5 /* Number of checks per second */
! #define PERMIN 60*PERSEC /* Number of checks per minute */
#define HOMETEAM FED /* Entry point for home team */
#define AWAYTEAM ROM /* Entry point for away team */
--- 22,40 ----
/* Fuses. These are used to control the timing of events */
+ /* Constant values must be in () or the constants might be misevaluated
+ depending on the syntax it is used in */
+
#define PLAYERFUSE 1
! #define PLANETFUSE (400/MAXPLANETS) /* INL 3.9 POP */
! #define INLSTARTFUSE (60*PERSEC) /* 1 minute fuse */
! #define TIMEFUSE PERSEC
/* System dependent setups */
#define PERSEC 5 /* Number of checks per second */
! #define PERMIN (60*PERSEC) /* Number of checks per minute */
#define HOMETEAM FED /* Entry point for home team */
#define AWAYTEAM ROM /* Entry point for away team */
***************
*** 46,51 ****
--- 49,58 ----
/* is 1 */
#define N_INLLOG "./INL_log"
+ #define C_PR_CAPTAIN C_PR_1
+ #define C_PR_PREGAME C_PR_2
+ #define C_PR_INGAME C_PR_3
+
/* TEAM flags */
#define T_START 0x01
***************
*** 53,58 ****
--- 60,68 ----
#define T_PAUSE 0x04
#define T_CONTINUE 0x08
#define T_RESTART 0x10
+ #define T_TIMEOUT 0x20
+ #define T_SIDELOCKED 0x40 /* Pregame only-side cant choose */
+ #define T_CONFINE 0x80 /* Pregame only */
/* INL_STAT flags */
***************
*** 64,69 ****
--- 74,80 ----
#define S_OFFICIAL 0x20 /* Offical game */
#define S_TOURNEY 0x40 /* tournament under way! */
#define S_COUNTDOWN 0x80 /* 1 minute until start countdown */
+ #define S_CONFINE 0x100 /* Confine players */
#define NONE -1
***************
*** 89,95 ****
int start_armies; /* offical starting armies */
int change; /* 1 if things can be changed */
int flags;
! int ticks;
int time, overtime;
} Inl_stats;
--- 100,108 ----
int start_armies; /* offical starting armies */
int change; /* 1 if things can be changed */
int flags;
! int ticks; /* daemon ticks */
! int game_ticks; /* ticks in official game */
! int tmout_ticks;
int time, overtime;
} Inl_stats;
*** robots/Makefile.orig Sat Apr 5 00:58:43 1997
--- robots/Makefile Sat Apr 5 00:59:00 1997
***************
*** 46,59 ****
# INL Objects
! I_OBJS = inl.o inlcomm.o commands_inl.o $(C_OBJS)
SRCS = puck.c puckmove.c mars.c marsmove.c robotII.c rmove.c getpath.c \
data.c detonate.c enter.c getship.c interface.c \
orbit.c phaser.c sintab.c openmem.c sysdefaults.c torp.c \
util.c $(RANDOMC) commands.c smessage.c basep.c wander2.c \
! inl.c inlcomm.c slotmaint.c
EXECS = puck mars robotII basep inl
--- 46,59 ----
# INL Objects
! I_OBJS = inl.o inlcomm.o inlcmds.o gencmds.o $(C_OBJS)
SRCS = puck.c puckmove.c mars.c marsmove.c robotII.c rmove.c getpath.c \
data.c detonate.c enter.c getship.c interface.c \
orbit.c phaser.c sintab.c openmem.c sysdefaults.c torp.c \
util.c $(RANDOMC) commands.c smessage.c basep.c wander2.c \
! inl.c inlcomm.c slotmaint.c inlcmds.c gencmds.c
EXECS = puck mars robotII basep inl
--
------------------------------------------------------------------------
| Kevin O'Connor "BTW, IMHO we need a FAQ for 'RTFM', | **
| koconnor@acsu.buffalo.edu 'IMHO', 'IMO', 'FAQ', 'BTW', etc. !" | **
------------------------------------------------------------------------ **
*************************************************************************