Ready for release

This commit is contained in:
Anonymous275 2020-07-03 16:22:54 +03:00
parent e7c1bdd872
commit 69362b2dfd
2 changed files with 8 additions and 6 deletions

View File

@ -45,7 +45,7 @@ std::string HTTP(const std::string &DID){
int pos = a.find('"');
if(pos != std::string::npos){
return a.substr(pos+1,a.find('"',pos+1)-2);
}else if(a == "[]")return ""; //Member
}else if(a == "[]")return "Member";
}
}
return "";
@ -92,6 +92,11 @@ void Identification(SOCKET TCPSock){
Name = Res.substr(2,Res.find(':')-2);
DID = Res.substr(Res.find(':')+1);
Role = HTTP(DID);
if(Role.empty() || Role.find("Error") != std::string::npos){
closesocket(TCPSock);
return;
}
for(Client*c: Clients){
if(c->GetDID() == DID){
closesocket(c->GetTCPSock());
@ -99,10 +104,7 @@ void Identification(SOCKET TCPSock){
break;
}
}
if(Role.empty() || Role.find("Error") != std::string::npos){
closesocket(TCPSock);
return;
}
if(Debug)debug("Name -> " + Name + ", Role -> " + Role + ", ID -> " + DID);
if(Role == "MDEV"){
CreateClient(TCPSock,Name,DID,Role);

View File

@ -15,7 +15,7 @@ void ParseConfig();
void addToLog(const std::string& Data);
//void ServerMain(int Port, int MaxClients);
void HeartbeatInit();
std::string ServerVersion = "0.45";
std::string ServerVersion = "0.46";
std::string ClientVersion = "1.46";
std::string CustomIP;
void HandleResources(std::string path);