Exemple #1
0
/*
============
sdGameRules::GetBrowserStatusString
============
*/
void sdGameRulesCampaign::GetBrowserStatusString( idWStr& str, const sdNetSession& netSession ) const {
	str.Clear();

	const idDict& serverInfo = netSession.GetServerInfo();
	const char* campaignName = serverInfo.GetString( "si_campaign" );
	if( campaignName[ 0 ] != '\0' ) {
		const sdDeclCampaign* campaign = gameLocal.declCampaignType.LocalFind( campaignName, false );		

		if( campaign != NULL ) {			
			const char* campaignInfo = serverInfo.GetString( "si_campaignInfo" );
			int num = 1;
			int i = 0;
			while( campaignInfo[ i ] != '\0' ) {
				if( idStr::CharIsNumeric( campaignInfo[ i ] ) ) {
					num++;
				}
				i++;
			}

			// jrad - if we're reviewing,
			// we've received the win info, but haven't moved on to the next map yet
			if( netSession.GetGameState() & PGS_REVIEWING ) {
				num--;
			}

			idWStrList args( 3 );
			args.SetNum( 3 );
			
			sdGameRules::GetBrowserStatusString( args[ 0 ], netSession );
			args[ 1 ] = va( L"%i", num );
			args[ 2 ] = va( L"%i", campaign->GetNumMaps() );
			str = common->LocalizeText( "guis/mainmenu/campaign_status", args );
		}
	}
}
Exemple #2
0
/*
============
sdGameRulesStopWatch::GetServerBrowserScore
============
*/
int sdGameRulesStopWatch::GetServerBrowserScore( const sdNetSession& session ) const {
	int score = 0;
	if ( session.GetGameState() & PGS_RETURN ) {
		score += sdHotServerList::BROWSER_OK_BONUS;
	} else {
		score += sdHotServerList::BROWSER_GOOD_BONUS;
	}

	score += sdGameRules::GetServerBrowserScore( session );
	return score;
}
Exemple #3
0
/*
============
sdGameRulesStopWatch::GetBrowserStatusString
============
*/
void sdGameRulesStopWatch::GetBrowserStatusString( idWStr& str, const sdNetSession& netSession ) const {
	str.Clear();

	sdGameRules::GetBrowserStatusString( str, netSession );
	str += L" - ";

	if( netSession.GetGameState() & PGS_RETURN ) {
		str += declHolder.declLocStrType.LocalFind( "guis/hud/stopwatch_2" )->GetText();
	} else {
		str += declHolder.declLocStrType.LocalFind( "guis/hud/stopwatch_1" )->GetText();
	}
}
Exemple #4
0
/*
============
sdGameRulesCampaign::GetServerBrowserScore
============
*/
int sdGameRulesCampaign::GetServerBrowserScore( const sdNetSession& session ) const {
	int score = 0;

	const char* statusString = session.GetServerInfo().GetString( "si_campaignInfo" );
	int numMapsPlayed = idStr::Length( statusString );
	if ( numMapsPlayed == 0 ) {
		score += sdHotServerList::BROWSER_GOOD_BONUS;
	} else if ( numMapsPlayed == 1 ) {
		score += sdHotServerList::BROWSER_OK_BONUS;
	}

	score += sdGameRules::GetServerBrowserScore( session );
	return score;
}