mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Merge branch 'avination-current' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs OpenSim/Region/Framework/Interfaces/IDynamicMenuModule.cs OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
This commit is contained in:
@@ -4643,20 +4643,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
ScenePresence presence = World.GetScenePresence(agentId);
|
||||
if (presence != null && presence.PresenceType != PresenceType.Npc)
|
||||
{
|
||||
// agent must not be a god
|
||||
if (presence.GodLevel >= 200) return;
|
||||
|
||||
if (destination == String.Empty)
|
||||
destination = World.RegionInfo.RegionName;
|
||||
|
||||
// agent must be over the owners land
|
||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID)
|
||||
if (m_item.PermsGranter == agentId)
|
||||
{
|
||||
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0)
|
||||
{
|
||||
DoLLTeleport(presence, destination, targetPos, targetLookAt);
|
||||
}
|
||||
}
|
||||
|
||||
// agent must be wearing the object
|
||||
if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID)
|
||||
{
|
||||
DoLLTeleport(presence, destination, targetPos, targetLookAt);
|
||||
}
|
||||
else // or must be wearing the prim
|
||||
else
|
||||
{
|
||||
if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID)
|
||||
// agent must not be a god
|
||||
if (presence.GodLevel >= 200) return;
|
||||
|
||||
// agent must be over the owners land
|
||||
ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition);
|
||||
ILandObject objectLand = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
|
||||
if (m_host.OwnerID == objectLand.LandData.OwnerID && m_host.OwnerID == agentLand.LandData.OwnerID)
|
||||
{
|
||||
DoLLTeleport(presence, destination, targetPos, targetLookAt);
|
||||
}
|
||||
@@ -4670,24 +4681,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_host.AddScriptLPS(1);
|
||||
UUID agentId = new UUID();
|
||||
|
||||
ulong regionHandle = Utils.UIntsToLong((uint)global_coords.x, (uint)global_coords.y);
|
||||
ulong regionHandle = Utils.UIntsToLong((uint)(global_coords.x / 256) * 256, (uint)(global_coords.y / 256) * 256);
|
||||
|
||||
if (UUID.TryParse(agent, out agentId))
|
||||
{
|
||||
// This function is owner only!
|
||||
if (m_host.OwnerID != agentId)
|
||||
return;
|
||||
|
||||
ScenePresence presence = World.GetScenePresence(agentId);
|
||||
|
||||
// Can't TP sitting avatars
|
||||
if (presence.ParentID != 0) // Sitting
|
||||
return;
|
||||
|
||||
if (presence != null && presence.PresenceType != PresenceType.Npc)
|
||||
{
|
||||
// agent must not be a god
|
||||
if (presence.GodLevel >= 200) return;
|
||||
if (m_item.PermsGranter == agentId)
|
||||
{
|
||||
// If attached using llAttachToAvatarTemp, cowardly refuse
|
||||
if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.ParentGroup.FromItemID == UUID.Zero)
|
||||
return;
|
||||
|
||||
// agent must be over the owners land
|
||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID)
|
||||
{
|
||||
World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
|
||||
}
|
||||
else // or must be wearing the prim
|
||||
{
|
||||
if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID)
|
||||
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0)
|
||||
{
|
||||
World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
|
||||
}
|
||||
@@ -7853,6 +7869,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
}
|
||||
|
||||
public LSL_List llGetPhysicsMaterial()
|
||||
{
|
||||
LSL_List result = new LSL_List();
|
||||
|
||||
result.Add(new LSL_Float(m_host.GravityModifier));
|
||||
result.Add(new LSL_Float(m_host.Restitution));
|
||||
result.Add(new LSL_Float(m_host.Friction));
|
||||
result.Add(new LSL_Float(m_host.Density));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void SetPhysicsMaterial(SceneObjectPart part, int material_bits,
|
||||
float material_density, float material_friction,
|
||||
float material_restitution, float material_gravity_modifier)
|
||||
@@ -13379,6 +13407,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void llSetContentType(LSL_Key id, LSL_Integer content_type)
|
||||
{
|
||||
if (m_UrlModule != null)
|
||||
{
|
||||
string type = "text.plain";
|
||||
if (content_type == (int)ScriptBaseClass.CONTENT_TYPE_HTML)
|
||||
type = "text/html";
|
||||
|
||||
m_UrlModule.HttpContentType(new UUID(id),type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class NotecardCache
|
||||
|
||||
@@ -398,7 +398,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
objtype = 0;
|
||||
|
||||
part = ((SceneObjectGroup)ent).RootPart;
|
||||
if (part.ParentGroup.AttachmentPoint != 0) // Attached so ignore
|
||||
if (part.ParentGroup.RootPart.Shape.PCode != (byte)PCode.Tree &&
|
||||
part.ParentGroup.RootPart.Shape.PCode != (byte)PCode.NewTree &&
|
||||
part.ParentGroup.AttachmentPoint != 0) // Attached so ignore
|
||||
continue;
|
||||
|
||||
if (part.Inventory.ContainsScripts())
|
||||
|
||||
@@ -433,5 +433,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules, string originFunc);
|
||||
void llSetKeyframedMotion(LSL_List frames, LSL_List options);
|
||||
LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
|
||||
LSL_List llGetPhysicsMaterial();
|
||||
void llSetContentType(LSL_Key id, LSL_Integer content_type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
public const int PERMISSION_CHANGE_PERMISSIONS = 512;
|
||||
public const int PERMISSION_TRACK_CAMERA = 1024;
|
||||
public const int PERMISSION_CONTROL_CAMERA = 2048;
|
||||
public const int PERMISSION_TELEPORT = 4096;
|
||||
|
||||
public const int AGENT_FLYING = 1;
|
||||
public const int AGENT_ATTACHMENTS = 2;
|
||||
@@ -771,5 +772,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
/// process message parameter as regex
|
||||
/// </summary>
|
||||
public const int OS_LISTEN_REGEX_MESSAGE = 0x2;
|
||||
|
||||
public const int CONTENT_TYPE_TEXT = 0;
|
||||
public const int CONTENT_TYPE_HTML = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2009,5 +2009,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
m_LSL_Functions.llSetPhysicsMaterial(material_bits, material_gravity_modifier, material_restitution, material_friction, material_density);
|
||||
}
|
||||
|
||||
public LSL_List llGetPhysicsMaterial()
|
||||
{
|
||||
return m_LSL_Functions.llGetPhysicsMaterial();
|
||||
}
|
||||
|
||||
public void llSetContentType(LSL_Key id, LSL_Integer content_type)
|
||||
{
|
||||
m_LSL_Functions.llSetContentType(id, content_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user