X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmiscfunctions.qc;h=84901fa32273fd54b7cf7640225ce2cba2a5b8f5;hb=969dc49d01d650a812706aba16c765af488605d0;hp=6e2fe4b16e5f316db4960e0d66bdd0078a21822c;hpb=717defe5e02506bb5c857025d71fb605d6eb8c55;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 6e2fe4b16..84901fa32 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -4,12 +4,14 @@ #include "command/common.qh" #include "constants.qh" #include "g_hook.qh" +#include "g_world.qh" +#include #include "ipban.qh" +#include #include -#include "../common/t_items.qh" #include "mapvoting.qh" #include "resources.qh" -#include "items.qh" +#include #include "player.qh" #include "weapons/accuracy.qh" #include "weapons/csqcprojectile.qh" @@ -24,6 +26,7 @@ #include "../common/playerstats.qh" #include "../common/teams.qh" #include "../common/mapobjects/subs.qh" +#include #include "../common/util.qh" #include "../common/turrets/sv_turrets.qh" #include @@ -84,61 +87,6 @@ void dedicated_print(string input) if (server_is_dedicated) print(input); } -string GameLog_ProcessIP(string s) -{ - if(!autocvar_sv_eventlog_ipv6_delimiter) - return s; - return strreplace(":", "_", s); -} - -void GameLogEcho(string s) -{ - string fn; - int matches; - - if (autocvar_sv_eventlog_files) - { - if (!logfile_open) - { - logfile_open = true; - matches = autocvar_sv_eventlog_files_counter + 1; - cvar_set("sv_eventlog_files_counter", itos(matches)); - fn = ftos(matches); - if (strlen(fn) < 8) - fn = strcat(substring("00000000", 0, 8 - strlen(fn)), fn); - fn = strcat(autocvar_sv_eventlog_files_nameprefix, fn, autocvar_sv_eventlog_files_namesuffix); - logfile = fopen(fn, FILE_APPEND); - fputs(logfile, ":logversion:3\n"); - } - if (logfile >= 0) - { - if (autocvar_sv_eventlog_files_timestamps) - fputs(logfile, strcat(":time:", strftime(true, "%Y-%m-%d %H:%M:%S", "\n", s, "\n"))); - else - fputs(logfile, strcat(s, "\n")); - } - } - if (autocvar_sv_eventlog_console) - { - dedicated_print(strcat(s, "\n")); - } -} - -void GameLogInit() -{ - logfile_open = 0; - // will be opened later -} - -void GameLogClose() -{ - if (logfile_open && logfile >= 0) - { - fclose(logfile); - logfile = -1; - } -} - entity findnearest(vector point, bool checkitems, vector axismod) { vector dist; @@ -719,7 +667,7 @@ void readplayerstartcvars() for (int j = 0; j < t; ++j) { s = argv(j); - Weapon wep = Weapons_fromstr(s); + Weapon wep = Weapon_from_name(s); if(wep != WEP_Null) { g_weaponarena_weapons |= (wep.m_wepset);