playdemo now accepts urls. :)

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1678 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-12-06 03:09:46 +00:00
parent c73948abf9
commit 2a405f98e7
1 changed files with 18 additions and 0 deletions

View File

@ -1049,6 +1049,15 @@ void CL_ReRecord_f (void)
CL_BeginServerReconnect();
}
#ifdef WEBCLIENT
void CL_PlayDownloadedDemo(char *name, qboolean success)
{
if (success == false)
Con_Printf("Failed to download %s\n", name);
else
Cbuf_AddText(va("playdemo %s\n", name), RESTRICT_LOCAL);
}
#endif
/*
====================
@ -1072,6 +1081,15 @@ void CL_PlayDemo_f (void)
return;
}
#ifdef WEBCLIENT
if (!strncmp(Cmd_Argv(1), "ftp://", 6) || !strncmp(Cmd_Argv(1), "http://", 7))
{
if (Cmd_ExecLevel == RESTRICT_LOCAL)
HTTP_CL_Get(Cmd_Argv(1), COM_SkipPath(Cmd_Argv(1)), CL_PlayDownloadedDemo);
return;
}
#endif
//
// disconnect from server
//