Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
gamelog.qc File Reference
Include dependency graph for gamelog.qc:
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 ()

Function Documentation

◆ GameLog_ProcessIP()

string GameLog_ProcessIP ( string s)

Definition at line 8 of file gamelog.qc.

9{
11 return s;
12 return strreplace(":", "_", s);
13}
bool autocvar_sv_eventlog_ipv6_delimiter
Definition gamelog.qh:10

References autocvar_sv_eventlog_ipv6_delimiter.

Referenced by ClientConnect().

◆ GameLogClose()

void GameLogClose ( )

Definition at line 75 of file gamelog.qc.

76{
77 if (logfile_open && logfile >= 0)
78 {
80 logfile = -1;
81 }
82}
bool logfile_open
Definition gamelog.qh:12
float logfile
Definition gamelog.qh:13
void fclose(float fhandle)

References fclose(), logfile, and logfile_open.

Referenced by NextLevel().

◆ GameLogEcho()

void GameLogEcho ( string s)

Definition at line 15 of file gamelog.qc.

16{
18 {
19 if (!logfile_open)
20 {
21 logfile_open = true;
22 int matches = autocvar_sv_eventlog_files_counter + 1;
23 cvar_set("sv_eventlog_files_counter", itos(matches));
24 string fn = ftos(matches);
25 if (strlen(fn) < 8)
26 fn = strcat(substring("00000000", 0, 8 - strlen(fn)), fn);
29 fputs(logfile, ":logversion:3\n");
30 }
31 if (logfile >= 0)
32 {
34 fputs(logfile, strcat(":time:", strftime(true, "%Y-%m-%d %H:%M:%S", "\n", s, "\n")));
35 else
36 fputs(logfile, strcat(s, "\n"));
37 }
38 }
40 {
41 dedicated_print(strcat(s, "\n"));
42 }
43}
const float FILE_APPEND
#define strlen
bool autocvar_sv_eventlog_files
Definition gamelog.qh:5
string autocvar_sv_eventlog_files_namesuffix
Definition gamelog.qh:8
bool autocvar_sv_eventlog_files_timestamps
Definition gamelog.qh:9
int autocvar_sv_eventlog_files_counter
Definition gamelog.qh:6
bool autocvar_sv_eventlog_console
Definition gamelog.qh:4
string autocvar_sv_eventlog_files_nameprefix
Definition gamelog.qh:7
#define itos(i)
Definition int.qh:6
void cvar_set(string name, string value)
void fputs(float fhandle, string s)
string substring(string s, float start, float length)
float fopen(string filename, float mode)
string ftos(float f)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void dedicated_print(string input)
print(), but only print if the server is not local
Definition main.qc:233

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(), GameLogInit(), invite_minigame(), ka_EventLog(), kh_Scores_Event(), LogDeath(), LogNB(), LogTeamChange(), MapVote_CheckRules_decide(), MapVote_Finished(), MapVote_Suggest(), minigame_addplayer(), minigame_rmplayer(), MUTATOR_HOOKFUNCTION(), NextLevel(), PlayerFrame(), race_EventLog(), ReadyRestart_force(), Say(), start_minigame(), StartFrame(), tka_EventLog(), VoteCommand_call(), VoteCommand_master(), VoteSpam(), VoteStop(), and write_recordmarker().

◆ GameLogInit()

void GameLogInit ( )

Definition at line 45 of file gamelog.qc.

46{
47 GameLogEcho(strcat(":gamestart:", GetGametype(), "_", GetMapname(), ":", matchid));
48 string s = ":gameinfo:mutators:LIST";
49
50 MUTATOR_CALLHOOK(BuildMutatorsString, s);
51 s = M_ARGV(0, string);
52
53 // initialiation stuff, not good in the mutator system
55 s = strcat(s, ":no_use_ammunition");
56
57 // initialiation stuff, not good in the mutator system
59 s = strcat(s, ":no_pickup_items");
61 s = strcat(s, ":pickup_items");
62
63 // initialiation stuff, not good in the mutator system
64 if(autocvar_g_weaponarena != "0")
65 s = strcat(s, ":", autocvar_g_weaponarena, " arena");
66
67 // TODO to mutator system
69 s = strcat(s, ":norecoil");
70
71 GameLogEcho(s);
72 GameLogEcho(":gameinfo:end");
73}
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
#define M_ARGV(x, type)
Definition events.qh:17
void GameLogEcho(string s)
Definition gamelog.qc:15
string GetMapname()
string GetGametype()
int autocvar_g_pickup_items
Definition items.qh:10
bool autocvar_g_norecoil
Definition tracing.qh:16
bool autocvar_g_use_ammunition
Definition world.qh:7
string matchid
Definition world.qh:63
#define autocvar_g_weaponarena
Definition world.qh:12

References autocvar_g_norecoil, autocvar_g_pickup_items, autocvar_g_use_ammunition, autocvar_g_weaponarena, GameLogEcho(), GetGametype(), GetMapname(), M_ARGV, matchid, MUTATOR_CALLHOOK, and strcat().

Referenced by spawnfunc().