Exemplo n.º 1
0
 public void Initialize(ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID, ScriptProtectionModule module)
 {
     m_itemID = itemID;
     m_ScriptEngine = ScriptEngine;
     m_host = host;
     ScriptProtection = module;
 }
Exemplo n.º 2
0
        public static void Deserialize(ScriptData instance, ScriptEngine engine, StateSave save)
        {
            Dictionary<string, object> vars = save.Variables as Dictionary<string, object>;
            instance.State = save.State;
            instance.Running = save.Running;

            if (vars != null && vars.Count != 0)
                instance.Script.SetStoreVars(vars);

            if(save.Plugins is object[])
                instance.PluginData = (object[])save.Plugins;
            else
                instance.PluginData = new object[1] {(object)save.Plugins};

            if (save.Permissions != " " && save.Permissions != "")
            {
                instance.InventoryItem.PermsGranter = new UUID(save.Permissions.Split(',')[0]);
                instance.InventoryItem.PermsMask = int.Parse(save.Permissions.Split(',')[1], NumberStyles.Integer, Culture.NumberFormatInfo);
            }
            instance.EventDelayTicks = (long)save.MinEventDelay;
            instance.AssemblyName = save.AssemblyName;
            instance.Disabled = save.Disabled;
            instance.UserInventoryItemID = save.UserInventoryID;
            // Add it to our script memstruct
            ScriptEngine.ScriptProtection.AddNewScript(instance);
        }
Exemplo n.º 3
0
        public void Initialize (ScriptEngine module)
        {
            m_module = module;

            m_manager = module.Worlds[0].RequestModuleInterface<IComponentManager> ();
            DefaultComponents com = new DefaultComponents (m_componentName);
            m_manager.RegisterComponent (com);
        }
Exemplo n.º 4
0
        public ScriptData(ScriptEngine engine)
        {
            m_ScriptEngine = engine;

            NextEventDelay = new Dictionary<string, long>();
            NextEventDelay.Add("at_rot_target", 0);
            NextEventDelay.Add("at_target", 0);
            NextEventDelay.Add("attach", 0);
            NextEventDelay.Add("changed", 0);
            NextEventDelay.Add("collision", 0);
            NextEventDelay.Add("collision_end", 0);
            NextEventDelay.Add("collision_start", 0);
            NextEventDelay.Add("control", 0);
            NextEventDelay.Add("dataserver", 0);
            NextEventDelay.Add("email", 0);
            NextEventDelay.Add("http_response", 0);
            NextEventDelay.Add("http_request", 0);
            NextEventDelay.Add("land_collision", 0);
            NextEventDelay.Add("land_collision_end", 0);
            NextEventDelay.Add("land_collision_start", 0);
            //Don't limit link_message, too important!
            //NextEventDelay.Add("link_message", 0);
            NextEventDelay.Add("listen", 0);
            NextEventDelay.Add("money", 0);
            NextEventDelay.Add("moving_end", 0);
            NextEventDelay.Add("moving_start", 0);
            NextEventDelay.Add("no_sensor", 0);
            NextEventDelay.Add("not_at_rot_target", 0);
            NextEventDelay.Add("not_at_target", 0);
            NextEventDelay.Add("object_rez", 0);
            NextEventDelay.Add("on_rez", 0);
            NextEventDelay.Add("remote_data", 0);
            NextEventDelay.Add("run_time_permissions", 0);
            NextEventDelay.Add("sensor", 0);
            NextEventDelay.Add("state_entry", 0);
            NextEventDelay.Add("state_exit", 0);
            NextEventDelay.Add("timer", 0);
            NextEventDelay.Add("touch", 0);
            NextEventDelay.Add("touch_end", 0);
            NextEventDelay.Add("touch_start", 0);

            ChangedInQueue = new List<Changed>();
            CollisionEventDelayTicks = 0.13;
            DefaultEventDelayTicks = 0.05;
            PluginData = null;
            ScriptEventLock = new object();
            TimerEventDelayTicks = 0.01;
            TouchEventDelayTicks = 0.1;
            Loading = true;
            Running = true;
        }
