Date: Thursday July 6, 2000 @ 9:50 Author: karthik Update of /home/netrek/cvsroot/Vanilla/ntserv In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv10999 Modified Files: defs.h queue.c solicit.c struct.h Log Message: Newbie server changes to properly limit humans to 8 players by means of a separate queue, as well as to stop reporting bots to the metaserver. (When the human queue is full, the game will still be reported as Wait Queue, but when it is not full, only the human count will be reported.) **************************************** Index: Vanilla/ntserv/defs.h diff -u Vanilla/ntserv/defs.h:1.18 Vanilla/ntserv/defs.h:1.19 --- Vanilla/ntserv/defs.h:1.18 Tue May 23 20:16:31 2000 +++ Vanilla/ntserv/defs.h Thu Jul 6 09:50:54 2000 @@ -1,4 +1,4 @@ -/* $Id: defs.h,v 1.18 2000/05/24 01:16:31 jeffno Exp $ +/* $Id: defs.h,v 1.19 2000/07/06 14:50:54 karthik Exp $ */ #ifndef _h_defs @@ -67,8 +67,11 @@ #define PV_TOTAL MAXPLAYER /* total number of votable slots */ #endif - -#define MAXQUEUE 9 /* Number of different waitqueues */ +#ifdef NEWBIESERVER +#define MAXQUEUE 13 /* Number of different waitqueues */ +#else +#define MAXQUEUE 9 +#endif #define MAXWAITING 32 /* Number of total people waiting */ #define QNAMESIZE 20 /* Max length of wait queue name */ #define MAXPLANETS 40 Index: Vanilla/ntserv/queue.c diff -u Vanilla/ntserv/queue.c:1.5 Vanilla/ntserv/queue.c:1.6 --- Vanilla/ntserv/queue.c:1.5 Thu Mar 23 20:37:34 2000 +++ Vanilla/ntserv/queue.c Thu Jul 6 09:50:55 2000 @@ -136,6 +136,40 @@ queues[QU_GOD_OBS].q_flags = QU_OPEN|QU_OBSERVER; queue_setname(QU_GOD_OBS,"god observer"); +#ifdef NEWBIESERVER + queues[QU_NEWBIE_PLR].free_slots = (MAXPLAYER - TESTERS) / 2; + queues[QU_NEWBIE_PLR].max_slots = (MAXPLAYER - TESTERS) / 2; + queues[QU_NEWBIE_PLR].tournmask = ALLTEAM; + queues[QU_NEWBIE_PLR].low_slot = 0; + queues[QU_NEWBIE_PLR].high_slot = (MAXPLAYER - TESTERS) / 2; + queues[QU_NEWBIE_PLR].q_flags = QU_OPEN|QU_RESTRICT|QU_REPORT; + queue_setname(QU_NEWBIE_PLR, "newbie player"); + + queues[QU_NEWBIE_BOT].free_slots = MAXPLAYER - TESTERS; + queues[QU_NEWBIE_BOT].max_slots = MAXPLAYER - TESTERS; + queues[QU_NEWBIE_BOT].tournmask = ALLTEAM; + queues[QU_NEWBIE_BOT].low_slot = (MAXPLAYER - TESTERS) / 2; + queues[QU_NEWBIE_BOT].high_slot = MAXPLAYER - (TESTERS / 2); + queues[QU_NEWBIE_BOT].q_flags = QU_OPEN; + queue_setname(QU_NEWBIE_BOT, "newbie robot"); + + queues[QU_NEWBIE_OBS].free_slots = (MAXPLAYER - TESTERS) / 2 - 1; + queues[QU_NEWBIE_OBS].max_slots = (MAXPLAYER - TESTERS) / 2 - 1; + queues[QU_NEWBIE_OBS].tournmask = ALLTEAM; + queues[QU_NEWBIE_OBS].low_slot = MAXPLAYER - (TESTERS / 2); + queues[QU_NEWBIE_OBS].high_slot = MAXPLAYER - 1; + queues[QU_NEWBIE_OBS].q_flags = QU_OPEN|QU_RESTRICT|QU_OBSERVER|QU_REPORT; + queue_setname(QU_NEWBIE_OBS, "newbie observer"); + + queues[QU_NEWBIE_DMN].free_slots = 1; + queues[QU_NEWBIE_DMN].max_slots = 1; + queues[QU_NEWBIE_DMN].tournmask = ALLTEAM; + queues[QU_NEWBIE_DMN].low_slot = MAXPLAYER - 1; + queues[QU_NEWBIE_DMN].high_slot = MAXPLAYER; + queues[QU_NEWBIE_DMN].q_flags = QU_OPEN; + queue_setname(QU_NEWBIE_DMN, "newbie daemon"); +#endif + return 1; } Index: Vanilla/ntserv/solicit.c diff -u Vanilla/ntserv/solicit.c:1.16 Vanilla/ntserv/solicit.c:1.17 --- Vanilla/ntserv/solicit.c:1.16 Tue Feb 29 22:08:34 2000 +++ Vanilla/ntserv/solicit.c Thu Jul 6 09:50:55 2000 @@ -220,7 +220,11 @@ /* count up the number of free slots and players for pickup games */ /* don't want to go all the way to MAX_PLAYERS. Queue starts at */ /* queues[QU_PICKUP].high_slot players. */ +#ifdef NEWBIESERVER + for (j=0; j<queues[QU_NEWBIE_PLR].high_slot; j++) +#else for (j=0; j<queues[QU_PICKUP].high_slot; j++) +#endif if (players[j].p_status == PFREE) nfree++; else @@ -230,7 +234,11 @@ /* and report that the game is full */ if (nfree == 0) { +#ifdef NEWBIESERVER + nfree = -queues[QU_NEWBIE_PLR].count; +#else nfree = -queues[QU_PICKUP].count; +#endif gamefull++; } Index: Vanilla/ntserv/struct.h diff -u Vanilla/ntserv/struct.h:1.11 Vanilla/ntserv/struct.h:1.12 --- Vanilla/ntserv/struct.h:1.11 Fri Jun 23 04:12:58 2000 +++ Vanilla/ntserv/struct.h Thu Jul 6 09:50:55 2000 @@ -37,7 +37,10 @@ #define QU_PICKUP_OBS 6 /* Pickup observer queue */ #define QU_GOD 7 /* Queue for God */ #define QU_GOD_OBS 8 /* Queue for God as Voyeur */ - +#define QU_NEWBIE_PLR 9 /* Newbie server players */ +#define QU_NEWBIE_BOT 10 /* Newbie server robots */ +#define QU_NEWBIE_OBS 11 /* Newbie server observers */ +#define QU_NEWBIE_DMN 12 /* Newbie server daemon */ /* * Queue flag definitions. */