Example #1
0
// Parses for a referee command.
//	--> ref arg allows for the server console to utilize all referee commands (ent == NULL)
//
qboolean G_refCommandCheck(gentity_t *ent, char *cmd)
{
		 if(!Q_stricmp(cmd, "allready"))	G_refAllReady_cmd(ent);
	else if(!Q_stricmp(cmd, "lock"))		G_refLockTeams_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "help"))		G_refHelp_cmd(ent);
	else if(!Q_stricmp(cmd, "pause"))		G_refPause_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "putallies"))	G_refPlayerPut_cmd(ent, TEAM_ALLIES);
	else if(!Q_stricmp(cmd, "putaxis"))		G_refPlayerPut_cmd(ent, TEAM_AXIS);
	else if(!Q_stricmp(cmd, "remove"))		G_refRemove_cmd(ent);
	else if(!Q_stricmp(cmd, "speclock"))	G_refSpeclockTeams_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "specunlock"))	G_refSpeclockTeams_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "unlock"))		G_refLockTeams_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "unpause"))		G_refPause_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "warmup"))		G_refWarmup_cmd(ent);
	else if(!Q_stricmp(cmd, "warn"))		G_refWarning_cmd(ent);
	// yada - handled by the vote functions now
	//else if(!Q_stricmp(cmd, "mute"))		G_refMute_cmd(ent, qtrue); 
	//else if(!Q_stricmp(cmd, "unmute"))		G_refMute_cmd(ent, qfalse);

	// pheno
	else if( !Q_stricmp( cmd, "makeshoutcaster" ) )
		G_refMakeShoutcaster_cmd( ent );
	else if( !Q_stricmp( cmd, "removeshoutcaster" ) )
		G_refRemoveShoutcaster_cmd( ent );
	else if( !Q_stricmp( cmd, "logout" ) )
		G_refLogout_cmd( ent );

	else return(qfalse);

	return(qtrue);
}
Example #2
0
// Parses for a referee command.
//	--> ref arg allows for the server console to utilize all referee commands (ent == NULL)
//
qboolean G_refCommandCheck(gentity_t *ent, char *cmd)
{
		 if(!Q_stricmp(cmd, "allready"))	G_refAllReady_cmd(ent);
	else if(!Q_stricmp(cmd, "lock"))		G_refLockTeams_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "help"))		G_refHelp_cmd(ent);
	else if(!Q_stricmp(cmd, "pause"))		G_refPause_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "putallies"))	G_refPlayerPut_cmd(ent, TEAM_ALLIES);
	else if(!Q_stricmp(cmd, "putaxis"))		G_refPlayerPut_cmd(ent, TEAM_AXIS);
	else if(!Q_stricmp(cmd, "remove"))		G_refRemove_cmd(ent);
	else if(!Q_stricmp(cmd, "speclock"))	G_refSpeclockTeams_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "specunlock"))	G_refSpeclockTeams_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "unlock"))		G_refLockTeams_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "unpause"))		G_refPause_cmd(ent, qfalse);
	else if(!Q_stricmp(cmd, "warmup"))		G_refWarmup_cmd(ent);
	else if(!Q_stricmp(cmd, "warn"))		G_refWarning_cmd(ent);
	else if(!Q_stricmp(cmd, "mute"))		G_refMute_cmd(ent, qtrue);
	else if(!Q_stricmp(cmd, "unmute"))		G_refMute_cmd(ent, qfalse);
	else return(qfalse);

	return(qtrue);
}
Example #3
0
// ************** PAUSE / UNPAUSE
//
// Pause/unpause a match.
void G_pause_cmd(gentity_t *ent, unsigned int dwCommand, qboolean fPause)
{
	char *status[2] = { "^5UN", "^1" };

	if(team_nocontrols.integer) { G_noTeamControls(ent); return; }

	if((PAUSE_UNPAUSING >= level.match_pause && !fPause) || (PAUSE_NONE != level.match_pause && fPause)) {
		CP(va("print \"The match is already %sPAUSED^7!\n\"", status[fPause]));
		return;
	}

	// Alias for referees
	if(ent->client->sess.referee) G_refPause_cmd(ent, fPause);
	else {
		int tteam = G_teamID(ent);

		if(!G_cmdDebounce(ent, aCommandInfo[dwCommand].pszCommandName)) return;

		// Trigger the auto-handling of pauses
		if(fPause) {
			if(0 == teamInfo[tteam].timeouts) {
				CP("cpm \"^3Your team has no more timeouts remaining!\n\"");
				return;
			} else {
				teamInfo[tteam].timeouts--;
				level.match_pause = tteam + 128;
				G_globalSound("sound/misc/referee.wav");
				G_spawnPrintf(DP_PAUSEINFO, level.time + 15000, NULL);
				AP(va("print \"^3Match is ^1PAUSED^3!\n^7[%s^7: - %d Timeouts Remaining]\n\"", aTeams[tteam], teamInfo[tteam].timeouts));
				// sta acqu-sdk (issue 2): CHRUKER: b040 - Was only sending this to the client sending the command
				AP(va("cp \"^3Match is ^1PAUSED^3! (%s^3)\n\"", aTeams[tteam]));
				//CP(va("cp \"^3Match is ^1PAUSED^3! (%s^3)\n\"", aTeams[tteam]));
				// end acqu-sdk (issue 2): CHRUKER: b040
				level.server_settings |= CV_SVS_PAUSE;
				trap_SetConfigstring(CS_SERVERTOGGLES, va("%d", level.server_settings));
			}
		} else if(tteam + 128 != level.match_pause) {
			CP("cpm \"^3Your team didn't call the timeout!\n\"");
			return;
		} else {
			// sta acqu-sdk (issue 2): CHRUKER: b068 - Had extra linebreaks, before and after.
			AP("print \"^3Match is ^5UNPAUSED^3 ... resuming in 10 seconds!\n\"");
			//AP("print \"\n^3Match is ^5UNPAUSED^3 ... resuming in 10 seconds!\n\n\"");
			// end acqu-sdk (issue 2): CHRUKER: b068
			level.match_pause = PAUSE_UNPAUSING;
			G_globalSound("sound/osp/prepare.wav");
			G_spawnPrintf(DP_UNPAUSING, level.time + 10, NULL);
		}
	}
}