set object select on demand, not when it is created

master
UbitUmarov 2020-06-05 01:57:17 +01:00
parent b440a9534d
commit 775420c46a
12 changed files with 32 additions and 19 deletions

View File

@ -221,7 +221,7 @@ namespace OpenSim.Framework
public delegate void AddNewPrim( public delegate void AddNewPrim(
UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, byte bypassRaycast, Vector3 RayStart, UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, byte bypassRaycast, Vector3 RayStart,
UUID RayTargetID, UUID RayTargetID,
byte RayEndIsIntersection); byte RayEndIsIntersection, uint addflags);
public delegate void AgentDataUpdate(IClientAPI remoteClient, UUID itemID, UUID ownerID); public delegate void AgentDataUpdate(IClientAPI remoteClient, UUID itemID, UUID ownerID);

View File

@ -4525,7 +4525,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// no AppearanceData // no AppearanceData
data[pos++] = 0; data[pos++] = 0;
// no AppearanceHover // AppearanceHover vector 3
data[pos++] = 1; data[pos++] = 1;
Utils.FloatToBytesSafepos(0, data, pos); pos += 4; Utils.FloatToBytesSafepos(0, data, pos); pos += 4;
Utils.FloatToBytesSafepos(0, data, pos); pos += 4; Utils.FloatToBytesSafepos(0, data, pos); pos += 4;
@ -9310,8 +9310,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (addPacket.AgentData.SessionID != SessionId || addPacket.AgentData.AgentID != AgentId) if (addPacket.AgentData.SessionID != SessionId || addPacket.AgentData.AgentID != AgentId)
return; return;
ObjectAddPacket.ObjectDataBlock datablk = addPacket.ObjectData;
PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket);
OnAddPrim?.Invoke(AgentId, addPacket.AgentData.GroupID, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection); OnAddPrim?.Invoke(AgentId, addPacket.AgentData.GroupID, datablk.RayEnd,
datablk.Rotation, shape,
datablk.BypassRaycast, datablk.RayStart, datablk.RayTargetID, datablk.RayEndIsIntersection,
datablk.AddFlags);
} }
private void HandleObjectShape(Packet Pack) private void HandleObjectShape(Packet Pack)

View File

@ -351,6 +351,5 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AddByte((byte)(len)); AddByte((byte)(len));
AddBytes(data, len); AddBytes(data, len);
} }
} }
} }

View File

@ -2597,8 +2597,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="vel">The velocity of the rezzed object.</param> /// <param name="vel">The velocity of the rezzed object.</param>
/// <param name="param"></param> /// <param name="param"></param>
/// <returns>The SceneObjectGroup(s) rezzed, or null if rez was unsuccessful</returns> /// <returns>The SceneObjectGroup(s) rezzed, or null if rez was unsuccessful</returns>
public virtual List<SceneObjectGroup> RezObject( public virtual List<SceneObjectGroup> RezObject(SceneObjectPart sourcePart, TaskInventoryItem item,
SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion? rot, Vector3 vel, int param, bool atRoot) Vector3 pos, Quaternion? rot, Vector3 vel, int param, bool atRoot, bool rezSelected = false)
{ {
if (null == item) if (null == item)
return null; return null;
@ -2710,6 +2710,12 @@ namespace OpenSim.Region.Framework.Scenes
AddNewSceneObject(group, true, curpos, crot, vel); AddNewSceneObject(group, true, curpos, crot, vel);
} }
if(rezSelected)
{
group.IsSelected = true;
group.RootPart.CreateSelected = true;
}
// We can only call this after adding the scene object, since the scene object references the scene // We can only call this after adding the scene object, since the scene object references the scene
// to find out if scripts should be activated at all. // to find out if scripts should be activated at all.
group.InvalidateEffectivePerms(); group.InvalidateEffectivePerms();

View File

@ -261,7 +261,6 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
bool oldgprSelect = part.ParentGroup.IsSelected; bool oldgprSelect = part.ParentGroup.IsSelected;
bool oldSelect = part.IsSelected;
part.IsSelected = false; part.IsSelected = false;
if (oldgprSelect != part.ParentGroup.IsSelected) if (oldgprSelect != part.ParentGroup.IsSelected)
@ -271,7 +270,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
// restore targetOmega // restore targetOmega
if (oldSelect && part.AngularVelocity != Vector3.Zero) if (part.AngularVelocity != Vector3.Zero)
part.ScheduleTerseUpdate(); part.ScheduleTerseUpdate();
} }

View File

