Пример #1
0
 public ClientMessage(ClientChannel channel, Packets.Types.Data.MessageData message)
 {
     Channel    = channel;
     MessageID  = message.MessageID;
     SenderID   = message.SenderID;
     SenderName = message.SenderName;
     Content    = message.Content;
 }
Пример #2
0
        public ClientChannel(Client client, int id, ClientChannel parent, string name, ChannelType type)
        {
            this.client = client;

            ChannelID = id;
            Parent    = parent;
            Name      = name;
            Type      = type;

            Messages   = new Dictionary <int, ClientMessage>();
            VoiceUsers = new Dictionary <int, ClientUser>();
        }
Пример #3
0
        public void SendJoinVoiceChannel(ClientChannel channel)
        {
            Console.WriteLine(channel.Name);
            if (User.VoiceChannel == channel)
            {
                return;
            }

            SendPacket(new VoiceChannelJoin
            {
                channelID = channel.ChannelID
            });
        }
Пример #4
0
        public void SendChatMessage(ClientChannel channel, string content)
        {
            Console.WriteLine("Sending chat message to channel " + channel.ChannelID + " with content \"" + content + "\"");

            SendPacket(new ChatMessage
            {
                channelID = channel.ChannelID,
                message   = new Packets.Types.Data.MessageData
                {
                    Content = content
                }
            });
        }
Пример #5
0
        public void ReceiveGetChannels(GetChannels getChannels)
        {
            Console.WriteLine("GetChannels");

            for (int i = 0; i < getChannels.channels.Length; i++)
            {
                Packets.Types.Data.ChannelData data = getChannels.channels[i];

                ClientChannel parentChannel;
                Channels.TryGetValue(data.ParentID, out parentChannel);

                ClientChannel channel = new ClientChannel(this, data.ChannelID, parentChannel, data.Name, (ClientChannel.ChannelType)data.type);
                Channels.Add(data.ChannelID, channel);

                OnChannelAdded?.Invoke(channel);
            }
        }
Пример #6
0
 public void SetVoiceChannel(ClientChannel channel)
 {
     VoiceChannel = channel;
 }
Пример #7
0
 private void JoinVoiceChannel(ClientChannel channel)
 {
     audioRecorder = CreateAudioRecorder();
 }