home · contact · privacy
Ensure rough feature parity between clients.
[plomrogue2-experiments] / new2 / plomrogue / game.py
index c89d2c6cfddf80c3d30bca0abbe9dbabaa9e1d16..da148460d0c244b3f350bd6c0ada8c407ec5e4e3 100755 (executable)
@@ -16,6 +16,7 @@ class GameBase:
     def __init__(self):
         self.turn = 0
         self.things = []
+        self.map_geometry = MapGeometrySquare(YX(24, 40))
 
     def get_thing(self, id_, create_unfound):
         # No default for create_unfound because every call to get_thing
@@ -42,7 +43,6 @@ class Game(GameBase):
                       'MOVE': Task_MOVE,
                       'WRITE': Task_WRITE,
                       'FLATTEN_SURROUNDINGS': Task_FLATTEN_SURROUNDINGS}
-        self.map_geometry = MapGeometrySquare(YX(24, 40))
         self.commands = {'QUERY': cmd_QUERY,
                          'ALL': cmd_ALL,
                          'LOGIN': cmd_LOGIN,
@@ -88,7 +88,6 @@ class Game(GameBase):
             if hasattr(thing, 'nickname'):
                 self.io.send('THING_NAME %s %s' % (thing.id_, quote(t.nickname)))
 
-
         self.io.send('TURN ' + str(self.turn))
         for t in self.things:
             send_thing(t)
@@ -186,7 +185,7 @@ class Game(GameBase):
           for yx in self.annotations:
               write(f, 'ANNOTATE %s %s' % (yx, quote(self.annotations[yx])))
           for yx in self.portals:
-              write(f, 'PORTAL %s %s' % (yx, self.portals[yx]))
+              write(f, 'PORTAL %s %s' % (yx, quote(self.portals[yx])))
 
     def new_world(self, size):
         self.map_geometry = MapGeometrySquare(YX(size.y, size.x))