Example #1
0
 /// <summary>
 ///     Create a practice or tournament or custom lobby.
 /// </summary>
 /// <param name="pass_key">Password for the lobby.</param>
 /// <param name="details">Lobby options.</param>
 /// <param name="tournament_game">Is this a tournament game?</param>
 /// <param name="tournament">Tournament ID</param>
 /// <param name="tournament_game_id">Tournament game ID</param>
 public void CreateLobby(string pass_key, CMsgPracticeLobbySetDetails details, bool tournament_game = false,
     uint tournament = 0, uint tournament_game_id = 0)
 {
     var create = new ClientGCMsgProtobuf<CMsgPracticeLobbyCreate>((uint) EDOTAGCMsg.k_EMsgGCPracticeLobbyCreate);
     create.Body.pass_key = pass_key;
     create.Body.tournament_game_id = tournament_game_id;
     create.Body.tournament_game = tournament_game;
     create.Body.tournament_id = tournament;
     create.Body.lobby_details = details;
     create.Body.lobby_details.pass_key = pass_key;
     create.Body.lobby_details.visibility = DOTALobbyVisibility.DOTALobbyVisibility_Public;
     if (string.IsNullOrWhiteSpace(create.Body.search_key))
         create.Body.search_key = "";
     Send(create);
 }
Example #2
0
        public void CreateLobby(string password)
        {
            leaveLobby();
            log.Debug("Setting up the lobby with passcode [" + password + "]...");

            var ldetails = new CMsgPracticeLobbySetDetails
            {
                allchat = false,
            #if DEBUG
                allow_cheats = true,
            #else
                allow_cheats = false,
            #endif
                allow_spectating = true,
                fill_with_bots = false,
                game_mode = (uint) DOTA_GameMode.DOTA_GAMEMODE_AP,
                game_name = "Test Lobby",
                game_version = DOTAGameVersion.GAME_VERSION_CURRENT
            };
            dota.CreateLobby(password, ldetails);
        }