mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-03 16:37:11 +00:00
Mod validity check
This commit is contained in:
parent
082445c295
commit
691be8cd08
@ -211,6 +211,11 @@ std::string MultiDownload(SOCKET MSock,SOCKET DSock, uint64_t Size, const std::s
|
|||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InvalidResource(const std::string& File){
|
||||||
|
UUl("Invalid mod \"" + File + "\"");
|
||||||
|
warn("The server tried to sync \"" + File + "\" that is not a .zip file!");
|
||||||
|
Terminate = true;
|
||||||
|
}
|
||||||
|
|
||||||
void SyncResources(SOCKET Sock){
|
void SyncResources(SOCKET Sock){
|
||||||
std::string Ret = Auth(Sock);
|
std::string Ret = Auth(Sock);
|
||||||
@ -237,6 +242,11 @@ void SyncResources(SOCKET Sock){
|
|||||||
t.clear();
|
t.clear();
|
||||||
for(auto FN = FNames.begin(),FS = FSizes.begin(); FN != FNames.end() && !Terminate; ++FN,++FS) {
|
for(auto FN = FNames.begin(),FS = FSizes.begin(); FN != FNames.end() && !Terminate; ++FN,++FS) {
|
||||||
auto pos = FN->find_last_of('/');
|
auto pos = FN->find_last_of('/');
|
||||||
|
auto ZIP = FN->find(".zip");
|
||||||
|
if (ZIP == std::string::npos || FN->length() - ZIP != 4) {
|
||||||
|
InvalidResource(*FN);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (pos == std::string::npos)continue;
|
if (pos == std::string::npos)continue;
|
||||||
Amount++;
|
Amount++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user