def lobby(game_type, lobby_id,): lobby_state_response = lobbyservice.get_lobby(GetLobbyStateRequest(lobbyId=lobby_id)) if (isinstance(lobby_state_response, GetLobbyStateResponse)): pass return render_template('create_game.html', lobby_members=lobby_state_response.lobby.lobbymembers, friends_list=get_friends_list(), game_type=game_type, lobby_id=lobby_id)
def lobby_list(): print "lobby list" lobby_list_response = lobbyservice.get_lobbies(GetLobbyListRequest(userId=session['userId'])) if (isinstance(lobby_list_response, GetLobbyListResponse)): #print "lobby list response", lobby_list_response pass return render_template('lobby_list.html', lobby_list=lobby_list_response.lobbies, friends_list=get_friends_list())
def friends(): return render_template('friends_list.html', friends_list=get_friends_list()) # try: # remove_friend_response = friendservice.remove_friend(RemoveFriendRequest(userId =session['userId'],friendId=int(request.form['friend']))) # except: # print "Exception in user code:" # print '-'*60 # traceback.print_exc(file=sys.stdout) # print '-'*60
def lobby_state(game_type, lobby_id): print "lobby state" lobby_state_response = lobbyservice.get_lobby(GetLobbyStateRequest(lobbyId=lobby_id)) if (isinstance(lobby_state_response, GetLobbyStateResponse)): pass #print "lobby state response", lobby_state_response # print "owner", lobby_state_response.lobby.owner # for member in lobby_state_response.lobby.lobbymembers: # print "member", member.user.email return render_template('create_game.html', owner=lobby_state_response.lobby.owner, lobby_members=lobby_state_response.lobby.lobbymembers, friends_list=get_friends_list(), game_type=game_type, lobby_id=lobby_id)
def friends_list(msg): print msg return render_template('friends_list.html', friends_list=get_friends_list(), error=msg)