aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorMelanie Thielker2008-11-09 19:30:40 +0000
committerMelanie Thielker2008-11-09 19:30:40 +0000
commit664e8a464e4608afeb590a3330ccc69e7988138b (patch)
tree099c17a1769a7e7ac16232c5a20f5d9515a1d480 /OpenSim/Region/ScriptEngine
parentCause llGetInventoryType to return the asset type, which corresponds with (diff)
downloadopensim-SC-664e8a464e4608afeb590a3330ccc69e7988138b.zip
opensim-SC-664e8a464e4608afeb590a3330ccc69e7988138b.tar.gz
opensim-SC-664e8a464e4608afeb590a3330ccc69e7988138b.tar.bz2
opensim-SC-664e8a464e4608afeb590a3330ccc69e7988138b.tar.xz
Script region crossing. This has not user functionality, but lays all the
groundwork.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs14
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs9
4 files changed, 20 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs
index 4abea40..d1dbf94 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs
@@ -232,7 +232,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
232 } 232 }
233 233
234 public void OnRezScript(uint localID, UUID itemID, string script, 234 public void OnRezScript(uint localID, UUID itemID, string script,
235 int startParam, bool postOnRez, string engine) 235 int startParam, bool postOnRez, string engine, int stateSource)
236 { 236 {
237 List<IScriptModule> engines = 237 List<IScriptModule> engines =
238 new List<IScriptModule>( 238 new List<IScriptModule>(
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
index 508e00f..f615250 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
@@ -39,8 +39,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
39 public enum StateSource 39 public enum StateSource
40 { 40 {
41 NewRez = 0, 41 NewRez = 0,
42 PrimCrossing = 1, 42 PrimCrossing = 1
43 AttachmentCrossing = 2
44 } 43 }
45 44
46 public interface IScriptWorkItem 45 public interface IScriptWorkItem
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 30f03ac..08a97f07 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -286,6 +286,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
286 PostEvent(new EventParams("changed", 286 PostEvent(new EventParams("changed",
287 new Object[] {new LSL_Types.LSLInteger(256)}, new DetectParams[0])); 287 new Object[] {new LSL_Types.LSLInteger(256)}, new DetectParams[0]));
288 } 288 }
289 else if (stateSource == StateSource.PrimCrossing)
290 {
291 // CHANGED_REGION
292 PostEvent(new EventParams("changed",
293 new Object[] {new LSL_Types.LSLInteger(512)}, new DetectParams[0]));
294 }
289 } 295 }
290 } 296 }
291 else 297 else
@@ -313,6 +319,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
313 } 319 }
314 else 320 else
315 { 321 {
322 ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID);
323
324 if (presence != null && (!postOnRez))
325 presence.ControllingClient.SendAgentAlertMessage("Compile successful", false);
326
316// m_Engine.Log.ErrorFormat("[Script] Unable to load script state, file not found"); 327// m_Engine.Log.ErrorFormat("[Script] Unable to load script state, file not found");
317 Start(); 328 Start();
318 PostEvent(new EventParams("state_entry", 329 PostEvent(new EventParams("state_entry",
@@ -856,8 +867,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
856 867
857 public string GetXMLState() 868 public string GetXMLState()
858 { 869 {
870 bool run = Running;
859 Stop(100); 871 Stop(100);
872 Running = run;
860 return ScriptSerializer.Serialize(this); 873 return ScriptSerializer.Serialize(this);
874 Running = false;
861 } 875 }
862 } 876 }
863} 877}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 221562e..6584bb3 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -333,7 +333,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
333 get { return false; } 333 get { return false; }
334 } 334 }
335 335
336 public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine) 336 public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
337 { 337 {
338 List<IScriptModule> engines = new List<IScriptModule>(m_Scene.RequestModuleInterfaces<IScriptModule>()); 338 List<IScriptModule> engines = new List<IScriptModule>(m_Scene.RequestModuleInterfaces<IScriptModule>());
339 339
@@ -388,7 +388,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
388 if (engine != ScriptEngineName) 388 if (engine != ScriptEngineName)
389 return; 389 return;
390 390
391 Object[] parms = new Object[]{localID, itemID, script, startParam, postOnRez}; 391 Object[] parms = new Object[]{localID, itemID, script, startParam, postOnRez, (StateSource)stateSource};
392 392
393 lock (m_CompileQueue) 393 lock (m_CompileQueue)
394 { 394 {
@@ -471,6 +471,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
471 string script =(string)p[2]; 471 string script =(string)p[2];
472 int startParam = (int)p[3]; 472 int startParam = (int)p[3];
473 bool postOnRez = (bool)p[4]; 473 bool postOnRez = (bool)p[4];
474 StateSource stateSource = (StateSource)p[5];
474 475
475 // Get the asset ID of the script, so we can check if we 476 // Get the asset ID of the script, so we can check if we
476 // already have it. 477 // already have it.
@@ -505,8 +506,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
505 { 506 {
506 assembly = m_Compiler.PerformScriptCompile(script, 507 assembly = m_Compiler.PerformScriptCompile(script,
507 assetID.ToString()); 508 assetID.ToString());
508 if (presence != null && (!postOnRez))
509 presence.ControllingClient.SendAgentAlertMessage("Compile successful", false);
510 } 509 }
511 catch (Exception e) 510 catch (Exception e)
512 { 511 {
@@ -584,7 +583,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
584 m_AppDomains[appDomain], 583 m_AppDomains[appDomain],
585 part.ParentGroup.RootPart.Name, 584 part.ParentGroup.RootPart.Name,
586 item.Name, startParam, postOnRez, 585 item.Name, startParam, postOnRez,
587 StateSource.NewRez, m_MaxScriptQueue); 586 stateSource, m_MaxScriptQueue);
588 587
589 m_log.DebugFormat("[XEngine] Loaded script {0}.{1}", 588 m_log.DebugFormat("[XEngine] Loaded script {0}.{1}",
590 part.ParentGroup.RootPart.Name, item.Name); 589 part.ParentGroup.RootPart.Name, item.Name);