home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More quote fixing.
[plomrogue2-experiments]
/
new2
/
plomrogue
/
game.py
diff --git
a/new2/plomrogue/game.py
b/new2/plomrogue/game.py
index e871d59401f1a9418ccc97c5f6c7fd5a055dd58a..5e33bc49cedc7a408fdb9f5a37415c5bf85346c9 100755
(executable)
--- 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
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
from plomrogue.mapping import YX, MapGeometrySquare, Map
@@
-14,7
+14,6
@@
from plomrogue.mapping import YX, MapGeometrySquare, Map
class GameBase:
def __init__(self):
class GameBase:
def __init__(self):
- pass
self.turn = 0
self.things = []
self.turn = 0
self.things = []
@@
-86,13
+85,16
@@
class Game(GameBase):
def send_thing(thing):
self.io.send('THING_POS %s %s' % (thing.id_, t.position))
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_, 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('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):
self.io.send('GAME_STATE_COMPLETE')
def run_tick(self):
@@
-184,7
+186,7
@@
class Game(GameBase):
for yx in self.annotations:
write(f, 'ANNOTATE %s %s' % (yx, quote(self.annotations[yx])))
for yx in self.portals:
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))
def new_world(self, size):
self.map_geometry = MapGeometrySquare(YX(size.y, size.x))