aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP
diff options
context:
space:
mode:
authorUbitUmarov2016-08-25 06:56:13 +0100
committerUbitUmarov2016-08-25 06:56:25 +0100
commit991dd5f4712f7f6b61b4953f3f388f85992db67b (patch)
treed83792fc1645b5a9b49d8c42bdf921645d44bd87 /OpenSim/Region/ClientStack/Linden/UDP
parent fix missing PhysicsProprieties sending on Object select. This is a temporary... (diff)
downloadopensim-SC-991dd5f4712f7f6b61b4953f3f388f85992db67b.zip
opensim-SC-991dd5f4712f7f6b61b4953f3f388f85992db67b.tar.gz
opensim-SC-991dd5f4712f7f6b61b4953f3f388f85992db67b.tar.bz2
opensim-SC-991dd5f4712f7f6b61b4953f3f388f85992db67b.tar.xz
first step changing Object Select code
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs117
1 files changed, 28 insertions, 89 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 78043bd..5b39cc5 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -2882,18 +2882,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2882 2882
2883 public void SendAsset(AssetRequestToClient req) 2883 public void SendAsset(AssetRequestToClient req)
2884 { 2884 {
2885 if (req.AssetInf == null)
2886 {
2887 m_log.ErrorFormat("{0} Cannot send asset {1} ({2}), asset is null",
2888 LogHeader);
2889 return;
2890 }
2891
2885 if (req.AssetInf.Data == null) 2892 if (req.AssetInf.Data == null)
2886 { 2893 {
2887 m_log.ErrorFormat("{0} Cannot send asset {1} ({2}), asset data is null", 2894 m_log.ErrorFormat("{0} Cannot send asset {1} ({2}), asset data is null",
2888 LogHeader, req.AssetInf.ID, req.AssetInf.Metadata.ContentType); 2895 LogHeader, req.AssetInf.ID, req.AssetInf.Metadata.ContentType);
2889 return; 2896 return;
2890 } 2897 }
2898
2891 int WearableOut = 0; 2899 int WearableOut = 0;
2892 bool isWearable = false; 2900 bool isWearable = false;
2893 2901
2894 if (req.AssetInf != null) 2902 isWearable = ((AssetType) req.AssetInf.Type ==
2895 isWearable =
2896 ((AssetType) req.AssetInf.Type ==
2897 AssetType.Bodypart || (AssetType) req.AssetInf.Type == AssetType.Clothing); 2903 AssetType.Bodypart || (AssetType) req.AssetInf.Type == AssetType.Clothing);
2898 2904
2899 2905
@@ -3013,7 +3019,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3013 reply.Data.ParcelID = parcelID; 3019 reply.Data.ParcelID = parcelID;
3014 reply.Data.OwnerID = land.OwnerID; 3020 reply.Data.OwnerID = land.OwnerID;
3015 reply.Data.Name = Utils.StringToBytes(land.Name); 3021 reply.Data.Name = Utils.StringToBytes(land.Name);
3016 if (land != null && land.Description != null && land.Description != String.Empty) 3022 if (land.Description != null && land.Description != String.Empty)
3017 reply.Data.Desc = Utils.StringToBytes(land.Description.Substring(0, land.Description.Length > 254 ? 254: land.Description.Length)); 3023 reply.Data.Desc = Utils.StringToBytes(land.Description.Substring(0, land.Description.Length > 254 ? 254: land.Description.Length));
3018 else 3024 else
3019 reply.Data.Desc = new Byte[0]; 3025 reply.Data.Desc = new Byte[0];
@@ -4241,24 +4247,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4241 } 4247 }
4242 else 4248 else
4243 { 4249 {
4250 ImprovedTerseObjectUpdatePacket.ObjectDataBlock ablock;
4244 if (update.Entity is ScenePresence) 4251 if (update.Entity is ScenePresence)
4245 { 4252 {
4246 // ALL presence updates go into a special list 4253 // ALL presence updates go into a special list
4247 ImprovedTerseObjectUpdatePacket.ObjectDataBlock ablock = 4254 ablock = CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures));
4248 CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures));
4249 terseAgentUpdateBlocks.Value.Add(ablock); 4255 terseAgentUpdateBlocks.Value.Add(ablock);
4250 terseAgentUpdates.Value.Add(update); 4256 terseAgentUpdates.Value.Add(update);
4251 maxUpdatesBytes -= ablock.Length;
4252 } 4257 }
4253 else 4258 else
4254 { 4259 {
4255 // Everything else goes here 4260 // Everything else goes here
4256 ImprovedTerseObjectUpdatePacket.ObjectDataBlock ablock = 4261 ablock = CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures));
4257 CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures));
4258 terseUpdateBlocks.Value.Add(ablock); 4262 terseUpdateBlocks.Value.Add(ablock);
4259 terseUpdates.Value.Add(update); 4263 terseUpdates.Value.Add(update);
4260 maxUpdatesBytes -= ablock.Length;
4261 } 4264 }
4265 maxUpdatesBytes -= ablock.Length;
4262 } 4266 }
4263 4267
4264 #endregion Block Construction 4268 #endregion Block Construction
@@ -5442,22 +5446,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5442 Quaternion rotation; 5446 Quaternion rotation;
5443 byte[] textureEntry; 5447 byte[] textureEntry;
5444 5448
5445 if (entity is ScenePresence) 5449 if (avatar)
5446 { 5450 {
5447 ScenePresence presence = (ScenePresence)entity; 5451 ScenePresence presence = (ScenePresence)entity;
5448 5452
5449 position = presence.OffsetPosition; 5453 position = presence.OffsetPosition;
5454 velocity = presence.Velocity;
5455 acceleration = Vector3.Zero;
5450 rotation = presence.Rotation; 5456 rotation = presence.Rotation;
5451 angularVelocity = presence.AngularVelocity; 5457 angularVelocity = presence.AngularVelocity;
5452 rotation = presence.Rotation;
5453 5458
5454// m_log.DebugFormat( 5459// m_log.DebugFormat(
5455// "[LLCLIENTVIEW]: Sending terse update to {0} with position {1} in {2}", Name, presence.OffsetPosition, m_scene.Name); 5460// "[LLCLIENTVIEW]: Sending terse update to {0} with position {1} in {2}", Name, presence.OffsetPosition, m_scene.Name);
5456 5461
5457 attachPoint = presence.State; 5462 attachPoint = presence.State;
5458 collisionPlane = presence.CollisionPlane; 5463 collisionPlane = presence.CollisionPlane;
5459 velocity = presence.Velocity;
5460 acceleration = Vector3.Zero;
5461 5464
5462 if (sendTexture) 5465 if (sendTexture)
5463 { 5466 {
@@ -7708,20 +7711,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7708 return true; 7711 return true;
7709 } 7712 }
7710 #endregion 7713 #endregion
7711 7714 List<uint> thisSelection = new List<uint>();
7712 ObjectSelect handlerObjectSelect = null; 7715 ObjectSelect handlerObjectSelect = null;
7713 uint objID; 7716 uint objID;
7714 for (int i = 0; i < incomingselect.ObjectData.Length; i++) 7717 handlerObjectSelect = OnObjectSelect;
7718 if (handlerObjectSelect != null)
7715 { 7719 {
7716 objID = incomingselect.ObjectData[i].ObjectLocalID; 7720 for (int i = 0; i < incomingselect.ObjectData.Length; i++)
7717 if (!SelectedObjects.Contains(objID))
7718 SelectedObjects.Add(objID);
7719
7720 handlerObjectSelect = OnObjectSelect;
7721 if (handlerObjectSelect != null)
7722 { 7721 {
7723 handlerObjectSelect(objID, this); 7722 objID = incomingselect.ObjectData[i].ObjectLocalID;
7723 if (!SelectedObjects.Contains(objID))
7724 SelectedObjects.Add(objID);
7725 thisSelection.Add(objID);
7724 } 7726 }
7727
7728 handlerObjectSelect(thisSelection, this);
7725 } 7729 }
7726 return true; 7730 return true;
7727 } 7731 }
@@ -7967,6 +7971,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7967 touchArgs.Add(arg); 7971 touchArgs.Add(arg);
7968 } 7972 }
7969 } 7973 }
7974
7970 handlerGrabUpdate(grabUpdate.ObjectData.ObjectID, grabUpdate.ObjectData.GrabOffsetInitial, 7975 handlerGrabUpdate(grabUpdate.ObjectData.ObjectID, grabUpdate.ObjectData.GrabOffsetInitial,
7971 grabUpdate.ObjectData.GrabPosition, this, touchArgs); 7976 grabUpdate.ObjectData.GrabPosition, this, touchArgs);
7972 } 7977 }
@@ -12407,72 +12412,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12407 /// <param name="simclient"></param> 12412 /// <param name="simclient"></param>
12408 /// <param name="packet"></param> 12413 /// <param name="packet"></param>
12409 /// <returns></returns> 12414 /// <returns></returns>
12410 // TODO: Convert old handler to use new method
12411/*
12412 protected bool HandleAgentTextureCached(IClientAPI simclient, Packet packet)
12413 {
12414 AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet;
12415 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse);
12416
12417 if (cachedtex.AgentData.SessionID != SessionId)
12418 return false;
12419
12420
12421
12422 // TODO: don't create new blocks if recycling an old packet
12423 cachedresp.AgentData.AgentID = AgentId;
12424 cachedresp.AgentData.SessionID = m_sessionId;
12425 cachedresp.AgentData.SerialNum = m_cachedTextureSerial;
12426 m_cachedTextureSerial++;
12427 cachedresp.WearableData =
12428 new AgentCachedTextureResponsePacket.WearableDataBlock[cachedtex.WearableData.Length];
12429
12430 int maxWearablesLoop = cachedtex.WearableData.Length;
12431 if (maxWearablesLoop > AvatarWearable.MAX_WEARABLES)
12432 maxWearablesLoop = AvatarWearable.MAX_WEARABLES;
12433
12434 // Find the cached baked textures for this user, if they're available
12435
12436 IAssetService cache = m_scene.AssetService;
12437 IBakedTextureModule bakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>();
12438
12439 WearableCacheItem[] cacheItems = null;
12440
12441 if (bakedTextureModule != null && cache != null)
12442 {
12443 ScenePresence p = m_scene.GetScenePresence(AgentId);
12444 if (p.Appearance != null)
12445 {
12446 if (p.Appearance.WearableCacheItems == null || p.Appearance.WearableCacheItemsDirty)
12447 {
12448 try
12449 {
12450 cacheItems = bakedTextureModule.Get(AgentId);
12451 p.Appearance.WearableCacheItems = cacheItems;
12452 p.Appearance.WearableCacheItemsDirty = false;
12453 }
12454 catch (Exception)
12455 {
12456 cacheItems = null;
12457 }
12458
12459 }
12460 else if (p.Appearance.WearableCacheItems != null)
12461 {
12462 cacheItems = p.Appearance.WearableCacheItems;
12463 }
12464 }
12465 }
12466
12467 CachedTextureRequest handlerCachedTextureRequest = OnCachedTextureRequest;
12468 if (handlerCachedTextureRequest != null)
12469 {
12470 handlerCachedTextureRequest(simclient,cachedtex.AgentData.SerialNum,requestArgs);
12471 }
12472
12473 return true;
12474 }
12475*/
12476 12415
12477 protected bool HandleAgentTextureCached(IClientAPI simclient, Packet packet) 12416 protected bool HandleAgentTextureCached(IClientAPI simclient, Packet packet)
12478 { 12417 {