// -------- Functions -------- /// <summary> /// Inits this plugin. /// </summary> /// <param name="pluginInit">The class that has information required for initing the plugin.</param> public void Init(PluginInitor initor) { string configPath = Path.Combine( initor.ChaskisConfigPluginRoot, "ServerDiagnostics", "ServerDiagnosticsConfig.xml" ); this.config = XmlLoader.LoadConfig(configPath); this.ircConfig = initor.IrcConfig; if (string.IsNullOrEmpty(config.UpTimeCmd) == false) { MessageHandlerConfig msgConfig = new MessageHandlerConfig { LineRegex = config.UpTimeCmd, LineAction = HandleUpTimeCmd, CoolDown = coolDown }; MessageHandler utimeHandler = new MessageHandler( msgConfig ); this.handlerList.Add(utimeHandler); } if (string.IsNullOrEmpty(config.OsVersionCmd) == false) { MessageHandlerConfig msgConfig = new MessageHandlerConfig { LineRegex = config.OsVersionCmd, LineAction = HandleOsVersionCmd, CoolDown = coolDown }; MessageHandler osHandler = new MessageHandler( msgConfig ); this.handlerList.Add(osHandler); } if (string.IsNullOrEmpty(config.ProcessorCountCmd) == false) { MessageHandlerConfig msgConfig = new MessageHandlerConfig { LineRegex = config.ProcessorCountCmd, LineAction = HandleProcessorCountCmd, CoolDown = coolDown }; MessageHandler procCoundHandler = new MessageHandler( msgConfig ); this.handlerList.Add(procCoundHandler); } if (string.IsNullOrEmpty(config.TimeCmd) == false) { MessageHandlerConfig msgConfig = new MessageHandlerConfig { LineRegex = config.TimeCmd, LineAction = HandleTimeCmd, CoolDown = coolDown }; MessageHandler timeHandler = new MessageHandler( msgConfig ); this.handlerList.Add(timeHandler); } }