mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-03 00:16:50 +00:00
fix stupid socket
This commit is contained in:
parent
5714c3de76
commit
cfcabf31a4
@ -15,7 +15,6 @@ extern int ping;
|
|||||||
|
|
||||||
extern bool ModWarningConfirmed;
|
extern bool ModWarningConfirmed;
|
||||||
|
|
||||||
|
|
||||||
[[noreturn]] void CoreNetwork();
|
[[noreturn]] void CoreNetwork();
|
||||||
extern int ProxyPort;
|
extern int ProxyPort;
|
||||||
extern int ClientID;
|
extern int ClientID;
|
||||||
|
@ -219,11 +219,13 @@ void localRes(){
|
|||||||
ConfList = new std::set<std::string>;
|
ConfList = new std::set<std::string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
SOCKET LSocket,CSocket;
|
|
||||||
|
uint64_t TheClientSocket;
|
||||||
|
|
||||||
void CoreMain() {
|
void CoreMain() {
|
||||||
debug("Core Network on start!");
|
debug("Core Network on start!");
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
|
SOCKET LSocket,CSocket;
|
||||||
struct addrinfo *res = nullptr;
|
struct addrinfo *res = nullptr;
|
||||||
struct addrinfo hints{};
|
struct addrinfo hints{};
|
||||||
int iRes = WSAStartup(514, &wsaData); //2.2
|
int iRes = WSAStartup(514, &wsaData); //2.2
|
||||||
@ -268,6 +270,7 @@ void CoreMain() {
|
|||||||
error("(Core) accept failed with error: " + std::to_string(WSAGetLastError()));
|
error("(Core) accept failed with error: " + std::to_string(WSAGetLastError()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
TheClientSocket = CSocket;
|
||||||
localRes();
|
localRes();
|
||||||
info("Game Connected!");
|
info("Game Connected!");
|
||||||
GameHandler(CSocket);
|
GameHandler(CSocket);
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <future>
|
#include <future>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
extern SOCKET LSocket,CSocket;
|
extern SOCKET TheClientSocket;
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
std::string ListOfMods;
|
std::string ListOfMods;
|
||||||
@ -226,7 +226,7 @@ void SyncResources(SOCKET Sock){
|
|||||||
ModWarningConfirmed = false;
|
ModWarningConfirmed = false;
|
||||||
|
|
||||||
std::string Data = "WMODS_FOUND";
|
std::string Data = "WMODS_FOUND";
|
||||||
send(CSocket, (Data + "\n").c_str(), int(Data.size())+1, 0);
|
send(TheClientSocket, (Data + "\n").c_str(), int(Data.size())+1, 0);
|
||||||
|
|
||||||
while (!Terminate && !ModWarningConfirmed) {
|
while (!Terminate && !ModWarningConfirmed) {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user