diff options
author | Sean Dague | 2008-03-28 12:47:03 +0000 |
---|---|---|
committer | Sean Dague | 2008-03-28 12:47:03 +0000 |
commit | 2eda6a12962e0af23e060d4338e32896ddedf366 (patch) | |
tree | 0d6b055f5be5f589cfaa9d5f9f7ae031072e8feb /OpenSim/Region/Environment/Modules/WorldCommModule.cs | |
parent | * Correct asset type of Lost and Found folder - this might stop it appearing ... (diff) | |
download | opensim-SC-2eda6a12962e0af23e060d4338e32896ddedf366.zip opensim-SC-2eda6a12962e0af23e060d4338e32896ddedf366.tar.gz opensim-SC-2eda6a12962e0af23e060d4338e32896ddedf366.tar.bz2 opensim-SC-2eda6a12962e0af23e060d4338e32896ddedf366.tar.xz |
From: Michael Osias <mosias@us.ibm.com>
This patch implements llMessageLinked.
I had to make a change to llGetLinkNumber to return m_host.LinkNum + 1 for
link sets of more than 1 prim, or 0 for a single object, since according
to:
http://rpgstats.com/wiki/index.php?title=LlMessageLinked
linksets with 2 or more prims start the link numbering at 1, but a single
prims link number is 0.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/WorldCommModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/WorldCommModule.cs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Modules/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/WorldCommModule.cs index e1d2fbc..79e475c 100644 --- a/OpenSim/Region/Environment/Modules/WorldCommModule.cs +++ b/OpenSim/Region/Environment/Modules/WorldCommModule.cs | |||
@@ -75,6 +75,7 @@ namespace OpenSim.Region.Environment.Modules | |||
75 | private ListenerManager m_listenerManager; | 75 | private ListenerManager m_listenerManager; |
76 | private Queue m_pendingQ; | 76 | private Queue m_pendingQ; |
77 | private Queue m_pending; | 77 | private Queue m_pending; |
78 | |||
78 | public WorldCommModule() | 79 | public WorldCommModule() |
79 | { | 80 | { |
80 | } | 81 | } |
@@ -112,6 +113,11 @@ namespace OpenSim.Region.Environment.Modules | |||
112 | client.OnChatFromViewer += DeliverClientMessage; | 113 | client.OnChatFromViewer += DeliverClientMessage; |
113 | } | 114 | } |
114 | 115 | ||
116 | /******************************************************************** | ||
117 | * | ||
118 | * Listener Stuff | ||
119 | * | ||
120 | * *****************************************************************/ | ||
115 | private void DeliverClientMessage(Object sender, ChatFromViewerArgs e) | 121 | private void DeliverClientMessage(Object sender, ChatFromViewerArgs e) |
116 | { | 122 | { |
117 | DeliverMessage(e.Sender.AgentId.ToString(), | 123 | DeliverMessage(e.Sender.AgentId.ToString(), |
@@ -179,7 +185,7 @@ namespace OpenSim.Region.Environment.Modules | |||
179 | 185 | ||
180 | m_scene.Entities.TryGetValue(li.GetHostID(), out sPart); | 186 | m_scene.Entities.TryGetValue(li.GetHostID(), out sPart); |
181 | 187 | ||
182 | if(sPart != null) | 188 | if (sPart != null) |
183 | { | 189 | { |
184 | // Dont process if this message is from itself! | 190 | // Dont process if this message is from itself! |
185 | if (li.GetHostID().ToString().Equals(sourceItemID) || | 191 | if (li.GetHostID().ToString().Equals(sourceItemID) || |
@@ -291,7 +297,7 @@ namespace OpenSim.Region.Environment.Modules | |||
291 | 297 | ||
292 | lock (m_pending.SyncRoot) | 298 | lock (m_pending.SyncRoot) |
293 | { | 299 | { |
294 | li = (ListenerInfo) m_pending.Dequeue(); | 300 | li = (ListenerInfo)m_pending.Dequeue(); |
295 | } | 301 | } |
296 | 302 | ||
297 | return li; | 303 | return li; |
@@ -306,12 +312,13 @@ namespace OpenSim.Region.Environment.Modules | |||
306 | { | 312 | { |
307 | return ((ListenerInfo)m_pending.Peek()).GetItemID(); | 313 | return ((ListenerInfo)m_pending.Peek()).GetItemID(); |
308 | } | 314 | } |
309 | |||
310 | } | 315 | } |
311 | 316 | ||
312 | // hostID: the ID of the ScenePart | 317 | /********************************************************** |
313 | // itemID: the ID of the script host engine | 318 | * |
314 | // localID: local ID of host engine | 319 | * Even more listener stuff |
320 | * | ||
321 | * ********************************************************/ | ||
315 | public class ListenerManager | 322 | public class ListenerManager |
316 | { | 323 | { |
317 | //private Dictionary<int, ListenerInfo> m_listeners; | 324 | //private Dictionary<int, ListenerInfo> m_listeners; |
@@ -434,9 +441,9 @@ namespace OpenSim.Region.Environment.Modules | |||
434 | { | 441 | { |
435 | ListenerInfo li = (ListenerInfo)en.Value; | 442 | ListenerInfo li = (ListenerInfo)en.Value; |
436 | 443 | ||
437 | if (li.GetHostID().Equals(listenerKey)) | 444 | if (li.IsActive()) |
438 | { | 445 | { |
439 | if (li.IsActive()) | 446 | if (li.GetHostID().Equals(listenerKey)) |
440 | { | 447 | { |
441 | if (channel == li.GetChannel()) | 448 | if (channel == li.GetChannel()) |
442 | { | 449 | { |
@@ -575,4 +582,5 @@ namespace OpenSim.Region.Environment.Modules | |||
575 | return m_id; | 582 | return m_id; |
576 | } | 583 | } |
577 | } | 584 | } |
585 | |||
578 | } | 586 | } |