Commit d9308e87 authored by sqozz's avatar sqozz
Browse files

Add play field size metrics

parent 64d4eb03
......@@ -96,8 +96,8 @@ def main():
class Game():
def __init__(self):
self.x = 0
self.y = 0
self.x = Gauge("x_resolution", "X resolution of the play field")
self.y = Gauge("y_resolution", "Y resolution of the play field")
self.food_decay_per_frame = 0
self.users = UserList()
self.uptime = Summary("api_up", "Status of the server API")
......@@ -116,8 +116,8 @@ class Game():
name = bot.get("name")
self.users.update_by_name(name, data=bot)
elif typ == MESSAGES["GameInfo"]:
game.x = js.get("world_size_c")
game.y = js.get("world_size_y")
game.x.set(js.get("world_size_x"))
game.y.set(js.get("world_size_y"))
elif typ == MESSAGES["BotKill"]:
try:
victim = self.users.get_user_by_worm(js.get("victim_id"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment