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