Skip to content

Commit ee2a6de

Browse files
committedJan 11, 2015
Refine sorting algorithm
1 parent bbd3c12 commit ee2a6de

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
 

Diff for: ‎server.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,18 @@ def server_points(server):
292292
else:
293293
points += 1
294294

295-
# 1 per month of age, limited to 8
296-
points += min(8, server["game_time"] / (60*60*24*30))
295+
# 1/2 per month of age, limited to 2
296+
points += min(2, server["game_time"] / (60*60*24*30) * (1/2))
297+
298+
# 1/8 per average client, limited to 1
299+
points += min(1, server["pop_v"] * (1/8))
297300

298301
# -8 for unrealistic max_clients
299302
if server["clients_max"] >= 128:
300303
points -= 8
301304

302-
# -8 per second of ping
303-
points -= server["ping"] * 8
305+
# -6 per second of ping
306+
points -= server["ping"] * 6
304307

305308
# Up to -8 for less than an hour of uptime (penalty linearly decreasing)
306309
HOUR_SECS = 60 * 60

0 commit comments

Comments
 (0)
Please sign in to comment.