diff options
author | UbitUmarov | 2018-12-11 18:23:26 +0000 |
---|---|---|
committer | UbitUmarov | 2018-12-11 18:23:26 +0000 |
commit | d6c9ddfdeebf8c18daacb421ab59a2bcd6481ab2 (patch) | |
tree | 66885913b03520bd8d8b81acef32977d35f67dd0 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | Add osNpcSayTo(key npc, key target, integer channel, string message) (diff) | |
download | opensim-SC-d6c9ddfdeebf8c18daacb421ab59a2bcd6481ab2.zip opensim-SC-d6c9ddfdeebf8c18daacb421ab59a2bcd6481ab2.tar.gz opensim-SC-d6c9ddfdeebf8c18daacb421ab59a2bcd6481ab2.tar.bz2 opensim-SC-d6c9ddfdeebf8c18daacb421ab59a2bcd6481ab2.tar.xz |
cleanup last patch
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
3 files changed, 28 insertions, 21 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7c43b6a..3c824eb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3164,33 +3164,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3164 | module.Say(npcId, World, message, channel); | 3164 | module.Say(npcId, World, message, channel); |
3165 | } | 3165 | } |
3166 | } | 3166 | } |
3167 | 3167 | ||
3168 | public void osNpcSayTo(LSL_Key npc, string target, int channel, string msg) | 3168 | public void osNpcSayTo(LSL_Key npc, LSL_Key target, int channel, string msg) |
3169 | { | 3169 | { |
3170 | CheckThreatLevel(ThreatLevel.High, "osNpcSayTo"); | 3170 | CheckThreatLevel(ThreatLevel.High, "osNpcSayTo"); |
3171 | 3171 | ||
3172 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 3172 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
3173 | if (module != null) | 3173 | if (module == null) |
3174 | { | 3174 | return; |
3175 | UUID npcId = new UUID(npc.m_string); | 3175 | |
3176 | UUID npcId; | ||
3177 | if (!UUID.TryParse(npc.m_string, out npcId)) | ||
3178 | return; | ||
3176 | 3179 | ||
3177 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
3178 | return; | ||
3179 | |||
3180 | ScenePresence NPCpresence = World.GetScenePresence(npcId); | ||
3181 | if (NPCpresence == null || NPCpresence.IsDeleted) | ||
3182 | return; | ||
3183 | |||
3184 | Vector3 npcPOS = NPCpresence.AbsolutePosition; | ||
3185 | string npcNAME = NPCpresence.Name; | ||
3186 | UUID TargetID; | 3180 | UUID TargetID; |
3187 | UUID.TryParse(target, out TargetID); | 3181 | if (!UUID.TryParse(target.m_string, out TargetID)) |
3188 | 3182 | return; | |
3189 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 3183 | |
3184 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
3185 | return; | ||
3186 | |||
3187 | ScenePresence NPCpresence = World.GetScenePresence(npcId); | ||
3188 | if (NPCpresence == null || NPCpresence.IsDeleted || !NPCpresence.IsNPC) | ||
3189 | return; | ||
3190 | |||
3191 | Vector3 npcPOS = NPCpresence.AbsolutePosition; | ||
3192 | string npcNAME = NPCpresence.Name; | ||
3193 | |||
3194 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | ||
3190 | if (wComm != null) | 3195 | if (wComm != null) |
3191 | wComm.DeliverMessageTo(TargetID, channel, npcPOS, npcNAME, npcId, msg); | 3196 | wComm.DeliverMessageTo(TargetID, channel, npcPOS, npcNAME, npcId, msg); |
3192 | } | ||
3193 | } | 3197 | } |
3198 | |||
3194 | public void osNpcShout(LSL_Key npc, int channel, string message) | 3199 | public void osNpcShout(LSL_Key npc, int channel, string message) |
3195 | { | 3200 | { |
3196 | CheckThreatLevel(ThreatLevel.High, "osNpcShout"); | 3201 | CheckThreatLevel(ThreatLevel.High, "osNpcShout"); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 2f800bc..12e8103 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -358,7 +358,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
358 | void osNpcSetProfileImage(LSL_Key npc, string image); | 358 | void osNpcSetProfileImage(LSL_Key npc, string image); |
359 | void osNpcSay(key npc, string message); | 359 | void osNpcSay(key npc, string message); |
360 | void osNpcSay(key npc, int channel, string message); | 360 | void osNpcSay(key npc, int channel, string message); |
361 | void osNpcSayTo(LSL_Key npc, string target, int channel, string msg); | 361 | void osNpcSayTo(LSL_Key npc, LSL_Key target, int channel, string msg); |
362 | void osNpcShout(key npc, int channel, string message); | 362 | void osNpcShout(key npc, int channel, string message); |
363 | void osNpcSit(key npc, key target, int options); | 363 | void osNpcSit(key npc, key target, int options); |
364 | void osNpcStand(LSL_Key npc); | 364 | void osNpcStand(LSL_Key npc); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index ba899b0..94df1ea 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -682,10 +682,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
682 | { | 682 | { |
683 | m_OSSL_Functions.osNpcSay(npc, channel, message); | 683 | m_OSSL_Functions.osNpcSay(npc, channel, message); |
684 | } | 684 | } |
685 | public void osNpcSayTo(LSL_Key npc, string target, int channel, string msg) | 685 | |
686 | public void osNpcSayTo(LSL_Key npc, LSL_Key target, int channel, string msg) | ||
686 | { | 687 | { |
687 | m_OSSL_Functions.osNpcSayTo(npc, target, channel, msg); | 688 | m_OSSL_Functions.osNpcSayTo(npc, target, channel, msg); |
688 | } | 689 | } |
690 | |||
689 | public void osNpcShout(key npc, int channel, string message) | 691 | public void osNpcShout(key npc, int channel, string message) |
690 | { | 692 | { |
691 | m_OSSL_Functions.osNpcShout(npc, channel, message); | 693 | m_OSSL_Functions.osNpcShout(npc, channel, message); |