Adding check permission CanIssueEstateCommand for osRegionNotice and new function osRegionNotice(string agentID, string msg)

Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
0.9.1.0-post-fixes
Mandarinka Tasty 2018-08-27 21:36:45 +02:00 committed by UbitUmarov
parent 7120ffbc08
commit 99a23421a8
3 changed files with 36 additions and 7 deletions

View File

@ -628,16 +628,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osRegionNotice(string msg)
{
// This implementation provides absolutely no security
// It's high griefing potential makes this classification
// necessary
//
CheckThreatLevel(ThreatLevel.VeryHigh, "osRegionNotice");
CheckThreatLevel(ThreatLevel.High, "osRegionNotice");
IDialogModule dm = World.RequestModuleInterface<IDialogModule>();
if (dm == null)
return;
if (dm != null)
dm.SendGeneralAlert(msg);
if (!World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false))
return;
dm.SendGeneralAlert(msg + "\n");
}
public void osRegionNotice(string agentID, string msg)
{
CheckThreatLevel(ThreatLevel.High, "osRegionNotice");
if (!UUID.TryParse(agentID, out UUID avatarID))
return;
if (!World.TryGetScenePresence(avatarID, out ScenePresence sp))
return;
if (sp.IsChildAgent || sp.IsDeleted || sp.IsInTransit || sp.IsNPC)
return;
IDialogModule dm = World.RequestModuleInterface<IDialogModule>();
if (dm == null)
return;
if (!World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false))
return;
dm.SendAlertToUser(sp.ControllingClient, msg + "\n", false);
}
public void osSetRot(UUID target, Quaternion rotation)

View File

@ -138,6 +138,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
int osRegionRestart(double seconds);
int osRegionRestart(double seconds, string msg);
void osRegionNotice(string msg);
void osRegionNotice(string agentID, string msg);
bool osConsoleCommand(string Command);
void osSetParcelMediaURL(string url);
void osSetPrimFloatOnWater(int floatYN);

View File

@ -225,6 +225,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osRegionNotice(msg);
}
public void osRegionNotice(string agentID, string msg)
{
m_OSSL_Functions.osRegionNotice(agentID, msg);
}
public bool osConsoleCommand(string Command)
{
return m_OSSL_Functions.osConsoleCommand(Command);