Example #1
0
        public IrcDaemon(IrcMode ircMode = IrcMode.Modern)
        {
            Capabilities = new List <string>();

            // Create Optionobject & Set the proper IRC Protocol Version
            // The protocol version cannot be changed after construction,
            // because the construction methods below use this Option
            options = new ServerOptions(ircMode);

            //Clean Interface to statistics, it needs the IrcDaemon Object to gather this information.
            stats = new ServerStats(this);

            // Setup Modes Infrastructure
            modeFactory           = new ModeFactory();
            supportedChannelModes = new ChannelModeList(this);
            supportedRanks        = new RankList(this);
            supportedUserModes    = new UserModeList(this);

            // The Protocol Objects
            commands      = new CommandList(this);
            replies       = new ServerReplies.ServerReplies(this);
            serverCreated = DateTime.Now;

            // Add Commands
            SetupCommands();
            // Add Modes
            SetupModes();
            //Add ChannelTypes
            SetupChannelTypes();
        }
Example #2
0
        public IrcDaemon(IrcMode ircMode = IrcMode.Modern)
        {
            Capabilities = new List<string>();

            // Create Optionobject & Set the proper IRC Protocol Version
            // The protocol version cannot be changed after construction,
            // because the construction methods below use this Option
            Options = new ServerOptions(ircMode);

            //Clean Interface to statistics, it needs the IrcDaemon Object to gather this information.
            Stats = new ServerStats(this);

            // Setup Modes Infrastructure
            ModeFactory = new ModeFactory();
            SupportedChannelModes = new ChannelModeList(this);
            SupportedRanks = new RankList(this);
            SupportedUserModes = new UserModeList(this);

            // The Protocol Objects
            Commands = new CommandList(this);
            Replies = new ServerReplies.ServerReplies(this);
            ServerCreated = DateTime.Now;

            // Add Commands
            SetupCommands();
            // Add Modes
            SetupModes();
            //Add ChannelTypes
            SetupChannelTypes();
        }
        private static string TranslateOneUserMode(IrcUser user, IrcUser setter, IrcMode mode)
        {
            string suffix = GetUserModeSuffix(user, setter);
            string group  = mode.IsAdded ? "PositiveUserModes" : "NegativeUserModes";
            string key    = mode.Flag.ToString();

            if (_translator.CanTranslate(group, key))
            {
                return(_translator.Translate(group, key, user.Nickname) + suffix);
            }
            else
            {
                string text = (mode.IsAdded ? "+" : "-") + mode.Flag;
                return(_translator.Translate("UserMode", "Default", user.Nickname, text) + suffix);
            }
        }
        private static string TranslateOneChannelMode(IrcUser setter, IrcMode mode)
        {
            if (setter.Network.Parameters.ChannelModes.UserModes.ContainsKey(mode.Flag) && mode.Argument.HasText())
            {
                string formatKey = mode.IsAdded ? "+" : "-";
                string arg       = _translator.Translate("ChannelUserModes", mode.Flag.ToString());
                return(_translator.Translate("ChannelUserModes", formatKey, setter.Nickname, arg, mode.Argument));
            }

            string key    = mode.Flag.ToString();
            string suffix = _translator.Translate("ChannelMode", "SetBy", setter.Nickname);
            string group  = mode.IsAdded ? "PositiveChannelModes" : "NegativeChannelModes";

            if (_translator.CanTranslate(group, key))
            {
                return(_translator.Translate(group, key, mode.Argument) + suffix);
            }

            string modeString = (mode.IsAdded ? "+" : "-") + mode.Flag + " " + mode.Argument;

            return(_translator.Translate("ChannelMode", "Default", modeString) + suffix);
        }
Example #5
0
 internal ServerOptions(IrcMode ircMode)
 {
     IrcMode        = ircMode;
     IrcCaseMapping = ircMode == IrcMode.Rfc1459 ? IrcCaseMapping.StrictRfc1459 : IrcCaseMapping.Rfc1459;
 }
Example #6
0
 internal ServerOptions(IrcMode ircMode)
 {
     IrcMode          = ircMode;
     IrcCaseMapping   = ircMode == IrcMode.Rfc1459 ? IrcCaseMapping.StrictRfc1459 : IrcCaseMapping.Rfc1459;
     ConnectionPasses = null;
 }
Example #7
0
 internal ServerOptions(IrcMode ircMode)
 {
     this.ircMode = ircMode;
     IrcCaseMapping = ircMode == IrcMode.Rfc1459 ? IrcCaseMapping.StrictRfc1459 : IrcCaseMapping.Rfc1459;
 }