Exemplo n.º 5
0
        public static void SaveState(ScriptData instance, ScriptEngine engine)
        {
            StateSave Insert = new StateSave();
            Insert.State = instance.State;
            Insert.ItemID = instance.ItemID;
            string source = instance.Source.Replace("\n", " ");
            Insert.Source = source.Replace("'", " ");
            Insert.Running = instance.Running;
            //Vars
            Dictionary<string, Object> vars = new Dictionary<string, object>();
            if (instance.Script != null)
                vars = instance.Script.GetVars();
            string varsmap = "";
            foreach (KeyValuePair<string, Object> var in vars)
            {
                varsmap += var.Key + "," + var.Value + "\n";
            }
            Insert.Variables = varsmap;
            //Plugins
            object[] Plugins = engine.GetSerializationData( instance.ItemID, instance.part.UUID);
            string plugins = "";
            foreach (object plugin in Plugins)
                plugins += plugin + ",";
            Insert.Plugins = plugins;

            //perms
            string perms = "";
            if (instance.InventoryItem != null)
            {
                if (instance.InventoryItem.PermsMask != 0 && instance.InventoryItem.PermsGranter != UUID.Zero)
                {
                    perms += instance.InventoryItem.PermsGranter.ToString() + "," + instance.InventoryItem.PermsMask.ToString();

                }
            }
            Insert.Permissions = perms;

            Insert.MinEventDelay = instance.EventDelayTicks;
            string[] AN = instance.AssemblyName.Split('\\');
            if(AN.Length > 2)
                Insert.AssemblyName = instance.AssemblyName.Split('\\')[2];
            else
            	Insert.AssemblyName = instance.AssemblyName;
            Insert.Disabled = instance.Disabled;
            Insert.UserInventoryID = instance.UserInventoryItemID;
            IScriptDataConnector ScriptFrontend = Aurora.DataManager.DataManager.RequestPlugin<IScriptDataConnector>();
            if(ScriptFrontend != null)
                ScriptFrontend.SaveStateSave(Insert);
        }
Exemplo n.º 6
0
        public MaintenanceThread(ScriptEngine Engine)
        {
            m_ScriptEngine = Engine;
            EventManager = Engine.EventManager;

            //There IS a reason we start this, even if RunInMain is enabled
            // If this isn't enabled, we run into issues with the CmdHandlerQueue,
            // as it always must be async, so we must run the pool anyway
            AuroraThreadPoolStartInfo info = new AuroraThreadPoolStartInfo();
            info.priority = ThreadPriority.Normal;
            info.Threads = 4;
            info.MaxSleepTime = Engine.Config.GetInt("SleepTime", 300);
            info.Threads = 1;
            threadpool = new AuroraThreadPool(info);

            AppDomain.CurrentDomain.AssemblyResolve += m_ScriptEngine.AssemblyResolver.OnAssemblyResolve;
        }
        public ScriptProtectionModule(ScriptEngine engine, IConfig config)
		{
            m_config = config;
            m_scriptEngine = engine;
            EnabledAPIs = new List<string>(config.GetString("AllowedAPIs", "LSL").Split(','));

            allowHTMLLinking = config.GetBoolean("AllowHTMLLinking", true);

            m_threatLevelNone = new ThreatLevelDefinition (ThreatLevel.None, UserSetHelpers.ParseUserSetConfigSetting (config, "NoneUserSet", UserSet.None), this);
            m_threatLevelNuisance = new ThreatLevelDefinition (ThreatLevel.Nuisance, UserSetHelpers.ParseUserSetConfigSetting (config, "NuisanceUserSet", UserSet.None), this);
            m_threatLevelVeryLow = new ThreatLevelDefinition (ThreatLevel.VeryLow, UserSetHelpers.ParseUserSetConfigSetting (config, "VeryLowUserSet", UserSet.None), this);
            m_threatLevelLow = new ThreatLevelDefinition (ThreatLevel.Low, UserSetHelpers.ParseUserSetConfigSetting (config, "LowUserSet", UserSet.None), this);
            m_threatLevelModerate = new ThreatLevelDefinition (ThreatLevel.Moderate, UserSetHelpers.ParseUserSetConfigSetting (config, "ModerateUserSet", UserSet.None), this);
            m_threatLevelHigh = new ThreatLevelDefinition (ThreatLevel.High, UserSetHelpers.ParseUserSetConfigSetting (config, "HighUserSet", UserSet.None), this);
            m_threatLevelVeryHigh = new ThreatLevelDefinition (ThreatLevel.VeryHigh, UserSetHelpers.ParseUserSetConfigSetting (config, "VeryHighUserSet", UserSet.None), this);
            m_threatLevelSevere = new ThreatLevelDefinition (ThreatLevel.Severe, UserSetHelpers.ParseUserSetConfigSetting (config, "SevereUserSet", UserSet.None), this);
		}
