send selected objects Proprieties udp part outside update queues and as a physics single caps message per selection request

LSLKeyTest
UbitUmarov 2016-08-25 09:51:34 +01:00
parent 90fc4183dc
commit d5f376a4b1
6 changed files with 59 additions and 11 deletions

View File

@ -1382,6 +1382,8 @@ namespace OpenSim.Framework
void SendObjectPropertiesReply(ISceneEntity Entity); void SendObjectPropertiesReply(ISceneEntity Entity);
void SendSelectedPartsProprieties(List<ISceneEntity> parts);
void SendPartPhysicsProprieties(ISceneEntity Entity); void SendPartPhysicsProprieties(ISceneEntity Entity);
void SendAgentOffline(UUID[] agentIDs); void SendAgentOffline(UUID[] agentIDs);

View File

@ -2801,6 +2801,48 @@ namespace OpenSim.Region.ClientStack.LindenUDP
SendAgentGroupDataUpdate(AgentId,GroupMembership); SendAgentGroupDataUpdate(AgentId,GroupMembership);
} }
public void SendSelectedPartsProprieties(List<ISceneEntity> parts)
{
// udp part
ObjectPropertiesPacket packet =
(ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties);
ObjectPropertiesPacket.ObjectDataBlock[] ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[parts.Count];
int i = 0;
foreach(SceneObjectPart sop in parts)
ObjectData[i++] = CreateObjectPropertiesBlock(sop);
packet.ObjectData = ObjectData;
packet.Header.Zerocoded = true;
// udp send splits this mega packets correctly
// mb later will avoid that to reduce gc stress
OutPacket(packet, ThrottleOutPacketType.Task, true);
// caps physics part
IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
if(eq == null)
return;
OSDArray array = new OSDArray();
foreach(SceneObjectPart sop in parts)
{
OSDMap physinfo = new OSDMap(6);
physinfo["LocalID"] = sop.LocalId;
physinfo["Density"] = sop.Density;
physinfo["Friction"] = sop.Friction;
physinfo["GravityMultiplier"] = sop.GravityModifier;
physinfo["Restitution"] = sop.Restitution;
physinfo["PhysicsShapeType"] = (int)sop.PhysicsShapeType;
array.Add(physinfo);
}
OSDMap llsdBody = new OSDMap(1);
llsdBody.Add("ObjectData", array);
eq.Enqueue(BuildEvent("ObjectPhysicsProperties", llsdBody),AgentId);
}
public void SendPartPhysicsProprieties(ISceneEntity entity) public void SendPartPhysicsProprieties(ISceneEntity entity)
{ {
SceneObjectPart part = (SceneObjectPart)entity; SceneObjectPart part = (SceneObjectPart)entity;

View File

@ -166,7 +166,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void SelectPrim(List<uint> primIDs, IClientAPI remoteClient) public void SelectPrim(List<uint> primIDs, IClientAPI remoteClient)
{ {
List<SceneObjectPart> needUpdates = new List<SceneObjectPart>(); List<ISceneEntity> needUpdates = new List<ISceneEntity>();
foreach(uint primLocalID in primIDs) foreach(uint primLocalID in primIDs)
{ {
@ -179,7 +179,7 @@ namespace OpenSim.Region.Framework.Scenes
if (sog == null) if (sog == null)
continue; continue;
needUpdates.Add(part); needUpdates.Add((ISceneEntity)part);
// waste of time because properties do not send prim flags as they should // waste of time because properties do not send prim flags as they should
// if a friend got or lost edit rights after login, a full update is needed // if a friend got or lost edit rights after login, a full update is needed
@ -196,15 +196,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
if(needUpdates.Count > 0) if(needUpdates.Count > 0)
{ remoteClient.SendSelectedPartsProprieties(needUpdates);
// this will be replaced by single client function
// that will send the UDP and Caps part
foreach(SceneObjectPart part in needUpdates)
{
part.SendPropertiesToClient(remoteClient);
remoteClient.SendPartPhysicsProprieties(part);
}
}
} }
/// <summary> /// <summary>

View File

@ -1753,6 +1753,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
{ {
} }
public void SendSelectedPartsProprieties(List<ISceneEntity> parts)
{
}
public void SendPartPhysicsProprieties(ISceneEntity entity) public void SendPartPhysicsProprieties(ISceneEntity entity)
{ {
} }

View File

@ -1337,6 +1337,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
{ {
} }
public void SendSelectedPartsProprieties(List<ISceneEntity> parts)
{
}
public void SendPartPhysicsProprieties(ISceneEntity entity) public void SendPartPhysicsProprieties(ISceneEntity entity)
{ {
} }

View File

@ -1384,6 +1384,10 @@ namespace OpenSim.Tests.Common
{ {
} }
public void SendSelectedPartsProprieties(List<ISceneEntity> parts)
{
}
public void SendPartPhysicsProprieties(ISceneEntity entity) public void SendPartPhysicsProprieties(ISceneEntity entity)
{ {
} }