from plomrogue.misc import quote
from plomrogue.mapping import YX, MapGeometrySquare, MapGeometryHex, Map
import string
+import datetime
self.player_chars = string.digits + string.ascii_letters
self.player_char_i = -1
self.admin_passwords = []
+ self.send_gamestate_interval = datetime.timedelta(seconds=0.04)
+ self.last_send_gamestate = datetime.datetime.now() -\
+ self.send_gamestate_interval
self.terrains = {
'.': 'floor',
'X': 'wall',
self.io.send('PLAY_ERROR ' + quote(str(e)), connection_id)
if self.changed:
self.turn += 1
- self.send_gamestate()
- self.changed = False
- self.save()
+ if self.last_send_gamestate < \
+ datetime.datetime.now() -self.send_gamestate_interval:
+ self.send_gamestate()
+ self.changed = False
+ self.save()
+ self.last_send_gamestate = datetime.datetime.now()
def get_command(self, command_name):