Ejemplo n.º 1
0
    public DefaultLobbyPage(QueueLobby lobby) {
      InitializeComponent();

      this.lobby = lobby;

      lobby.MemberJoined += Lobby_MemberJoined;
      lobby.MemberLeft += Lobby_MemberLeft;

      lobby.QueueEntered += Lobby_QueueEntered;
      lobby.QueueLeft += Lobby_QueueLeft;

      lobby.LeftLobby += Lobby_LeftLobby;
      lobby.Loaded += Lobby_Loaded;

      lobby.CatchUp();

      config = Session.Current.AvailableQueues[lobby.QueueID];
      var map = GameMap.Maps.FirstOrDefault(m => config.SupportedMapIds.Contains(m.MapId));

      MapImage.Source = new BitmapImage(GameMap.Images[map]);
      MapLabel.Content = map.DisplayName;
      QueueLabel.Content = GameConfig.Values[config.GameTypeConfigId].Value;
      ModeLabel.Content = config.Ranked ? "Ranked" : ModeLabel.Content = GameMode.Values[config.GameMode].Value;
      TeamSizeLabel.Content = $"{config.NumPlayersPerTeam}v{config.NumPlayersPerTeam}";
    }
Ejemplo n.º 2
0
 public static QueueLobby Join(Invitation invite, int queueId) {
   var lobby = new QueueLobby(queueId);
   Session.Current.CurrentLobby = lobby;
   var task = invite.Join();
   task.ContinueWith(t => lobby.GotLobbyStatus(t.Result));
   return lobby;
 }
Ejemplo n.º 3
0
 public static QueueLobby CreateLobby(int queueId) {
   var lobby = new QueueLobby(queueId);
   Session.Current.CurrentLobby = lobby;
   var task = RiotServices.GameInvitationService.CreateArrangedTeamLobby(queueId);
   task.ContinueWith(t => lobby.GotLobbyStatus(t.Result));
   return lobby;
 }
Ejemplo n.º 4
0
        public static QueueLobby Join(Invitation invite, int queueId)
        {
            var lobby = new QueueLobby(queueId);

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

            task.ContinueWith(t => lobby.GotLobbyStatus(t.Result));
            return(lobby);
        }
Ejemplo n.º 5
0
        public static QueueLobby CreateLobby(int queueId)
        {
            var lobby = new QueueLobby(queueId);

            Session.Current.CurrentLobby = lobby;
            var task = RiotServices.GameInvitationService.CreateArrangedTeamLobby(queueId);

            task.ContinueWith(t => lobby.GotLobbyStatus(t.Result));
            return(lobby);
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 7
0
 internal QueueLobbyMember(Member member, QueueLobby lobby) : base(lobby)
 {
     Update(member);
 }
Ejemplo n.º 8
0
 internal QueueLobbyMember(Member member, QueueLobby lobby) : base(lobby) {
   Update(member);
 }