mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs OpenSim/Region/Framework/Scenes/Scene.Inventory.cs OpenSim/Region/Framework/Scenes/Scene.cs
This commit is contained in:
@@ -360,7 +360,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
UUID ownerID = ti.OwnerID;
|
||||
|
||||
//OSSL only may be used if objet is in the same group as the parcel
|
||||
//OSSL only may be used if object is in the same group as the parcel
|
||||
if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER"))
|
||||
{
|
||||
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
|
||||
@@ -738,11 +738,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
// For safety, we add another permission check here, and don't rely only on the standard OSSL permissions
|
||||
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
|
||||
{
|
||||
MainConsole.Instance.RunCommand(command);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2568,6 +2570,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
|
||||
public void osNpcSay(LSL_Key npc, string message)
|
||||
{
|
||||
osNpcSay(npc, 0, message);
|
||||
}
|
||||
|
||||
public void osNpcSay(LSL_Key npc, int channel, string message)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osNpcSay");
|
||||
m_host.AddScriptLPS(1);
|
||||
@@ -2580,7 +2587,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (!module.CheckPermissions(npcId, m_host.OwnerID))
|
||||
return;
|
||||
|
||||
module.Say(npcId, World, message);
|
||||
module.Say(npcId, World, message, channel);
|
||||
}
|
||||
}
|
||||
|
||||
public void osNpcShout(LSL_Key npc, int channel, string message)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osNpcShout");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||
if (module != null)
|
||||
{
|
||||
UUID npcId = new UUID(npc.m_string);
|
||||
|
||||
if (!module.CheckPermissions(npcId, m_host.OwnerID))
|
||||
return;
|
||||
|
||||
module.Shout(npcId, World, message, channel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2681,6 +2705,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
}
|
||||
|
||||
public void osNpcWhisper(LSL_Key npc, int channel, string message)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osNpcWhisper");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||
if (module != null)
|
||||
{
|
||||
UUID npcId = new UUID(npc.m_string);
|
||||
|
||||
if (!module.CheckPermissions(npcId, m_host.OwnerID))
|
||||
return;
|
||||
|
||||
module.Whisper(npcId, World, message, channel);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save the current appearance of the script owner permanently to the named notecard.
|
||||
/// </summary>
|
||||
@@ -2832,21 +2873,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
|
||||
World.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
World.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
if (sp.Firstname == FirstName && sp.Lastname == SurName)
|
||||
{
|
||||
if (sp.Firstname == FirstName && sp.Lastname == SurName)
|
||||
{
|
||||
// kick client...
|
||||
if (alert != null)
|
||||
sp.ControllingClient.Kick(alert);
|
||||
// kick client...
|
||||
if (alert != null)
|
||||
sp.ControllingClient.Kick(alert);
|
||||
|
||||
// ...and close on our side
|
||||
sp.Scene.IncomingCloseAgent(sp.UUID);
|
||||
}
|
||||
});
|
||||
}
|
||||
// ...and close on our side
|
||||
sp.Scene.IncomingCloseAgent(sp.UUID);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void osCauseDamage(string avatar, double damage)
|
||||
|
||||
@@ -217,11 +217,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
void osNpcSetRot(LSL_Key npc, rotation rot);
|
||||
void osNpcStopMoveToTarget(LSL_Key npc);
|
||||
void osNpcSay(key npc, string message);
|
||||
void osNpcSay(key npc, int channel, string message);
|
||||
void osNpcShout(key npc, int channel, string message);
|
||||
void osNpcSit(key npc, key target, int options);
|
||||
void osNpcStand(LSL_Key npc);
|
||||
void osNpcRemove(key npc);
|
||||
void osNpcPlayAnimation(LSL_Key npc, string animation);
|
||||
void osNpcStopAnimation(LSL_Key npc, string animation);
|
||||
void osNpcWhisper(key npc, int channel, string message);
|
||||
|
||||
LSL_Key osOwnerSaveAppearance(string notecard);
|
||||
LSL_Key osAgentSaveAppearance(key agentId, string notecard);
|
||||
|
||||
@@ -580,6 +580,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
m_OSSL_Functions.osNpcSay(npc, message);
|
||||
}
|
||||
|
||||
public void osNpcSay(key npc, int channel, string message)
|
||||
{
|
||||
m_OSSL_Functions.osNpcSay(npc, channel, message);
|
||||
}
|
||||
|
||||
|
||||
public void osNpcShout(key npc, int channel, string message)
|
||||
{
|
||||
m_OSSL_Functions.osNpcShout(npc, channel, message);
|
||||
}
|
||||
|
||||
public void osNpcSit(LSL_Key npc, LSL_Key target, int options)
|
||||
{
|
||||
m_OSSL_Functions.osNpcSit(npc, target, options);
|
||||
@@ -605,6 +616,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
m_OSSL_Functions.osNpcStopAnimation(npc, animation);
|
||||
}
|
||||
|
||||
public void osNpcWhisper(key npc, int channel, string message)
|
||||
{
|
||||
m_OSSL_Functions.osNpcWhisper(npc, channel, message);
|
||||
}
|
||||
|
||||
public LSL_Key osOwnerSaveAppearance(string notecard)
|
||||
{
|
||||
return m_OSSL_Functions.osOwnerSaveAppearance(notecard);
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||
IConfig config = initConfigSource.AddConfig("XEngine");
|
||||
config.Set("Enabled", "true");
|
||||
|
||||
m_scene = SceneHelpers.SetupScene();
|
||||
m_scene = new SceneHelpers().SetupScene();
|
||||
SceneHelpers.SetupSceneModules(m_scene, initConfigSource);
|
||||
|
||||
m_engine = new XEngine.XEngine();
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||
IConfig config = initConfigSource.AddConfig("XEngine");
|
||||
config.Set("Enabled", "true");
|
||||
|
||||
Scene scene = SceneHelpers.SetupScene();
|
||||
Scene scene = new SceneHelpers().SetupScene();
|
||||
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
|
||||
|
||||
XEngine.XEngine engine = new XEngine.XEngine();
|
||||
@@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||
TestHelpers.InMethod();
|
||||
|
||||
// Create Prim1.
|
||||
Scene scene = SceneHelpers.SetupScene();
|
||||
Scene scene = new SceneHelpers().SetupScene();
|
||||
string obj1Name = "Prim1";
|
||||
UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
|
||||
SceneObjectPart part1 =
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||
config = initConfigSource.AddConfig("NPC");
|
||||
config.Set("Enabled", "true");
|
||||
|
||||
m_scene = SceneHelpers.SetupScene();
|
||||
m_scene = new SceneHelpers().SetupScene();
|
||||
SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule());
|
||||
|
||||
m_engine = new XEngine.XEngine();
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||
config = initConfigSource.AddConfig("NPC");
|
||||
config.Set("Enabled", "true");
|
||||
|
||||
m_scene = SceneHelpers.SetupScene();
|
||||
m_scene = new SceneHelpers().SetupScene();
|
||||
SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule());
|
||||
|
||||
m_engine = new XEngine.XEngine();
|
||||
|
||||
Reference in New Issue
Block a user