X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=plomrogue%2Fcommands.py;h=8ec6f524d22e8283ba13fc47424dc4e18352de2d;hb=e67306357a830cabdd5ce86b2b333499d99da325;hp=0145157d537e9cb6986afbe94a8c7acdf39858bf;hpb=0dfec5ae86777e8ac5ab35eb6e1f0b6846a4859e;p=plomrogue2 diff --git a/plomrogue/commands.py b/plomrogue/commands.py index 0145157..8ec6f52 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -99,20 +99,20 @@ def cmd_GET_GAMESTATE(game, connection_id): game.send_gamestate(connection_id) cmd_GET_GAMESTATE.argtypes = '' -def cmd_QUERY(game, target_nick, msg, connection_id): - if not connection_id in game.sessions: - raise GameError('can only query when logged in') - t = game.get_thing(game.sessions[connection_id], False) - source_nick = t.nickname - for t in [t for t in game.things if t.type_ == 'player' and t.nickname == target_nick]: - for c_id in game.sessions: - if game.sessions[c_id] == t.id_: - game.io.send('CHAT ' + quote(source_nick+ '->' + target_nick + ': ' + msg), c_id) - game.io.send('CHAT ' + quote(source_nick+ '->' + target_nick + ': ' + msg), connection_id) - return - raise GameError('target user offline') - raise GameError('can only query with registered nicknames') -cmd_QUERY.argtypes = 'string string' +#def cmd_QUERY(game, target_nick, msg, connection_id): +# if not connection_id in game.sessions: +# raise GameError('can only query when logged in') +# t = game.get_thing(game.sessions[connection_id], False) +# source_nick = t.nickname +# for t in [t for t in game.things if t.type_ == 'player' and t.nickname == target_nick]: +# for c_id in game.sessions: +# if game.sessions[c_id] == t.id_: +# game.io.send('CHAT ' + quote(source_nick+ '->' + target_nick + ': ' + msg), c_id) +# game.io.send('CHAT ' + quote(source_nick+ '->' + target_nick + ': ' + msg), connection_id) +# return +# raise GameError('target user offline') +# raise GameError('can only query with registered nicknames') +#cmd_QUERY.argtypes = 'string string' def cmd_PING(game, connection_id): game.io.send('PONG', connection_id)