home · contact · privacy
Identify player in client so scrolling can follow them.
[plomrogue2-experiments] / new2 / plomrogue / commands.py
index 09f22c081beb346070f5bbc7175110577471378b..352f40dc1af3a64e99564a7033f2fb8626422f3c 100644 (file)
@@ -18,6 +18,7 @@ def cmd_LOGIN(game, nick, connection_id):
     game.things += [t]  # TODO refactor into Thing.__init__?
     game.sessions[connection_id] = t.id_ 
     game.io.send('META ' + quote('you are now: ' + nick), connection_id)
+    game.io.send('PLAYER_ID %s' % t.id_, connection_id)
 cmd_LOGIN.argtypes = 'string'
 
 def cmd_QUERY(game, target_nick, msg, connection_id):
@@ -37,4 +38,12 @@ cmd_QUERY.argtypes = 'string string'
 
 def cmd_PING(game, connection_id):
     game.io.send('PONG')
-cmd_QUERY.argtypes = ''
+cmd_PING.argtypes = ''
+
+def cmd_TURN(game, n):
+    game.turn = n
+cmd_TURN.argtypes = 'int:nonneg'
+
+def cmd_MAP_LINE(game, y, line):
+    game.map.set_line(y, line)
+cmd_MAP_LINE.argtypes = 'int:nonneg string'