diff --git a/src/Network 2.0/VehicleEvent.cpp b/src/Network 2.0/VehicleEvent.cpp index 33b0c57..7d5432c 100644 --- a/src/Network 2.0/VehicleEvent.cpp +++ b/src/Network 2.0/VehicleEvent.cpp @@ -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); diff --git a/src/main.cpp b/src/main.cpp index f8d362e..0c4c7fa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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);