aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP
diff options
context:
space:
mode:
authorMic Bowman2013-05-08 13:13:51 -0700
committerMic Bowman2013-05-08 13:13:51 -0700
commit33aaa40bee37ca4d8a3afa10fbbea7c1be3a1d58 (patch)
tree36cdb2066ecc0cbf8298225c53da6c996da4b50d /OpenSim/Region/ClientStack/Linden/UDP
parentDelete "" entry for AvatarPicker cap. (diff)
downloadopensim-SC-33aaa40bee37ca4d8a3afa10fbbea7c1be3a1d58.zip
opensim-SC-33aaa40bee37ca4d8a3afa10fbbea7c1be3a1d58.tar.gz
opensim-SC-33aaa40bee37ca4d8a3afa10fbbea7c1be3a1d58.tar.bz2
opensim-SC-33aaa40bee37ca4d8a3afa10fbbea7c1be3a1d58.tar.xz
Adds an event and a method so that handling of the CachedTexture
packet can be pulled out of LLClientView and moved to AvatarFactory. The first pass at reusing textures (turned off by default) is included. When reusing textures, if the baked textures from a previous login are still in the asset service (which generally means that they are in the simulator's cache) then the avatar will not need to rebake. This is both a performance improvement (specifically that an avatars baked textures do not need to be sent to other users who have the old textures cached) and a resource improvement (don't have to deal with duplicate bakes in the asset service cache).
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs58
1 files changed, 43 insertions, 15 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index bede379..47dd842 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -84,6 +84,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
84 public event ModifyTerrain OnModifyTerrain; 84 public event ModifyTerrain OnModifyTerrain;
85 public event Action<IClientAPI> OnRegionHandShakeReply; 85 public event Action<IClientAPI> OnRegionHandShakeReply;
86 public event GenericCall1 OnRequestWearables; 86 public event GenericCall1 OnRequestWearables;
87 public event CachedTextureRequest OnCachedTextureRequest;
87 public event SetAppearance OnSetAppearance; 88 public event SetAppearance OnSetAppearance;
88 public event AvatarNowWearing OnAvatarNowWearing; 89 public event AvatarNowWearing OnAvatarNowWearing;
89 public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; 90 public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv;
@@ -321,7 +322,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
321 private readonly byte[] m_channelVersion = Utils.EmptyBytes; 322 private readonly byte[] m_channelVersion = Utils.EmptyBytes;
322 private readonly IGroupsModule m_GroupsModule; 323 private readonly IGroupsModule m_GroupsModule;
323 324
324 private int m_cachedTextureSerial;
325 private PriorityQueue m_entityUpdates; 325 private PriorityQueue m_entityUpdates;
326 private PriorityQueue m_entityProps; 326 private PriorityQueue m_entityProps;
327 private Prioritizer m_prioritizer; 327 private Prioritizer m_prioritizer;
@@ -11462,8 +11462,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11462 } 11462 }
11463 11463
11464 /// <summary> 11464 /// <summary>
11465 /// Send a response back to a client when it asks the asset server (via the region server) if it has
11466 /// its appearance texture cached.
11467 /// </summary> 11465 /// </summary>
11468 /// <remarks> 11466 /// <remarks>
11469 /// At the moment, we always reply that there is no cached texture. 11467 /// At the moment, we always reply that there is no cached texture.
@@ -11473,33 +11471,63 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11473 /// <returns></returns> 11471 /// <returns></returns>
11474 protected bool HandleAgentTextureCached(IClientAPI simclient, Packet packet) 11472 protected bool HandleAgentTextureCached(IClientAPI simclient, Packet packet)
11475 { 11473 {
11476 //m_log.Debug("texture cached: " + packet.ToString());
11477 AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet; 11474 AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet;
11478 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse);
11479 11475
11480 if (cachedtex.AgentData.SessionID != SessionId) 11476 if (cachedtex.AgentData.SessionID != SessionId)
11481 return false; 11477 return false;
11482 11478
11479 List<CachedTextureRequestArg> requestArgs = new List<CachedTextureRequestArg>();
11480
11481 for (int i = 0; i < cachedtex.WearableData.Length; i++)
11482 {
11483 CachedTextureRequestArg arg = new CachedTextureRequestArg();
11484 arg.BakedTextureIndex = cachedtex.WearableData[i].TextureIndex;
11485 arg.WearableHashID = cachedtex.WearableData[i].ID;
11486
11487 requestArgs.Add(arg);
11488 }
11489
11490 CachedTextureRequest handlerCachedTextureRequest = OnCachedTextureRequest;
11491 if (handlerCachedTextureRequest != null)
11492 {
11493 handlerCachedTextureRequest(simclient,cachedtex.AgentData.SerialNum,requestArgs);
11494 }
11495
11496 return true;
11497 }
11498
11499 /// <summary>
11500 /// Send a response back to a client when it asks the asset server (via the region server) if it has
11501 /// its appearance texture cached.
11502 /// </summary>
11503 /// <param name="avatar"></param>
11504 /// <param name="serial"></param>
11505 /// <param name="cachedTextures"></param>
11506 /// <returns></returns>
11507 public void SendCachedTextureResponse(ISceneEntity avatar, int serial, List<CachedTextureResponseArg> cachedTextures)
11508 {
11509 ScenePresence presence = avatar as ScenePresence;
11510 if (presence == null)
11511 return;
11512
11513 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse);
11514
11483 // TODO: don't create new blocks if recycling an old packet 11515 // TODO: don't create new blocks if recycling an old packet
11484 cachedresp.AgentData.AgentID = AgentId; 11516 cachedresp.AgentData.AgentID = m_agentId;
11485 cachedresp.AgentData.SessionID = m_sessionId; 11517 cachedresp.AgentData.SessionID = m_sessionId;
11486 cachedresp.AgentData.SerialNum = m_cachedTextureSerial; 11518 cachedresp.AgentData.SerialNum = serial;
11487 m_cachedTextureSerial++; 11519 cachedresp.WearableData = new AgentCachedTextureResponsePacket.WearableDataBlock[cachedTextures.Count];
11488 cachedresp.WearableData =
11489 new AgentCachedTextureResponsePacket.WearableDataBlock[cachedtex.WearableData.Length];
11490 11520
11491 for (int i = 0; i < cachedtex.WearableData.Length; i++) 11521 for (int i = 0; i < cachedTextures.Count; i++)
11492 { 11522 {
11493 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); 11523 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
11494 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; 11524 cachedresp.WearableData[i].TextureIndex = (byte)cachedTextures[i].BakedTextureIndex;
11495 cachedresp.WearableData[i].TextureID = UUID.Zero; 11525 cachedresp.WearableData[i].TextureID = cachedTextures[i].BakedTextureID;
11496 cachedresp.WearableData[i].HostName = new byte[0]; 11526 cachedresp.WearableData[i].HostName = new byte[0];
11497 } 11527 }
11498 11528
11499 cachedresp.Header.Zerocoded = true; 11529 cachedresp.Header.Zerocoded = true;
11500 OutPacket(cachedresp, ThrottleOutPacketType.Task); 11530 OutPacket(cachedresp, ThrottleOutPacketType.Task);
11501
11502 return true;
11503 } 11531 }
11504 11532
11505 protected bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet) 11533 protected bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet)