Merge branch 'master' into bigmerge

Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
avinationmerge
Melanie 2011-10-26 17:48:51 +01:00
commit 6a96c9546d
10 changed files with 120 additions and 22 deletions

18
.gitignore vendored
View File

@ -73,4 +73,20 @@ TAGS
Makefile.local Makefile.local
bin/.version bin/.version
compile.bat compile.bat
addon-modules
OpenSim/Data/Tests/test-results/
OpenSim/Framework/Serialization/Tests/test-results/
OpenSim/Framework/Servers/Tests/test-results/
OpenSim/Framework/Tests/test-results/
OpenSim/Region/ClientStack/Linden/Caps/test-results/
OpenSim/Region/ClientStack/Linden/UDP/Tests/test-results/
OpenSim/Region/CoreModules/test-results/
OpenSim/Region/Framework/test-results/
OpenSim/Region/OptionalModules/test-results/
OpenSim/Region/Physics/BulletDotNETPlugin/
OpenSim/Region/Physics/Manager/test-results/
OpenSim/Region/Physics/OdePlugin/Tests/test-results/
OpenSim/Region/ScriptEngine/test-results/
OpenSim/Tests/Common/test-results/
OpenSim/Tests/test-results/
test-results/

View File

@ -164,11 +164,7 @@ namespace OpenSim.Framework
return m_threads.Remove(threadID); return m_threads.Remove(threadID);
} }
<<<<<<< HEAD:OpenSim/Framework/Watchdog.cs
public static bool RemoveThread(int threadID)
=======
public static bool AbortThread(int threadID) public static bool AbortThread(int threadID)
>>>>>>> master:OpenSim/Framework/Watchdog.cs
{ {
lock (m_threads) lock (m_threads)
{ {
@ -198,14 +194,10 @@ namespace OpenSim.Framework
try try
{ {
if (m_threads.TryGetValue(threadID, out threadInfo)) if (m_threads.TryGetValue(threadID, out threadInfo))
<<<<<<< HEAD:OpenSim/Framework/Watchdog.cs
threadInfo.LastTick = Environment.TickCount;
=======
{ {
threadInfo.LastTick = Environment.TickCount & Int32.MaxValue; threadInfo.LastTick = Environment.TickCount & Int32.MaxValue;
threadInfo.IsTimedOut = false; threadInfo.IsTimedOut = false;
} }
>>>>>>> master:OpenSim/Framework/Watchdog.cs
else else
{ {
m_log.WarnFormat("[WATCHDOG]: Asked to update thread {0} which is not being monitored", threadID); m_log.WarnFormat("[WATCHDOG]: Asked to update thread {0} which is not being monitored", threadID);

View File

@ -1203,7 +1203,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_log.ErrorFormat("[SCENE]: Restarting heartbeat thread because it hasn't reported in in region {0}", RegionInfo.RegionName); m_log.ErrorFormat("[SCENE]: Restarting heartbeat thread because it hasn't reported in in region {0}", RegionInfo.RegionName);
HeartbeatThread.Abort(); HeartbeatThread.Abort();
Watchdog.RemoveThread(HeartbeatThread.ManagedThreadId); Watchdog.AbortThread(HeartbeatThread.ManagedThreadId);
HeartbeatThread = null; HeartbeatThread = null;
} }
m_lastUpdate = Util.EnvironmentTickCount(); m_lastUpdate = Util.EnvironmentTickCount();

View File

@ -1299,7 +1299,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
if (m_eventsubscription > 0) if (m_eventsubscription > 0)
{ {
CollisionEventsThisFrame.addCollider(CollidedWith, contact); CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
} }
} }

View File

@ -2438,7 +2438,7 @@ Console.WriteLine("ODEPrim JointCreateFixed !!!");
{ {
if (CollisionEventsThisFrame == null) if (CollisionEventsThisFrame == null)
CollisionEventsThisFrame = new CollisionEventUpdate(); CollisionEventsThisFrame = new CollisionEventUpdate();
CollisionEventsThisFrame.addCollider(CollidedWith, contact); CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
} }
public void SendCollisions() public void SendCollisions()

View File

@ -3648,10 +3648,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) public void llTargetOmega(LSL_Vector axis, double spinrate, double gain)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); TargetOmega(m_host, axis, spinrate, gain);
m_host.ScheduleTerseUpdate(); }
m_host.SendTerseUpdateToAllClients();
m_host.ParentGroup.HasGroupChanged = true; protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain)
{
part.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
part.ScheduleTerseUpdate();
part.SendTerseUpdateToAllClients();
part.ParentGroup.HasGroupChanged = true;
} }
public LSL_Integer llGetStartParameter() public LSL_Integer llGetStartParameter()
@ -7936,6 +7941,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LSL_Rotation lr = rules.GetQuaternionItem(idx++); LSL_Rotation lr = rules.GetQuaternionItem(idx++);
SetRot(part, Rot2Quaternion(lr)); SetRot(part, Rot2Quaternion(lr));
break; break;
case (int)ScriptBaseClass.PRIM_OMEGA:
if (remain < 3)
return;
LSL_Vector axis = rules.GetVector3Item(idx++);
LSL_Float spinrate = rules.GetLSLFloatItem(idx++);
LSL_Float gain = rules.GetLSLFloatItem(idx++);
TargetOmega(part, axis, (double)spinrate, (double)gain);
break;
case (int)ScriptBaseClass.PRIM_LINK_TARGET:
if (remain < 1)
return;
LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++);
part = part.ParentGroup.GetLinkNumPart((int)new_linknumber);
break;
} }
} }

View File

@ -113,11 +113,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
public List<UUID> AllowedCreators; public List<UUID> AllowedCreators;
public List<UUID> AllowedOwners; public List<UUID> AllowedOwners;
public List<string> AllowedOwnerClasses;
public FunctionPerms() public FunctionPerms()
{ {
AllowedCreators = new List<UUID>(); AllowedCreators = new List<UUID>();
AllowedOwners = new List<UUID>(); AllowedOwners = new List<UUID>();
AllowedOwnerClasses = new List<string>();
} }
} }
@ -254,6 +256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// Default behavior // Default behavior
perms.AllowedOwners = null; perms.AllowedOwners = null;
perms.AllowedCreators = null; perms.AllowedCreators = null;
perms.AllowedOwnerClasses = null;
} }
else else
{ {
@ -274,6 +277,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
foreach (string id in ids) foreach (string id in ids)
{ {
string current = id.Trim(); string current = id.Trim();
if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER")
{
if (!perms.AllowedOwnerClasses.Contains(current))
perms.AllowedOwnerClasses.Add(current.ToUpper());
}
else
{
UUID uuid; UUID uuid;
if (UUID.TryParse(current, out uuid)) if (UUID.TryParse(current, out uuid))
@ -282,6 +292,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
perms.AllowedOwners.Add(uuid); perms.AllowedOwners.Add(uuid);
} }
} }
}
ids = creatorPerm.Split(new char[] {','}); ids = creatorPerm.Split(new char[] {','});
foreach (string id in ids) foreach (string id in ids)
@ -335,11 +346,55 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
String.Format("{0} permission error. Can't find script in prim inventory.", String.Format("{0} permission error. Can't find script in prim inventory.",
function)); function));
} }
UUID ownerID = ti.OwnerID;
//OSSL only may be used if objet 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);
if (land.LandData.GroupID == ti.GroupID && land.LandData.GroupID != UUID.Zero)
{
return;
}
}
//Only Parcelowners may use the function
if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_OWNER"))
{
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
if (land.LandData.OwnerID == ownerID)
{
return;
}
}
//Only Estate Managers may use the function
if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ESTATE_MANAGER"))
{
//Only Estate Managers may use the function
if (World.RegionInfo.EstateSettings.IsEstateManager(ownerID) && World.RegionInfo.EstateSettings.EstateOwner != ownerID)
{
return;
}
}
//Only regionowners may use the function
if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ESTATE_OWNER"))
{
if (World.RegionInfo.EstateSettings.EstateOwner == ownerID)
{
return;
}
}
if (!m_FunctionPerms[function].AllowedCreators.Contains(ti.CreatorID)) if (!m_FunctionPerms[function].AllowedCreators.Contains(ti.CreatorID))
OSSLError( OSSLError(
String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.", String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.",
function)); function));
if (ti.CreatorID != ti.OwnerID) if (ti.CreatorID != ownerID)
{ {
if ((ti.CurrentPermissions & (uint)PermissionMask.Modify) != 0) if ((ti.CurrentPermissions & (uint)PermissionMask.Modify) != 0)
OSSLError( OSSLError(

View File

@ -322,6 +322,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int PRIM_NAME = 27; public const int PRIM_NAME = 27;
public const int PRIM_DESC = 28; public const int PRIM_DESC = 28;
public const int PRIM_ROT_LOCAL = 29; public const int PRIM_ROT_LOCAL = 29;
public const int PRIM_OMEGA = 32;
public const int PRIM_LINK_TARGET = 34;
public const int PRIM_TEXGEN_DEFAULT = 0; public const int PRIM_TEXGEN_DEFAULT = 0;
public const int PRIM_TEXGEN_PLANAR = 1; public const int PRIM_TEXGEN_PLANAR = 1;

7
bin/OpenSim.ini.example Normal file → Executable file
View File

@ -618,6 +618,13 @@
; Comma separated list of UUIDS allows the function for that list of UUIDS ; Comma separated list of UUIDS allows the function for that list of UUIDS
; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb ; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb
; Comma separated list of owner classes that allow the function for a particular class of owners. Choices are
; - PARCEL_GROUP_MEMBER: allow if objectgroup is the same group as the parcel
; - PARCEL_OWNER: allow if the objectowner is parcelowner
; - ESTATE_MANAGER: allow if the object owner is a estate manager
; - ESTATE_OWNER: allow if objectowner is estateowner
; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb, PARCEL_OWNER, ESTATE_OWNER>, ...
; You can also use script creators as the uuid ; You can also use script creators as the uuid
; Creators_osSetRegionWaterHeight = <uuid>, ... ; Creators_osSetRegionWaterHeight = <uuid>, ...

View File

@ -1197,6 +1197,13 @@
; Comma separated list of UUIDS allows the function for that list of UUIDS ; Comma separated list of UUIDS allows the function for that list of UUIDS
; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb ; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb
; Comma separated list of owner classes that allow the function for a particular class of owners. Choices are
; - PARCEL_GROUP_MEMBER: allow if objectgroup is the same group as the parcel
; - PARCEL_OWNER: allow if the objectowner is parcelowner
; - ESTATE_MANAGER: allow if the object owner is a estate manager
; - ESTATE_OWNER: allow if objectowner is estateowner
; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb, PARCEL_OWNER, ESTATE_OWNER>, ...
; You can also use script creators as the uuid ; You can also use script creators as the uuid
; Creators_osSetRegionWaterHeight = <uuid>, ... ; Creators_osSetRegionWaterHeight = <uuid>, ...