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
Replace GET_TURN with more useful GET_GAMESTATE.
[plomrogue2-experiments]
/
server_
/
game.py
diff --git
a/server_/game.py
b/server_/game.py
index 878917fbda7711a741c53a981737be741942ffda..eee30d9702a4814322254411546bb86b5d4b4b9d 100644
(file)
--- a/
server_/game.py
+++ b/
server_/game.py
@@
-79,6
+79,9
@@
class Task:
map_tile = self.thing.world.terrain_map[pos_i]
if map_tile != '.':
raise GameError('would move into illegal terrain')
map_tile = self.thing.world.terrain_map[pos_i]
if map_tile != '.':
raise GameError('would move into illegal terrain')
+ for t in self.thing.world.things:
+ if t.position == test_pos:
+ raise GameError('would move into other thing')
class Thing(game_common.Thing):
class Thing(game_common.Thing):
@@
-150,9
+153,9
@@
class Commander():
self.world.get_player().set_task('wait')
self.proceed()
self.world.get_player().set_task('wait')
self.proceed()
- def cmd_GET_
TURN
(self, connection_id):
- """Send
world.turn
to caller."""
- self.send_
to(connection_id, str(self.world.turn)
)
+ def cmd_GET_
GAMESTATE
(self, connection_id):
+ """Send
game state j
to caller."""
+ self.send_
gamestate(connection_id
)
def cmd_ECHO(self, msg, connection_id):
"""Send msg to caller."""
def cmd_ECHO(self, msg, connection_id):
"""Send msg to caller."""