Beispiel #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;
 }
Beispiel #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);
        }
Beispiel #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;
      }
    }
Beispiel #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);
            }
        }
    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;
    }
Beispiel #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);
                }
            }
        }
Beispiel #7
0
 internal virtual void Associate(CustomLobby teamSelect)
 {
     this.teamSelect = teamSelect;
 }
Beispiel #8
0
 protected virtual void OnGameCancel(CustomLobby lobby)
 {
     GameCancelled?.Invoke(this, lobby);
 }
Beispiel #9
0
 internal CustomLobbyMember(GameObserver observer, CustomLobby lobby) : base((BotParticipant)null, 2, lobby)
 {
     this.observer = observer;
     Team          = 2;
 }
Beispiel #10
0
 internal CustomLobbyMember(BotParticipant bot, int team, CustomLobby lobby) : base(bot, team, lobby)
 {
 }
Beispiel #11
0
 internal CustomLobbyMember(PlayerParticipant player, int team, CustomLobby lobby) : base(player, team, lobby)
 {
 }
Beispiel #12
0
 internal virtual void Associate(CustomLobby teamSelect) {
   this.teamSelect = teamSelect;
 }
Beispiel #13
0
 protected virtual void OnGameCancel(CustomLobby lobby) {
   GameCancelled?.Invoke(this, lobby);
 }
Beispiel #14
0
 internal CustomLobbyMember(GameObserver observer, CustomLobby lobby) : base((BotParticipant) null, 2, lobby) {
   this.observer = observer;
   Team = 2;
 }
Beispiel #15
0
 internal CustomLobbyMember(BotParticipant bot, int team, CustomLobby lobby) : base(bot, team, lobby) { }
Beispiel #16
0
 internal CustomLobbyMember(PlayerParticipant player, int team, CustomLobby lobby) : base(player, team, lobby) { }