ALFAIRCBot.ALFAIRCBot.IngameCommand_Channels C# (CSharp) Метод

IngameCommand_Channels() приватный Метод

List available channels.
private IngameCommand_Channels ( int PlayerId, int CharacterServerId, string Text ) : void
PlayerId int Supplies the requesting player ID.
CharacterServerId int Supplies the server ID to send the /// response information to.
Text string
Результат void
        private void IngameCommand_Channels(int PlayerId, int CharacterServerId, string Text)
        {
            SendMessageToPlayer(PlayerId, CharacterServerId, String.Format("{0} available channel(s):", Client.JoinedChannels.Count));

            StringBuilder Line = new StringBuilder();
            int ChannelsInLine = 0;

            foreach (string ChannelName in Client.GetChannels())
            {
                if (ChannelsInLine != 0)
                    Line.Append(", ");

                Line.Append(ChannelName);
                ChannelsInLine += 1;

                if (ChannelsInLine == 3)
                {
                    SendMessageToPlayer(PlayerId, CharacterServerId, Line.ToString());
                    Line.Clear();
                    ChannelsInLine = 0;
                }
            }

            if (ChannelsInLine != 0)
            {
                SendMessageToPlayer(PlayerId, CharacterServerId, Line.ToString());
                Line.Clear();
                ChannelsInLine = 0;
            }

            IncrementStatistic("IRC_COMMAND_CHANNELS");
        }