aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-27 22:53:58 +0000
committerMelanie Thielker2008-08-27 22:53:58 +0000
commit5525a3ecb424ce6180198b5f4e440d6d5f065346 (patch)
tree01526d143e42a05d97b5375e9cfbdc9280c7b243 /OpenSim/Region/ScriptEngine/XEngine
parentRefactor XScriptInstance to IScriptInstance and move into Shared/. Now (diff)
downloadopensim-SC_OLD-5525a3ecb424ce6180198b5f4e440d6d5f065346.zip
opensim-SC_OLD-5525a3ecb424ce6180198b5f4e440d6d5f065346.tar.gz
opensim-SC_OLD-5525a3ecb424ce6180198b5f4e440d6d5f065346.tar.bz2
opensim-SC_OLD-5525a3ecb424ce6180198b5f4e440d6d5f065346.tar.xz
Thank you, salahazar, for a patch that corrects the behavior of
llDetectedLink(). Also a small refactor to remove an interface member from IScriptEngine.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/EventManager.cs60
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs10
2 files changed, 42 insertions, 28 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
index a4b9d4c..3a01dc6 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
80 } 80 }
81 } 81 }
82 82
83 public void touch_start(uint localID, LLVector3 offsetPos, 83 public void touch_start(uint localID, uint originalID, LLVector3 offsetPos,
84 IClientAPI remoteClient) 84 IClientAPI remoteClient)
85 { 85 {
86 // Add to queue for all scripts in ObjectID object 86 // Add to queue for all scripts in ObjectID object
@@ -89,19 +89,27 @@ namespace OpenSim.Region.ScriptEngine.XEngine
89 det[0].Key = remoteClient.AgentId; 89 det[0].Key = remoteClient.AgentId;
90 det[0].Populate(myScriptEngine.World); 90 det[0].Populate(myScriptEngine.World);
91 91
92 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart( 92
93 localID); 93 if (originalID == 0)
94 if (part == null) 94 {
95 return; 95 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
96 96 if (part == null)
97 det[0].LinkNum = part.LinkNum; 97 return;
98 98
99 det[0].LinkNum = part.LinkNum;
100 }
101 else
102 {
103 SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID);
104 det[0].LinkNum = originalPart.LinkNum;
105 }
106
99 myScriptEngine.PostObjectEvent(localID, new EventParams( 107 myScriptEngine.PostObjectEvent(localID, new EventParams(
100 "touch_start", new Object[] { new LSL_Types.LSLInteger(1) }, 108 "touch_start", new Object[] { new LSL_Types.LSLInteger(1) },
101 det)); 109 det));
102 } 110 }
103 111
104 public void touch(uint localID, LLVector3 offsetPos, 112 public void touch(uint localID, uint originalID, LLVector3 offsetPos,
105 IClientAPI remoteClient) 113 IClientAPI remoteClient)
106 { 114 {
107 // Add to queue for all scripts in ObjectID object 115 // Add to queue for all scripts in ObjectID object
@@ -113,19 +121,26 @@ namespace OpenSim.Region.ScriptEngine.XEngine
113 offsetPos.Y, 121 offsetPos.Y,
114 offsetPos.Z); 122 offsetPos.Z);
115 123
116 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart( 124 if (originalID == 0)
117 localID); 125 {
118 if (part == null) 126 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
119 return; 127 if (part == null)
128 return;
120 129
121 det[0].LinkNum = part.LinkNum; 130 det[0].LinkNum = part.LinkNum;
131 }
132 else
133 {
134 SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID);
135 det[0].LinkNum = originalPart.LinkNum;
136 }
122 137
123 myScriptEngine.PostObjectEvent(localID, new EventParams( 138 myScriptEngine.PostObjectEvent(localID, new EventParams(
124 "touch", new Object[] { new LSL_Types.LSLInteger(1) }, 139 "touch", new Object[] { new LSL_Types.LSLInteger(1) },
125 det)); 140 det));
126 } 141 }
127 142
128 public void touch_end(uint localID, IClientAPI remoteClient) 143 public void touch_end(uint localID, uint originalID, IClientAPI remoteClient)
129 { 144 {
130 // Add to queue for all scripts in ObjectID object 145 // Add to queue for all scripts in ObjectID object
131 DetectParams[] det = new DetectParams[1]; 146 DetectParams[] det = new DetectParams[1];
@@ -133,12 +148,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine
133 det[0].Key = remoteClient.AgentId; 148 det[0].Key = remoteClient.AgentId;
134 det[0].Populate(myScriptEngine.World); 149 det[0].Populate(myScriptEngine.World);
135 150
136 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart( 151 if (originalID == 0)
137 localID); 152 {
138 if (part == null) 153 SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
139 return; 154 if (part == null)
155 return;
140 156
141 det[0].LinkNum = part.LinkNum; 157 det[0].LinkNum = part.LinkNum;
158 }
159 else
160 {
161 SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID);
162 det[0].LinkNum = originalPart.LinkNum;
163 }
142 164
143 myScriptEngine.PostObjectEvent(localID, new EventParams( 165 myScriptEngine.PostObjectEvent(localID, new EventParams(
144 "touch_end", new Object[] { new LSL_Types.LSLInteger(1) }, 166 "touch_end", new Object[] { new LSL_Types.LSLInteger(1) },
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index c5bcfd5..8fd8a1c 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -319,14 +319,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
319 get { return false; } 319 get { return false; }
320 } 320 }
321 321
322 //
323 // XEngine functions
324 //
325 public int MaxScriptQueue
326 {
327 get { return m_MaxScriptQueue; }
328 }
329
330 public void OnRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez) 322 public void OnRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez)
331 { 323 {
332 Object[] parms = new Object[] 324 Object[] parms = new Object[]
@@ -508,7 +500,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
508 m_AppDomains[appDomain], 500 m_AppDomains[appDomain],
509 part.ParentGroup.RootPart.Name, 501 part.ParentGroup.RootPart.Name,
510 item.Name, startParam, postOnRez, 502 item.Name, startParam, postOnRez,
511 StateSource.NewRez); 503 StateSource.NewRez, m_MaxScriptQueue);
512 504
513 m_log.DebugFormat("[XEngine] Loaded script {0}.{1}", 505 m_log.DebugFormat("[XEngine] Loaded script {0}.{1}",
514 part.ParentGroup.RootPart.Name, item.Name); 506 part.ParentGroup.RootPart.Name, item.Name);