/* * G_SnapClients */ void G_SnapClients( void ) { int i; edict_t *ent; // calc the player views now that all pushing and damage has been added for( i = 0; i < gs.maxclients; i++ ) { ent = game.edicts + 1 + i; if( !ent->r.inuse || !ent->r.client ) continue; G_Client_InactivityRemove( ent->r.client ); G_ClientEndSnapFrame( ent ); } G_EndServerFrames_UpdateChaseCam(); }
/* * ClientBegin * called when a client has finished connecting, and is ready * to be placed into the game. This will happen every level load. */ void ClientBegin( edict_t *ent ) { gclient_t *client = ent->r.client; const char *mm_login; memset( &client->ucmd, 0, sizeof( client->ucmd ) ); memset( &client->level, 0, sizeof( client->level ) ); client->level.timeStamp = level.time; G_Client_UpdateActivity( client ); // activity detected client->team = TEAM_SPECTATOR; G_ClientRespawn( ent, true ); // respawn as ghost ent->movetype = MOVETYPE_NOCLIP; // allow freefly G_UpdatePlayerMatchMsg( ent ); mm_login = Info_ValueForKey( client->userinfo, "cl_mm_login" ); if( mm_login && *mm_login && client->mm_session > 0 ) { G_PrintMsg( NULL, "%s" S_COLOR_WHITE " (" S_COLOR_YELLOW "%s" S_COLOR_WHITE ") entered the game\n", client->netname, mm_login ); } else { if( !level.gametype.disableObituaries || !(ent->r.svflags & SVF_FAKECLIENT ) ) G_PrintMsg( NULL, "%s" S_COLOR_WHITE " entered the game\n", client->netname ); } client->level.respawnCount = 0; // clear respawncount client->connecting = false; // schedule the next scoreboard update client->level.scoreboard_time = game.realtime + scoreboardInterval - ( game.realtime%scoreboardInterval ); AI_EnemyAdded( ent ); G_ClientEndSnapFrame( ent ); // make sure all view stuff is valid // let the gametype scripts now this client just entered the level G_Gametype_ScoreEvent( client, "enterGame", NULL ); }