Skip to content

Commit

Permalink
Merge pull request #131 from QW-Group/demo-record-add-epoch
Browse files Browse the repository at this point in the history
DEMO: add epoch time to fullserverinfo
  • Loading branch information
ciscon authored Mar 5, 2024
2 parents 1c1b778 + 0006b95 commit 2f4e915
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sv_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,7 @@ void SV_MVD_SendInitialGamestate(mvddest_t* dest)
unsigned char buf_data[MAX_MSGLEN];
unsigned int n;
char* s, info[MAX_EXT_INFO_STRING];
char epoch[20];

client_t* player;
edict_t* ent;
Expand Down Expand Up @@ -1269,6 +1270,10 @@ void SV_MVD_SendInitialGamestate(mvddest_t* dest)
MSG_WriteByte (&buf, svc_cdtrack);
MSG_WriteByte (&buf, 0); // none in demos

//set start time
sprintf(epoch,"%ld", (unsigned long)time(NULL));
Info_SetValueForKey (svs.info, "epoch", epoch, MAX_SERVERINFO_STRING);

// send server info string
MSG_WriteByte (&buf, svc_stufftext);
MSG_WriteString (&buf, va("fullserverinfo \"%s\"\n", svs.info) );
Expand Down

0 comments on commit 2f4e915

Please sign in to comment.