mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-04 00:36:14 +00:00
v1.48
This commit is contained in:
parent
83c095ba17
commit
c83bc7864a
@ -10,6 +10,7 @@
|
|||||||
#include "../Settings.hpp"
|
#include "../Settings.hpp"
|
||||||
#include <thread>
|
#include <thread>
|
||||||
std::string HTTP_REQUEST(const std::string& IP,int port);
|
std::string HTTP_REQUEST(const std::string& IP,int port);
|
||||||
|
std::string HTA(const std::string& hex);
|
||||||
struct Sequence{
|
struct Sequence{
|
||||||
SOCKET TCPSock;
|
SOCKET TCPSock;
|
||||||
bool Done = false;
|
bool Done = false;
|
||||||
@ -64,6 +65,15 @@ int Max(){
|
|||||||
}
|
}
|
||||||
return M;
|
return M;
|
||||||
}
|
}
|
||||||
|
bool IsHex(const std::string&a){
|
||||||
|
if(a.empty())return false;
|
||||||
|
for(const char&c : a){
|
||||||
|
if(c < 48 || tolower(c) > 102){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
void Identification(SOCKET TCPSock){
|
void Identification(SOCKET TCPSock){
|
||||||
auto* S = new Sequence;
|
auto* S = new Sequence;
|
||||||
S->TCPSock = TCPSock;
|
S->TCPSock = TCPSock;
|
||||||
@ -71,8 +81,8 @@ void Identification(SOCKET TCPSock){
|
|||||||
Timeout.detach();
|
Timeout.detach();
|
||||||
std::string Name,DID,Role,Res = TCPRcv(TCPSock),Ver = TCPRcv(TCPSock);
|
std::string Name,DID,Role,Res = TCPRcv(TCPSock),Ver = TCPRcv(TCPSock);
|
||||||
S->Done = true;
|
S->Done = true;
|
||||||
if(Ver.size() > 3 && Ver.substr(0,2) == "VC"){
|
if(IsHex(Ver) && Ver.size() > 3 && HTA(Ver).substr(0,2) == "VC"){
|
||||||
Ver = Ver.substr(2);
|
Ver = HTA(Ver).substr(2);
|
||||||
if(Ver.length() > 4 || Ver != ClientVersion){
|
if(Ver.length() > 4 || Ver != ClientVersion){
|
||||||
closesocket(TCPSock);
|
closesocket(TCPSock);
|
||||||
return;
|
return;
|
||||||
|
@ -15,8 +15,8 @@ void ParseConfig();
|
|||||||
void addToLog(const std::string& Data);
|
void addToLog(const std::string& Data);
|
||||||
//void ServerMain(int Port, int MaxClients);
|
//void ServerMain(int Port, int MaxClients);
|
||||||
void HeartbeatInit();
|
void HeartbeatInit();
|
||||||
std::string ServerVersion = "0.47";
|
std::string ServerVersion = "0.49";
|
||||||
std::string ClientVersion = "1.46";
|
std::string ClientVersion = "1.48";
|
||||||
std::string CustomIP;
|
std::string CustomIP;
|
||||||
void HandleResources(std::string path);
|
void HandleResources(std::string path);
|
||||||
void StatInit();
|
void StatInit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user