Skip to content

Commit

Permalink
Merged patch by TheDoctor: Support auto-demo-recording on server side
Browse files Browse the repository at this point in the history
git-svn-id: https://smokinguns.svn.sourceforge.net/svnroot/smokinguns/trunk@666 07eb42f0-b032-4355-afd3-42b1f3832223
  • Loading branch information
sg_tequila committed Dec 30, 2012
1 parent b5043d7 commit 52b428c
Show file tree
Hide file tree
Showing 7 changed files with 466 additions and 33 deletions.
8 changes: 6 additions & 2 deletions code/game/g_main.c
Expand Up @@ -2,7 +2,7 @@
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
Copyright (C) 2000-2003 Iron Claw Interactive
Copyright (C) 2005-2010 Smokin' Guns
Copyright (C) 2005-2012 Smokin' Guns
This file is part of Smokin' Guns.
Expand Down Expand Up @@ -1708,6 +1708,7 @@ Append information about this game to the log file
void LogExit( const char *string ) {
int i, numSorted;
gclient_t *cl;
qtime_t q;
#ifndef SMOKINGUNS
qboolean won = qtrue;
#endif
Expand All @@ -1730,6 +1731,8 @@ void LogExit( const char *string ) {
level.teamScores[TEAM_RED], level.teamScores[TEAM_BLUE] );
}

trap_RealTime(&q);

for (i=0 ; i < numSorted ; i++) {
int ping;

Expand All @@ -1744,7 +1747,8 @@ void LogExit( const char *string ) {

ping = cl->ps.ping < 999 ? cl->ps.ping : 999;

G_LogPrintf( "score: %i ping: %i client: %i %s\n", cl->ps.persistant[PERS_SCORE], ping, level.sortedClients[i], cl->pers.netname );
// TheDoctor: patch demo: extended score log entry for demo recording
G_LogPrintf( "score: %i ping: %i client: %i date: %s name: %s\n", cl->ps.persistant[PERS_SCORE], ping, level.sortedClients[i], va("%02i.%02i.%04i %02i:%02i", q.tm_mday, q.tm_mon+1, 1900+q.tm_year,q.tm_hour,q.tm_min), cl->pers.netname );
#ifndef SMOKINGUNS
if (g_singlePlayer.integer && g_gametype.integer == GT_TOURNAMENT) {
if (g_entities[cl - level.clients].r.svFlags & SVF_BOT && cl->ps.persistant[PERS_RANK] == 0) {
Expand Down
14 changes: 13 additions & 1 deletion code/server/server.h
Expand Up @@ -146,6 +146,14 @@ typedef struct client_s {
sharedEntity_t *gentity; // SV_GentityNum(clientnum)
char name[MAX_NAME_LENGTH]; // extracted from userinfo, high bits masked

// demo information
char demoName[MAX_QPATH];
qboolean savedemo;
qboolean demorecording;
qboolean demowaiting; // don't record until a non-delta message is received
fileHandle_t demofile;
clientSnapshot_t *olddemoframe;

// cullentities
int tracetimer[MAX_GENTITIES];
vec3_t lasttrace[MAX_GENTITIES];
Expand Down Expand Up @@ -281,6 +289,7 @@ extern cvar_t *sv_floodProtect;
extern cvar_t *sv_lanForceRate;
extern cvar_t *sv_strictAuth;
extern cvar_t *sv_banFile;
extern cvar_t *sv_autorecord;
extern cvar_t *sv_antiwallhack;
extern cvar_t *sv_heartbeat;
extern cvar_t *sv_flatline;
Expand Down Expand Up @@ -356,12 +365,15 @@ void SV_WriteVoipToClient( client_t *cl, msg_t *msg );
// sv_ccmds.c
//
void SV_Heartbeat_f( void );
void SVCL_WriteDemoMessage( client_t *cl, msg_t *msg, int headerBytes );
void CL_Record( client_t *cl, char *s );
void CL_StopRecord( client_t *cl );

//
// sv_snapshot.c
//
void SV_AddServerCommand( client_t *client, const char *cmd );
void SV_UpdateServerCommandsToClient( client_t *client, msg_t *msg );
void SV_UpdateServerCommandsToClient( client_t *client, msg_t *msg, msg_t *msg_demo );
void SV_WriteFrameToClient (client_t *client, msg_t *msg);
void SV_SendMessageToClient( msg_t *msg, client_t *client );
void SV_SendClientMessages( void );
Expand Down

0 comments on commit 52b428c

Please sign in to comment.