2 #include <server/intermission.qh> // GetGametype(), GetMapname()
3 #include <server/weapons/tracing.qh> // autocvar_g_norecoil
4 #include <server/world.qh> // matchid
5 #include <server/main.qh>
7 string GameLog_ProcessIP(string s)
9 if(!autocvar_sv_eventlog_ipv6_delimiter)
11 return strreplace(":", "_", s);
14 void GameLogEcho(string s)
16 if (autocvar_sv_eventlog_files)
21 int matches = autocvar_sv_eventlog_files_counter + 1;
22 cvar_set("sv_eventlog_files_counter", itos(matches));
23 string fn = ftos(matches);
25 fn = strcat(substring("00000000", 0, 8 - strlen(fn)), fn);
26 fn = strcat(autocvar_sv_eventlog_files_nameprefix, fn, autocvar_sv_eventlog_files_namesuffix);
27 logfile = fopen(fn, FILE_APPEND);
28 fputs(logfile, ":logversion:3\n");
32 if (autocvar_sv_eventlog_files_timestamps)
33 fputs(logfile, strcat(":time:", strftime(true, "%Y-%m-%d %H:%M:%S", "\n", s, "\n")));
35 fputs(logfile, strcat(s, "\n"));
38 if (autocvar_sv_eventlog_console)
40 dedicated_print(strcat(s, "\n"));
46 GameLogEcho(strcat(":gamestart:", GetGametype(), "_", GetMapname(), ":", matchid));
47 string s = ":gameinfo:mutators:LIST";
49 MUTATOR_CALLHOOK(BuildMutatorsString, s);
50 s = M_ARGV(0, string);
52 // initialiation stuff, not good in the mutator system
53 if(!autocvar_g_use_ammunition)
54 s = strcat(s, ":no_use_ammunition");
56 // initialiation stuff, not good in the mutator system
57 if(autocvar_g_pickup_items == 0)
58 s = strcat(s, ":no_pickup_items");
59 if(autocvar_g_pickup_items > 0)
60 s = strcat(s, ":pickup_items");
62 // initialiation stuff, not good in the mutator system
63 if(autocvar_g_weaponarena != "0")
64 s = strcat(s, ":", autocvar_g_weaponarena, " arena");
66 // TODO to mutator system
67 if(autocvar_g_norecoil)
68 s = strcat(s, ":norecoil");
71 GameLogEcho(":gameinfo:end");
76 if (logfile_open && logfile >= 0)