more changes relative to incorrect use of activegroupid

LSLKeyTest
UbitUmarov 2016-08-05 15:19:42 +01:00
parent ab7619292f
commit 23578635df
10 changed files with 95 additions and 48 deletions

View File

@ -47,9 +47,10 @@ namespace OpenSim.Framework
public delegate void ImprovedInstantMessage(IClientAPI remoteclient, GridInstantMessage im);
public delegate void RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID);
public delegate void RezObject(IClientAPI remoteClient, UUID itemID, UUID GroupID,
Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID);
public delegate void RezRestoreToWorld(IClientAPI remoteClient, UUID itemId);
public delegate ISceneEntity RezSingleAttachmentFromInv(IClientAPI remoteClient, UUID itemID, uint AttachmentPt);

View File

@ -5805,9 +5805,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public ulong GetGroupPowers(UUID groupID)
{
if (groupID == ActiveGroupId)
return ActiveGroupPowers;
lock(m_groupPowers)
{
if (m_groupPowers.ContainsKey(groupID))
@ -6729,11 +6726,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
RezObject handlerRezObject = OnRezObject;
if (handlerRezObject != null)
{
handlerRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd,
rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID,
rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection,
rezPacket.RezData.RezSelected, rezPacket.RezData.RemoveItem,
rezPacket.RezData.FromTaskID);
UUID rezGroupID = rezPacket.AgentData.GroupID;
if(!IsGroupMember(rezGroupID))
rezGroupID = UUID.Zero;
handlerRezObject(this, rezPacket.InventoryData.ItemID, rezGroupID, rezPacket.RezData.RayEnd,
rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID,
rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection,
rezPacket.RezData.RezSelected, rezPacket.RezData.RemoveItem,
rezPacket.RezData.FromTaskID);
}
return true;
}
@ -7644,9 +7644,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerObjectDuplicate = OnObjectDuplicate;
if (handlerObjectDuplicate != null)
{
UUID rezGroupID = dupe.AgentData.GroupID;
if(!IsGroupMember(rezGroupID))
rezGroupID = UUID.Zero;
handlerObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset,
dupe.SharedData.DuplicateFlags, AgentId,
dupe.AgentData.GroupID);
rezGroupID);
}
}
@ -8266,10 +8269,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerObjectDuplicateOnRay = OnObjectDuplicateOnRay;
if (handlerObjectDuplicateOnRay != null)
{
handlerObjectDuplicateOnRay(dupeOnRay.ObjectData[i].ObjectLocalID, dupeOnRay.AgentData.DuplicateFlags,
AgentId, dupeOnRay.AgentData.GroupID, dupeOnRay.AgentData.RayTargetID, dupeOnRay.AgentData.RayEnd,
dupeOnRay.AgentData.RayStart, dupeOnRay.AgentData.BypassRaycast, dupeOnRay.AgentData.RayEndIsIntersection,
dupeOnRay.AgentData.CopyCenters, dupeOnRay.AgentData.CopyRotates);
UUID rezGroupID = dupeOnRay.AgentData.GroupID;
if(!IsGroupMember(rezGroupID))
rezGroupID = UUID.Zero;
handlerObjectDuplicateOnRay(dupeOnRay.ObjectData[i].ObjectLocalID,
dupeOnRay.AgentData.DuplicateFlags, AgentId, rezGroupID,
dupeOnRay.AgentData.RayTargetID, dupeOnRay.AgentData.RayEnd,
dupeOnRay.AgentData.RayStart, dupeOnRay.AgentData.BypassRaycast,
dupeOnRay.AgentData.RayEndIsIntersection,
dupeOnRay.AgentData.CopyCenters, dupeOnRay.AgentData.CopyRotates);
}
}

View File

@ -306,9 +306,21 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
///
/// RezObject
///
public override SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
// compatibility do not use
public override SceneObjectGroup RezObject(
IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
return RezObject(remoteClient, itemID, UUID.Zero, RayEnd, RayStart,
RayTargetID, BypassRayCast, RayEndIsIntersection,
RezSelected, RemoveItem, fromTaskID, attachment);
}
public override SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID,
UUID groupID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
m_log.DebugFormat("[HGScene]: RezObject itemID={0} fromTaskID={1}", itemID, fromTaskID);
@ -331,7 +343,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
//}
// OK, we're done fetching. Pass it up to the default RezObject
SceneObjectGroup sog = base.RezObject(remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
SceneObjectGroup sog = base.RezObject(remoteClient, itemID, groupID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
RezSelected, RemoveItem, fromTaskID, attachment);
return sog;

View File

@ -818,12 +818,22 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return item;
}
// compatibility do not use
public virtual SceneObjectGroup RezObject(
IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
return RezObject(remoteClient, itemID, UUID.Zero, RayEnd, RayStart,
RayTargetID, BypassRayCast, RayEndIsIntersection,
RezSelected, RemoveItem, fromTaskID, attachment);
}
public virtual SceneObjectGroup RezObject(
IClientAPI remoteClient, UUID itemID, UUID rezGroupID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
// m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID);
InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID);
@ -835,15 +845,27 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
item.Owner = remoteClient.AgentId;
return RezObject(
remoteClient, item, item.AssetID,
remoteClient, item, rezGroupID, item.AssetID,
RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
RezSelected, RemoveItem, fromTaskID, attachment);
}
// compatility
public virtual SceneObjectGroup RezObject(
IClientAPI remoteClient, InventoryItemBase item, UUID assetID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
return RezObject(remoteClient, item, UUID.Zero, assetID,
RayEnd, RayStart, RayTargetID,
BypassRayCast, RayEndIsIntersection,
RezSelected, RemoveItem, fromTaskID, attachment);
}
public virtual SceneObjectGroup RezObject(
IClientAPI remoteClient, InventoryItemBase item, UUID groupID, UUID assetID,
Vector3 RayEnd, Vector3 RayStart, UUID RayTargetID,
byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString());
@ -986,6 +1008,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
group.IsAttachment = true;
}
group.SetGroup(groupID, remoteClient);
// If we're rezzing an attachment then don't ask
// AddNewSceneObject() to update the client since
// we'll be doing that later on. Scheduling more than
@ -995,12 +1019,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
m_Scene.AddNewSceneObject(group, true, false);
if (!attachment)
{
group.AbsolutePosition = pos + veclist[i];
group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
if (!attachment)
{
// Fire on_rez
group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1);
rootPart.ParentGroup.ResumeScripts();

View File

@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
SceneObjectGroup so
= m_iam.RezObject(
m_tc, item1Id, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false);
m_tc, item1Id, UUID.Zero, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false);
Assert.That(so, Is.Not.Null);

View File