Exemplo n.º 8
0
        public ScriptData(ScriptEngine engine)
        {
            m_ScriptEngine = engine;
            ScriptFrontend = Aurora.DataManager.DataManager.RequestPlugin<IScriptDataConnector>();

            NextEventDelay.Add("at_rot_target", 0);
            NextEventDelay.Add("at_target", 0);
            NextEventDelay.Add("attach", 0);
            NextEventDelay.Add("changed", 0);
            NextEventDelay.Add("collision", 0);
            NextEventDelay.Add("collision_end", 0);
            NextEventDelay.Add("collision_start", 0);
            NextEventDelay.Add("control", 0);
            NextEventDelay.Add("dataserver", 0);
            NextEventDelay.Add("email", 0);
            NextEventDelay.Add("http_response", 0);
            NextEventDelay.Add("http_request", 0);
            NextEventDelay.Add("land_collision", 0);
            NextEventDelay.Add("land_collision_end", 0);
            NextEventDelay.Add("land_collision_start", 0);
            //Don't limit link_message, too important!
            //NextEventDelay.Add("link_message", 0);
            NextEventDelay.Add("listen", 0);
            NextEventDelay.Add("money", 0);
            NextEventDelay.Add("moving_end", 0);
            NextEventDelay.Add("moving_start", 0);
            NextEventDelay.Add("no_sensor", 0);
            NextEventDelay.Add("not_at_rot_target", 0);
            NextEventDelay.Add("not_at_target", 0);
            NextEventDelay.Add("object_rez", 0);
            NextEventDelay.Add("on_rez", 0);
            NextEventDelay.Add("remote_data", 0);
            NextEventDelay.Add("run_time_permissions", 0);
            NextEventDelay.Add("sensor", 0);
            NextEventDelay.Add("state_entry", 0);
            NextEventDelay.Add("state_exit", 0);
            NextEventDelay.Add("timer", 0);
            NextEventDelay.Add("touch", 0);
            NextEventDelay.Add("touch_end", 0);
            NextEventDelay.Add("touch_start", 0);
        }
Exemplo n.º 9
0
        public MaintenanceThread(ScriptEngine Engine)
        {
            m_ScriptEngine = Engine;
            EventManager = Engine.EventManager;

            RunInMainProcessingThread = Engine.Config.GetBoolean("RunInMainProcessingThread", false);

            RunInMainProcessingThread = false; // temporary false until code is fix to work with true

            //There IS a reason we start this, even if RunInMain is enabled
            // If this isn't enabled, we run into issues with the CmdHandlerQueue,
            // as it always must be async, so we must run the pool anyway
            AuroraThreadPoolStartInfo info = new AuroraThreadPoolStartInfo
                                                 {
                                                     priority = ThreadPriority.Normal,
                                                     Threads = 1,
                                                     MaxSleepTime = Engine.Config.GetInt("SleepTime", 100),
                                                     SleepIncrementTime = Engine.Config.GetInt("SleepIncrementTime", 1),
                                                     Name = "Script Cmd Thread Pools"
                                                 };
            cmdThreadpool = new AuroraThreadPool(info);
            info.Name = "Script Loading Thread Pools";
            scriptChangeThreadpool = new AuroraThreadPool(info);

            MaxScriptThreads = Engine.Config.GetInt("Threads", 100); // leave control threads out of user option
            AuroraThreadPoolStartInfo sinfo = new AuroraThreadPoolStartInfo
                                                  {
                                                      priority = ThreadPriority.Normal,
                                                      Threads = MaxScriptThreads,
                                                      MaxSleepTime = Engine.Config.GetInt("SleepTime", 100),
                                                      SleepIncrementTime = Engine.Config.GetInt("SleepIncrementTime", 1),
                                                      KillThreadAfterQueueClear = true,
                                                      Name = "Script Event Thread Pools"
                                                  };
            scriptThreadpool = new AuroraThreadPool(sinfo);

            AppDomain.CurrentDomain.AssemblyResolve += m_ScriptEngine.AssemblyResolver.OnAssemblyResolve;
        }
Exemplo n.º 10
0
 public EventManager(ScriptEngine _ScriptEngine)
 {
     m_scriptEngine = _ScriptEngine;
 }
Exemplo n.º 11
0
        public void Initialize(ScriptEngine module)
        {
            m_module = module;

            m_manager = module.Worlds[0].RequestModuleInterface<IComponentManager>();
        }
