mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-07 00:06:08 +00:00
Fixed invalid string position, Bumped game version
This commit is contained in:
@@ -109,11 +109,10 @@ void UpdateUl(bool D,const std::string&msg){
|
||||
|
||||
void AsyncUpdate(uint64_t& Rcv,uint64_t Size,const std::string& Name){
|
||||
do {
|
||||
double pr = Rcv / double(Size) * 100;
|
||||
double pr = double(Rcv) / double(Size) * 100;
|
||||
std::string Per = std::to_string(trunc(pr * 10) / 10);
|
||||
UpdateUl(true, Name + " (" + Per.substr(0, Per.find('.') + 2) + "%)");
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
|
||||
}while(!Terminate && Rcv < Size);
|
||||
}
|
||||
|
||||
@@ -176,8 +175,7 @@ std::string MultiDownload(SOCKET MSock,SOCKET DSock, uint64_t Size, const std::s
|
||||
|
||||
uint64_t GRcv = 0, MSize = Size/2, DSize = Size - MSize;
|
||||
|
||||
std::thread Au(AsyncUpdate,std::ref(GRcv),Size,Name);
|
||||
Au.detach();
|
||||
std::thread Au(AsyncUpdate,std::ref(GRcv), Size, Name);
|
||||
|
||||
std::packaged_task<char*()> task([&] { return TCPRcvRaw(MSock,GRcv,MSize); });
|
||||
std::future<char*> f1 = task.get_future();
|
||||
@@ -198,6 +196,7 @@ std::string MultiDownload(SOCKET MSock,SOCKET DSock, uint64_t Size, const std::s
|
||||
MultiKill(MSock,DSock);
|
||||
return "";
|
||||
}
|
||||
|
||||
if(Au.joinable())Au.join();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user