MCPcopy Create free account
hub / github.com/ddnet/ddnet / ClassifyAge

Function ClassifyAge

src/engine/client/serverbrowser_http.cpp:38–45  ·  view source on GitHub ↗

Classify HTTP responses into buckets, treat 15 seconds as fresh, 1 minute as less fresh, etc. This ensures that differences in the order of seconds do not affect master choice.

Source from the content-addressed store, hash-verified

36// less fresh, etc. This ensures that differences in the order of seconds do
37// not affect master choice.
38static int ClassifyAge(int AgeSeconds)
39{
40 return 0 //
41 + (AgeSeconds >= 15) // 15 seconds
42 + (AgeSeconds >= 60) // 1 minute
43 + (AgeSeconds >= 300) // 5 minutes
44 + (AgeSeconds / 3600); // 1 hour
45}
46
47class CChooseMaster
48{

Callers 1

RunMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected