X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/move_up?a=blobdiff_plain;f=new2%2Fplomrogue%2Fgame.py;h=1cb6e2232b7d59542a37e08e9264a58da538efde;hb=3f6aeac609f6337713f6cca17e4f54960ecf4d7f;hp=2202343d2bf61bc2fd63c5467ae4fb373bf7f20e;hpb=81554cf96856befe1392d86efcebb25e997e3497;p=plomrogue2-experiments diff --git a/new2/plomrogue/game.py b/new2/plomrogue/game.py index 2202343..1cb6e22 100755 --- a/new2/plomrogue/game.py +++ b/new2/plomrogue/game.py @@ -6,7 +6,7 @@ from plomrogue.commands import (cmd_ALL, cmd_LOGIN, cmd_QUERY, cmd_PING, cmd_ANNOTATE, cmd_PORTAL, cmd_GET_GAMESTATE) from plomrogue.io import GameIO from plomrogue.misc import quote -from plomrogue.things import Thing, ThingPlayer +from plomrogue.things import Thing, ThingPlayer from plomrogue.mapping import YX, MapGeometrySquare, Map @@ -14,7 +14,6 @@ from plomrogue.mapping import YX, MapGeometrySquare, Map class GameBase: def __init__(self): - pass self.turn = 0 self.things = [] @@ -87,15 +86,14 @@ class Game(GameBase): def send_thing(thing): self.io.send('THING_POS %s %s' % (thing.id_, t.position)) if hasattr(thing, 'nickname'): - self.io.send('THING_NAME %s %s' % (thing.id_, t.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) self.io.send('MAP %s %s' % (self.map_geometry.size, quote(self.map.terrain))) for yx in self.portals: - self.io.send('PORTAL %s %s' % (yx, self.portals[yx])) + self.io.send('PORTAL %s %s' % (yx, quote(self.portals[yx]))) self.io.send('GAME_STATE_COMPLETE') def run_tick(self): @@ -187,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))