Xonotic
gamelog.qh File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

string GameLog_ProcessIP (string s)
 
void GameLogClose ()
 
void GameLogEcho (string s)
 
void GameLogInit ()
 

Variables

bool autocvar_sv_eventlog
 
bool autocvar_sv_eventlog_console
 
bool autocvar_sv_eventlog_files
 
int autocvar_sv_eventlog_files_counter
 
string autocvar_sv_eventlog_files_nameprefix
 
string autocvar_sv_eventlog_files_namesuffix
 
bool autocvar_sv_eventlog_files_timestamps
 
bool autocvar_sv_eventlog_ipv6_delimiter = false
 
float logfile
 
bool logfile_open
 

Function Documentation

◆ GameLog_ProcessIP()

string GameLog_ProcessIP ( string  s)

Definition at line 5 of file gamelog.qc.

References autocvar_sv_eventlog_ipv6_delimiter.

Referenced by ClientConnect().

6 {
8  return s;
9  return strreplace(":", "_", s);
10 }
bool autocvar_sv_eventlog_ipv6_delimiter
Definition: gamelog.qh:10
+ Here is the caller graph for this function:

◆ GameLogClose()

void GameLogClose ( )

Definition at line 48 of file gamelog.qc.

References fclose(), logfile, and logfile_open.

Referenced by NextLevel().

49 {
50  if (logfile_open && logfile >= 0)
51  {
52  fclose(logfile);
53  logfile = -1;
54  }
55 }
float logfile
Definition: gamelog.qh:13
bool logfile_open
Definition: gamelog.qh:12
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GameLogEcho()

void GameLogEcho ( string  s)

Definition at line 12 of file gamelog.qc.

References autocvar_sv_eventlog_console, autocvar_sv_eventlog_files, autocvar_sv_eventlog_files_counter, autocvar_sv_eventlog_files_nameprefix, autocvar_sv_eventlog_files_namesuffix, autocvar_sv_eventlog_files_timestamps, cvar_set(), dedicated_print(), FILE_APPEND, fopen(), fputs(), ftos(), itos, logfile, logfile_open, strcat(), strlen(), and substring().

Referenced by anticheat_report_to_eventlog(), ClientConnect(), ClientDisconnect(), ctf_EventLog(), cts_EventLog(), dom_EventLog(), DumpStats(), end_minigame(), invite_minigame(), ka_EventLog(), kh_Scores_Event(), LogDeath(), LogNB(), LogTeamChange(), MapVote_CheckRules_2(), MapVote_Finished(), MapVote_Suggest(), minigame_addplayer(), minigame_rmplayer(), MUTATOR_HOOKFUNCTION(), NextLevel(), PlayerInList(), PlayerPreThink(), race_EventLog(), ReadyRestart_force(), Say(), spawnfunc(), start_minigame(), StartFrame(), VoteCommand_call(), VoteCommand_master(), VoteSpam(), VoteStop(), and write_recordmarker().

13 {
15  {
16  if (!logfile_open)
17  {
18  logfile_open = true;
19  int matches = autocvar_sv_eventlog_files_counter + 1;
20  cvar_set("sv_eventlog_files_counter", itos(matches));
21  string fn = ftos(matches);
22  if (strlen(fn) < 8)
23  fn = strcat(substring("00000000", 0, 8 - strlen(fn)), fn);
25  logfile = fopen(fn, FILE_APPEND);
26  fputs(logfile, ":logversion:3\n");
27  }
28  if (logfile >= 0)
29  {
31  fputs(logfile, strcat(":time:", strftime(true, "%Y-%m-%d %H:%M:%S", "\n", s, "\n")));
32  else
33  fputs(logfile, strcat(s, "\n"));
34  }
35  }
37  {
38  dedicated_print(strcat(s, "\n"));
39  }
40 }
bool autocvar_sv_eventlog_files_timestamps
Definition: gamelog.qh:9
void dedicated_print(string input)
print(), but only print if the server is not local
Definition: main.qc:205
bool autocvar_sv_eventlog_files
Definition: gamelog.qh:5
const float FILE_APPEND
Definition: csprogsdefs.qc:232
float logfile
Definition: gamelog.qh:13
#define itos(i)
Definition: int.qh:6
bool autocvar_sv_eventlog_console
Definition: gamelog.qh:4
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
bool logfile_open
Definition: gamelog.qh:12
string autocvar_sv_eventlog_files_namesuffix
Definition: gamelog.qh:8
int autocvar_sv_eventlog_files_counter
Definition: gamelog.qh:6
string autocvar_sv_eventlog_files_nameprefix
Definition: gamelog.qh:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GameLogInit()

void GameLogInit ( )

Definition at line 42 of file gamelog.qc.

References logfile_open.

Referenced by spawnfunc().

43 {
44  logfile_open = false;
45  // will be opened later
46 }
bool logfile_open
Definition: gamelog.qh:12
+ Here is the caller graph for this function:

Variable Documentation

◆ autocvar_sv_eventlog

◆ autocvar_sv_eventlog_console

bool autocvar_sv_eventlog_console

Definition at line 4 of file gamelog.qh.

Referenced by DumpStats(), and GameLogEcho().

◆ autocvar_sv_eventlog_files

bool autocvar_sv_eventlog_files

Definition at line 5 of file gamelog.qh.

Referenced by GameLogEcho().

◆ autocvar_sv_eventlog_files_counter

int autocvar_sv_eventlog_files_counter

Definition at line 6 of file gamelog.qh.

Referenced by GameLogEcho(), and spawnfunc().

◆ autocvar_sv_eventlog_files_nameprefix

string autocvar_sv_eventlog_files_nameprefix

Definition at line 7 of file gamelog.qh.

Referenced by GameLogEcho().

◆ autocvar_sv_eventlog_files_namesuffix

string autocvar_sv_eventlog_files_namesuffix

Definition at line 8 of file gamelog.qh.

Referenced by GameLogEcho().

◆ autocvar_sv_eventlog_files_timestamps

bool autocvar_sv_eventlog_files_timestamps

Definition at line 9 of file gamelog.qh.

Referenced by GameLogEcho().

◆ autocvar_sv_eventlog_ipv6_delimiter

bool autocvar_sv_eventlog_ipv6_delimiter = false

Definition at line 10 of file gamelog.qh.

Referenced by GameLog_ProcessIP().

◆ logfile

float logfile

Definition at line 13 of file gamelog.qh.

Referenced by GameLogClose(), and GameLogEcho().

◆ logfile_open

bool logfile_open

Definition at line 12 of file gamelog.qh.

Referenced by GameLogClose(), GameLogEcho(), and GameLogInit().