예제 #1
0
 internal static CustomLobby Join(Invitation invite) {
   var lobby = new CustomLobby();
   Session.Current.CurrentLobby = lobby;
   var task = invite.Join();
   task.ContinueWith(t => lobby.GotLobbyStatus(t.Result));
   return lobby;
 }
예제 #2
0
        internal static CustomLobby Join(Invitation invite)
        {
            var lobby = new CustomLobby();

            Session.Current.CurrentLobby = lobby;
            var task = invite.Join();

            task.ContinueWith(t => lobby.GotLobbyStatus(t.Result));
            return(lobby);
        }
예제 #3
0
    public static async Task<CustomLobby> CreateLobby(PracticeGameConfig config) {
      var lobby = new CustomLobby();
      Session.Current.CurrentLobby = lobby;

      GameDTO game = await RiotServices.GameService.CreatePracticeGame(config);

      if (game?.Name == null) {
        throw new Exception("Invalid name");
      } else {
        lobby.GotGameData(game);
        return lobby;
      }
    }
예제 #4
0
        public static async Task <CustomLobby> CreateLobby(PracticeGameConfig config)
        {
            var lobby = new CustomLobby();

            Session.Current.CurrentLobby = lobby;

            GameDTO game = await RiotServices.GameService.CreatePracticeGame(config);

            if (game?.Name == null)
            {
                throw new Exception("Invalid name");
            }
            else
            {
                lobby.GotGameData(game);
                return(lobby);
            }
        }
예제 #5
0
    public CustomLobbyPage(CustomLobby lobby) {
      InitializeComponent();

      this.lobby = lobby;

      lobby.MemberJoined += Lobby_MemberJoined;
      lobby.MemberChangedTeam += Lobby_MemberChangedTeam;
      lobby.MemberLeft += Lobby_MemberLeft;
      lobby.LeftLobby += Lobby_LeftLobby;
      lobby.Loaded += Lobby_Loaded;

      lobby.GameStarted += Lobby_GameStarted;
      lobby.Updated += Lobby_GotGameDTO;

      lobby.CatchUp();

      Session.Current.ChatManager.Status = ChatStatus.hostingPracticeGame;
    }
예제 #6
0
        public Lobby Accept()
        {
            var metadata = JSONParser.ParseObject(invite.GameMetaData);

            if ((int)metadata["gameTypeConfigId"] == GameConfig.CapDraft.Key)
            {
                return(TBDLobby.Join(this, (int)metadata["queueId"]));
            }
            else
            {
                switch ((string)metadata["gameType"])
                {
                case "PRACTICE_GAME":
                    return(CustomLobby.Join(this));

                case "NORMAL_GAME":
                    return(QueueLobby.Join(this, (int)metadata["queueId"]));

                default:
                    throw new Exception("Lobby type not found: " + invite.InviteType);
                }
            }
        }
예제 #7
0
 internal virtual void Associate(CustomLobby teamSelect)
 {
     this.teamSelect = teamSelect;
 }
예제 #8
0
 protected virtual void OnGameCancel(CustomLobby lobby)
 {
     GameCancelled?.Invoke(this, lobby);
 }
예제 #9
0
 internal CustomLobbyMember(GameObserver observer, CustomLobby lobby) : base((BotParticipant)null, 2, lobby)
 {
     this.observer = observer;
     Team          = 2;
 }
예제 #10
0
 internal CustomLobbyMember(BotParticipant bot, int team, CustomLobby lobby) : base(bot, team, lobby)
 {
 }
예제 #11
0
 internal CustomLobbyMember(PlayerParticipant player, int team, CustomLobby lobby) : base(player, team, lobby)
 {
 }
예제 #12
0
 internal virtual void Associate(CustomLobby teamSelect) {
   this.teamSelect = teamSelect;
 }
예제 #13
0
 protected virtual void OnGameCancel(CustomLobby lobby) {
   GameCancelled?.Invoke(this, lobby);
 }
예제 #14
0
 internal CustomLobbyMember(GameObserver observer, CustomLobby lobby) : base((BotParticipant) null, 2, lobby) {
   this.observer = observer;
   Team = 2;
 }
예제 #15
0
 internal CustomLobbyMember(BotParticipant bot, int team, CustomLobby lobby) : base(bot, team, lobby) { }
예제 #16
0
 internal CustomLobbyMember(PlayerParticipant player, int team, CustomLobby lobby) : base(player, team, lobby) { }