while random.random() > volume * 8:
if c.isupper():
c = c.lower()
- elif c != '.':
+ elif c != '.' and c != ' ':
c = '.'
else:
c = ' '
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)