This commit is contained in:
Anonymous275
2020-07-02 00:20:35 +03:00
parent 1b8c7abea5
commit 6c93ea7fb2
11 changed files with 77 additions and 39 deletions

View File

@@ -8,6 +8,5 @@ std::set<Client*> Clients;
void NetMain() {
std::thread TCP(TCPServerMain);
TCP.detach();
std::this_thread::sleep_for(std::chrono::milliseconds(50));
UDPServerMain();
}

View File

@@ -8,7 +8,7 @@
std::string StatReport = "-";
int PPS = 0;
[[noreturn]] void Monitor(){
int R,C,V=0;
int R,C,V;
while(true){
if(Clients.empty()){
StatReport = "-";
@@ -24,7 +24,6 @@ int PPS = 0;
StatReport = "-";
}else{
R = (PPS/C)/V;
std::cout << PPS << std::endl;
StatReport = std::to_string(R);
}
PPS = 0;

View File

@@ -58,11 +58,11 @@ void Check(Sequence* S){
}
}
int Max(){
int T = MaxPlayers;
int M = MaxPlayers;
for(Client*c : Clients){
if(c->GetRole() == "MDEV")T--;
if(c->GetRole() == "MDEV")M--;
}
return T;
return M;
}
void Identification(SOCKET TCPSock){
auto* S = new Sequence;
@@ -73,7 +73,7 @@ void Identification(SOCKET TCPSock){
S->Done = true;
if(Ver.size() > 3 && Ver.substr(0,2) == "VC"){
Ver = Ver.substr(2);
if(Ver.length() > 4 || Ver < ClientVersion){
if(Ver.length() > 4 || Ver != ClientVersion){
closesocket(TCPSock);
return;
}