mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-04 00:36:14 +00:00
Ready for release
This commit is contained in:
parent
e7c1bdd872
commit
69362b2dfd
@ -45,7 +45,7 @@ std::string HTTP(const std::string &DID){
|
|||||||
int pos = a.find('"');
|
int pos = a.find('"');
|
||||||
if(pos != std::string::npos){
|
if(pos != std::string::npos){
|
||||||
return a.substr(pos+1,a.find('"',pos+1)-2);
|
return a.substr(pos+1,a.find('"',pos+1)-2);
|
||||||
}else if(a == "[]")return ""; //Member
|
}else if(a == "[]")return "Member";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
@ -92,6 +92,11 @@ void Identification(SOCKET TCPSock){
|
|||||||
Name = Res.substr(2,Res.find(':')-2);
|
Name = Res.substr(2,Res.find(':')-2);
|
||||||
DID = Res.substr(Res.find(':')+1);
|
DID = Res.substr(Res.find(':')+1);
|
||||||
Role = HTTP(DID);
|
Role = HTTP(DID);
|
||||||
|
if(Role.empty() || Role.find("Error") != std::string::npos){
|
||||||
|
closesocket(TCPSock);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for(Client*c: Clients){
|
for(Client*c: Clients){
|
||||||
if(c->GetDID() == DID){
|
if(c->GetDID() == DID){
|
||||||
closesocket(c->GetTCPSock());
|
closesocket(c->GetTCPSock());
|
||||||
@ -99,10 +104,7 @@ void Identification(SOCKET TCPSock){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Role.empty() || Role.find("Error") != std::string::npos){
|
|
||||||
closesocket(TCPSock);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(Debug)debug("Name -> " + Name + ", Role -> " + Role + ", ID -> " + DID);
|
if(Debug)debug("Name -> " + Name + ", Role -> " + Role + ", ID -> " + DID);
|
||||||
if(Role == "MDEV"){
|
if(Role == "MDEV"){
|
||||||
CreateClient(TCPSock,Name,DID,Role);
|
CreateClient(TCPSock,Name,DID,Role);
|
||||||
|
@ -15,7 +15,7 @@ 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.45";
|
std::string ServerVersion = "0.46";
|
||||||
std::string ClientVersion = "1.46";
|
std::string ClientVersion = "1.46";
|
||||||
std::string CustomIP;
|
std::string CustomIP;
|
||||||
void HandleResources(std::string path);
|
void HandleResources(std::string path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user