mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-29 12:40:40 +00:00
Don't send httpsource in SERVERINFO if join password is set
This commit is contained in:
parent
b25acfa782
commit
abd15288b4
1 changed files with 49 additions and 44 deletions
|
@ -1471,15 +1471,18 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
||||||
netbuffer->u.serverinfo.actnum = 0; //mapheaderinfo[gamemap-1]->actnum
|
netbuffer->u.serverinfo.actnum = 0; //mapheaderinfo[gamemap-1]->actnum
|
||||||
|
|
||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
mirror_length = strlen(httpurl);
|
if (D_IsJoinPasswordOn())
|
||||||
if (mirror_length > MAX_MIRROR_LENGTH)
|
{
|
||||||
mirror_length = MAX_MIRROR_LENGTH;
|
mirror_length = strlen(httpurl);
|
||||||
|
if (mirror_length > MAX_MIRROR_LENGTH)
|
||||||
|
mirror_length = MAX_MIRROR_LENGTH;
|
||||||
|
|
||||||
if (snprintf(netbuffer->u.serverinfo.httpsource, mirror_length+1, "%s", httpurl) < 0)
|
if (snprintf(netbuffer->u.serverinfo.httpsource, mirror_length+1, "%s", httpurl) < 0)
|
||||||
// If there's an encoding error, send nothing, we accept that the above may be truncated
|
// If there's an encoding error, send nothing, we accept that the above may be truncated
|
||||||
strncpy(netbuffer->u.serverinfo.httpsource, "", mirror_length);
|
strncpy(netbuffer->u.serverinfo.httpsource, "", mirror_length);
|
||||||
|
|
||||||
netbuffer->u.serverinfo.httpsource[MAX_MIRROR_LENGTH-1] = '\0';
|
netbuffer->u.serverinfo.httpsource[MAX_MIRROR_LENGTH-1] = '\0';
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
p = PutFileNeeded(0);
|
p = PutFileNeeded(0);
|
||||||
|
@ -2042,16 +2045,6 @@ static boolean CL_ServerConnectionSearchTicker(boolean viams, tic_t *asksent)
|
||||||
|
|
||||||
if (client)
|
if (client)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_CURL
|
|
||||||
if (serverlist[i].info.httpsource[0])
|
|
||||||
strncpy(http_source, serverlist[i].info.httpsource, MAX_MIRROR_LENGTH);
|
|
||||||
else
|
|
||||||
http_source[0] = '\0';
|
|
||||||
#else
|
|
||||||
if (serverlist[i].info.httpsource[0])
|
|
||||||
CONS_Printf("We received a http url from the server, however it will not be used as this build lacks curl support (%s)\n", serverlist[i].info.httpsource);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
D_ParseFileneeded(serverlist[i].info.fileneedednum, serverlist[i].info.fileneeded, 0);
|
D_ParseFileneeded(serverlist[i].info.fileneedednum, serverlist[i].info.fileneeded, 0);
|
||||||
if (serverlist[i].info.kartvars & SV_LOTSOFADDONS)
|
if (serverlist[i].info.kartvars & SV_LOTSOFADDONS)
|
||||||
{
|
{
|
||||||
|
@ -4161,40 +4154,52 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
||||||
|
|
||||||
SERVERONLY
|
SERVERONLY
|
||||||
|
|
||||||
#ifdef HAVE_CURL
|
if (netbuffer->u.filecfg.http_source[0] != '\0')
|
||||||
if (! curl_failedwebdownload &&
|
|
||||||
netbuffer->u.filecfg.http_source[0] != '\0'
|
|
||||||
){
|
|
||||||
strlcpy(http_source, netbuffer->u.filecfg.http_source,
|
|
||||||
MAX_MIRROR_LENGTH);
|
|
||||||
|
|
||||||
cl_mode = CL_PREPAREHTTPFILES;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
if (!CL_CheckDownloadable())
|
|
||||||
{
|
{
|
||||||
D_QuitNetGame();
|
netbuffer->u.filecfg.http_source[MAX_MIRROR_LENGTH-1] = '\0';
|
||||||
CL_Reset();
|
|
||||||
D_StartTitle();
|
#ifdef HAVE_CURL
|
||||||
M_StartMessage(M_GetText(
|
if (! curl_failedwebdownload)
|
||||||
"You cannot connect to this server\n"
|
{
|
||||||
"because you cannot download the files\n"
|
strncpy(http_source, netbuffer->u.filecfg.http_source,
|
||||||
"that you are missing from the server.\n\n"
|
sizeof http_source);
|
||||||
"See the console or log file for\n"
|
|
||||||
"more details.\n\n"
|
cl_mode = CL_PREPAREHTTPFILES;
|
||||||
"Press ESC\n"
|
}
|
||||||
), NULL, MM_NOTHING);
|
#else
|
||||||
break;
|
CONS_Printf("We received a http url from the server, however it will not be used as this build lacks curl support (%s)\n", netbuffer->u.filecfg.http_source);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cl_mode == CL_WAITDOWNLOADFILESRESPONSE)
|
||||||
|
{
|
||||||
|
if (CL_CheckDownloadable())
|
||||||
|
{
|
||||||
|
CONS_Printf("trying to download\n");
|
||||||
|
if (CL_SendRequestFile())
|
||||||
|
cl_mode = CL_DOWNLOADFILES;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
D_QuitNetGame();
|
||||||
|
CL_Reset();
|
||||||
|
D_StartTitle();
|
||||||
|
M_StartMessage(M_GetText(
|
||||||
|
"You cannot connect to this server\n"
|
||||||
|
"because you cannot download the files\n"
|
||||||
|
"that you are missing from the server.\n\n"
|
||||||
|
"See the console or log file for\n"
|
||||||
|
"more details.\n\n"
|
||||||
|
"Press ESC\n"
|
||||||
|
), NULL, MM_NOTHING);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cl_challengeattempted == 1) // Successful password noise.
|
if (cl_challengeattempted == 1) // Successful password noise.
|
||||||
S_StartSound(NULL, sfx_s221);
|
S_StartSound(NULL, sfx_s221);
|
||||||
|
|
||||||
cl_challengeattempted = 2;
|
cl_challengeattempted = 2;
|
||||||
CONS_Printf("trying to download\n");
|
|
||||||
if (cl_mode == CL_WAITDOWNLOADFILESRESPONSE && CL_SendRequestFile())
|
|
||||||
cl_mode = CL_DOWNLOADFILES;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PT_SERVERCFG: // Positive response of client join request
|
case PT_SERVERCFG: // Positive response of client join request
|
||||||
|
|
Loading…
Reference in a new issue