Open dp's download protocol to more client types (for qss's benefit). Work around some DP bugs.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6072 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-10-05 05:05:56 +00:00
parent 0218f2dcf2
commit 8ae9fe1141
2 changed files with 15 additions and 14 deletions

View file

@ -3313,6 +3313,7 @@ void SVC_DirectConnect(int expectedreliablesequence)
{"NEHAHRABJP2", 0},
{"NEHAHRABJP3", 1u<<SCP_BJP3},
{"DP7DP6", (1u<<SCP_DARKPLACES7)|(1u<<SCP_DARKPLACES6)}, //stupid shitty buggy crappy client
{"DP8DP7", /*(1u<<SCP_DARKPLACES8)|*/(1u<<SCP_DARKPLACES7)}, //stupid shitty buggy crappy client
};
int p;

View file

@ -759,8 +759,8 @@ void SVNQ_New_f (void)
}
else
{
MSG_WriteByte (&host_client->netchan.message, svc_stufftext);
MSG_WriteString (&host_client->netchan.message, "csqc_progcrc \"\"\n");
// MSG_WriteByte (&host_client->netchan.message, svc_stufftext);
// MSG_WriteString (&host_client->netchan.message, "csqc_progcrc \"\"\n");
}
}
else if (allow_download.value && (protext1||protext2))
@ -2459,12 +2459,12 @@ void SV_DarkPlacesDownloadChunk(client_t *cl, sizebuf_t *msg)
void SVDP_StartDownload_f(void)
{
if (host_client->protocol != SCP_DARKPLACES7)
return;
// if (host_client->protocol != SCP_DARKPLACES7)
// return;
if (!host_client->download)
return;
host_client->downloadstarted = true;
host_client->downloadacked = true;
host_client->downloadacked = 0;
}
void SV_DarkPlacesDownloadAck(client_t *cl)
@ -2504,7 +2504,7 @@ void SV_DarkPlacesDownloadAck(client_t *cl)
pos += csize;
}
s = va("\ncl_downloadfinished %u %i \"%s\"\n", (unsigned int)host_client->downloadsize, hashfunc_terminate_uint(hfunc, hctx), "");
s = va("\ncl_downloadfinished %u %i \"%s\"\n", (unsigned int)host_client->downloadsize, hashfunc_terminate_uint(hfunc, hctx), host_client->downloadfn);
ClientReliableWrite_Begin (cl, svc_stufftext, 2+strlen(s));
ClientReliableWrite_String(cl, s);
@ -3659,11 +3659,11 @@ void SV_BeginDownload_f(void)
flocation_t loc;
int result;
if (ISNQCLIENT(host_client) && host_client->protocol != SCP_DARKPLACES7)
/*if (ISNQCLIENT(host_client) && host_client->protocol != SCP_DARKPLACES7)
{
SV_PrintToClient(host_client, PRINT_HIGH, "Your client isn't meant to support downloads\n");
return;
}
}*/
/*
if (ISQWCLIENT(host_client) && !strcmp(name, "ezquake-security.dll"))
@ -3767,17 +3767,17 @@ void SV_BeginDownload_f(void)
case DLERR_FILENOTFOUND:
default:
result = DLERR_FILENOTFOUND;
error = "Download could not be found\n";
error = "Download %s could not be found\n";
break;
case DLERR_UNKNOWN:
error = "Filesystem error\n";
error = "Download %s: Filesystem error\n";
break;
case DLERR_PERMISSIONS:
error = "Download permission denied\n";
error = "Download %s: Permission denied\n";
break;
case DLERR_REDIRECTFILE:
result = DLERR_PERMISSIONS;
error = "Client doesn't support file redirection\n";
error = "Client doesn't support file redirection for %s\n";
break;
case DLERR_REDIRECTPACK:
result = DLERR_PERMISSIONS;
@ -3796,14 +3796,14 @@ void SV_BeginDownload_f(void)
#endif
if (ISNQCLIENT(host_client))
{ //dp's download protocol
SV_PrintToClient(host_client, PRINT_HIGH, error);
SV_PrintToClient(host_client, PRINT_HIGH, va(error, name));
ClientReliableWrite_Begin (host_client, svc_stufftext, 2+12);
ClientReliableWrite_String (host_client, "\nstopdownload\n");
}
else
{
SV_PrintToClient(host_client, PRINT_HIGH, error);
SV_PrintToClient(host_client, PRINT_HIGH, va(error, name));
ClientReliableWrite_Begin (host_client, ISQ2CLIENT(host_client)?svcq2_download:svc_download, 4);
ClientReliableWrite_Short (host_client, -1);