Exemplo n.º 1
0
static void Svcmd_Evacuation_f( void )
{
  trap_SendServerCommand( -1, "print \"Evacuation ordered\n\"" );
  level.lastWin = TEAM_NONE;
  trap_SetConfigstring( CS_WINNER, "Evacuation" );
  LogExit( "Evacuation." );
}
Exemplo n.º 2
0
static void Svcmd_Evacuation_f( void )
{
	trap_SendServerCommand( -1, "print_tr \"" N_("Evacuation ordered\n") "\"" );
	level.lastWin = TEAM_NONE;
	trap_SetConfigstring( CS_WINNER, "Evacuation" );
	LogExit( "Evacuation." );
	G_MapLog_Result( 'd' );
}
Exemplo n.º 3
0
// game.EndRound()
static int game_EndRound(lua_State * L)
{
	DEBUG_LUA("game_EndRound: start: round ending");

	trap_SendServerCommand(-1, "print \"Round Ended.\n\"");
	LogExit("Round Ended.");

	DEBUG_LUA("game_EndRound: return: exited");
	return 0;
}
Exemplo n.º 4
0
qboolean G_ScriptAction_EndRound( gentity_t *ent, char *params )
{
	if ( level.intermissiontime ) {
		return qtrue;
	}

	LogExit( "Wolf EndRound." );

	return qtrue;
}
Exemplo n.º 5
0
int G_Surrender_v( gentity_t *ent, unsigned int dwVoteIndex,
		char *arg, char *arg2, qboolean fRefereeCmd )
{
	team_t team;
	
	// Vote request (vote is being initiated)
	if(arg) {
		if(g_gamestate.integer != GS_PLAYING) {
			return G_INVALID;
		}
		if(!vote_allow_surrender.integer)
			return G_INVALID;
			
		// yada - noone ever seemes to have thought of refs calling this
		if(	!ent||
				ent->client->sess.sessionTeam==TEAM_SPECTATOR
		){
			if(trap_Argc()==2){
				G_refPrintf(ent,"Usage: \\%s surrender <team>",fRefereeCmd?"ref":"callvote");
				return G_INVALID;
			}
			team=TeamFromString(arg2);
			if(	team!=TEAM_AXIS&&
					team!=TEAM_ALLIES
			){
				G_refPrintf(ent,"Invalid team specified.");
				return G_INVALID;
			}
			level.voteInfo.voteTeam=team;
		}else{
			team=ent->client->sess.sessionTeam;
		}
		
		Q_strncpyz(arg2,
			(team == TEAM_AXIS) ?
				"[AXIS]" : "[ALLIES]",
			VOTE_MAXSTRING);
	}
	// Vote action (vote has passed)
	else if(g_gamestate.integer == GS_PLAYING){
		char cs[MAX_STRING_CHARS];

		trap_GetConfigstring(CS_MULTI_MAPWINNER, cs, sizeof(cs));
		Info_SetValueForKey(cs, "winner",
			(level.voteInfo.voteTeam == TEAM_AXIS) ? "1" : "0");
		trap_SetConfigstring(CS_MULTI_MAPWINNER, cs);
		LogExit(va("%s Surrender\n",
			(level.voteInfo.voteTeam == TEAM_AXIS) ?
			"Axis" : "Allies"));
		AP(va("chat \"%s have surrendered!\" -1",
			(level.voteInfo.voteTeam == TEAM_AXIS) ?
			"^1AXIS^7" : "^4ALLIES^7"));
	}
	return(G_OK);
}
/*
=================
CheckExitRules

There will be a delay between the time the exit is qualified for
and the time everyone is moved to the intermission spot, so you
can see the last frag.
=================
*/
void CheckExitRules( void ) {
 	int			i;
	gclient_t	*cl;
	// if at the intermission, wait for all non-bots to
	// signal ready, then go to next level
	if ( level.intermissiontime ) {
		CheckIntermissionExit ();
		return;
	}

	if ( level.intermissionQueued ) {
#ifdef MISSIONPACK
		int time = (g_singlePlayer.integer) ? SP_INTERMISSION_DELAY_TIME : INTERMISSION_DELAY_TIME;
		if ( level.time - level.intermissionQueued >= time ) {
			level.intermissionQueued = 0;
			BeginIntermission();
		}
#else
		if ( level.time - level.intermissionQueued >= INTERMISSION_DELAY_TIME ) {
			level.intermissionQueued = 0;
			BeginIntermission();
		}
#endif
		return;
	}

	// check for sudden death
	if ( ScoreIsTied() ) {
		// always wait for sudden death
		return;
	}

	if ( g_timelimit.integer && !level.warmupTime ) {
		if ( level.time - level.startTime >= g_timelimit.integer*60000 ) {
			trap_SendServerCommand( -1, "print \"Timelimit hit.\n\"");
			LogExit( "Timelimit hit." );
			return;
		}
	}

	if ( g_gametype.integer < GT_CTF && g_fraglimit.integer ) {
		if ( level.teamScores[TEAM_RED] >= g_fraglimit.integer ) {
			trap_SendServerCommand( -1, "print \"Red hit the fraglimit.\n\"" );
			LogExit( "Fraglimit hit." );
			return;
		}

		if ( level.teamScores[TEAM_BLUE] >= g_fraglimit.integer ) {
			trap_SendServerCommand( -1, "print \"Blue hit the fraglimit.\n\"" );
			LogExit( "Fraglimit hit." );
			return;
		}

		for ( i=0 ; i< g_maxclients.integer ; i++ ) {
			cl = level.clients + i;
			if ( cl->pers.connected != CON_CONNECTED ) {
				continue;
			}
			if ( cl->sess.sessionTeam != TEAM_FREE ) {
				continue;
			}

			if ( cl->ps.persistant[PERS_SCORE] >= g_fraglimit.integer ) {
				LogExit( "Fraglimit hit." );
				trap_SendServerCommand( -1, va("print \"%s" S_COLOR_WHITE " hit the fraglimit.\n\"",
					cl->pers.netname ) );
				return;
			}
		}
	}

	if ( g_gametype.integer >= GT_CTF && g_capturelimit.integer ) {

		if ( level.teamScores[TEAM_RED] >= g_capturelimit.integer ) {
			trap_SendServerCommand( -1, "print \"Red hit the capturelimit.\n\"" );
			LogExit( "Capturelimit hit." );
			return;
		}

		if ( level.teamScores[TEAM_BLUE] >= g_capturelimit.integer ) {
			trap_SendServerCommand( -1, "print \"Blue hit the capturelimit.\n\"" );
			LogExit( "Capturelimit hit." );
			return;
		}
	}
}
Exemplo n.º 7
0
static void trigger_exit_touch( gentity_t *self, gentity_t *other, trace_t *trace ) {
	if(other && other->client && !(other->r.svFlags & SVF_BOT)) {
		LogExit("touched trigger_exit.");
		level.intermissionQueued = level.time - INTERMISSION_DELAY_TIME; // NOTE: on trigger we want to exit faster (on limit-hit there is a delay) ... and the LogExit wont work if it is called on every touch (overwrites because it always resets level.intermissionQueued)
	}
}
Exemplo n.º 8
0
/*
=================
CheckExitRules

There will be a delay between the time the exit is qualified for
and the time everyone is moved to the intermission spot, so you
can see the last frag.
=================
*/
void CheckExitRules() 
{
	// if at the intermission, wait for all non-bots to
	// signal ready, then go to next level
	if( theLevel.intermissiontime_ ) 
	{
		CheckIntermissionExit ();
		return;
	}

	if( theLevel.intermissionQueued_ ) 
	{
		if ( theLevel.time_ - theLevel.intermissionQueued_ >= INTERMISSION_DELAY_TIME ) 
		{
			theLevel.intermissionQueued_ = 0;
			BeginIntermission();
		}
		return;
	}

	// check for sudden death
	if( ScoreIsTied() )
	{
		// always wait for sudden death
		return;
	}

	if( g_timelimit.integer && !theLevel.warmupTime_ ) 
	{
		if( theLevel.time_ - theLevel.startTime_ >= g_timelimit.integer*60000 ) 
		{
			SV_GameSendServerCommand( -1, "print \"Timelimit hit.\n\" \"<scoreboard>\"");
			LogExit( "Timelimit hit." );
			return;
		}
	}

	if( theLevel.numPlayingClients_ < 2 ) 
		return;

	if( g_gametype.integer < GT_CTF && g_fraglimit.integer ) 
	{
		if( theLevel.teamScores_[ClientBase::TEAM_RED] >= g_fraglimit.integer ) 
		{
			SV_GameSendServerCommand( -1, "print \"Red hit the fraglimit.\n\" \"<scoreboard>\"" );
			LogExit( "Fraglimit hit." );
			return;
		}

		if( theLevel.teamScores_[ClientBase::TEAM_BLUE] >= g_fraglimit.integer ) 
		{
			SV_GameSendServerCommand( -1, "print \"Blue hit the fraglimit.\n\" \"<scoreboard>\"" );
			LogExit( "Fraglimit hit." );
			return;
		}

		for( int i=1 ; i<= g_maxclients.integer ; i++ ) 
		{
			GameClient *cl = theLevel.getClient(i);
			if( !cl || cl->pers_.connected_ != GameClient::ClientPersistant::CON_CONNECTED ) 
				continue;

			if( cl->sess_.sessionTeam_ != ClientBase::TEAM_FREE ) 
				continue;

			if( cl->ps_.persistant[PERS_SCORE] >= g_fraglimit.integer )
			{
				LogExit( "Fraglimit hit." );
				SV_GameSendServerCommand( -1, va("print \"%s" S_COLOR_WHITE " hit the fraglimit.\n\" \"<scoreboard>\"",
					cl->pers_.netname_ ) );
				return;
			}
		}
	}

	if( g_gametype.integer >= GT_CTF && g_capturelimit.integer )
	{

		if( theLevel.teamScores_[ClientBase::TEAM_RED] >= g_capturelimit.integer )
		{
			SV_GameSendServerCommand( -1, "print \"Red hit the capturelimit.\n\" \"<scoreboard>\"" );
			LogExit( "Capturelimit hit." );
			return;
		}

		if( theLevel.teamScores_[ClientBase::TEAM_BLUE] >= g_capturelimit.integer )
		{
			SV_GameSendServerCommand( -1, "print \"Blue hit the capturelimit.\n\" \"<scoreboard>\"" );
			LogExit( "Capturelimit hit." );
			return;
		}
	}
}
qboolean G_ScriptAction_EndRound( gentity_t *ent, char *params ) {
    LogExit( "Wolf EndRound." );

    return qtrue;
}