mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-04 00:47:23 +00:00
Minor Fixes
This commit is contained in:
parent
93299f0fa4
commit
cc537802f7
@ -7,7 +7,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#define DEFAULT_BUFLEN 64000
|
#define DEFAULT_BUFLEN 64000
|
||||||
#define DEFAULT_PORT "4444"
|
|
||||||
|
extern int DEFAULT_PORT;
|
||||||
|
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
#pragma clang diagnostic ignored "-Wmissing-noreturn"
|
||||||
@ -88,7 +89,7 @@ std::string Parse(const std::string& Data){
|
|||||||
hints.ai_flags = AI_PASSIVE;
|
hints.ai_flags = AI_PASSIVE;
|
||||||
|
|
||||||
// Resolve the server address and port
|
// Resolve the server address and port
|
||||||
iResult = getaddrinfo(NULL, DEFAULT_PORT, &hints, &result);
|
iResult = getaddrinfo(nullptr, std::to_string(DEFAULT_PORT).c_str(), &hints, &result);
|
||||||
if ( iResult != 0 ) {
|
if ( iResult != 0 ) {
|
||||||
if(MPDEV)std::cout << "(Core) getaddrinfo failed with error: " << iResult << std::endl;
|
if(MPDEV)std::cout << "(Core) getaddrinfo failed with error: " << iResult << std::endl;
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
|
383
include/enet.hpp
383
include/enet.hpp
File diff suppressed because it is too large
Load Diff
2
main.cpp
2
main.cpp
@ -18,7 +18,7 @@ std::vector<std::string> GetDiscordInfo();
|
|||||||
std::vector<std::string> GlobalInfo;
|
std::vector<std::string> GlobalInfo;
|
||||||
std::vector<std::string> Check();
|
std::vector<std::string> Check();
|
||||||
std::string getHardwareID();
|
std::string getHardwareID();
|
||||||
extern int DEFAULT_PORT;
|
int DEFAULT_PORT = 4444;
|
||||||
void Discord_Main();
|
void Discord_Main();
|
||||||
bool MPDEV = false;
|
bool MPDEV = false;
|
||||||
void ProxyStart();
|
void ProxyStart();
|
||||||
|
15
proxy.cpp
15
proxy.cpp
@ -12,7 +12,7 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
int DEFAULT_PORT = 4445;
|
extern int DEFAULT_PORT;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ENetHost *host;
|
ENetHost *host;
|
||||||
ENetPeer *peer;
|
ENetPeer *peer;
|
||||||
@ -26,8 +26,8 @@ bool Terminate = false;
|
|||||||
bool CServer = true;
|
bool CServer = true;
|
||||||
ENetPeer*ServerPeer;
|
ENetPeer*ServerPeer;
|
||||||
SOCKET*ClientSocket;
|
SOCKET*ClientSocket;
|
||||||
int ping = 0;
|
|
||||||
extern bool MPDEV;
|
extern bool MPDEV;
|
||||||
|
int ping = 0;
|
||||||
|
|
||||||
[[noreturn]] void CoreNetworkThread();
|
[[noreturn]] void CoreNetworkThread();
|
||||||
|
|
||||||
@ -38,11 +38,10 @@ void TCPSEND(const std::string&Data){
|
|||||||
if (MPDEV)std::cout << "(Proxy) send failed with error: " << WSAGetLastError() << std::endl;
|
if (MPDEV)std::cout << "(Proxy) send failed with error: " << WSAGetLastError() << std::endl;
|
||||||
TCPTerminate = true;
|
TCPTerminate = true;
|
||||||
} else {
|
} else {
|
||||||
if (MPDEV && iSendResult > 1000) {
|
if (MPDEV && Data.length() > 1000) {
|
||||||
std::cout << "(Launcher->Game) Bytes sent: " << iSendResult << " : " << Data.substr(0, 10)
|
std::cout << "(Launcher->Game) Bytes sent: " << iSendResult << " : " << Data << std::endl;
|
||||||
<< Data.substr(Data.length() - 10) << std::endl;
|
|
||||||
}
|
}
|
||||||
//std::cout << "(Launcher->Game) Bytes sent: " << iSendResult << " : " << RUDPData.front()<< std::endl;
|
//std::cout << "(Launcher->Game) Bytes sent: " << iSendResult << " : " << Data << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,7 +146,7 @@ void RUDPClientThread(const std::string& IP, int Port){
|
|||||||
HandleEvent(event,client);
|
HandleEvent(event,client);
|
||||||
}
|
}
|
||||||
enet_peer_disconnect(client.peer,0);
|
enet_peer_disconnect(client.peer,0);
|
||||||
enet_host_service(client.host, &event, 0);
|
enet_host_service(client.host, &event, 1);
|
||||||
HandleEvent(event,client);
|
HandleEvent(event,client);
|
||||||
CServer = true;
|
CServer = true;
|
||||||
std::cout << "Connection Terminated!" << std::endl;
|
std::cout << "Connection Terminated!" << std::endl;
|
||||||
@ -182,7 +181,7 @@ void TCPServerThread(const std::string& IP, int Port){
|
|||||||
hints.ai_protocol = IPPROTO_TCP;
|
hints.ai_protocol = IPPROTO_TCP;
|
||||||
hints.ai_flags = AI_PASSIVE;
|
hints.ai_flags = AI_PASSIVE;
|
||||||
// Resolve the server address and port
|
// Resolve the server address and port
|
||||||
iResult = getaddrinfo(nullptr, std::to_string(DEFAULT_PORT).c_str(), &hints, &result);
|
iResult = getaddrinfo(nullptr, std::to_string(DEFAULT_PORT+1).c_str(), &hints, &result);
|
||||||
if (iResult != 0) {
|
if (iResult != 0) {
|
||||||
if(MPDEV)std::cout << "(Proxy) getaddrinfo failed with error: " << iResult << std::endl;
|
if(MPDEV)std::cout << "(Proxy) getaddrinfo failed with error: " << iResult << std::endl;
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user