diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 2e04e8a7e..d4d025643 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4799,7 +4799,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 @@ -4813,6 +4813,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 a7be4cf15..aed1efbfd 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2964,6 +2964,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; @@ -3007,7 +3008,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; } @@ -3027,7 +3042,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")); @@ -3134,7 +3149,7 @@ static void Got_MapQueuecmd(const 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 363c9f330..476c4b2a8 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -38,7 +38,9 @@ extern "C" { // ============================= #define ROUNDQUEUE_MAX 10 // sane max? maybe make dynamically allocated later -#define ROUNDQUEUE_CLEAR UINT16_MAX // lives in gametype field of packets +// 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.