@@ -290,27 +290,39 @@ def sort(self):
290
290
def server_points (server ):
291
291
points = 0
292
292
293
- # 1 per client
294
- # Only 1/16 per client with a guest or all-numeric name
295
- for name in server ["clients_list" ]:
296
- if name .startswith ("Guest" ) or \
297
- name .isdigit ():
298
- points += 1 / 16
299
- else :
300
- points += 1
293
+ # 1 per client, but only 1/8 per client with a guest
294
+ # or all-numeric name.
295
+ if "clients_list" in server :
296
+ for name in server ["clients_list" ]:
297
+ if name .startswith ("Guest" ) or \
298
+ name .isdigit ():
299
+ points += 1 / 8
300
+ else :
301
+ points += 1
302
+ else :
303
+ # Old server
304
+ points = server ["clients" ] / 4
305
+
306
+ # Penalize highly loaded servers to improve player distribution.
307
+ # Note: This doesn't just make more than 16 players stop
308
+ # increasing your points, it can actually reduce your points
309
+ # if you have guests/all-numerics.
310
+ if server ["clients" ] > 16 :
311
+ points = server ["clients" ] - 16
301
312
302
- # 1/2 per month of age, limited to 2
303
- points += min (2 , server ["game_time" ] / (60 * 60 * 24 * 30 ) * ( 1 / 2 ))
313
+ # 1 per month of age, limited to 8
314
+ points += min (8 , server ["game_time" ] / (60 * 60 * 24 * 30 ))
304
315
305
- # 1/8 per average client, limited to 1
306
- points += min (1 , server ["pop_v" ] * ( 1 / 8 ) )
316
+ # 1/2 per average client, limited to 4
317
+ points += min (4 , server ["pop_v" ] / 2 )
307
318
308
319
# -8 for unrealistic max_clients
309
320
if server ["clients_max" ] >= 128 :
310
321
points -= 8
311
322
312
- # -6 per second of ping
313
- points -= server ["ping" ] * 6
323
+ # -8 per second of ping over 0.4s
324
+ if server ["ping" ] > 0.4 :
325
+ points -= (server ["ping" ] - 0.4 ) * 8
314
326
315
327
# Up to -8 for less than an hour of uptime (penalty linearly decreasing)
316
328
HOUR_SECS = 60 * 60
0 commit comments