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(
UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, byte bypassRaycast, Vector3 RayStart,
UUID RayTargetID,
byte RayEndIsIntersection);
byte RayEndIsIntersection, uint addflags);
public delegate void AgentDataUpdate(IClientAPI remoteClient, UUID itemID, UUID ownerID);

View File

@ -4525,7 +4525,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// no AppearanceData
data[pos++] = 0;
// no AppearanceHover
// AppearanceHover vector 3
data[pos++] = 1;
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)
return;
ObjectAddPacket.ObjectDataBlock datablk = addPacket.ObjectData;
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)

View File

@ -351,6 +351,5 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AddByte((byte)(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="param"></param>
/// <returns>The SceneObjectGroup(s) rezzed, or null if rez was unsuccessful</returns>
public virtual List<SceneObjectGroup> RezObject(
SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion? rot, Vector3 vel, int param, bool atRoot)
public virtual List<SceneObjectGroup> RezObject(SceneObjectPart sourcePart, TaskInventoryItem item,
Vector3 pos, Quaternion? rot, Vector3 vel, int param, bool atRoot, bool rezSelected = false)
{
if (null == item)
return null;
@ -2710,6 +2710,12 @@ namespace OpenSim.Region.Framework.Scenes
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
// to find out if scripts should be activated at all.
group.InvalidateEffectivePerms();

View File

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

View File

@ -2512,7 +2512,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="RayEndIsIntersection"></param>
public virtual void AddNewPrim(UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape,
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);
@ -2521,7 +2521,7 @@ namespace OpenSim.Region.Framework.Scenes
// 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
AddNewPrim(ownerID, groupID, pos, rot, shape);
AddNewPrim(ownerID, groupID, pos, rot, shape, addFlags);
}
else
{
@ -2531,8 +2531,8 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public virtual SceneObjectGroup AddNewPrim(
UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
public virtual SceneObjectGroup AddNewPrim(UUID ownerID, UUID groupID,
Vector3 pos, Quaternion rot, PrimitiveBaseShape shape, uint addFlags = 0)
{
//m_log.DebugFormat(
// "[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)
sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID);
if((addFlags & (uint)PrimFlags.CreateSelected) != 0)
{
sceneObject.IsSelected = true;
sceneObject.RootPart.CreateSelected = true;
}
sceneObject.InvalidateDeepEffectivePerms();;
sceneObject.ScheduleGroupForFullAnimUpdate();

View File

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

View File

@ -3250,7 +3250,7 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.SetParent(this);
linkPart.CreateSelected = true;
//linkPart.CreateSelected = 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;
APIDActive = false;
Flags = 0;
CreateSelected = true;
CreateSelected = false;
TrimPermissions();
AggregateInnerPerms();
}

View File

@ -66,7 +66,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
client.OnAddPrim += delegate (UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot,
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)
{ 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.AddNewAgent(npcAvatar, PresenceType.Npc);
ScenePresence sp;
if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp))
if (scene.TryGetScenePresence(npcAvatar.AgentId, out ScenePresence sp))
{
npcAvatar.Born = born;
npcAvatar.ActiveGroupId = groupID;

View File

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