localinfo/serverinfo savings
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@442 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
7da6c1188e
commit
12de27385e
1 changed files with 31 additions and 0 deletions
|
@ -1157,6 +1157,37 @@ void SV_Localinfo_f (void)
|
|||
PR_LocalInfoChanged(Cmd_Argv(1), old, Cmd_Argv(2));
|
||||
}
|
||||
|
||||
void SV_SaveInfo(FILE *f, char *info, char *commandname)
|
||||
{
|
||||
char *command;
|
||||
char *value;
|
||||
|
||||
while(*info == '\\')
|
||||
{
|
||||
command = info+1;
|
||||
value = strchr(command, '\\');
|
||||
info = strchr(value+1, '\\');
|
||||
if (!*info) //eot..
|
||||
info = value+strlen(value);
|
||||
|
||||
if (*command == '*') //unsettable, so don't write it for later setting.
|
||||
continue;
|
||||
|
||||
fprintf(f, "%s ");
|
||||
fwrite(commandname, strlen(commandname), 1, f);
|
||||
fwrite(" ", 1, 1, f);
|
||||
fwrite(command, value-command, 1, f);
|
||||
fwrite(" ", 1, 1, f);
|
||||
fwrite(value, info-value, 1, f);
|
||||
fwrite("\n", 1, 1, f);
|
||||
}
|
||||
}
|
||||
|
||||
void SV_SaveInfos(FILE *f)
|
||||
{
|
||||
SV_SaveInfo(f, svs.info, "serverinfo");
|
||||
SV_SaveInfo(f, localinfo, "localinfo");
|
||||
}
|
||||
|
||||
/*
|
||||
===========
|
||||
|
|
Loading…
Reference in a new issue