Beispiel #1
0
/*
================
G_WriteClientSessionData

Called on game shutdown
================
*/
void G_WriteClientSessionData(gclient_t *client, qboolean restart)
{
#ifdef FEATURE_MULTIVIEW
	int mvc = G_smvGenerateClientList(g_entities + (client - level.clients));
#endif
	const char *s;

	// stats reset check
	//if (level.fResetStats)
	//{
	G_deleteStats(client - level.clients);
	//}

#ifdef FEATURE_MULTIVIEW
#ifdef FEATURE_RATING
	s = va("%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %f %f %f %f %i %i %i %i %i %i %i %i",
#else
	s = va("%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i",
#endif
#else
#ifdef FEATURE_RATING
	s = va("%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %f %f %f %f %i %i %i %i %i %i",
#else
	s = va("%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i",
#endif
#endif
	       client->sess.sessionTeam,
	       client->sess.spectatorTime,
	       client->sess.spectatorState,
	       client->sess.spectatorClient,
	       client->sess.playerType,
	       client->sess.playerWeapon,
	       client->sess.playerWeapon2,
	       client->sess.latchPlayerType,
	       client->sess.latchPlayerWeapon,
	       client->sess.latchPlayerWeapon2,

	       client->sess.coach_team,
	       client->sess.referee,
	       client->sess.spec_invite,
	       client->sess.spec_team,
	       client->sess.kills,
	       client->sess.deaths,
	       client->sess.gibs,
	       client->sess.self_kills,
	       client->sess.team_kills,
	       client->sess.team_gibs,

	       client->sess.time_axis,
	       client->sess.time_allies,
	       client->sess.time_played,
#ifdef FEATURE_RATING
	       client->sess.mu,
	       client->sess.sigma,
	       client->sess.oldmu,
	       client->sess.oldsigma,
#endif
#ifdef FEATURE_MULTIVIEW
	       (mvc & 0xFFFF),
	       ((mvc >> 16) & 0xFFFF),
#endif
	       // Damage and rounds played rolled in with weapon stats (below)

	       client->sess.muted,
	       client->sess.ignoreClients[0],
	       client->sess.ignoreClients[1],
	       client->pers.enterTime,
	       restart ? client->sess.spawnObjectiveIndex : 0,
	       client->sess.uci
	       );

	trap_Cvar_Set(va("session%i", (int)(client - level.clients)), s);

	// store the clients stats (7) and medals (7)
	// addition: but only if it isn't a forced map_restart (done by someone on the console)
	if (!(restart && !level.warmupTime))
	{
		s = va("%.2f %.2f %.2f %.2f %.2f %.2f %.2f %i %i %i %i %i %i %i",
		       client->sess.skillpoints[0],
		       client->sess.skillpoints[1],
		       client->sess.skillpoints[2],
		       client->sess.skillpoints[3],
		       client->sess.skillpoints[4],
		       client->sess.skillpoints[5],
		       client->sess.skillpoints[6],
		       client->sess.medals[0],
		       client->sess.medals[1],
		       client->sess.medals[2],
		       client->sess.medals[3],
		       client->sess.medals[4],
		       client->sess.medals[5],
		       client->sess.medals[6]
		       );

		trap_Cvar_Set(va("sessionstats%i", (int)(client - level.clients)), s);
	}

	// save weapon stats too
	if (!level.fResetStats)
	{
		trap_Cvar_Set(va("wstats%i", (int)(client - level.clients)), G_createStats(&g_entities[client - level.clients]));
	}
}
Beispiel #2
0
/*
================
G_WriteClientSessionData

Called on game shutdown
================
*/
void G_WriteClientSessionData( gclient_t *client, qboolean restart )
{
	int mvc = G_smvGenerateClientList(g_entities + (client - level.clients));
	const char	*s;

	// OSP -- stats reset check
	if(level.fResetStats) G_deleteStats(client - level.clients);

	s = va("%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i",
		client->sess.sessionTeam,
		client->sess.spectatorTime,
		client->sess.spectatorState,
		client->sess.spectatorClient,
		client->sess.playerType,			// DHM - Nerve
		client->sess.playerWeapon,			// DHM - Nerve
		client->sess.playerWeapon2,
		client->sess.latchPlayerType,		// DHM - Nerve
		client->sess.latchPlayerWeapon,		// DHM - Nerve
		client->sess.latchPlayerWeapon2,

		// OSP
		client->sess.coach_team,
		client->sess.deaths,
		client->sess.game_points,
		client->sess.kills,
		client->sess.referee,
		client->sess.spec_invite,
		client->sess.spec_team,
		client->sess.suicides,
		client->sess.team_kills,
		(mvc & 0xFFFF),
		((mvc >> 16) & 0xFFFF)
		// Damage and rounds played rolled in with weapon stats (below)
		// OSP

		, 
//		client->sess.experience,
		client->sess.muted,
		client->sess.ignoreClients[0],
		client->sess.ignoreClients[1],
		client->pers.enterTime,
		restart ? client->sess.spawnObjectiveIndex : 0
		);

	trap_Cvar_Set( va( "session%i", client - level.clients ), s );

	// Arnout: store the clients stats (7) and medals (7)
	// addition: but only if it isn't a forced map_restart (done by someone on the console)
	if( !(restart && !level.warmupTime) ) {
		s = va( "%.2f %.2f %.2f %.2f %.2f %.2f %.2f %i %i %i %i %i %i %i",
			client->sess.skillpoints[0],
			client->sess.skillpoints[1],
			client->sess.skillpoints[2],
			client->sess.skillpoints[3],
			client->sess.skillpoints[4],
			client->sess.skillpoints[5],
			client->sess.skillpoints[6],
			client->sess.medals[0],
			client->sess.medals[1],
			client->sess.medals[2],
			client->sess.medals[3],
			client->sess.medals[4],
			client->sess.medals[5],
			client->sess.medals[6]
			);

		trap_Cvar_Set( va( "sessionstats%i", client - level.clients ), s );
	}

	// OSP -- save weapon stats too
	if(!level.fResetStats)
		trap_Cvar_Set(va("wstats%i", client - level.clients), G_createStats(&g_entities[client - level.clients]));
	// OSP
}
Beispiel #3
0
// Update global MV list for a given client
void G_smvUpdateClientCSList(gentity_t *ent)
{
	ent->client->ps.powerups[PW_MVCLIENTLIST] = G_smvGenerateClientList(ent);
}
Beispiel #4
0
/*
================
G_WriteClientSessionData

Called on game shutdown
================
*/
void G_WriteClientSessionData( gclient_t *client, qboolean restart )
{
	int mvc = G_smvGenerateClientList(g_entities + (client - level.clients));
	const char	*s;

	// OSP -- stats reset check
	// tjw: stopped saving weapon stats between rounds so always
	//      reset stats.
	//if(level.fResetStats) G_deleteStats(client - level.clients);
	G_deleteStats(client - level.clients);

	s = va("%i %i %i %i %i %i %i %i %i %i %i %i %i %i %f %f %f %f %i %i %i %i %i %i %i %i %i %i %i %i %i %s %s %u %d %i %i",
		client->sess.sessionTeam,
		client->sess.spectatorTime,
		client->sess.spectatorState,
		client->sess.spectatorClient,
		client->sess.playerType,			// DHM - Nerve
		client->sess.playerWeapon,			// DHM - Nerve
		client->sess.playerWeapon2,
		client->sess.latchPlayerType,		// DHM - Nerve
		client->sess.latchPlayerWeapon,		// DHM - Nerve
		client->sess.latchPlayerWeapon2,

		// OSP
		client->sess.coach_team,
		client->sess.deaths,
		client->sess.game_points,
		client->sess.kills,
		client->sess.overall_killrating,
		client->sess.overall_killvariance,
		client->sess.rating,
		client->sess.rating_variance,
		client->sess.referee,
		client->sess.spec_invite,
		client->sess.spec_team,
		client->sess.suicides,
		client->sess.team_kills,
		(mvc & 0xFFFF),
		((mvc >> 16) & 0xFFFF)
		// Damage and rounds played rolled in with weapon stats (below)
		// OSP

		, 
//		client->sess.experience,
		client->sess.auto_unmute_time,
		client->sess.ignoreClients[0],
		client->sess.ignoreClients[1],
		client->pers.enterTime,
		restart ? client->sess.spawnObjectiveIndex : 0,
		client->sess.ATB_count,
		// Dens: Needs to be saved to prevent spoofing
		// quad: I think this solves ticket #5, will need to test it at large now
		//       but at least ETTV clients don't get kicked anymore.
		client->sess.guid && (*client->sess.guid) ? client->sess.guid : "NOGUID",
		client->sess.ip && (*client->sess.ip) ? client->sess.ip : "NOIP",
		client->sess.uci, //mcwf GeoIP
		client->sess.need_greeting,
		// quad: shoutcaster and ettv
		client->sess.shoutcaster,
		client->sess.ettv
		);

	trap_Cvar_Set( va( "session%i", client - level.clients ), s );

	// Arnout: store the clients stats (7) and medals (7)
	// addition: but only if it isn't a forced map_restart (done by someone on the console)
	// tjw: go ahead and write them if the server has g_XPSave with the 2 flag
	if( !(restart && !level.warmupTime) || (g_XPSave.integer & XPSF_NR_MAPRESET)) {
		s = va( "%.2f %.2f %.2f %.2f %.2f %.2f %.2f %i %i %i %i %i %i %i",
			client->sess.skillpoints[0],
			client->sess.skillpoints[1],
			client->sess.skillpoints[2],
			client->sess.skillpoints[3],
			client->sess.skillpoints[4],
			client->sess.skillpoints[5],
			client->sess.skillpoints[6],
			client->sess.medals[0],
			client->sess.medals[1],
			client->sess.medals[2],
			client->sess.medals[3],
			client->sess.medals[4],
			client->sess.medals[5],
			client->sess.medals[6]
			);

		trap_Cvar_Set( va( "sessionstats%i", client - level.clients ), s );
	}

	// tjw: don't bother saving weapon stats between rounds
	/*
	// OSP -- save weapon stats too
	if(!level.fResetStats)
		trap_Cvar_Set(va("wstats%i", client - level.clients), G_createStats(&g_entities[client - level.clients]));
	// OSP
	*/
}