aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2009-04-03 10:30:51 +0000
committerAdam Frisby2009-04-03 10:30:51 +0000
commit36bc485e7e622301a900663320b52e136e4181f3 (patch)
treeac5f4b1e1a4f735365711d61fa8f4a6fca1ff3ff
parent* Implements "ID" semi-global within MRM scripts. This is tied to the 'state ... (diff)
downloadopensim-SC_OLD-36bc485e7e622301a900663320b52e136e4181f3.zip
opensim-SC_OLD-36bc485e7e622301a900663320b52e136e4181f3.tar.gz
opensim-SC_OLD-36bc485e7e622301a900663320b52e136e4181f3.tar.bz2
opensim-SC_OLD-36bc485e7e622301a900663320b52e136e4181f3.tar.xz
* MRM Scripts will now no longer disconnect the client if there was an error in compilation or script initialisation.
* Clarified some debug text for MRM Enabling
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs42
1 files changed, 27 insertions, 15 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
index 3e53bc5..6fa8a24 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
@@ -35,6 +35,7 @@ using log4net;
35using Microsoft.CSharp; 35using Microsoft.CSharp;
36using Nini.Config; 36using Nini.Config;
37using OpenMetaverse; 37using OpenMetaverse;
38using OpenSim.Framework;
38using OpenSim.Region.Framework.Interfaces; 39using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
40 41
@@ -61,12 +62,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
61 } 62 }
62 else 63 else
63 { 64 {
64 m_log.Info("[MRM] Disabled MRM Module (Express)"); 65 m_log.Info("[MRM] Disabled MRM Module (Disabled in ini)");
65 } 66 }
66 } 67 }
67 else 68 else
68 { 69 {
69 m_log.Info("[MRM] Disabled MRM Module (Omission)"); 70 m_log.Info("[MRM] Disabled MRM Module (Default disabled)");
70 } 71 }
71 } 72 }
72 73
@@ -74,19 +75,30 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
74 { 75 {
75 if (script.StartsWith("//MiniMod:C#")) 76 if (script.StartsWith("//MiniMod:C#"))
76 { 77 {
77 m_log.Info("[MRM] Found C# MRM"); 78 try
78 IWorld m_world = new World(m_scene); 79 {
79 IHost m_host = new Host(new SOPObject(m_scene, localID)); 80 m_log.Info("[MRM] Found C# MRM");
80 81 IWorld m_world = new World(m_scene);
81 MRMBase mmb = (MRMBase) AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap( 82 IHost m_host = new Host(new SOPObject(m_scene, localID));
82 CompileFromDotNetText(script, itemID.ToString()), 83
83 "OpenSim.MiniModule"); 84 MRMBase mmb = (MRMBase)AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap(
84 m_log.Info("[MRM] Created MRM Instance"); 85 CompileFromDotNetText(script, itemID.ToString()),
85 mmb.InitMiniModule(m_world, m_host, itemID); 86 "OpenSim.MiniModule");
86 m_scripts[itemID] = mmb; 87 m_log.Info("[MRM] Created MRM Instance");
87 88 mmb.InitMiniModule(m_world, m_host, itemID);
88 m_log.Info("[MRM] Starting MRM"); 89 m_scripts[itemID] = mmb;
89 mmb.Start(); 90
91 m_log.Info("[MRM] Starting MRM");
92 mmb.Start();
93 }
94 catch (Exception e)
95 {
96 m_scene.Broadcast(delegate(IClientAPI user)
97 {
98 user.SendAlertMessage(
99 "MiniRegionModule Compilation and Initialisation failed: " + e);
100 });
101 }
90 } 102 }
91 } 103 }
92 104