Add play field size metrics
This commit is contained in:
parent
64d4eb0344
commit
d9308e8753
|
@ -96,8 +96,8 @@ def main():
|
||||||
|
|
||||||
class Game():
|
class Game():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.x = 0
|
self.x = Gauge("x_resolution", "X resolution of the play field")
|
||||||
self.y = 0
|
self.y = Gauge("y_resolution", "Y resolution of the play field")
|
||||||
self.food_decay_per_frame = 0
|
self.food_decay_per_frame = 0
|
||||||
self.users = UserList()
|
self.users = UserList()
|
||||||
self.uptime = Summary("api_up", "Status of the server API")
|
self.uptime = Summary("api_up", "Status of the server API")
|
||||||
|
@ -116,8 +116,8 @@ class Game():
|
||||||
name = bot.get("name")
|
name = bot.get("name")
|
||||||
self.users.update_by_name(name, data=bot)
|
self.users.update_by_name(name, data=bot)
|
||||||
elif typ == MESSAGES["GameInfo"]:
|
elif typ == MESSAGES["GameInfo"]:
|
||||||
game.x = js.get("world_size_c")
|
game.x.set(js.get("world_size_x"))
|
||||||
game.y = js.get("world_size_y")
|
game.y.set(js.get("world_size_y"))
|
||||||
elif typ == MESSAGES["BotKill"]:
|
elif typ == MESSAGES["BotKill"]:
|
||||||
try:
|
try:
|
||||||
victim = self.users.get_user_by_worm(js.get("victim_id"))
|
victim = self.users.get_user_by_worm(js.get("victim_id"))
|
||||||
|
|
Loading…
Reference in a new issue