diff options
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 87 |
1 files changed, 60 insertions, 27 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index ee66485..7364f45 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -460,6 +460,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
460 | } | 460 | } |
461 | 461 | ||
462 | public bool SendLogoutPacketWhenClosing { set { m_SendLogoutPacketWhenClosing = value; } } | 462 | public bool SendLogoutPacketWhenClosing { set { m_SendLogoutPacketWhenClosing = value; } } |
463 | |||
463 | 464 | ||
464 | #endregion Properties | 465 | #endregion Properties |
465 | 466 | ||
@@ -585,6 +586,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
585 | // Disable UDP handling for this client | 586 | // Disable UDP handling for this client |
586 | m_udpClient.Shutdown(); | 587 | m_udpClient.Shutdown(); |
587 | 588 | ||
589 | |||
588 | //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); | 590 | //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); |
589 | //GC.Collect(); | 591 | //GC.Collect(); |
590 | //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); | 592 | //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); |
@@ -2750,8 +2752,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2750 | req.AssetInf.ID, req.AssetInf.Metadata.ContentType); | 2752 | req.AssetInf.ID, req.AssetInf.Metadata.ContentType); |
2751 | return; | 2753 | return; |
2752 | } | 2754 | } |
2755 | int WearableOut = 0; | ||
2756 | bool isWearable = false; | ||
2757 | |||
2758 | if (req.AssetInf != null) | ||
2759 | isWearable = | ||
2760 | ((AssetType) req.AssetInf.Type == | ||
2761 | AssetType.Bodypart || (AssetType) req.AssetInf.Type == AssetType.Clothing); | ||
2753 | 2762 | ||
2754 | //m_log.Debug("sending asset " + req.RequestAssetID); | 2763 | |
2764 | //m_log.Debug("sending asset " + req.RequestAssetID + ", iswearable: " + isWearable); | ||
2765 | |||
2766 | |||
2767 | //if (isWearable) | ||
2768 | // m_log.Debug((AssetType)req.AssetInf.Type); | ||
2769 | |||
2755 | TransferInfoPacket Transfer = new TransferInfoPacket(); | 2770 | TransferInfoPacket Transfer = new TransferInfoPacket(); |
2756 | Transfer.TransferInfo.ChannelType = 2; | 2771 | Transfer.TransferInfo.ChannelType = 2; |
2757 | Transfer.TransferInfo.Status = 0; | 2772 | Transfer.TransferInfo.Status = 0; |
@@ -2773,7 +2788,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2773 | Transfer.TransferInfo.Size = req.AssetInf.Data.Length; | 2788 | Transfer.TransferInfo.Size = req.AssetInf.Data.Length; |
2774 | Transfer.TransferInfo.TransferID = req.TransferRequestID; | 2789 | Transfer.TransferInfo.TransferID = req.TransferRequestID; |
2775 | Transfer.Header.Zerocoded = true; | 2790 | Transfer.Header.Zerocoded = true; |
2776 | OutPacket(Transfer, ThrottleOutPacketType.Asset); | 2791 | OutPacket(Transfer, isWearable ? ThrottleOutPacketType.State : ThrottleOutPacketType.Asset); |
2777 | 2792 | ||
2778 | if (req.NumPackets == 1) | 2793 | if (req.NumPackets == 1) |
2779 | { | 2794 | { |
@@ -2784,7 +2799,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2784 | TransferPacket.TransferData.Data = req.AssetInf.Data; | 2799 | TransferPacket.TransferData.Data = req.AssetInf.Data; |
2785 | TransferPacket.TransferData.Status = 1; | 2800 | TransferPacket.TransferData.Status = 1; |
2786 | TransferPacket.Header.Zerocoded = true; | 2801 | TransferPacket.Header.Zerocoded = true; |
2787 | OutPacket(TransferPacket, ThrottleOutPacketType.Asset); | 2802 | OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.State : ThrottleOutPacketType.Asset); |
2788 | } | 2803 | } |
2789 | else | 2804 | else |
2790 | { | 2805 | { |
@@ -2817,7 +2832,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2817 | TransferPacket.TransferData.Status = 1; | 2832 | TransferPacket.TransferData.Status = 1; |
2818 | } | 2833 | } |
2819 | TransferPacket.Header.Zerocoded = true; | 2834 | TransferPacket.Header.Zerocoded = true; |
2820 | OutPacket(TransferPacket, ThrottleOutPacketType.Asset); | 2835 | OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.State : ThrottleOutPacketType.Asset); |
2821 | 2836 | ||
2822 | processedLength += chunkSize; | 2837 | processedLength += chunkSize; |
2823 | packetNumber++; | 2838 | packetNumber++; |
@@ -3572,24 +3587,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3572 | aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[count]; | 3587 | aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[count]; |
3573 | AgentWearablesUpdatePacket.WearableDataBlock awb; | 3588 | AgentWearablesUpdatePacket.WearableDataBlock awb; |
3574 | int idx = 0; | 3589 | int idx = 0; |
3575 | for (int i = 0; i < wearables.Length; i++) | 3590 | |
3576 | { | 3591 | for (int i = 0; i < wearables.Length; i++) |
3577 | for (int j = 0; j < wearables[i].Count; j++) | 3592 | { |
3578 | { | 3593 | for (int j = 0; j < wearables[i].Count; j++) |
3579 | awb = new AgentWearablesUpdatePacket.WearableDataBlock(); | 3594 | { |
3580 | awb.WearableType = (byte)i; | 3595 | awb = new AgentWearablesUpdatePacket.WearableDataBlock(); |
3581 | awb.AssetID = wearables[i][j].AssetID; | 3596 | awb.WearableType = (byte) i; |
3582 | awb.ItemID = wearables[i][j].ItemID; | 3597 | awb.AssetID = wearables[i][j].AssetID; |
3583 | aw.WearableData[idx] = awb; | 3598 | awb.ItemID = wearables[i][j].ItemID; |
3584 | idx++; | 3599 | aw.WearableData[idx] = awb; |
3585 | 3600 | idx++; | |
3586 | // m_log.DebugFormat( | 3601 | |
3587 | // "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}", | 3602 | // m_log.DebugFormat( |
3588 | // awb.ItemID, awb.AssetID, i, Name); | 3603 | // "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}", |
3589 | } | 3604 | // awb.ItemID, awb.AssetID, i, Name); |
3590 | } | 3605 | } |
3606 | } | ||
3591 | 3607 | ||
3592 | OutPacket(aw, ThrottleOutPacketType.Task); | 3608 | OutPacket(aw, ThrottleOutPacketType.State); |
3593 | } | 3609 | } |
3594 | 3610 | ||
3595 | public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) | 3611 | public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) |
@@ -3614,7 +3630,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3614 | avp.Sender.IsTrial = false; | 3630 | avp.Sender.IsTrial = false; |
3615 | avp.Sender.ID = agentID; | 3631 | avp.Sender.ID = agentID; |
3616 | //m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); | 3632 | //m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); |
3617 | OutPacket(avp, ThrottleOutPacketType.Task); | 3633 | OutPacket(avp, ThrottleOutPacketType.State); |
3618 | } | 3634 | } |
3619 | 3635 | ||
3620 | public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) | 3636 | public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) |
@@ -6282,12 +6298,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6282 | byte[] visualparams = new byte[appear.VisualParam.Length]; | 6298 | byte[] visualparams = new byte[appear.VisualParam.Length]; |
6283 | for (int i = 0; i < appear.VisualParam.Length; i++) | 6299 | for (int i = 0; i < appear.VisualParam.Length; i++) |
6284 | visualparams[i] = appear.VisualParam[i].ParamValue; | 6300 | visualparams[i] = appear.VisualParam[i].ParamValue; |
6285 | 6301 | //var b = appear.WearableData[0]; | |
6302 | |||
6286 | Primitive.TextureEntry te = null; | 6303 | Primitive.TextureEntry te = null; |
6287 | if (appear.ObjectData.TextureEntry.Length > 1) | 6304 | if (appear.ObjectData.TextureEntry.Length > 1) |
6288 | te = new Primitive.TextureEntry(appear.ObjectData.TextureEntry, 0, appear.ObjectData.TextureEntry.Length); | 6305 | te = new Primitive.TextureEntry(appear.ObjectData.TextureEntry, 0, appear.ObjectData.TextureEntry.Length); |
6306 | |||
6307 | WearableCacheItem[] cacheitems = new WearableCacheItem[appear.WearableData.Length]; | ||
6308 | for (int i=0; i<appear.WearableData.Length;i++) | ||
6309 | cacheitems[i] = new WearableCacheItem(){CacheId = appear.WearableData[i].CacheID,TextureIndex=Convert.ToUInt32(appear.WearableData[i].TextureIndex)}; | ||
6310 | |||
6311 | |||
6289 | 6312 | ||
6290 | handlerSetAppearance(sender, te, visualparams,avSize); | 6313 | handlerSetAppearance(sender, te, visualparams,avSize, cacheitems); |
6291 | } | 6314 | } |
6292 | catch (Exception e) | 6315 | catch (Exception e) |
6293 | { | 6316 | { |
@@ -7798,6 +7821,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7798 | // surrounding scene | 7821 | // surrounding scene |
7799 | if ((ImageType)block.Type == ImageType.Baked) | 7822 | if ((ImageType)block.Type == ImageType.Baked) |
7800 | args.Priority *= 2.0f; | 7823 | args.Priority *= 2.0f; |
7824 | int wearableout = 0; | ||
7801 | 7825 | ||
7802 | ImageManager.EnqueueReq(args); | 7826 | ImageManager.EnqueueReq(args); |
7803 | } | 7827 | } |
@@ -11687,6 +11711,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11687 | 11711 | ||
11688 | if (cachedtex.AgentData.SessionID != SessionId) | 11712 | if (cachedtex.AgentData.SessionID != SessionId) |
11689 | return false; | 11713 | return false; |
11714 | |||
11690 | 11715 | ||
11691 | // TODO: don't create new blocks if recycling an old packet | 11716 | // TODO: don't create new blocks if recycling an old packet |
11692 | cachedresp.AgentData.AgentID = AgentId; | 11717 | cachedresp.AgentData.AgentID = AgentId; |
@@ -11696,6 +11721,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11696 | cachedresp.WearableData = | 11721 | cachedresp.WearableData = |
11697 | new AgentCachedTextureResponsePacket.WearableDataBlock[cachedtex.WearableData.Length]; | 11722 | new AgentCachedTextureResponsePacket.WearableDataBlock[cachedtex.WearableData.Length]; |
11698 | 11723 | ||
11724 | //IAvatarFactoryModule fac = m_scene.RequestModuleInterface<IAvatarFactoryModule>(); | ||
11725 | // var item = fac.GetBakedTextureFaces(AgentId); | ||
11726 | //WearableCacheItem[] items = fac.GetCachedItems(AgentId); | ||
11727 | |||
11699 | IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); | 11728 | IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); |
11700 | if (cache == null) | 11729 | if (cache == null) |
11701 | { | 11730 | { |
@@ -11703,7 +11732,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11703 | { | 11732 | { |
11704 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); | 11733 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); |
11705 | cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; | 11734 | cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; |
11706 | cachedresp.WearableData[i].TextureID = UUID.Zero; | 11735 | cachedresp.WearableData[i].TextureID = UUID.Zero; //UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46"); |
11707 | cachedresp.WearableData[i].HostName = new byte[0]; | 11736 | cachedresp.WearableData[i].HostName = new byte[0]; |
11708 | } | 11737 | } |
11709 | } | 11738 | } |
@@ -11713,10 +11742,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11713 | { | 11742 | { |
11714 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); | 11743 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); |
11715 | cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; | 11744 | cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; |
11716 | if(cache.Check(cachedtex.WearableData[i].ID.ToString())) | 11745 | |
11746 | |||
11747 | |||
11748 | if (cache.Check(cachedtex.WearableData[i].ID.ToString())) | ||
11717 | cachedresp.WearableData[i].TextureID = UUID.Zero; | 11749 | cachedresp.WearableData[i].TextureID = UUID.Zero; |
11750 | //UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46"); | ||
11718 | else | 11751 | else |
11719 | cachedresp.WearableData[i].TextureID = UUID.Zero; | 11752 | cachedresp.WearableData[i].TextureID = UUID.Zero; // UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46"); |
11720 | cachedresp.WearableData[i].HostName = new byte[0]; | 11753 | cachedresp.WearableData[i].HostName = new byte[0]; |
11721 | } | 11754 | } |
11722 | } | 11755 | } |