diff options
author | Justin Clark-Casey (justincc) | 2013-01-15 21:13:22 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-01-15 21:13:22 +0000 |
commit | fccb03227e3f541a4c2f4e0e619074e4c1fb55dd (patch) | |
tree | aa37ee5014fe71bb07d1d4e296a7ac3821c84da4 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | Print full stacktrace from plugin loading failure to help determine what went... (diff) | |
download | opensim-SC-fccb03227e3f541a4c2f4e0e619074e4c1fb55dd.zip opensim-SC-fccb03227e3f541a4c2f4e0e619074e4c1fb55dd.tar.gz opensim-SC-fccb03227e3f541a4c2f4e0e619074e4c1fb55dd.tar.bz2 opensim-SC-fccb03227e3f541a4c2f4e0e619074e4c1fb55dd.tar.xz |
Instead of passing separate engine, part and item components to script APIs, pass down IScriptInstance instead.
This is to allow the future co-operative script thread terminate feature to detect and act upon termination requests.
This splits the assembly and state loading out from the ScriptInstance() constructor to a separate Load() method
in order to facilititate continued script logic regression testing.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
4 files changed, 24 insertions, 21 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ea4e609..44072c6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -110,11 +110,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
110 | protected int EMAIL_PAUSE_TIME = 20; // documented delay value for smtp. | 110 | protected int EMAIL_PAUSE_TIME = 20; // documented delay value for smtp. |
111 | protected ISoundModule m_SoundModule = null; | 111 | protected ISoundModule m_SoundModule = null; |
112 | 112 | ||
113 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) | 113 | public void Initialize(IScriptInstance scriptInstance) |
114 | { | 114 | { |
115 | m_ScriptEngine = ScriptEngine; | 115 | m_ScriptEngine = scriptInstance.Engine; |
116 | m_host = host; | 116 | m_host = scriptInstance.Part; |
117 | m_item = item; | 117 | m_item = scriptInstance.ScriptTask; |
118 | 118 | ||
119 | LoadLimits(); // read script limits from config. | 119 | LoadLimits(); // read script limits from config. |
120 | 120 | ||
@@ -123,10 +123,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
123 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); | 123 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); |
124 | m_SoundModule = m_ScriptEngine.World.RequestModuleInterface<ISoundModule>(); | 124 | m_SoundModule = m_ScriptEngine.World.RequestModuleInterface<ISoundModule>(); |
125 | 125 | ||
126 | AsyncCommands = new AsyncCommandManager(ScriptEngine); | 126 | AsyncCommands = new AsyncCommandManager(m_ScriptEngine); |
127 | } | 127 | } |
128 | 128 | ||
129 | /* load configuration items that affect script, object and run-time behavior. */ | 129 | /// <summary> |
130 | /// Load configuration items that affect script, object and run-time behavior. */ | ||
131 | /// </summary> | ||
130 | private void LoadLimits() | 132 | private void LoadLimits() |
131 | { | 133 | { |
132 | m_ScriptDelayFactor = | 134 | m_ScriptDelayFactor = |
@@ -141,12 +143,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
141 | m_ScriptEngine.Config.GetInt("NotecardLineReadCharsMax", 255); | 143 | m_ScriptEngine.Config.GetInt("NotecardLineReadCharsMax", 255); |
142 | if (m_notecardLineReadCharsMax > 65535) | 144 | if (m_notecardLineReadCharsMax > 65535) |
143 | m_notecardLineReadCharsMax = 65535; | 145 | m_notecardLineReadCharsMax = 65535; |
146 | |||
144 | // load limits for particular subsystems. | 147 | // load limits for particular subsystems. |
145 | IConfig SMTPConfig; | 148 | IConfig SMTPConfig; |
146 | if ((SMTPConfig = m_ScriptEngine.ConfigSource.Configs["SMTP"]) != null) { | 149 | if ((SMTPConfig = m_ScriptEngine.ConfigSource.Configs["SMTP"]) != null) { |
147 | // there's an smtp config, so load in the snooze time. | 150 | // there's an smtp config, so load in the snooze time. |
148 | EMAIL_PAUSE_TIME = SMTPConfig.GetInt("email_pause_time", EMAIL_PAUSE_TIME); | 151 | EMAIL_PAUSE_TIME = SMTPConfig.GetInt("email_pause_time", EMAIL_PAUSE_TIME); |
149 | } | 152 | } |
153 | |||
150 | // Rezzing an object with a velocity can create recoil. This feature seems to have been | 154 | // Rezzing an object with a velocity can create recoil. This feature seems to have been |
151 | // removed from recent versions of SL. The code computes recoil (vel*mass) and scales | 155 | // removed from recent versions of SL. The code computes recoil (vel*mass) and scales |
152 | // it by this factor. May be zero to turn off recoil all together. | 156 | // it by this factor. May be zero to turn off recoil all together. |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index ceb4660..071c60e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | |||
@@ -61,10 +61,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
61 | internal bool m_LSFunctionsEnabled = false; | 61 | internal bool m_LSFunctionsEnabled = false; |
62 | internal IScriptModuleComms m_comms = null; | 62 | internal IScriptModuleComms m_comms = null; |
63 | 63 | ||
64 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) | 64 | public void Initialize(IScriptInstance scriptInstance) |
65 | { | 65 | { |
66 | m_ScriptEngine = ScriptEngine; | 66 | m_ScriptEngine = scriptInstance.Engine; |
67 | m_host = host; | 67 | m_host = scriptInstance.Part; |
68 | 68 | ||
69 | if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) | 69 | if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false)) |
70 | m_LSFunctionsEnabled = true; | 70 | m_LSFunctionsEnabled = true; |
@@ -92,10 +92,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
92 | get { return m_ScriptEngine.World; } | 92 | get { return m_ScriptEngine.World; } |
93 | } | 93 | } |
94 | 94 | ||
95 | // | 95 | /// <summary> |
96 | //Dumps an error message on the debug console. | 96 | /// Dumps an error message on the debug console. |
97 | // | 97 | /// </summary> |
98 | |||
99 | internal void LSShoutError(string message) | 98 | internal void LSShoutError(string message) |
100 | { | 99 | { |
101 | if (message.Length > 1023) | 100 | if (message.Length > 1023) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs index 8f34833..cbc69aa 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | |||
@@ -61,11 +61,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
61 | internal bool m_MODFunctionsEnabled = false; | 61 | internal bool m_MODFunctionsEnabled = false; |
62 | internal IScriptModuleComms m_comms = null; | 62 | internal IScriptModuleComms m_comms = null; |
63 | 63 | ||
64 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) | 64 | public void Initialize(IScriptInstance scriptInstance) |
65 | { | 65 | { |
66 | m_ScriptEngine = ScriptEngine; | 66 | m_ScriptEngine = scriptInstance.Engine; |
67 | m_host = host; | 67 | m_host = scriptInstance.Part; |
68 | m_item = item; | 68 | m_item = scriptInstance.ScriptTask; |
69 | 69 | ||
70 | if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false)) | 70 | if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false)) |
71 | m_MODFunctionsEnabled = true; | 71 | m_MODFunctionsEnabled = true; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 958a448..33ae5f0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -142,11 +142,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
142 | 142 | ||
143 | protected IUrlModule m_UrlModule = null; | 143 | protected IUrlModule m_UrlModule = null; |
144 | 144 | ||
145 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item) | 145 | public void Initialize(IScriptInstance scriptInstance) |
146 | { | 146 | { |
147 | m_ScriptEngine = ScriptEngine; | 147 | m_ScriptEngine = scriptInstance.Engine; |
148 | m_host = host; | 148 | m_host = scriptInstance.Part; |
149 | m_item = item; | 149 | m_item = scriptInstance.ScriptTask; |
150 | 150 | ||
151 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); | 151 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); |
152 | 152 | ||