@ -2512,7 +2512,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="RayEndIsIntersection"></param> /// <param name="RayEndIsIntersection"></param>
public virtual void AddNewPrim(UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, public virtual void AddNewPrim(UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape,
byte bypassRaycast, Vector3 RayStart, UUID RayTargetID, byte bypassRaycast, Vector3 RayStart, UUID RayTargetID,
byte RayEndIsIntersection) byte RayEndIsIntersection, uint addFlags)
{ {
Vector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new Vector3(0.5f, 0.5f, 0.5f), false); Vector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection, true, new Vector3(0.5f, 0.5f, 0.5f), false);
@ -2521,7 +2521,7 @@ namespace OpenSim.Region.Framework.Scenes
// rez ON the ground, not IN the ground // rez ON the ground, not IN the ground
// pos.Z += 0.25F; The rez point should now be correct so that its not in the ground // pos.Z += 0.25F; The rez point should now be correct so that its not in the ground
AddNewPrim(ownerID, groupID, pos, rot, shape); AddNewPrim(ownerID, groupID, pos, rot, shape, addFlags);
} }
else else
{ {
@ -2531,8 +2531,8 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public virtual SceneObjectGroup AddNewPrim( public virtual SceneObjectGroup AddNewPrim(UUID ownerID, UUID groupID,
UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) Vector3 pos, Quaternion rot, PrimitiveBaseShape shape, uint addFlags = 0)
{ {
//m_log.DebugFormat( //m_log.DebugFormat(
// "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName); // "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName);
@ -2567,6 +2567,12 @@ namespace OpenSim.Region.Framework.Scenes
if (UserManagementModule != null) if (UserManagementModule != null)
sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID); sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID);
if((addFlags & (uint)PrimFlags.CreateSelected) != 0)
{
sceneObject.IsSelected = true;
sceneObject.RootPart.CreateSelected = true;
}
sceneObject.InvalidateDeepEffectivePerms();; sceneObject.InvalidateDeepEffectivePerms();;
sceneObject.ScheduleGroupForFullAnimUpdate(); sceneObject.ScheduleGroupForFullAnimUpdate();

View File

@ -1938,7 +1938,7 @@ namespace OpenSim.Region.Framework.Scenes
// occur on link to invoke this elsewhere (such as object selection) // occur on link to invoke this elsewhere (such as object selection)
if (childGroups.Count > 0) if (childGroups.Count > 0)
{ {
parentGroup.RootPart.CreateSelected = true; //parentGroup.RootPart.CreateSelected = true;
parentGroup.TriggerScriptChangedEvent(Changed.LINK); parentGroup.TriggerScriptChangedEvent(Changed.LINK);
} }
} }

View File

@ -3250,7 +3250,7 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.SetParent(this); linkPart.SetParent(this);
linkPart.CreateSelected = true; //linkPart.CreateSelected = true;
linkPart.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (linkPart.Flags & PrimFlags.Phantom) != 0), linkPart.VolumeDetectActive || RootPart.VolumeDetectActive, true); linkPart.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (linkPart.Flags & PrimFlags.Phantom) != 0), linkPart.VolumeDetectActive || RootPart.VolumeDetectActive, true);

View File

@ -444,7 +444,7 @@ namespace OpenSim.Region.Framework.Scenes
Acceleration = Vector3.Zero; Acceleration = Vector3.Zero;
APIDActive = false; APIDActive = false;
Flags = 0; Flags = 0;
CreateSelected = true; CreateSelected = false;
TrimPermissions(); TrimPermissions();
AggregateInnerPerms(); AggregateInnerPerms();
} }

View File

@ -66,7 +66,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
client.OnAddPrim += delegate (UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, client.OnAddPrim += delegate (UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot,
PrimitiveBaseShape shape, byte bypassRaycast, Vector3 RayStart, UUID RayTargetID, PrimitiveBaseShape shape, byte bypassRaycast, Vector3 RayStart, UUID RayTargetID,
byte RayEndIsIntersection) { this.Stale = true; }; byte RayEndIsIntersection, uint addFlags) { this.Stale = true; };
client.OnLinkObjects += delegate (IClientAPI remoteClient, uint parent, List<uint> children) client.OnLinkObjects += delegate (IClientAPI remoteClient, uint parent, List<uint> children)
{ this.Stale = true; }; { this.Stale = true; };
client.OnDelinkObjects += delegate(List<uint> primIds, IClientAPI clientApi) { this.Stale = true; }; client.OnDelinkObjects += delegate(List<uint> primIds, IClientAPI clientApi) { this.Stale = true; };

View File

@ -220,8 +220,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd); scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd);
scene.AddNewAgent(npcAvatar, PresenceType.Npc); scene.AddNewAgent(npcAvatar, PresenceType.Npc);
ScenePresence sp; if (scene.TryGetScenePresence(npcAvatar.AgentId, out ScenePresence sp))
if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp))
{ {
npcAvatar.Born = born; npcAvatar.Born = born;
npcAvatar.ActiveGroupId = groupID; npcAvatar.ActiveGroupId = groupID;

View File

@ -4506,7 +4506,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
parentPrim.TriggerScriptChangedEvent(Changed.LINK); parentPrim.TriggerScriptChangedEvent(Changed.LINK);
parentPrim.RootPart.CreateSelected = true; parentPrim.RootPart.CreateSelected = false;
parentPrim.HasGroupChanged = true; parentPrim.HasGroupChanged = true;
parentPrim.ScheduleGroupForFullUpdate(); parentPrim.ScheduleGroupForFullUpdate();