Exemplo n.º 12
0
 public AppDomainManager(ScriptEngine scriptEngine)
 {
     m_scriptEngine = scriptEngine;
     ReadConfig();
 }
Exemplo n.º 13
0
 public ScriptProtectionModule(ScriptEngine engine, IConfig config)
 {
 }
Exemplo n.º 14
0
        public void Initialize(ScriptEngine engine, IConfig config)
        {
            m_config = config;
            m_scriptEngine = engine;
            EnabledAPIs = new List<string>(config.GetString("AllowedAPIs", "LSL").ToLower().Split(','));

            allowHTMLLinking = config.GetBoolean("AllowHTMLLinking", true);

            #region Limitation configs

            m_allowFunctionLimiting = config.GetBoolean("AllowFunctionLimiting", false);

            foreach (string kvp in config.GetKeys())
            {
                if (kvp.EndsWith("_Limit"))
                {
                    string functionName = kvp.Remove(kvp.Length - 6);
                    LimitDef limitDef = new LimitDef();
                    string limitType = config.GetString(functionName + "_LimitType", "None");
                    string limitAlert = config.GetString(functionName + "_LimitAlert", "None");
                    string limitAction = config.GetString(functionName + "_LimitAction", "None");
                    int limitTimeScale = config.GetInt(functionName + "_LimitTimeScale", 0);
                    int limitMaxNumberOfTimes = config.GetInt(functionName + "_LimitMaxNumberOfTimes", 0);
                    int limitFunctionsOverTimeScale = config.GetInt(functionName + "_LimitFunctionsOverTimeScale", 0);

                    try
                    {
                        limitDef.Type = (LimitType) Enum.Parse(typeof (LimitType), limitType, true);
                    }
                    catch
                    {
                    }
                    try
                    {
                        limitDef.Alert = (LimitAlert) Enum.Parse(typeof (LimitAlert), limitAlert, true);
                    }
                    catch
                    {
                    }
                    try
                    {
                        limitDef.Action = (LimitAction) Enum.Parse(typeof (LimitAction), limitAction, true);
                    }
                    catch
                    {
                    }

                    limitDef.TimeScale = limitTimeScale;
                    limitDef.MaxNumberOfTimes = limitMaxNumberOfTimes;
                    limitDef.FunctionsOverTimeScale = limitFunctionsOverTimeScale;
                    m_functionsToLimit[functionName] = limitDef;
                }
            }

            #endregion

            m_threatLevelNone = new ThreatLevelDefinition(ThreatLevel.None,
                                                          UserSetHelpers.ParseUserSetConfigSetting(config, "NoneUserSet",
                                                                                                   UserSet.None), this);
            m_threatLevelNuisance = new ThreatLevelDefinition(ThreatLevel.Nuisance,
                                                              UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                       "NuisanceUserSet",
                                                                                                       UserSet.None),
                                                              this);
            m_threatLevelVeryLow = new ThreatLevelDefinition(ThreatLevel.VeryLow,
                                                             UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                      "VeryLowUserSet",
                                                                                                      UserSet.None),
                                                             this);
            m_threatLevelLow = new ThreatLevelDefinition(ThreatLevel.Low,
                                                         UserSetHelpers.ParseUserSetConfigSetting(config, "LowUserSet",
                                                                                                  UserSet.None), this);
            m_threatLevelModerate = new ThreatLevelDefinition(ThreatLevel.Moderate,
                                                              UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                       "ModerateUserSet",
                                                                                                       UserSet.None),
                                                              this);
            m_threatLevelHigh = new ThreatLevelDefinition(ThreatLevel.High,
                                                          UserSetHelpers.ParseUserSetConfigSetting(config, "HighUserSet",
                                                                                                   UserSet.None), this);
            m_threatLevelVeryHigh = new ThreatLevelDefinition(ThreatLevel.VeryHigh,
                                                              UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                       "VeryHighUserSet",
                                                                                                       UserSet.None),
                                                              this);
            m_threatLevelSevere = new ThreatLevelDefinition(ThreatLevel.Severe,
                                                            UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                     "SevereUserSet",
                                                                                                     UserSet.None), this);
            m_threatLevelNoAccess = new ThreatLevelDefinition(ThreatLevel.NoAccess,
                                                              UserSetHelpers.ParseUserSetConfigSetting(config,
                                                                                                       "NoAccessUserSet",
                                                                                                       UserSet.None),
                                                              this);
        }
Exemplo n.º 15
0
 public SharedScriptPluginInitialiser(ScriptEngine engine)
 {
     m_engine = engine;
 }
