Port the server side of HTTP downloading from q2dos.

This commit is contained in:
Yamagi Burmeister 2018-12-18 19:30:24 +01:00
parent 5b44c9f3b4
commit 537e6d8de3
4 changed files with 12 additions and 1 deletions

View file

@ -167,6 +167,7 @@ static qboolean CL_RemoveFromQueue(dlqueue_t *entry)
cur = cur->next;
}
return false;
}

View file

@ -186,6 +186,7 @@ extern cvar_t *sv_noreload; /* don't reload level state when ree
extern cvar_t *sv_airaccelerate; /* don't reload level state when reentering */
/* development tool */
extern cvar_t *sv_enforcetime;
extern cvar_t *sv_downloadserver; /* Download server. */
extern client_t *sv_client;
extern edict_t *sv_player;

View file

@ -303,7 +303,14 @@ gotnewcl:
SV_UserinfoChanged(newcl);
/* send the connect packet to the client */
Netchan_OutOfBandPrint(NS_SERVER, adr, "client_connect");
if (sv_downloadserver->string[0])
{
Netchan_OutOfBandPrint(NS_SERVER, adr, "client_connect dlserver=%s", sv_downloadserver->string);
}
else
{
Netchan_OutOfBandPrint(NS_SERVER, adr, "client_connect");
}
Netchan_Setup(NS_SERVER, &newcl->netchan, adr, qport);

View file

@ -50,6 +50,7 @@ cvar_t *sv_showclamp;
cvar_t *hostname;
cvar_t *public_server; /* should heartbeats be sent */
cvar_t *sv_entfile; /* External entity files. */
cvar_t *sv_downloadserver; /* Download server. */
void Master_Shutdown(void);
void SV_ConnectionlessPacket(void);
@ -603,6 +604,7 @@ SV_Init(void)
allow_download_models = Cvar_Get("allow_download_models", "1", CVAR_ARCHIVE);
allow_download_sounds = Cvar_Get("allow_download_sounds", "1", CVAR_ARCHIVE);
allow_download_maps = Cvar_Get("allow_download_maps", "1", CVAR_ARCHIVE);
sv_downloadserver = Cvar_Get ("sv_downloadserver", "", 0);
sv_noreload = Cvar_Get("sv_noreload", "0", 0);