aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ScriptEngine/Engines/DotNetEngine/DotNetEngine_ScriptLoadUnload.cs
diff options
context:
space:
mode:
authorTedd Hansen2008-11-08 17:35:48 +0000
committerTedd Hansen2008-11-08 17:35:48 +0000
commit9511a8c76370f21e839114007dcd2b25c69b009a (patch)
treeb63323dfd96ecd1cc3cd560939bd66bb43ec9c1c /OpenSim/ScriptEngine/Engines/DotNetEngine/DotNetEngine_ScriptLoadUnload.cs
parent* Added IClientIM to IClientCore interfaces (diff)
downloadopensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.zip
opensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.tar.gz
opensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.tar.bz2
opensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.tar.xz
Work in progress on SECS stuff. Have been holding it off until after 0.6 release. Still messy as hell and doesn't really work yet. Will undergo dramatic changes. AND MOST IMPORTANTLY: Will be conformed to work in coop with todays DNE and XEngine, hopefully one day providing a common interface for all components.
Diffstat (limited to 'OpenSim/ScriptEngine/Engines/DotNetEngine/DotNetEngine_ScriptLoadUnload.cs')
-rw-r--r--OpenSim/ScriptEngine/Engines/DotNetEngine/DotNetEngine_ScriptLoadUnload.cs68
1 files changed, 68 insertions, 0 deletions
diff --git a/OpenSim/ScriptEngine/Engines/DotNetEngine/DotNetEngine_ScriptLoadUnload.cs b/OpenSim/ScriptEngine/Engines/DotNetEngine/DotNetEngine_ScriptLoadUnload.cs
new file mode 100644
index 0000000..bf429f6
--- /dev/null
+++ b/OpenSim/ScriptEngine/Engines/DotNetEngine/DotNetEngine_ScriptLoadUnload.cs
@@ -0,0 +1,68 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenMetaverse;
5using OpenSim.ScriptEngine.Components.DotNetEngine.Events;
6using OpenSim.ScriptEngine.Shared;
7
8namespace OpenSim.ScriptEngine.Engines.DotNetEngine
9{
10 public partial class DotNetEngine
11 {
12
13 //internal Dictionary<int, IScriptScheduler> ScriptMapping = new Dictionary<int, IScriptScheduler>();
14
15
16 //
17 // HANDLE EVENTS FROM SCRIPTS
18 // We will handle script add, change and remove events outside of command pipeline
19 //
20 #region Script Add/Change/Remove
21 void Events_RezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine)
22 {
23 // ###
24 // # New script created
25 // ###
26 m_log.DebugFormat(
27 "[{0}] NEW SCRIPT: localID: {1}, itemID: {2}, startParam: {3}, postOnRez: {4}, engine: {5}",
28 Name, localID, itemID, startParam, postOnRez, engine);
29
30 // Make a script object
31 ScriptStructure scriptObject = new ScriptStructure();
32 scriptObject.RegionInfo = RegionInfo;
33 scriptObject.LocalID = localID;
34 scriptObject.ItemID = itemID;
35 scriptObject.Source = script;
36
37 //
38 // Get MetaData from script header
39 //
40 ScriptMetaData scriptMetaData = ScriptMetaData.Extract(ref script);
41 scriptObject.ScriptMetaData = scriptMetaData;
42 foreach (string key in scriptObject.ScriptMetaData.Keys)
43 {
44 m_log.DebugFormat("[{0}] Script metadata: Key: \"{1}\", Value: \"{2}\".", Name, key, scriptObject.ScriptMetaData[key]);
45 }
46
47 //
48 // Load this assembly
49 //
50 // TODO: Use Executor to send a command instead?
51 m_log.DebugFormat("[{0}] Adding script to scheduler", Name);
52 RegionInfo.FindScheduler(scriptObject.ScriptMetaData).AddScript(scriptObject);
53 // Add to our internal mapping
54 //ScriptMapping.Add(itemID, Schedulers[scheduler]);
55 }
56
57 private void Events_RemoveScript(uint localID, UUID itemID)
58 {
59 // Tell all schedulers to remove this item
60 foreach (IScriptScheduler scheduler in RegionInfo.Schedulers.Values)
61 {
62 scheduler.Removecript(localID, itemID);
63 }
64 }
65 #endregion
66
67 }
68}