cleanup last patch

This commit is contained in:
UbitUmarov
2018-12-11 18:23:26 +00:00
parent 0881840946
commit d6c9ddfdee
5 changed files with 268 additions and 50 deletions

View File

@@ -3164,33 +3164,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
module.Say(npcId, World, message, channel);
}
}
public void osNpcSayTo(LSL_Key npc, string target, int channel, string msg)
public void osNpcSayTo(LSL_Key npc, LSL_Key target, int channel, string msg)
{
CheckThreatLevel(ThreatLevel.High, "osNpcSayTo");
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
UUID npcId = new UUID(npc.m_string);
if (module == null)
return;
UUID npcId;
if (!UUID.TryParse(npc.m_string, out npcId))
return;
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
ScenePresence NPCpresence = World.GetScenePresence(npcId);
if (NPCpresence == null || NPCpresence.IsDeleted)
return;
Vector3 npcPOS = NPCpresence.AbsolutePosition;
string npcNAME = NPCpresence.Name;
UUID TargetID;
UUID.TryParse(target, out TargetID);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
if (!UUID.TryParse(target.m_string, out TargetID))
return;
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
ScenePresence NPCpresence = World.GetScenePresence(npcId);
if (NPCpresence == null || NPCpresence.IsDeleted || !NPCpresence.IsNPC)
return;
Vector3 npcPOS = NPCpresence.AbsolutePosition;
string npcNAME = NPCpresence.Name;
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
if (wComm != null)
wComm.DeliverMessageTo(TargetID, channel, npcPOS, npcNAME, npcId, msg);
}
}
public void osNpcShout(LSL_Key npc, int channel, string message)
{
CheckThreatLevel(ThreatLevel.High, "osNpcShout");

View File

@@ -358,7 +358,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osNpcSetProfileImage(LSL_Key npc, string image);
void osNpcSay(key npc, string message);
void osNpcSay(key npc, int channel, string message);
void osNpcSayTo(LSL_Key npc, string target, int channel, string msg);
void osNpcSayTo(LSL_Key npc, LSL_Key target, int channel, string msg);
void osNpcShout(key npc, int channel, string message);
void osNpcSit(key npc, key target, int options);
void osNpcStand(LSL_Key npc);

View File

@@ -682,10 +682,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
m_OSSL_Functions.osNpcSay(npc, channel, message);
}
public void osNpcSayTo(LSL_Key npc, string target, int channel, string msg)
public void osNpcSayTo(LSL_Key npc, LSL_Key target, int channel, string msg)
{
m_OSSL_Functions.osNpcSayTo(npc, target, channel, msg);
}
}
public void osNpcShout(key npc, int channel, string message)
{
m_OSSL_Functions.osNpcShout(npc, channel, message);