diff --git a/src/d_clisrv.c b/src/d_clisrv.c index e7bb65414..45b676dec 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5443,7 +5443,7 @@ static void PT_ReqMapQueue(int node) } } - const boolean doclear = (reqmapqueue.newgametype == ROUNDQUEUE_CLEAR); + const boolean doclear = (reqmapqueue.newgametype == ROUNDQUEUE_CMD_CLEAR); // The following prints will only appear when multiple clients // attempt to affect the round queue at similar time increments @@ -5457,6 +5457,33 @@ static void PT_ReqMapQueue(int node) return; } } + else if (reqmapqueue.newgametype == ROUNDQUEUE_CMD_SHOW) + { + char maprevealmsg[256]; + if (roundqueue.size == 0) + { + strlcpy(maprevealmsg, "There are no Rounds queued.", 256); + } + else if (roundqueue.position >= roundqueue.size) + { + strlcpy(maprevealmsg, "There are no more Rounds queued!", 256); + } + else + { + char *title = G_BuildMapTitle(roundqueue.entries[roundqueue.position].mapnum + 1); + + strlcpy( + maprevealmsg, + va("The next Round will be on \"%s\".", title), + 256 + ); + + Z_Free(title); + } + DoSayCommand(maprevealmsg, 0, HU_SHOUT, servernode); + + return; + } else if (roundqueue.size >= ROUNDQUEUE_MAX) { CONS_Alert(CONS_ERROR, "Recieved REQMAPQUEUE, but unable to add map beyond %u\n", roundqueue.size); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 6667219b7..fbb7842c9 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4156,6 +4156,7 @@ static void Command_QueueMap_f(void) size_t option_gametype; size_t option_encore; size_t option_clear; + size_t option_show; boolean usingcheats; boolean ischeating; @@ -4199,7 +4200,21 @@ static void Command_QueueMap_f(void) return; } - Handle_MapQueueSend(0, ROUNDQUEUE_CLEAR, false); + Handle_MapQueueSend(0, ROUNDQUEUE_CMD_CLEAR, false); + return; + } + + option_show = COM_CheckParm("-show"); + + if (option_show) + { + if (ischeating && !usingcheats) + { + CONS_Printf(M_GetText("Cheats must be enabled.\n")); + return; + } + + Handle_MapQueueSend(0, ROUNDQUEUE_CMD_SHOW, false); return; } @@ -4219,7 +4234,7 @@ static void Command_QueueMap_f(void) if (first_option < 2) { /* I'm going over the fucking lines and I DON'T CAREEEEE */ - CONS_Printf("queuemap [-gametype ] [-force] / [-clear]:\n"); + CONS_Printf("queuemap [-gametype ] [-force] / [-clear] / [-spoil]:\n"); CONS_Printf(M_GetText( "Queue up a map by its name, or by its number (though why would you).\n" "All parameters are case-insensitive and may be abbreviated.\n")); @@ -4326,7 +4341,7 @@ static void Got_MapQueuecmd(UINT8 **cp, INT32 playernum) return; } - doclear = (setgametype == ROUNDQUEUE_CLEAR); + doclear = (setgametype == ROUNDQUEUE_CMD_CLEAR); if (doclear == false && queueposition >= ROUNDQUEUE_MAX) { diff --git a/src/doomstat.h b/src/doomstat.h index f39100745..e53154731 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -37,6 +37,12 @@ extern "C" { // Selected map etc. // ============================= +#define ROUNDQUEUE_MAX 10 // sane max? maybe make dynamically allocated later +// These two live in gametype field of packets +#define ROUNDQUEUE_CMD_CLEAR UINT16_MAX +#define ROUNDQUEUE_CMD_SHOW UINT16_MAX-1 +// The roundqueue itself is resident in g_game.h + // Selected by user. extern mapnum_t gamemap; extern char mapmusname[7]; diff --git a/src/g_game.h b/src/g_game.h index 1984812cb..078224625 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -41,9 +41,6 @@ extern tic_t levelstarttic; // for modding? extern mapnum_t prevmap, nextmap; -#define ROUNDQUEUE_MAX 10 // sane max? maybe make dynamically allocated later -#define ROUNDQUEUE_CLEAR UINT16_MAX // lives in gametype field of packets - struct roundentry_t { UINT16 mapnum; // Map number at this position