fixed mod downloading stuck at 50%

This commit is contained in:
Anonymous275 2020-12-22 19:38:01 +02:00
parent 76a1b05056
commit 7cd25fbb22
2 changed files with 4 additions and 4 deletions

View File

@ -243,6 +243,7 @@ void SyncResources(SOCKET Sock){
Amount++;
}
if(!FNames.empty())info("Syncing...");
SOCKET DSock = InitDSock();
for(auto FN = FNames.begin(),FS = FSizes.begin(); FN != FNames.end() && !Terminate; ++FN,++FS) {
auto pos = FN->find_last_of('/');
if (pos != std::string::npos) {
@ -271,7 +272,6 @@ void SyncResources(SOCKET Sock){
}
CheckForDir();
std::string FName = a.substr(a.find_last_of('/'));
SOCKET DSock = InitDSock();
do {
TCPSend("f" + *FN,Sock);
@ -296,7 +296,6 @@ void SyncResources(SOCKET Sock){
}
}while(fs::file_size(a) != std::stoi(*FS) && !Terminate);
KillSocket(DSock);
if(!Terminate){
if(!fs::exists(GetGamePath() + "mods/multiplayer")){
fs::create_directory(GetGamePath() + "mods/multiplayer");
@ -305,6 +304,7 @@ void SyncResources(SOCKET Sock){
}
WaitForConfirm();
}
KillSocket(DSock);
if(!Terminate){
TCPSend("Done",Sock);
info("Done!");

View File

@ -27,7 +27,7 @@ std::string GetVer(){
return "1.80";
}
std::string GetPatch(){
return ".1";
return ".2";
}
void ReLaunch(int argc,char*args[]){
std::string Arg;
@ -182,7 +182,7 @@ void InitLauncher(int argc, char* argv[]) {
CheckName(argc, argv);
CheckLocalKey(); //will replace RequestRole
Discord_Main();
//Dev = true;
Dev = true;
//RequestRole();
CustomPort(argc, argv);
CheckForUpdates(argc, argv, std::string(GetVer()) + GetPatch());