summaryrefslogtreecommitdiff
path: root/src/game/g_session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_session.c')
-rw-r--r--src/game/g_session.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/src/game/g_session.c b/src/game/g_session.c
index d05e81e1..1dcb8883 100644
--- a/src/game/g_session.c
+++ b/src/game/g_session.c
@@ -36,22 +36,22 @@ Called on game shutdown
*/
void G_WriteClientSessionData( gclient_t *client )
{
- const char *s;
- const char *var;
-
- s = va( "%i %i %i %i %i %i %i",
- client->sess.sessionTeam,
- client->sess.spectatorTime,
- client->sess.spectatorState,
- client->sess.spectatorClient,
- client->sess.wins,
- client->sess.losses,
+ const char *s;
+ const char *var;
+
+ s = va( "%i %i %i %i %i %i %i",
+ client->sess.sessionTeam,
+ client->sess.spectatorTime,
+ client->sess.spectatorState,
+ client->sess.spectatorClient,
+ client->sess.wins,
+ client->sess.losses,
client->sess.teamLeader
- );
+ );
- var = va( "session%i", client - level.clients );
+ var = va( "session%i", client - level.clients );
- trap_Cvar_Set( var, s );
+ trap_Cvar_Set( var, s );
}
/*
@@ -63,26 +63,26 @@ Called on a reconnect
*/
void G_ReadSessionData( gclient_t *client )
{
- char s[ MAX_STRING_CHARS ];
- const char *var;
+ char s[ MAX_STRING_CHARS ];
+ const char *var;
// bk001205 - format
int teamLeader;
int spectatorState;
int sessionTeam;
- var = va( "session%i", client - level.clients );
- trap_Cvar_VariableStringBuffer( var, s, sizeof(s) );
+ var = va( "session%i", client - level.clients );
+ trap_Cvar_VariableStringBuffer( var, s, sizeof(s) );
- sscanf( s, "%i %i %i %i %i %i %i",
- &sessionTeam,
- &client->sess.spectatorTime,
- &spectatorState,
- &client->sess.spectatorClient,
- &client->sess.wins,
- &client->sess.losses,
+ sscanf( s, "%i %i %i %i %i %i %i",
+ &sessionTeam,
+ &client->sess.spectatorTime,
+ &spectatorState,
+ &client->sess.spectatorClient,
+ &client->sess.wins,
+ &client->sess.losses,
&teamLeader
- );
+ );
// bk001205 - format issues
client->sess.sessionTeam = (team_t)sessionTeam;
@@ -100,12 +100,12 @@ Called on a first-time connect
*/
void G_InitSessionData( gclient_t *client, char *userinfo )
{
- clientSession_t *sess;
- const char *value;
+ clientSession_t *sess;
+ const char *value;
- sess = &client->sess;
+ sess = &client->sess;
- // initial team determination
+ // initial team determination
value = Info_ValueForKey( userinfo, "team" );
if( value[ 0 ] == 's' )
{
@@ -114,18 +114,18 @@ void G_InitSessionData( gclient_t *client, char *userinfo )
}
else
{
- if( g_maxGameClients.integer > 0 &&
+ if( g_maxGameClients.integer > 0 &&
level.numNonSpectatorClients >= g_maxGameClients.integer )
sess->sessionTeam = TEAM_SPECTATOR;
else
sess->sessionTeam = TEAM_FREE;
}
- sess->spectatorState = SPECTATOR_FREE;
- sess->spectatorTime = level.time;
+ sess->spectatorState = SPECTATOR_FREE;
+ sess->spectatorTime = level.time;
sess->spectatorClient = -1;
- G_WriteClientSessionData( client );
+ G_WriteClientSessionData( client );
}
@@ -137,14 +137,14 @@ G_WriteSessionData
*/
void G_WriteSessionData( void )
{
- int i;
+ int i;
//TA: ?
- trap_Cvar_Set( "session", va( "%i", 0 ) );
+ trap_Cvar_Set( "session", va( "%i", 0 ) );
- for( i = 0 ; i < level.maxclients ; i++ )
+ for( i = 0 ; i < level.maxclients ; i++ )
{
- if( level.clients[ i ].pers.connected == CON_CONNECTED )
- G_WriteClientSessionData( &level.clients[ i ] );
- }
+ if( level.clients[ i ].pers.connected == CON_CONNECTED )
+ G_WriteClientSessionData( &level.clients[ i ] );
+ }
}