Skip to content
Permalink
Browse files

Refine "guest" name regex

Avoid detecting names such as "Bob123" (<4 chars) or "Angel060" (leading zero)
  • Loading branch information...
sfan5 committed Aug 8, 2017
1 parent afd7b16 commit da9f297346bba3f1591bafb95df1f9d0028267df
Showing with 2 additions and 2 deletions.
  1. +2 −2 server.py
@@ -299,12 +299,12 @@ def server_points(server):
# 1 per client, but only 1/8 per "guest" client
if "clients_list" in server:
for name in server["clients_list"]:
if re.match(r"[A-Z][a-z]+[0-9]{3,4}", name):
if re.match(r"[A-Z][a-z]{3,}[1-9][0-9]{2,3}", name):
points += 1/8
else:
points += 1
else:
# Old server
# Old server (1/4 per client)
points = server["clients"] / 4

# Penalize highly loaded servers to improve player distribution.

0 comments on commit da9f297

Please sign in to comment.
You can’t perform that action at this time.