Ejemplo n.º 1
0
        /// <summary>
        /// Perform any housekeeping / startup checks
        /// </summary>
        public void startupChecks()
        {
            //TODO - temporary code from 2018 - can be removed. Replace any incorrect namespaces in the datafile.
            foreach (ExpectedReply er in expectedReplies)
            {
                if (er.pluginType != null && er.pluginType.StartsWith("Roboto."))
                {
                    er.pluginType = "RobotoChatBot." + er.pluginType.Remove(0, 7);
                }
            }



            //TODO - all these checks should be general housekeeping and run on a schedule!!!
            logging.longOp lo_modules = new logging.longOp("Module Startup Checks", plugins.Count() * 2);
            foreach (Modules.RobotoModuleTemplate plugin in plugins)
            {
                Roboto.log.log("Startup Checks for " + plugin.ToString(), logging.loglevel.warn);

                //moduledata and chatData startup checks
                Roboto.log.log("Checking chatdata for " + plugin.ToString(), logging.loglevel.warn);
                int i = chatData.Count();
                foreach (chat c in chatData)
                {
                    i--;
                    if (i % 100 == 0)
                    {
                        Roboto.log.log(i.ToString() + " remaining", logging.loglevel.verbose);
                    }
                    c.initPlugins();
                    if (plugin.pluginChatDataType != null)
                    {
                        RobotoModuleChatDataTemplate cd = c.getPluginData(plugin.pluginChatDataType);
                        if (cd != null)
                        {
                            cd.startupChecks();
                        }
                    }
                }
                Roboto.log.log("Checking coredata for " + plugin.ToString(), logging.loglevel.warn);
                plugin.getPluginData().startupChecks();
                lo_modules.addone();
                Roboto.log.log("Checking module for " + plugin.ToString(), logging.loglevel.warn);
                plugin.startupChecks();
                lo_modules.addone();
            }
            lo_modules.complete();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Perform any housekeeping / startup checks
        /// </summary>
        public void startupChecks()
        {
            //TODO - all these checks should be general housekeeping and run on a schedule!!!
            logging.longOp lo_modules = new logging.longOp("Module Startup Checks", plugins.Count() * 2);
            foreach (Modules.RobotoModuleTemplate plugin in plugins)
            {
                Roboto.log.log("Startup Checks for " + plugin.ToString(), logging.loglevel.warn);

                //moduledata and chatData startup checks
                Roboto.log.log("Checking chatdata for " + plugin.ToString(), logging.loglevel.warn);
                int i = chatData.Count();
                foreach (chat c in chatData)
                {
                    i--;
                    if (i % 100 == 0)
                    {
                        Roboto.log.log(i.ToString() + " remaining", logging.loglevel.verbose);
                    }
                    c.initPlugins();
                    if (plugin.pluginChatDataType != null)
                    {
                        RobotoModuleChatDataTemplate cd = c.getPluginData(plugin.pluginChatDataType);
                        if (cd != null)
                        {
                            cd.startupChecks();
                        }
                    }
                }
                Roboto.log.log("Checking coredata for " + plugin.ToString(), logging.loglevel.warn);
                plugin.getPluginData().startupChecks();
                lo_modules.addone();
                Roboto.log.log("Checking module for " + plugin.ToString(), logging.loglevel.warn);
                plugin.startupChecks();
                lo_modules.addone();
            }
            lo_modules.complete();
        }