lobby

Lobby related features

class dota2.features.lobby.Lobby

Bases: object

EVENT_LOBBY_INVITE = 'lobby_invite'

When a lobby invite is received :param message: CSDOTALobbyInvite :type message: proto message

EVENT_LOBBY_INVITE_REMOVED = 'lobby_invite_removed'

When a lobby invite is no longer valid :param message: CSDOTALobbyInvite :type message: proto message

EVENT_LOBBY_NEW = 'lobby_new'

Entered a lobby, either by creating one or accepting an invite

Parameters:message (proto message) – CSODOTALobby
EVENT_LOBBY_CHANGED = 'lobby_changed'

Anything changes to the lobby state, players, options, broadcasters…

Parameters:message (proto message) –

CSODOTALobby

EVENT_LOBBY_REMOVED = 'lobby_removed'

The lobby is not valid anymore, quit or kick.

Parameters:message (proto message) –

CSODOTALobby

lobby = None
create_practice_lobby(password='', options=None)

Sends a message to the Game Coordinator requesting to create a lobby.

Parameters:
  • password (str) – password of lobby
  • options (dict) – options to setup the lobby with
create_tournament_lobby(password='', tournament_game_id=None, tournament_id=0, options=None)

Sends a message to the Game Coordinator requesting to create a tournament lobby.

Parameters:
  • password (str) – password of lobby
  • tournament_game_id (int) – tournament game id
  • tournament_id (int) – tournament id
  • options (dict) – options to setup the lobby with
config_practice_lobby(options)

Change settings of the current lobby.

Parameters:options (dict) – options to change in the lobby
get_lobby_list(server_region=<EServerRegion.Unspecified: 0>, game_mode=<DOTA_GameMode.DOTA_GAMEMODE_NONE: 0>)

Get a lobby list

Note

These are regular lobbies. (e.g. All pick, Captains Mode, etc)

Parameters:
  • server_region (EServerRegion) – limit to a specific server region
  • game_mode (DOTA_GameMode) – limit to specific game mode, DOTA_GAMEMODE_NONE means any
Returns:

List of CMsgPracticeLobbyListResponseEntry

Return type:

proto message, None

get_practice_lobby_list(tournament_games=False, password='')

Get list of practice lobbies

Note

These are private Custom Game lobbies

Parameters:
  • tournament_games (bool) – whether to show tournament games only
  • password (str) – practice lobbies with this password
Returns:

List of CMsgPracticeLobbyListResponseEntry

Return type:

proto message, None

get_friend_practice_lobby_list()

Request a list of friend practice lobbies.

Returns:List of CMsgPracticeLobbyListResponseEntry
Return type:proto message, None
balanced_shuffle_lobby()

Balance shuffle the the lobby.

flip_lobby_teams()

Flip both teams of the lobby.

invite_to_lobby(steam_id)

Asks to invite a player to your lobby. This creates a new default lobby when you are not already in one.

Parameters:steam_id (int) – steam_id
practice_lobby_kick(account_id)

Kick a player from the lobby.

Parameters:account_id (int) – 32-bit steam_id of the user to kick from the lobby
practice_lobby_kick_from_team(account_id)

Kick a player from the his current lobby team.

Parameters:account_id (int) – 32-bit steam_id of the user to kick from a team
join_practice_lobby(id, password='')

Join the target practice lobby.

Parameters:
  • id (int) – id of the lobby to join
  • password (str) – password necessary to join the lobby
Returns:

Result of the join command from the GC

Return type:

class:DOTAJoinLobbyResult. DOTAJoinLobbyResult.DOTA_JOIN_RESULT_TIMEOUT if timeout

leave_practice_lobby()

Sends a message to the Game Coordinator requesting to leave the current lobby.

abandon_current_game()

Abandon the current game.

launch_practice_lobby()

Launch the current lobby into a game.

join_practice_lobby_team(slot=1, team=<DOTA_GC_TEAM.PLAYER_POOL: 4>)

Join on of the lobby team at the specified slot.

Parameters:
  • slot (int) – slot to join into
  • team (DOTA_GC_TEAM) – team to join
join_practice_lobby_broadcast_channel(channel=1)

Join a specific channel of the broadcasters.

Parameters:channel (int) – channel to join into
add_bot_to_practice_lobby(slot=1, team=<DOTA_GC_TEAM.GOOD_GUYS: 0>, bot_difficulty=<DOTABotDifficulty.BOT_DIFFICULTY_PASSIVE: 0>)

Add a bot in the lobby.

Parameters:
respond_to_lobby_invite(lobby_id, accept=False)

Answer to a lobby invite.

Parameters:
  • id (int) – lobby_id to answer to.
  • accept (bool) – answer to the lobby invite
destroy_lobby()

Destroy the current lobby (host only)

Returns:job_id for response
Return type:str