Skip to content

Commit

Permalink
Refine "guest" name regex
Browse files Browse the repository at this point in the history
Avoid detecting names such as "Bob123" (<4 chars) or "Angel060" (leading zero)
  • Loading branch information
sfan5 committed Aug 8, 2017
1 parent afd7b16 commit da9f297
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server.py
Expand Up @@ -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.
Expand Down

0 comments on commit da9f297

Please sign in to comment.