Esempio n. 1
0
    public virtual void Kick(QueueLobbyMember member) {
      if (!IsCaptain) return;

      RiotServices.GameInvitationService.Kick(member.SummonerID);

      OnMemberLeft(member);
    }
Esempio n. 2
0
    public virtual void GiveInvitePowers(QueueLobbyMember member, bool canInvite) {
      if (!IsCaptain) return;

      if (canInvite) RiotServices.GameInvitationService.RevokeInvitePrivileges(member.SummonerID);
      else RiotServices.GameInvitationService.GrantInvitePrivileges(member.SummonerID);

      var raw = lobbyStatus.Members.FirstOrDefault(m => m.SummonerId == member.SummonerID);
      raw.HasInvitePower = canInvite;
      member.Update(raw);
    }
Esempio n. 3
0
        public virtual void Kick(QueueLobbyMember member)
        {
            if (!IsCaptain)
            {
                return;
            }

            RiotServices.GameInvitationService.Kick(member.SummonerID);

            OnMemberLeft(member);
        }
Esempio n. 4
0
    public LobbyPlayer2(bool amCaptain, QueueLobbyMember member, int profileIconId) {
      InitializeComponent();

      KickButton.Visibility = GiveInviteButt.Visibility = Visibility.Collapsed;
      CanControl = amCaptain;
      NameLabel.Content = member.Name;
      Member = member;

      ProfileIconImage.Source = DataDragon.GetProfileIconImage(DataDragon.GetIconData(profileIconId)).Load();

      member.Changed += (s, e) => Update();
      Update();
      Session.Current.SummonerCache.GetData(member.Name, GotSummoner);
    }
Esempio n. 5
0
        protected virtual void GotLobbyStatus(LobbyStatus status)
        {
            lobbyStatus = status;

            if (ChatLobby == null)
            {
                ChatLobby = new GroupChat(RiotChat.GetLobbyRoom(status.InvitationID, status.ChatKey), status.ChatKey);
            }

            var todo = status.Members.ToDictionary(m => m.SummonerId);

            foreach (var member in Members)
            {
                Member raw;
                if (todo.TryGetValue(member.SummonerID, out raw))
                {
                    member.Update(raw);
                    todo.Remove(member.SummonerID);
                }
                else
                {
                    Members.Remove(member);
                    OnMemberLeft(member);
                }
            }

            foreach (var raw in todo.Values)
            {
                var member = new QueueLobbyMember(raw, this);
                Members.Add(member);
                OnMemberJoined(member);
            }

            foreach (var raw in status.InvitedPlayers)
            {
                if (!Invitees.ContainsKey(raw.SummonerId))
                {
                    var invitee = new LobbyInvitee(raw, this);
                    Invitees.Add(invitee.SummonerID, invitee);
                    OnMemberJoined(invitee);
                }
            }
            if (!loaded)
            {
                OnLoaded();
            }
        }
Esempio n. 6
0
        public virtual void GiveInvitePowers(QueueLobbyMember member, bool canInvite)
        {
            if (!IsCaptain)
            {
                return;
            }

            if (canInvite)
            {
                RiotServices.GameInvitationService.RevokeInvitePrivileges(member.SummonerID);
            }
            else
            {
                RiotServices.GameInvitationService.GrantInvitePrivileges(member.SummonerID);
            }

            var raw = lobbyStatus.Members.FirstOrDefault(m => m.SummonerId == member.SummonerID);

            raw.HasInvitePower = canInvite;
            member.Update(raw);
        }
Esempio n. 7
0
    protected virtual void GotLobbyStatus(LobbyStatus status) {
      lobbyStatus = status;

      if (ChatLobby == null) {
        ChatLobby = new GroupChat(RiotChat.GetLobbyRoom(status.InvitationID, status.ChatKey), status.ChatKey);
      }

      var todo = status.Members.ToDictionary(m => m.SummonerId);

      foreach (var member in Members) {
        Member raw;
        if (todo.TryGetValue(member.SummonerID, out raw)) {
          member.Update(raw);
          todo.Remove(member.SummonerID);
        } else {
          Members.Remove(member);
          OnMemberLeft(member);
        }
      }

      foreach (var raw in todo.Values) {
        var member = new QueueLobbyMember(raw, this);
        Members.Add(member);
        OnMemberJoined(member);
      }

      foreach (var raw in status.InvitedPlayers) {
        if (!Invitees.ContainsKey(raw.SummonerId)) {
          var invitee = new LobbyInvitee(raw, this);
          Invitees.Add(invitee.SummonerID, invitee);
          OnMemberJoined(invitee);
        }
      }
      if (!loaded) OnLoaded();
    }