Added record/stop commands, allowed same-behaviour alternatives to the 'file' command, and made status show port numbers.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1371 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-09-24 21:36:06 +00:00
parent 60eac6b894
commit 45ca3e5401
1 changed files with 34 additions and 3 deletions

View File

@ -300,9 +300,19 @@ char *Rcon_Command(sv_t *qtv, char *command, char *buffer, int sizeofbuffer, qbo
strcat(buffer, "Waiting for gamestate\n");
if (qtv->listenmvd != INVALID_SOCKET)
strcat(buffer, "Listening for proxies\n");
{
strcat(buffer, "Listening for proxies (");
sprintf(arg[0], "%i", qtv->tcplistenportnum);
strcat(buffer, arg[0]);
strcat(buffer, ")\n");
}
if (qtv->qwdsocket != INVALID_SOCKET)
strcat(buffer, "Listening for qwcl\n");
{
strcat(buffer, "Listening for qwcl (");
sprintf(arg[0], "%i", qtv->qwlistenportnum);
strcat(buffer, arg[0]);
strcat(buffer, ")\n");
}
if (qtv->bsp)
{
@ -367,7 +377,7 @@ char *Rcon_Command(sv_t *qtv, char *command, char *buffer, int sizeofbuffer, qbo
else
return "Failed (will keep trying)\n";
}
else if (!strcmp(arg[0], "file"))
else if (!strcmp(arg[0], "file") || !strcmp(arg[0], "play") || !strcmp(arg[0], "playdemo"))
{
if (!*arg[1])
return "file requires a filename on the proxy's machine\n";
@ -383,6 +393,27 @@ char *Rcon_Command(sv_t *qtv, char *command, char *buffer, int sizeofbuffer, qbo
else
return "Failed (will keep trying)\n";
}
else if (!strcmp(arg[0], "record"))
{
if (!*arg[1])
return "record requires a filename on the proxy's machine\n";
if (!localcommand)
if (*arg[1] == '\\' || *arg[1] == '/' || strstr(arg[1], "..") || arg[1][1] == ':')
return "Absolute paths are prohibited.\n";
if (Net_FileProxy(qtv, arg[1]))
return "Recording to disk\n";
else
return "Failed to open file\n";
}
else if (!strcmp(arg[0], "stop"))
{
if (Net_StopFileProxy(qtv))
return "stopped\n";
else
return "not recording to disk\n";
}
else if (!strcmp(arg[0], "help"))
{
return "FTEQTV proxy\nValid commands: connect, file, status, option\n";