diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs index 2f67dee..ae5eefc 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using libsecondlife; | 31 | using OpenMetaverse; |
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Environment.Interfaces; | 34 | using OpenSim.Region.Environment.Interfaces; |
@@ -66,7 +66,7 @@ using OpenSim.Region.Environment.Scenes; | |||
66 | * | 66 | * |
67 | * For LSL compliance, note the following: | 67 | * For LSL compliance, note the following: |
68 | * (Tested again 1.21.1 on May 2, 2008) | 68 | * (Tested again 1.21.1 on May 2, 2008) |
69 | * 1. 'id' has to be parsed into a LLUUID. None-UUID keys are | 69 | * 1. 'id' has to be parsed into a UUID. None-UUID keys are |
70 | * to be replaced by the ZeroID key. (Well, TryParse does | 70 | * to be replaced by the ZeroID key. (Well, TryParse does |
71 | * that for us. | 71 | * that for us. |
72 | * 2. Setting up an listen event from the same script, with the | 72 | * 2. Setting up an listen event from the same script, with the |
@@ -157,7 +157,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
157 | /// <param name="id">key to filter on (user given, could be totally faked)</param> | 157 | /// <param name="id">key to filter on (user given, could be totally faked)</param> |
158 | /// <param name="msg">msg to filter on</param> | 158 | /// <param name="msg">msg to filter on</param> |
159 | /// <returns>number of the scripts handle</returns> | 159 | /// <returns>number of the scripts handle</returns> |
160 | public int Listen(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, LLUUID id, string msg) | 160 | public int Listen(uint localID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg) |
161 | { | 161 | { |
162 | return m_listenerManager.AddListener(localID, itemID, hostID, channel, name, id, msg); | 162 | return m_listenerManager.AddListener(localID, itemID, hostID, channel, name, id, msg); |
163 | } | 163 | } |
@@ -169,7 +169,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
169 | /// <param name="itemID">UUID of the script engine</param> | 169 | /// <param name="itemID">UUID of the script engine</param> |
170 | /// <param name="handle">handle returned by Listen()</param> | 170 | /// <param name="handle">handle returned by Listen()</param> |
171 | /// <param name="active">temp. activate or deactivate the Listen()</param> | 171 | /// <param name="active">temp. activate or deactivate the Listen()</param> |
172 | public void ListenControl(LLUUID itemID, int handle, int active) | 172 | public void ListenControl(UUID itemID, int handle, int active) |
173 | { | 173 | { |
174 | if (active == 1) | 174 | if (active == 1) |
175 | m_listenerManager.Activate(itemID, handle); | 175 | m_listenerManager.Activate(itemID, handle); |
@@ -182,7 +182,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
182 | /// </summary> | 182 | /// </summary> |
183 | /// <param name="itemID">UUID of the script engine</param> | 183 | /// <param name="itemID">UUID of the script engine</param> |
184 | /// <param name="handle">handle returned by Listen()</param> | 184 | /// <param name="handle">handle returned by Listen()</param> |
185 | public void ListenRemove(LLUUID itemID, int handle) | 185 | public void ListenRemove(UUID itemID, int handle) |
186 | { | 186 | { |
187 | m_listenerManager.Remove(itemID, handle); | 187 | m_listenerManager.Remove(itemID, handle); |
188 | } | 188 | } |
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
192 | /// (script engine) | 192 | /// (script engine) |
193 | /// </summary> | 193 | /// </summary> |
194 | /// <param name="itemID">UUID of the script engine</param> | 194 | /// <param name="itemID">UUID of the script engine</param> |
195 | public void DeleteListener(LLUUID itemID) | 195 | public void DeleteListener(UUID itemID) |
196 | { | 196 | { |
197 | m_listenerManager.DeleteListener(itemID); | 197 | m_listenerManager.DeleteListener(itemID); |
198 | } | 198 | } |
@@ -210,11 +210,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
210 | /// <param name="name">name of sender (object or avatar)</param> | 210 | /// <param name="name">name of sender (object or avatar)</param> |
211 | /// <param name="id">key of sender (object or avatar)</param> | 211 | /// <param name="id">key of sender (object or avatar)</param> |
212 | /// <param name="msg">msg to sent</param> | 212 | /// <param name="msg">msg to sent</param> |
213 | public void DeliverMessage(ChatTypeEnum type, int channel, string name, LLUUID id, string msg) | 213 | public void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg) |
214 | { | 214 | { |
215 | SceneObjectPart source = null; | 215 | SceneObjectPart source = null; |
216 | ScenePresence avatar = null; | 216 | ScenePresence avatar = null; |
217 | LLVector3 position; | 217 | Vector3 position; |
218 | 218 | ||
219 | source = m_scene.GetSceneObjectPart(id); | 219 | source = m_scene.GetSceneObjectPart(id); |
220 | if (source != null) | 220 | if (source != null) |
@@ -231,7 +231,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
231 | // Determine which listen event filters match the given set of arguments, this results | 231 | // Determine which listen event filters match the given set of arguments, this results |
232 | // in a limited set of listeners, each belonging a host. If the host is in range, add them | 232 | // in a limited set of listeners, each belonging a host. If the host is in range, add them |
233 | // to the pending queue. | 233 | // to the pending queue. |
234 | foreach (ListenerInfo li in m_listenerManager.GetListeners(LLUUID.Zero, channel, name, id, msg)) | 234 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) |
235 | { | 235 | { |
236 | // Dont process if this message is from yourself! | 236 | // Dont process if this message is from yourself! |
237 | if (li.GetHostID().Equals(id)) | 237 | if (li.GetHostID().Equals(id)) |
@@ -331,12 +331,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
331 | e.Message); | 331 | e.Message); |
332 | } | 332 | } |
333 | 333 | ||
334 | public Object[] GetSerializationData(LLUUID itemID) | 334 | public Object[] GetSerializationData(UUID itemID) |
335 | { | 335 | { |
336 | return m_listenerManager.GetSerializationData(itemID); | 336 | return m_listenerManager.GetSerializationData(itemID); |
337 | } | 337 | } |
338 | 338 | ||
339 | public void CreateFromData(uint localID, LLUUID itemID, LLUUID hostID, | 339 | public void CreateFromData(uint localID, UUID itemID, UUID hostID, |
340 | Object[] data) | 340 | Object[] data) |
341 | { | 341 | { |
342 | m_listenerManager.AddFromData(localID, itemID, hostID, data); | 342 | m_listenerManager.AddFromData(localID, itemID, hostID, data); |
@@ -357,7 +357,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
357 | m_curlisteners = 0; | 357 | m_curlisteners = 0; |
358 | } | 358 | } |
359 | 359 | ||
360 | public int AddListener(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, LLUUID id, string msg) | 360 | public int AddListener(uint localID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg) |
361 | { | 361 | { |
362 | // do we already have a match on this particular filter event? | 362 | // do we already have a match on this particular filter event? |
363 | List<ListenerInfo> coll = GetListeners(itemID, channel, name, id, msg); | 363 | List<ListenerInfo> coll = GetListeners(itemID, channel, name, id, msg); |
@@ -395,7 +395,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
395 | return -1; | 395 | return -1; |
396 | } | 396 | } |
397 | 397 | ||
398 | public void Remove(LLUUID itemID, int handle) | 398 | public void Remove(UUID itemID, int handle) |
399 | { | 399 | { |
400 | lock (m_listeners) | 400 | lock (m_listeners) |
401 | { | 401 | { |
@@ -419,7 +419,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
419 | } | 419 | } |
420 | } | 420 | } |
421 | 421 | ||
422 | public void DeleteListener(LLUUID itemID) | 422 | public void DeleteListener(UUID itemID) |
423 | { | 423 | { |
424 | List<int> emptyChannels = new List<int>(); | 424 | List<int> emptyChannels = new List<int>(); |
425 | List<ListenerInfo> removedListeners = new List<ListenerInfo>(); | 425 | List<ListenerInfo> removedListeners = new List<ListenerInfo>(); |
@@ -455,7 +455,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
455 | } | 455 | } |
456 | } | 456 | } |
457 | 457 | ||
458 | public void Activate(LLUUID itemID, int handle) | 458 | public void Activate(UUID itemID, int handle) |
459 | { | 459 | { |
460 | lock (m_listeners) | 460 | lock (m_listeners) |
461 | { | 461 | { |
@@ -474,7 +474,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
474 | } | 474 | } |
475 | } | 475 | } |
476 | 476 | ||
477 | public void Dectivate(LLUUID itemID, int handle) | 477 | public void Dectivate(UUID itemID, int handle) |
478 | { | 478 | { |
479 | lock (m_listeners) | 479 | lock (m_listeners) |
480 | { | 480 | { |
@@ -494,7 +494,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
494 | } | 494 | } |
495 | 495 | ||
496 | // non-locked access, since its always called in the context of the lock | 496 | // non-locked access, since its always called in the context of the lock |
497 | private int GetNewHandle(LLUUID itemID) | 497 | private int GetNewHandle(UUID itemID) |
498 | { | 498 | { |
499 | List<int> handles = new List<int>(); | 499 | List<int> handles = new List<int>(); |
500 | 500 | ||
@@ -521,7 +521,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
521 | // Theres probably a more clever and efficient way to | 521 | // Theres probably a more clever and efficient way to |
522 | // do this, maybe with regex. | 522 | // do this, maybe with regex. |
523 | // PM2008: Ha, one could even be smart and define a specialized Enumerator. | 523 | // PM2008: Ha, one could even be smart and define a specialized Enumerator. |
524 | public List<ListenerInfo> GetListeners(LLUUID itemID, int channel, string name, LLUUID id, string msg) | 524 | public List<ListenerInfo> GetListeners(UUID itemID, int channel, string name, UUID id, string msg) |
525 | { | 525 | { |
526 | List<ListenerInfo> collection = new List<ListenerInfo>(); | 526 | List<ListenerInfo> collection = new List<ListenerInfo>(); |
527 | 527 | ||
@@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
539 | { | 539 | { |
540 | continue; | 540 | continue; |
541 | } | 541 | } |
542 | if (!itemID.Equals(LLUUID.Zero) && !li.GetItemID().Equals(itemID)) | 542 | if (!itemID.Equals(UUID.Zero) && !li.GetItemID().Equals(itemID)) |
543 | { | 543 | { |
544 | continue; | 544 | continue; |
545 | } | 545 | } |
@@ -547,7 +547,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
547 | { | 547 | { |
548 | continue; | 548 | continue; |
549 | } | 549 | } |
550 | if (!li.GetID().Equals(LLUUID.Zero) && !li.GetID().Equals(id)) | 550 | if (!li.GetID().Equals(UUID.Zero) && !li.GetID().Equals(id)) |
551 | { | 551 | { |
552 | continue; | 552 | continue; |
553 | } | 553 | } |
@@ -561,7 +561,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
561 | return collection; | 561 | return collection; |
562 | } | 562 | } |
563 | 563 | ||
564 | public Object[] GetSerializationData(LLUUID itemID) | 564 | public Object[] GetSerializationData(UUID itemID) |
565 | { | 565 | { |
566 | List<Object> data = new List<Object>(); | 566 | List<Object> data = new List<Object>(); |
567 | 567 | ||
@@ -576,7 +576,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
576 | return (Object[])data.ToArray(); | 576 | return (Object[])data.ToArray(); |
577 | } | 577 | } |
578 | 578 | ||
579 | public void AddFromData(uint localID, LLUUID itemID, LLUUID hostID, | 579 | public void AddFromData(uint localID, UUID itemID, UUID hostID, |
580 | Object[] data) | 580 | Object[] data) |
581 | { | 581 | { |
582 | int idx = 0; | 582 | int idx = 0; |
@@ -603,25 +603,25 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
603 | private bool m_active; // Listener is active or not | 603 | private bool m_active; // Listener is active or not |
604 | private int m_handle; // Assigned handle of this listener | 604 | private int m_handle; // Assigned handle of this listener |
605 | private uint m_localID; // Local ID from script engine | 605 | private uint m_localID; // Local ID from script engine |
606 | private LLUUID m_itemID; // ID of the host script engine | 606 | private UUID m_itemID; // ID of the host script engine |
607 | private LLUUID m_hostID; // ID of the host/scene part | 607 | private UUID m_hostID; // ID of the host/scene part |
608 | private int m_channel; // Channel | 608 | private int m_channel; // Channel |
609 | private LLUUID m_id; // ID to filter messages from | 609 | private UUID m_id; // ID to filter messages from |
610 | private string m_name; // Object name to filter messages from | 610 | private string m_name; // Object name to filter messages from |
611 | private string m_message; // The message | 611 | private string m_message; // The message |
612 | 612 | ||
613 | public ListenerInfo(int handle, uint localID, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id, string message) | 613 | public ListenerInfo(int handle, uint localID, UUID ItemID, UUID hostID, int channel, string name, UUID id, string message) |
614 | { | 614 | { |
615 | Initialise(handle, localID, ItemID, hostID, channel, name, id, message); | 615 | Initialise(handle, localID, ItemID, hostID, channel, name, id, message); |
616 | } | 616 | } |
617 | 617 | ||
618 | public ListenerInfo(ListenerInfo li, string name, LLUUID id, string message) | 618 | public ListenerInfo(ListenerInfo li, string name, UUID id, string message) |
619 | { | 619 | { |
620 | Initialise(li.m_handle, li.m_localID, li.m_itemID, li.m_hostID, li.m_channel, name, id, message); | 620 | Initialise(li.m_handle, li.m_localID, li.m_itemID, li.m_hostID, li.m_channel, name, id, message); |
621 | } | 621 | } |
622 | 622 | ||
623 | private void Initialise(int handle, uint localID, LLUUID ItemID, LLUUID hostID, int channel, string name, | 623 | private void Initialise(int handle, uint localID, UUID ItemID, UUID hostID, int channel, string name, |
624 | LLUUID id, string message) | 624 | UUID id, string message) |
625 | { | 625 | { |
626 | m_active = true; | 626 | m_active = true; |
627 | m_handle = handle; | 627 | m_handle = handle; |
@@ -648,22 +648,22 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
648 | return data; | 648 | return data; |
649 | } | 649 | } |
650 | 650 | ||
651 | public static ListenerInfo FromData(uint localID, LLUUID ItemID, LLUUID hostID, Object[] data) | 651 | public static ListenerInfo FromData(uint localID, UUID ItemID, UUID hostID, Object[] data) |
652 | { | 652 | { |
653 | ListenerInfo linfo = new ListenerInfo((int)data[1], localID, | 653 | ListenerInfo linfo = new ListenerInfo((int)data[1], localID, |
654 | ItemID, hostID, (int)data[2], (string)data[3], | 654 | ItemID, hostID, (int)data[2], (string)data[3], |
655 | (LLUUID)data[4], (string)data[5]); | 655 | (UUID)data[4], (string)data[5]); |
656 | linfo.m_active=(bool)data[0]; | 656 | linfo.m_active=(bool)data[0]; |
657 | 657 | ||
658 | return linfo; | 658 | return linfo; |
659 | } | 659 | } |
660 | 660 | ||
661 | public LLUUID GetItemID() | 661 | public UUID GetItemID() |
662 | { | 662 | { |
663 | return m_itemID; | 663 | return m_itemID; |
664 | } | 664 | } |
665 | 665 | ||
666 | public LLUUID GetHostID() | 666 | public UUID GetHostID() |
667 | { | 667 | { |
668 | return m_hostID; | 668 | return m_hostID; |
669 | } | 669 | } |
@@ -708,7 +708,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm | |||
708 | m_active = true; | 708 | m_active = true; |
709 | } | 709 | } |
710 | 710 | ||
711 | public LLUUID GetID() | 711 | public UUID GetID() |
712 | { | 712 | { |
713 | return m_id; | 713 | return m_id; |
714 | } | 714 | } |