@ -70,6 +70,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// </remarks>
/// <param name="remoteClient"></param>
/// <param name="itemID"></param>
/// <param name="rezGroupID"></param>
/// <param name="RayEnd"></param>
/// <param name="RayStart"></param>
/// <param name="RayTargetID"></param>
@ -80,6 +81,11 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="fromTaskID"></param>
/// <param name="attachment"></param>
/// <returns>The SceneObjectGroup rezzed or null if rez was unsuccessful.</returns>
SceneObjectGroup RezObject(
IClientAPI remoteClient, UUID itemID, UUID rezGroupID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment);
// compatibily do not use
SceneObjectGroup RezObject(
IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
@ -97,6 +103,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// The item from which the object asset came. Can be null, in which case pre and post rez item adjustment and checks are not performed.
/// </param>
/// <param name="assetID">The asset id for the object to rez.</param>
/// <param name="rezObjectID">The requested group id for the object to rez.</param>
/// <param name="RayEnd"></param>
/// <param name="RayStart"></param>
/// <param name="RayTargetID"></param>
@ -107,8 +114,16 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="fromTaskID"></param>
/// <param name="attachment"></param>
/// <returns>The SceneObjectGroup rezzed or null if rez was unsuccessful.</returns>
SceneObjectGroup RezObject(IClientAPI remoteClient, InventoryItemBase item, UUID rezGroupID,
UUID assetID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment);
// compatibility do not use
SceneObjectGroup RezObject(
IClientAPI remoteClient, InventoryItemBase item, UUID assetID, Vector3 RayEnd, Vector3 RayStart,
IClientAPI remoteClient, InventoryItemBase item,
UUID assetID, Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment);

View File

@ -2454,6 +2454,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="itemID"></param>
/// <param name="groupID"></param>
/// <param name="RayEnd"></param>
/// <param name="RayStart"></param>
/// <param name="RayTargetID"></param>
@ -2464,7 +2465,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="RezSelected"></param>
/// <param name="RemoveItem"></param>
/// <param name="fromTaskID"></param>
public virtual void RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
public virtual void RezObject(IClientAPI remoteClient, UUID itemID, UUID groupID,
Vector3 RayEnd, Vector3 RayStart,
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID)
{
@ -2504,8 +2506,7 @@ namespace OpenSim.Region.Framework.Scenes
byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0);
Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f);
Vector3 pos
= GetNewRezLocation(
Vector3 pos = GetNewRezLocation(
RayStart, RayEnd, RayTargetID, Quaternion.Identity,
BypassRayCast, bRayEndIsIntersection, true, scale, false);

View File

@ -3115,14 +3115,9 @@ namespace OpenSim.Region.Framework.Scenes
|| (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
CheckHeartbeat();
sp = GetScenePresence(client.AgentId);
// XXX: Not sure how good it is to add a new client if a scene presence already exists. Possibly this
// could occur if a viewer crashes and relogs before the old client is kicked out. But this could cause
// other problems, and possibly the code calling AddNewAgent() should ensure that no client is already
// connected.
if (sp == null)
{
m_log.DebugFormat(
@ -3137,15 +3132,6 @@ namespace OpenSim.Region.Framework.Scenes
sp.TeleportFlags = (TPFlags)aCircuit.teleportFlags;
/* done in completMovement
InventoryFolderBase cof = InventoryService.GetFolderForType(client.AgentId, (AssetType)46);
if (cof == null)
sp.COF = UUID.Zero;
else
sp.COF = cof.ID;
m_log.DebugFormat("[SCENE]: COF for {0} is {1}", client.AgentId, sp.COF);
*/
m_eventManager.TriggerOnNewPresence(sp);
}
else

View File

@ -171,7 +171,7 @@ namespace OpenSim.Region.Framework.Tests
//Assert.That((retrievedItem1.CurrentPermissions & (uint)OpenMetaverse.PermissionMask.All) == (uint)OpenMetaverse.PermissionMask.All);
// Rez the object
scene.RezObject(sp2.ControllingClient, retrievedItem1.ID, Vector3.Zero, Vector3.Zero, UUID.Zero, 0, false, false, false, UUID.Zero);
scene.RezObject(sp2.ControllingClient, retrievedItem1.ID, UUID.Zero, Vector3.Zero, Vector3.Zero, UUID.Zero, 0, false, false, false, UUID.Zero);
SceneObjectGroup sog = scene.GetSceneObjectGroup("SomeObject");
Assert.That(sog, Is.Not.Null);

View File

@ -83,7 +83,8 @@ namespace OpenSim.Region.DataSnapshot.Providers
{ this.Stale = true; };
client.OnObjectPermissions += delegate(IClientAPI controller, UUID agentID, UUID sessionID,
byte field, uint localId, uint mask, byte set) { this.Stale = true; };
client.OnRezObject += delegate(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd,
client.OnRezObject += delegate(IClientAPI remoteClient, UUID itemID, UUID groupID,
Vector3 RayEnd,
Vector3 RayStart, UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected,
bool RemoveItem, UUID fromTaskID) { this.Stale = true; };