def leave_game(sid): dbi.getUser(sid).leaveGame() return responded_ok()
def join_game(sid, gameId): dbi.getUser(sid).joinGame(gameId) return responded_ok()
def set_readiness_status(sid, isReady): if isReady not in range(2): raise BadReadinessStatus dbi.getUser(sid).setStatus(isReady) return responded_ok()
def send_message(sid, text): user = dbi.getUser(sid) dbi.add(Chat(sid, text)) return responded_ok()