mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Add roundqueue -show
				
					
				
			Reveals the next Round in the queue via server shout message. Can be used manually, or with automate commands for tournament rulesets that permit foreknowledge of the next Round without requiring the host to work off memory or document.
This commit is contained in:
		
							parent
							
								
									512ec6c2eb
								
							
						
					
					
						commit
						63aaec65b1
					
				
					 3 changed files with 49 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 <name / number> [-gametype <type>] [-force] / [-clear]:\n");
 | 
			
		||||
		CONS_Printf("queuemap <name / number> [-gametype <type>] [-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)
 | 
			
		||||
	{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue