示例#1
0
        async void CreatePracticeGame()
        {
            LoLLauncher.RiotObjects.Platform.Game.PracticeGameConfig cfg = new LoLLauncher.RiotObjects.Platform.Game.PracticeGameConfig();
            cfg.GameName = "thelawkings" + new Random().Next().ToString();
            LoLLauncher.RiotObjects.Platform.Game.Map.GameMap map = new LoLLauncher.RiotObjects.Platform.Game.Map.GameMap();
            map.Description      = "DUBLEBERTAN";
            map.DisplayName      = "DUBLEBERTAN";
            map.TotalPlayers     = 2;
            map.Name             = "dummy";
            map.MapId            = (int)GameMode.TwistedTreeline;
            map.MinCustomPlayers = 1;
            cfg.GameMap          = map;
            cfg.MaxNumPlayers    = 6;
            cfg.GamePassword     = "******";
            cfg.GameTypeConfig   = 1;
            cfg.AllowSpectators  = "NONE";
            cfg.GameMode         = StringEnum.GetStringValue(GameMode.TwistedTreeline);
            Thread.Sleep(TimeSpan.FromMilliseconds((double)1000 * 20));
            if (!m_disposed)
            {
                GameDTO game = await connection.CreatePracticeGame(cfg);

                if (game.Id == 0)
                {
                    Logger.Push("Game failed to create", "warning", username);
                }
                else
                {
                    Logger.Push("Game (" + game.Id + ") created.", "info", username);
                }
            }
        }
 async void CreatePracticeGame()
 {
     updateStatus("Creating custom game");
     LoLLauncher.RiotObjects.Platform.Game.PracticeGameConfig cfg = new LoLLauncher.RiotObjects.Platform.Game.PracticeGameConfig();
     cfg.GameName = "funtime lol" + new Random().Next().ToString();
     LoLLauncher.RiotObjects.Platform.Game.Map.GameMap map = new LoLLauncher.RiotObjects.Platform.Game.Map.GameMap();
     map.Description      = "desc";
     map.DisplayName      = "dummy";
     map.TotalPlayers     = 10;
     map.Name             = "dummy";
     map.MapId            = (int)GameMode.SummonersRift;
     map.MinCustomPlayers = 1;
     cfg.GameMap          = map;
     cfg.MaxNumPlayers    = 10;
     cfg.GameTypeConfig   = 1;
     cfg.AllowSpectators  = "NONE";
     cfg.GameMode         = StringEnum.GetStringValue(GameMode.SummonersRift);
     await connection.CreatePracticeGame(cfg);
 }
 async void CreatePracticeGame()
 {
     updateStatus("Creating custom game");
     LoLLauncher.RiotObjects.Platform.Game.PracticeGameConfig cfg = new LoLLauncher.RiotObjects.Platform.Game.PracticeGameConfig();
     cfg.GameName = "funtime lol" + new Random().Next().ToString();
     LoLLauncher.RiotObjects.Platform.Game.Map.GameMap map = new LoLLauncher.RiotObjects.Platform.Game.Map.GameMap();
     map.Description = "desc";
     map.DisplayName = "dummy";
     map.TotalPlayers = 10;
     map.Name = "dummy";
     map.MapId = (int)GameMode.SummonersRift;
     map.MinCustomPlayers = 1;
     cfg.GameMap = map;
     cfg.MaxNumPlayers = 10;
     cfg.GameTypeConfig = 1;
     cfg.AllowSpectators = "NONE";
     cfg.GameMode = StringEnum.GetStringValue(GameMode.SummonersRift);
     await connection.CreatePracticeGame(cfg);
 }