Skip to content

Commit

Permalink
Merge pull request #157 from WPMGPRoSToTeMa/master
Browse files Browse the repository at this point in the history
Added listipcfgfile cvar
  • Loading branch information
theAsmodai committed Feb 4, 2016
2 parents 2937589 + 6bbce69 commit 67a4fed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rehlds/engine/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@ extern cvar_t servercfgfile;
extern cvar_t lservercfgfile;
extern cvar_t logsdir;
extern cvar_t bannedcfgfile;
#ifdef REHLDS_FIXES
extern cvar_t listipcfgfile;
#endif

extern decalname_t sv_decalnames[MAX_BASE_DECALS];
extern int sv_decalnamecount;
Expand Down
10 changes: 10 additions & 0 deletions rehlds/engine/sv_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ cvar_t servercfgfile = { "servercfgfile", "server.cfg", 0, 0.0f, NULL };
cvar_t lservercfgfile = { "lservercfgfile", "listenserver.cfg", 0, 0.0f, NULL };
cvar_t logsdir = { "logsdir", "logs", 0, 0.0f, NULL };
cvar_t bannedcfgfile = { "bannedcfgfile", "banned.cfg", 0, 0.0f, NULL };
#ifdef REHLDS_FIXES
cvar_t listipcfgfile = { "listipcfgfile", "listip.cfg", 0, 0.0f, nullptr };
#endif

int g_userid = 1;

Expand Down Expand Up @@ -6499,7 +6502,11 @@ void SV_ListIP_f(void)
void SV_WriteIP_f(void)
{
char name[MAX_PATH];
#ifdef REHLDS_FIXES
Q_snprintf(name, MAX_PATH, "%s", listipcfgfile.string);
#else
Q_snprintf(name, MAX_PATH, "listip.cfg");
#endif
Con_Printf("Writing %s.\n", name);

FILE *f = FS_Open(name, "wb");
Expand Down Expand Up @@ -7204,6 +7211,9 @@ void SV_Init(void)
Cvar_RegisterVariable(&lservercfgfile);
Cvar_RegisterVariable(&logsdir);
Cvar_RegisterVariable(&bannedcfgfile);
#ifdef REHLDS_FIXES
Cvar_RegisterVariable(&listipcfgfile);
#endif
Cvar_RegisterVariable(&sv_rcon_minfailures);
Cvar_RegisterVariable(&sv_rcon_maxfailures);
Cvar_RegisterVariable(&sv_rcon_minfailuretime);
Expand Down

0 comments on commit 67a4fed

Please sign in to comment.