diff options
author | BlueWall | 2011-08-19 18:47:21 -0400 |
---|---|---|
committer | BlueWall | 2011-08-19 18:47:21 -0400 |
commit | 2787207aa287a60a3c7c06fad66d406180033ae2 (patch) | |
tree | 8e311f249b2ed665dbb38dd0cb1b8d83215bc3e2 /OpenSim/Region | |
parent | Get rid of HttpServer.dll to avoid confusion since we use HttpServer_OpenSim.... (diff) | |
download | opensim-SC-2787207aa287a60a3c7c06fad66d406180033ae2.zip opensim-SC-2787207aa287a60a3c7c06fad66d406180033ae2.tar.gz opensim-SC-2787207aa287a60a3c7c06fad66d406180033ae2.tar.bz2 opensim-SC-2787207aa287a60a3c7c06fad66d406180033ae2.tar.xz |
Add llRegionSayTo
llRegionSayTo(key target, integer channel, string messasge)
Allows messages to be sent region-wide
to a particular prim.
Diffstat (limited to 'OpenSim/Region')
5 files changed, 68 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index d647e71..6917b14 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -282,6 +282,27 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
282 | } | 282 | } |
283 | } | 283 | } |
284 | 284 | ||
285 | // wComm.DeliverMessageTo(target, channelID, m_host.Name, m_host.UUID, text); | ||
286 | public void DeliverMessageTo(UUID target, int channel, string name, UUID id, string msg) | ||
287 | { | ||
288 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) | ||
289 | { | ||
290 | // Dont process if this message is from yourself! | ||
291 | if (li.GetHostID().Equals(id)) | ||
292 | continue; | ||
293 | |||
294 | SceneObjectPart sPart = m_scene.GetSceneObjectPart(li.GetHostID()); | ||
295 | if (sPart == null) | ||
296 | continue; | ||
297 | |||
298 | if ( li.GetHostID().Equals(target)) | ||
299 | { | ||
300 | QueueMessage(new ListenerInfo(li, name, id, msg)); | ||
301 | return; | ||
302 | } | ||
303 | } | ||
304 | } | ||
305 | |||
285 | protected void QueueMessage(ListenerInfo li) | 306 | protected void QueueMessage(ListenerInfo li) |
286 | { | 307 | { |
287 | lock (m_pending.SyncRoot) | 308 | lock (m_pending.SyncRoot) |
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs index 8da99a0..8f200ae 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs | |||
@@ -81,6 +81,26 @@ namespace OpenSim.Region.Framework.Interfaces | |||
81 | void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg); | 81 | void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg); |
82 | 82 | ||
83 | /// <summary> | 83 | /// <summary> |
84 | /// Delivers the message to a specified object in the region. | ||
85 | /// </summary> | ||
86 | /// <param name='target'> | ||
87 | /// Target. | ||
88 | /// </param> | ||
89 | /// <param name='channel'> | ||
90 | /// Channel. | ||
91 | /// </param> | ||
92 | /// <param name='name'> | ||
93 | /// Name. | ||
94 | /// </param> | ||
95 | /// <param name='id'> | ||
96 | /// Identifier. | ||
97 | /// </param> | ||
98 | /// <param name='msg'> | ||
99 | /// Message. | ||
100 | /// </param> | ||
101 | void DeliverMessageTo(UUID target, int channel, string name, UUID id, string msg); | ||
102 | |||
103 | /// <summary> | ||
84 | /// Are there any listen events ready to be dispatched? | 104 | /// Are there any listen events ready to be dispatched? |
85 | /// </summary> | 105 | /// </summary> |
86 | /// <returns>boolean indication</returns> | 106 | /// <returns>boolean indication</returns> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c84afee..25d7ad9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -843,6 +843,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
843 | wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text); | 843 | wComm.DeliverMessage(ChatTypeEnum.Region, channelID, m_host.Name, m_host.UUID, text); |
844 | } | 844 | } |
845 | 845 | ||
846 | public void llRegionSayTo(string target, int channel, string msg) | ||
847 | { | ||
848 | if (channel == 0) | ||
849 | { | ||
850 | LSLError("Cannot use llRegionSay() on channel 0"); | ||
851 | return; | ||
852 | } | ||
853 | |||
854 | if (msg.Length > 1023) | ||
855 | msg = msg.Substring(0, 1023); | ||
856 | |||
857 | m_host.AddScriptLPS(1); | ||
858 | |||
859 | UUID TargetID; | ||
860 | UUID.TryParse(target, out TargetID); | ||
861 | |||
862 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | ||
863 | if (wComm != null) | ||
864 | wComm.DeliverMessageTo(TargetID, channel, m_host.Name, m_host.UUID, msg); | ||
865 | } | ||
866 | |||
846 | public LSL_Integer llListen(int channelID, string name, string ID, string msg) | 867 | public LSL_Integer llListen(int channelID, string name, string ID, string msg) |
847 | { | 868 | { |
848 | m_host.AddScriptLPS(1); | 869 | m_host.AddScriptLPS(1); |
@@ -10486,12 +10507,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10486 | NotImplemented("llGetUsedMemory"); | 10507 | NotImplemented("llGetUsedMemory"); |
10487 | } | 10508 | } |
10488 | 10509 | ||
10489 | public void llRegionSayTo(LSL_Key target, LSL_Integer channel, LSL_String msg) | ||
10490 | { | ||
10491 | m_host.AddScriptLPS(1); | ||
10492 | NotImplemented("llRegionSayTo"); | ||
10493 | } | ||
10494 | |||
10495 | public void llScriptProfiler(LSL_Integer flags) | 10510 | public void llScriptProfiler(LSL_Integer flags) |
10496 | { | 10511 | { |
10497 | m_host.AddScriptLPS(1); | 10512 | m_host.AddScriptLPS(1); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 27f9c84..4d7d60d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | |||
@@ -271,6 +271,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
271 | void llPushObject(string target, LSL_Vector impulse, LSL_Vector ang_impulse, int local); | 271 | void llPushObject(string target, LSL_Vector impulse, LSL_Vector ang_impulse, int local); |
272 | void llRefreshPrimURL(); | 272 | void llRefreshPrimURL(); |
273 | void llRegionSay(int channelID, string text); | 273 | void llRegionSay(int channelID, string text); |
274 | void llRegionSayTo(string target, int channelID, string text); | ||
274 | void llReleaseCamera(string avatar); | 275 | void llReleaseCamera(string avatar); |
275 | void llReleaseControls(); | 276 | void llReleaseControls(); |
276 | void llReleaseURL(string url); | 277 | void llReleaseURL(string url); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 303d75e..96e46fd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | |||
@@ -1199,6 +1199,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
1199 | m_LSL_Functions.llRegionSay(channelID, text); | 1199 | m_LSL_Functions.llRegionSay(channelID, text); |
1200 | } | 1200 | } |
1201 | 1201 | ||
1202 | public void llRegionSayTo(string key, int channelID, string text) | ||
1203 | { | ||
1204 | m_LSL_Functions.llRegionSayTo(key, channelID, text); | ||
1205 | } | ||
1206 | |||
1202 | public void llReleaseCamera(string avatar) | 1207 | public void llReleaseCamera(string avatar) |
1203 | { | 1208 | { |
1204 | m_LSL_Functions.llReleaseCamera(avatar); | 1209 | m_LSL_Functions.llReleaseCamera(avatar); |