Security Improvements

This commit is contained in:
Anonymous275
2020-06-22 23:03:29 +03:00
parent 3d29067cab
commit ed0e35400d
7 changed files with 110 additions and 68 deletions

View File

@@ -7,19 +7,22 @@
std::string StatReport = "-";
int PPS = 0;
[[noreturn]] void Monitor(){
int R,C;
int R,C,V=0;
while(true){
if(Clients.empty()){
StatReport = "-";
}else{
C = 0;
for(Client *c : Clients){
if(c->GetCarCount() > 0)C++;
if(c->GetCarCount() > 0){
C++;
V += c->GetCarCount();
}
}
if(C == 0 || PPS == 0){
StatReport = "-";
}else{
R = PPS/C;
R = (PPS/C)/V;
StatReport = std::to_string(R);
PPS = 0;
}