Exemplo n.º 16
0
 public NonSharedScriptPluginInitialiser(ScriptEngine engine, Scene scene)
 {
     m_scene = scene;
     m_engine = engine;
 }
Exemplo n.º 17
0
 public void Initialize(ScriptEngine module)
 {
     m_module = module;
 }
Exemplo n.º 18
0
        public static void SetXMLState(string xml, ScriptData instance, ScriptEngine engine)
        {
            XmlDocument doc = new XmlDocument();

            Dictionary<string, object> vars = instance.Script.GetVars();

            doc.LoadXml(xml);

            XmlNodeList rootL = doc.GetElementsByTagName("ScriptState");
            if (rootL.Count != 1)
            {
                return;
            }
            XmlNode rootNode = rootL[0];

            if (rootNode != null)
            {
                object varValue;
                XmlNodeList partL = rootNode.ChildNodes;

                foreach (XmlNode part in partL)
                {
                    switch (part.Name)
                    {
                        case "State":
                            instance.State = part.InnerText;
                            break;
                        case "Running":
                            instance.Running = bool.Parse(part.InnerText);
                            break;
                        case "Variables":
                            XmlNodeList varL = part.ChildNodes;
                            foreach (XmlNode var in varL)
                            {
                                string varName;
                                varValue = ReadTypedValue(var, out varName);

                                if (vars.ContainsKey(varName))
                                    vars[varName] = varValue;
                            }
                            instance.Script.SetVars(vars);
                            break;
                        case "Plugins":
                            instance.PluginData = ReadList(part).Data;
                            break;
                        case "Permissions":
                            string tmpPerm;
                            int mask = 0;
                            tmpPerm = part.Attributes.GetNamedItem("mask").Value;
                            if (tmpPerm != null)
                            {
                                int.TryParse(tmpPerm, out mask);
                                if (mask != 0)
                                {
                                    tmpPerm = part.Attributes.GetNamedItem("granter").Value;
                                    if (tmpPerm != null)
                                    {
                                        UUID granter = new UUID();
                                        UUID.TryParse(tmpPerm, out granter);
                                        if (granter != UUID.Zero)
                                        {
                                            instance.InventoryItem.PermsMask = mask;
                                            instance.InventoryItem.PermsGranter = granter;
                                        }
                                    }
                                }
                            }
                            break;
                        case "MinEventDelay":
                            double minEventDelay = 0.0;
                            double.TryParse(part.InnerText, NumberStyles.Float, Culture.NumberFormatInfo, out minEventDelay);
                            instance.EventDelayTicks = (long)minEventDelay;
                            break;
                    }
                }
            }
        }
