mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Partial implementation of fix for Got_RequestAddfilecmd (the other half - the limitation on the size of the filesneeded section of the serverinfo packet - will be applied in internal.)
This commit is contained in:
parent
2aa1215716
commit
5c302d7ffc
1 changed files with 9 additions and 3 deletions
|
@ -3078,6 +3078,7 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
||||||
filestatus_t ncs = FS_NOTFOUND;
|
filestatus_t ncs = FS_NOTFOUND;
|
||||||
UINT8 md5sum[16];
|
UINT8 md5sum[16];
|
||||||
boolean kick = false;
|
boolean kick = false;
|
||||||
|
boolean toomany = false;
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
READSTRINGN(*cp, filename, 240);
|
READSTRINGN(*cp, filename, 240);
|
||||||
|
@ -3104,13 +3105,18 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (numwadfiles >= MAX_WADFILES) // a more comprehensive check in internal; bare minimum of out-of-bounds for public next
|
||||||
|
toomany = true;
|
||||||
|
else
|
||||||
ncs = findfile(filename,md5sum,true);
|
ncs = findfile(filename,md5sum,true);
|
||||||
|
|
||||||
if (ncs != FS_FOUND)
|
if (ncs != FS_FOUND || toomany)
|
||||||
{
|
{
|
||||||
char message[256];
|
char message[256];
|
||||||
|
|
||||||
if (ncs == FS_NOTFOUND)
|
if (toomany)
|
||||||
|
sprintf(message, M_GetText("Too many files loaded to add %s\n"), filename);
|
||||||
|
else if (ncs == FS_NOTFOUND)
|
||||||
sprintf(message, M_GetText("The server doesn't have %s\n"), filename);
|
sprintf(message, M_GetText("The server doesn't have %s\n"), filename);
|
||||||
else if (ncs == FS_MD5SUMBAD)
|
else if (ncs == FS_MD5SUMBAD)
|
||||||
sprintf(message, M_GetText("Checksum mismatch on %s\n"), filename);
|
sprintf(message, M_GetText("Checksum mismatch on %s\n"), filename);
|
||||||
|
|
Loading…
Reference in a new issue