Ejemplo n.º 1
0
        /// <summary>
        /// Unjoins the specified channel. If it wasn't joined, the events trigger anyway.
        /// </summary>
        /// <param name="channelId">Its ID.</param>
        public void UnjoinChannel(int channelId)
        {
            if (!Channels.ContainsKey(channelId))
            {
                return;
            }
            KgsChannel channel = Channels[channelId];

            channel.Joined = false;
            _kgsConnection.Events.RaiseUnjoin(channel);
            if (channel is KgsGameContainer)
            {
                KgsGameContainer container = channel as KgsGameContainer;
                GameContainers.Remove(container);
            }
            if (channel is KgsTrueGameChannel)
            {
                if (_joinedGames.ContainsKey(channel.ChannelId))
                {
                    _joinedGames.Remove(channel.ChannelId);
                }
            }
            SomethingChanged();

            // Old:
            _kgsConnection.Events.RaiseChannelUnjoined(channel);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Joins the specified global games list.
        /// </summary>
        /// <param name="channelId">The global games list channel ID.</param>
        /// <param name="containerType">Type of the container.</param>
        public void JoinGlobalChannel(int channelId, string containerType)
        {
            var globalGamesList = new KgsGlobalGamesList(channelId, containerType);

            JoinChannel(globalGamesList);
            GameContainers.Add(globalGamesList);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Joins the specified room. If the room isn't loaded in Data yet, it is loaded now.
        /// </summary>
        /// <param name="channelId">The room's channelId.</param>
        public void JoinRoom(int channelId)
        {
            var room = EnsureRoomExists(channelId);

            JoinChannel(room);
            GameContainers.Add(room);
        }
Ejemplo n.º 4
0
 private void UpdateBindings()
 {
     RaisePropertyChanged(nameof(AllRooms));
     RaisePropertyChanged(nameof(GameContainers));
     if (SelectedGameContainer == null)
     {
         SelectedGameContainer = GameContainers.FirstOrDefault();
     }
     RaisePropertyChanged(nameof(LoggedInUser));
 }