Exemplo n.º 19
0
        public static string GetXMLState(ScriptData instance, ScriptEngine engine)
        {
            if (instance.Script == null)
                return "";
            //Update PluginData
            instance.PluginData = engine.GetSerializationData(instance.ItemID, instance.part.UUID);

            bool running = instance.Running;

            XmlDocument xmldoc = new XmlDocument();

            XmlNode xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration,
                                                "", "");
            xmldoc.AppendChild(xmlnode);

            XmlElement rootElement = xmldoc.CreateElement("", "ScriptState",
                                                          "");
            xmldoc.AppendChild(rootElement);

            XmlElement state = xmldoc.CreateElement("", "State", "");
            state.AppendChild(xmldoc.CreateTextNode(instance.State));

            rootElement.AppendChild(state);

            XmlElement run = xmldoc.CreateElement("", "Running", "");
            run.AppendChild(xmldoc.CreateTextNode(
                    running.ToString()));

            rootElement.AppendChild(run);

            Dictionary<string, Object> vars = instance.Script.GetVars();

            XmlElement variables = xmldoc.CreateElement("", "Variables", "");

            foreach (KeyValuePair<string, Object> var in vars)
                WriteTypedValue(xmldoc, variables, "Variable", var.Key,
                                var.Value);

            rootElement.AppendChild(variables);

            #region Queue

            //We don't do queue...
            XmlElement queue = xmldoc.CreateElement("", "Queue", "");
            rootElement.AppendChild(queue);

            #endregion

            XmlNode plugins = xmldoc.CreateElement("", "Plugins", "");
            DumpList(xmldoc, plugins,
                     new LSL_Types.list(instance.PluginData));

            rootElement.AppendChild(plugins);

            if (instance.InventoryItem != null)
            {
                if (instance.InventoryItem.PermsMask != 0 && instance.InventoryItem.PermsGranter != UUID.Zero)
                {
                    XmlNode permissions = xmldoc.CreateElement("", "Permissions", "");
                    XmlAttribute granter = xmldoc.CreateAttribute("", "granter", "");
                    granter.Value = instance.InventoryItem.PermsGranter.ToString();
                    permissions.Attributes.Append(granter);
                    XmlAttribute mask = xmldoc.CreateAttribute("", "mask", "");
                    mask.Value = instance.InventoryItem.PermsMask.ToString();
                    permissions.Attributes.Append(mask);
                    rootElement.AppendChild(permissions);
                }
            }

            if (instance.EventDelayTicks > 0.0)
            {
                XmlElement eventDelay = xmldoc.CreateElement("", "MinEventDelay", "");
                eventDelay.AppendChild(xmldoc.CreateTextNode(instance.EventDelayTicks.ToString()));
                rootElement.AppendChild(eventDelay);
            }
            Type type = instance.Script.GetType();
            FieldInfo[] mi = type.GetFields();
            string xml = xmldoc.InnerXml;

            XmlDocument sdoc = new XmlDocument();
            sdoc.LoadXml(xml);
            XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState");
            XmlNode rootNode = rootL[0];

            // Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
            XmlDocument doc = new XmlDocument();
            XmlElement stateData = doc.CreateElement("", "State", "");
            XmlAttribute stateID = doc.CreateAttribute("", "UUID", "");
            stateID.Value = instance.ItemID.ToString();
            stateData.Attributes.Append(stateID);
            XmlAttribute assetID = doc.CreateAttribute("", "Asset", "");
            assetID.Value = instance.InventoryItem.AssetID.ToString();
            stateData.Attributes.Append(assetID);
            XmlAttribute engineName = doc.CreateAttribute("", "Engine", "");
            engineName.Value = engine.ScriptEngineName;
            stateData.Attributes.Append(engineName);
            doc.AppendChild(stateData);

            // Add <ScriptState>...</ScriptState>
            XmlNode xmlstate = doc.ImportNode(rootNode, true);
            stateData.AppendChild(xmlstate);

            string assemName = instance.AssemblyName;

            XmlElement assemblyData = doc.CreateElement("", "Assembly", "");
            XmlAttribute assemblyName = doc.CreateAttribute("", "Filename", "");

            assemblyName.Value = assemName;
            assemblyData.Attributes.Append(assemblyName);

            assemblyData.InnerText = assemName;

            stateData.AppendChild(assemblyData);

            XmlElement mapData = doc.CreateElement("", "LineMap", "");
            XmlAttribute mapName = doc.CreateAttribute("", "Filename", "");

            mapName.Value = assemName + ".map";
            mapData.Attributes.Append(mapName);

            mapData.InnerText = assemName;

            stateData.AppendChild(mapData);

            return doc.InnerXml;
        }
Exemplo n.º 20
0
        public MaintenanceThread(ScriptEngine Engine)
        {
            m_ScriptEngine = Engine;
            ScriptFrontend = Aurora.DataManager.DataManager.RequestPlugin<IScriptDataConnector>();
            EventManager = Engine.EventManager;

            RunInMainProcessingThread = Engine.Config.GetBoolean("RunInMainProcessingThread", false);

            RunInMainProcessingThread = false; // temporary false until code is fix to work with true

            //There IS a reason we start this, even if RunInMain is enabled
            // If this isn't enabled, we run into issues with the CmdHandlerQueue,
            // as it always must be async, so we must run the pool anyway
            AuroraThreadPoolStartInfo info = new AuroraThreadPoolStartInfo();
            info.priority = ThreadPriority.Normal;
            info.Threads = 4;
            info.MaxSleepTime = Engine.Config.GetInt("SleepTime", 300);
            threadpool = new AuroraThreadPool(info);


            MaxScriptThreads = Engine.Config.GetInt("Threads", 100); // leave control threads out of user option
            AuroraThreadPoolStartInfo sinfo = new AuroraThreadPoolStartInfo();
            sinfo.priority = ThreadPriority.Normal;
            sinfo.Threads = MaxScriptThreads + 1;
            sinfo.MaxSleepTime = Engine.Config.GetInt("SleepTime", 300);
            Scriptthreadpool = new AuroraThreadPool(sinfo);

            AppDomain.CurrentDomain.AssemblyResolve += m_ScriptEngine.AssemblyResolver.OnAssemblyResolve;


        }