1
0
Fork 0
forked from fte/fteqw

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:
Spoike 2004-11-17 17:42:28 +00:00
parent 7da6c1188e
commit 12de27385e

View file

@ -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");
}
/*
===========