|
|
|
@ -103,16 +103,15 @@ public:
@@ -103,16 +103,15 @@ public:
|
|
|
|
|
} |
|
|
|
|
int GetBanTime() const { |
|
|
|
|
if (IsGood()) return 0; |
|
|
|
|
if (clientVersion && clientVersion < 31900) { return 1000000; } |
|
|
|
|
if (stat1D.reliability < 0.01 && stat1D.count > 5) { return 500000; } |
|
|
|
|
if (stat1W.reliability - stat1W.weight + 1.0 < 0.10 && stat1W.count > 4) { return 10*24*3600; } |
|
|
|
|
if (clientVersion && clientVersion < 31900) { return 604800; } |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
int GetIgnoreTime() const { |
|
|
|
|
if (IsGood()) return 0; |
|
|
|
|
if (stat2H.reliability - stat2H.weight + 1.0 < 0.2 && stat2H.count > 3) { return 1*3600; } |
|
|
|
|
if (stat8H.reliability - stat8H.weight + 1.0 < 0.2 && stat8H.count > 6) { return 2*3600; } |
|
|
|
|
if (stat1D.reliability - stat1D.weight + 1.0 < 0.2 && stat1D.count > 9) { return 3*3600; } |
|
|
|
|
if (stat8H.reliability - stat8H.weight + 1.0 < 0.20 && stat8H.count > 6) { return 1*3600; } |
|
|
|
|
if (stat1D.reliability - stat1D.weight + 1.0 < 0.16 && stat1D.count > 12) { return 2*3600; } |
|
|
|
|
if (stat1W.reliability - stat1W.weight + 1.0 < 0.12 && stat8H.count > 24) { return 4*3600; } |
|
|
|
|
if (stat1M.reliability - stat1M.weight + 1.0 < 0.08 && stat1D.count > 48) { return 8*3600; } |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -204,6 +203,12 @@ public:
@@ -204,6 +203,12 @@ public:
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ResetIgnores() { |
|
|
|
|
for (std::map<int, CAddrInfo>::iterator it = idToInfo.begin(); it != idToInfo.end(); it++) { |
|
|
|
|
(*it).second.ignoreTill = 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::vector<CAddrReport> GetAll() { |
|
|
|
|
std::vector<CAddrReport> ret; |
|
|
|
|
SHARED_CRITICAL_BLOCK(cs) { |
|
|
|
|