X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;ds=sidebyside;f=plomrogue%2Fgame.py;h=0c84e044d5b087baf52bdcde18b0c7b8f7e40267;hb=ce80e43db5939580763b1f66bff4f87f1cccc383;hp=d3ab1e73b08b8b19d6bcc81f3832d6a72811d963;hpb=5cd44408532e23648ddcd1d59004a9dae59694af;p=plomrogue2 diff --git a/plomrogue/game.py b/plomrogue/game.py index d3ab1e7..0c84e04 100755 --- a/plomrogue/game.py +++ b/plomrogue/game.py @@ -136,9 +136,9 @@ class Game(GameBase): self.players_hat_chars = {} self.player_char_i = -1 self.admin_passwords = [] - self.send_gamestate_interval = datetime.timedelta(seconds=0.04) + self.send_gamestate_min_interval = datetime.timedelta(seconds=0.04) self.last_send_gamestate = datetime.datetime.now() -\ - self.send_gamestate_interval + self.send_gamestate_min_interval self.terrains = { '.': Terrain('.', 'floor'), 'X': Terrain('X', 'wall', blocks_light=True, blocks_sound=True, @@ -276,6 +276,8 @@ class Game(GameBase): player = self.get_player(c_id) self.io.send('PLAYERS_HAT_CHARS ' + quote(player.get_cookie_chars()), c_id) + self.io.send('STATS %s %s' % (player.need_for_toilet, + player.weariness), c_id) if player.id_ in player_ids_send_fov: self.io.send('FOV %s' % quote(player.fov_stencil.terrain), c_id) self.io.send('MAP %s %s %s' % (self.get_map_geometry_shape(), @@ -392,7 +394,7 @@ class Game(GameBase): # send_gamestate() can be rather expensive, due to among other reasons # re-calculating players' FOVs, so don't send it out too often if self.last_send_gamestate < \ - datetime.datetime.now() -self.send_gamestate_interval: + datetime.datetime.now() - self.send_gamestate_min_interval: n_changes = 0 for type_ in self.changed_tiles: n_changes += len(self.changed_tiles[type_])