diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 115 |
1 files changed, 52 insertions, 63 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 88ace6a..d8bd36d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -81,8 +81,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
81 | private List<ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates = | 81 | private List<ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates = |
82 | new List<ObjectUpdatePacket.ObjectDataBlock>(); | 82 | new List<ObjectUpdatePacket.ObjectDataBlock>(); |
83 | 83 | ||
84 | private Timer m_textureRequestTimer; | ||
85 | |||
86 | private bool m_clientBlocked; | 84 | private bool m_clientBlocked; |
87 | 85 | ||
88 | private int m_probesWithNoIngressPackets; | 86 | private int m_probesWithNoIngressPackets; |
@@ -143,9 +141,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
143 | protected int m_primTerseUpdateRate = 10; | 141 | protected int m_primTerseUpdateRate = 10; |
144 | protected int m_primFullUpdateRate = 14; | 142 | protected int m_primFullUpdateRate = 14; |
145 | 143 | ||
146 | protected int m_textureRequestRate = 100; | 144 | protected int m_textureSendLimit = 20; |
147 | protected int m_textureSendLimit = 10; | 145 | protected int m_textureDataLimit = 10; |
148 | protected int m_textureDataLimit = 5; | ||
149 | 146 | ||
150 | protected int m_packetMTU = 1400; | 147 | protected int m_packetMTU = 1400; |
151 | 148 | ||
@@ -534,6 +531,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
534 | m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings); | 531 | m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings); |
535 | m_PacketHandler.SynchronizeClient = SynchronizeClient; | 532 | m_PacketHandler.SynchronizeClient = SynchronizeClient; |
536 | m_PacketHandler.OnPacketStats += PopulateStats; | 533 | m_PacketHandler.OnPacketStats += PopulateStats; |
534 | m_PacketHandler.OnQueueEmpty += HandleQueueEmpty; | ||
537 | 535 | ||
538 | if (scene.Config != null) | 536 | if (scene.Config != null) |
539 | { | 537 | { |
@@ -555,9 +553,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
555 | m_primFullUpdateRate = clientConfig.GetInt("FullUpdateRate", | 553 | m_primFullUpdateRate = clientConfig.GetInt("FullUpdateRate", |
556 | m_primFullUpdateRate); | 554 | m_primFullUpdateRate); |
557 | 555 | ||
558 | m_textureRequestRate = clientConfig.GetInt("TextureRequestRate", | ||
559 | m_textureRequestRate); | ||
560 | |||
561 | m_textureSendLimit = clientConfig.GetInt("TextureSendLimit", | 556 | m_textureSendLimit = clientConfig.GetInt("TextureSendLimit", |
562 | m_textureSendLimit); | 557 | m_textureSendLimit); |
563 | 558 | ||
@@ -607,9 +602,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
607 | if (m_primFullUpdateTimer.Enabled) | 602 | if (m_primFullUpdateTimer.Enabled) |
608 | lock (m_primFullUpdateTimer) | 603 | lock (m_primFullUpdateTimer) |
609 | m_primFullUpdateTimer.Stop(); | 604 | m_primFullUpdateTimer.Stop(); |
610 | if (m_textureRequestTimer.Enabled) | ||
611 | lock (m_textureRequestTimer) | ||
612 | m_textureRequestTimer.Stop(); | ||
613 | 605 | ||
614 | // This is just to give the client a reasonable chance of | 606 | // This is just to give the client a reasonable chance of |
615 | // flushing out all it's packets. There should probably | 607 | // flushing out all it's packets. There should probably |
@@ -633,6 +625,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
633 | // of the client thread regardless of where Close() is called. | 625 | // of the client thread regardless of where Close() is called. |
634 | KillEndDone(); | 626 | KillEndDone(); |
635 | } | 627 | } |
628 | |||
629 | Terminate(); | ||
636 | } | 630 | } |
637 | 631 | ||
638 | /// <summary> | 632 | /// <summary> |
@@ -704,10 +698,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
704 | if (m_primFullUpdateTimer.Enabled) | 698 | if (m_primFullUpdateTimer.Enabled) |
705 | lock (m_primFullUpdateTimer) | 699 | lock (m_primFullUpdateTimer) |
706 | m_primFullUpdateTimer.Stop(); | 700 | m_primFullUpdateTimer.Stop(); |
707 | |||
708 | if (m_textureRequestTimer.Enabled) | ||
709 | lock (m_textureRequestTimer) | ||
710 | m_textureRequestTimer.Stop(); | ||
711 | } | 701 | } |
712 | 702 | ||
713 | public void Restart() | 703 | public void Restart() |
@@ -730,23 +720,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
730 | m_primFullUpdateTimer = new Timer(m_primFullUpdateRate); | 720 | m_primFullUpdateTimer = new Timer(m_primFullUpdateRate); |
731 | m_primFullUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessPrimFullUpdates); | 721 | m_primFullUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessPrimFullUpdates); |
732 | m_primFullUpdateTimer.AutoReset = false; | 722 | m_primFullUpdateTimer.AutoReset = false; |
733 | |||
734 | m_textureRequestTimer = new Timer(m_textureRequestRate); | ||
735 | m_textureRequestTimer.Elapsed += new ElapsedEventHandler(ProcessTextureRequests); | ||
736 | m_textureRequestTimer.AutoReset = false; | ||
737 | |||
738 | } | 723 | } |
739 | 724 | ||
740 | public void Terminate() | 725 | private void Terminate() |
741 | { | 726 | { |
727 | IsActive = false; | ||
728 | |||
729 | m_clientPingTimer.Close(); | ||
730 | m_avatarTerseUpdateTimer.Close(); | ||
731 | m_primTerseUpdateTimer.Close(); | ||
732 | m_primFullUpdateTimer.Close(); | ||
733 | |||
742 | m_PacketHandler.OnPacketStats -= PopulateStats; | 734 | m_PacketHandler.OnPacketStats -= PopulateStats; |
743 | m_PacketHandler.Stop(); | 735 | m_PacketHandler.Dispose(); |
744 | 736 | ||
745 | // wait for thread stoped | 737 | // wait for thread stoped |
746 | m_clientThread.Join(); | 738 | // m_clientThread.Join(); |
747 | 739 | ||
748 | // delete circuit code | 740 | // delete circuit code |
749 | m_networkServer.CloseClient(this); | 741 | //m_networkServer.CloseClient(this); |
750 | } | 742 | } |
751 | 743 | ||
752 | #endregion | 744 | #endregion |
@@ -876,6 +868,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
876 | while (IsActive) | 868 | while (IsActive) |
877 | { | 869 | { |
878 | LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue(); | 870 | LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue(); |
871 | |||
872 | if (nextPacket == null) { | ||
873 | m_log.DebugFormat("[CLIENT]: PacketQueue return null LLQueItem"); | ||
874 | continue; | ||
875 | } | ||
879 | 876 | ||
880 | if (nextPacket.Incoming) | 877 | if (nextPacket.Incoming) |
881 | { | 878 | { |
@@ -967,10 +964,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
967 | m_primFullUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessPrimFullUpdates); | 964 | m_primFullUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessPrimFullUpdates); |
968 | m_primFullUpdateTimer.AutoReset = false; | 965 | m_primFullUpdateTimer.AutoReset = false; |
969 | 966 | ||
970 | m_textureRequestTimer = new Timer(m_textureRequestRate); | ||
971 | m_textureRequestTimer.Elapsed += new ElapsedEventHandler(ProcessTextureRequests); | ||
972 | m_textureRequestTimer.AutoReset = false; | ||
973 | |||
974 | m_scene.AddNewClient(this); | 967 | m_scene.AddNewClient(this); |
975 | 968 | ||
976 | RefreshGroupMembership(); | 969 | RefreshGroupMembership(); |
@@ -1042,26 +1035,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1042 | } | 1035 | } |
1043 | } | 1036 | } |
1044 | 1037 | ||
1045 | protected virtual void TextureRequestHandler() | ||
1046 | { | ||
1047 | m_log.DebugFormat("[TRH] Thread started"); | ||
1048 | while (m_imageManager != null) | ||
1049 | { | ||
1050 | try | ||
1051 | { | ||
1052 | while (m_imageManager != null) | ||
1053 | { | ||
1054 | } | ||
1055 | } | ||
1056 | catch (Exception e) | ||
1057 | { | ||
1058 | m_log.WarnFormat("[TRH] Exception in handler loop: {0}", e.Message); | ||
1059 | m_log.Debug(e); | ||
1060 | } | ||
1061 | } | ||
1062 | m_log.DebugFormat("[TRH] Thread terminated"); | ||
1063 | } | ||
1064 | |||
1065 | # endregion | 1038 | # endregion |
1066 | 1039 | ||
1067 | // Previously ClientView.API partial class | 1040 | // Previously ClientView.API partial class |
@@ -3164,16 +3137,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3164 | // Unlike the other timers, this one is only started after | 3137 | // Unlike the other timers, this one is only started after |
3165 | // the first request is seen. | 3138 | // the first request is seen. |
3166 | 3139 | ||
3167 | void ProcessTextureRequests(object sender, ElapsedEventArgs e) | 3140 | void HandleQueueEmpty(ThrottleOutPacketType queue) |
3141 | { | ||
3142 | switch (queue) | ||
3143 | { | ||
3144 | case ThrottleOutPacketType.Texture: | ||
3145 | ProcessTextureRequests(); | ||
3146 | break; | ||
3147 | } | ||
3148 | } | ||
3149 | |||
3150 | void ProcessTextureRequests() | ||
3168 | { | 3151 | { |
3169 | if (m_imageManager != null) | 3152 | if (m_imageManager != null) |
3170 | { | 3153 | { |
3171 | if (m_imageManager.ProcessImageQueue(m_textureSendLimit, | 3154 | m_imageManager.ProcessImageQueue(m_textureSendLimit, |
3172 | m_textureDataLimit)) | 3155 | m_textureDataLimit); |
3173 | { | ||
3174 | lock (m_textureRequestTimer) | ||
3175 | m_textureRequestTimer.Start(); | ||
3176 | } | ||
3177 | } | 3156 | } |
3178 | } | 3157 | } |
3179 | 3158 | ||
@@ -5275,13 +5254,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5275 | // for the client session anyway, in order to protect ourselves against bad code in plugins | 5254 | // for the client session anyway, in order to protect ourselves against bad code in plugins |
5276 | try | 5255 | try |
5277 | { | 5256 | { |
5278 | List<byte> visualparams = new List<byte>(); | 5257 | byte[] visualparams = new byte[appear.VisualParam.Length]; |
5279 | foreach (AgentSetAppearancePacket.VisualParamBlock x in appear.VisualParam) | 5258 | for (int i = 0; i < appear.VisualParam.Length; i++) |
5280 | { | 5259 | visualparams[i] = appear.VisualParam[i].ParamValue; |
5281 | visualparams.Add(x.ParamValue); | ||
5282 | } | ||
5283 | 5260 | ||
5284 | handlerSetAppearance(appear.ObjectData.TextureEntry, visualparams); | 5261 | Primitive.TextureEntry te = null; |
5262 | if (appear.ObjectData.TextureEntry.Length > 1) | ||
5263 | te = new Primitive.TextureEntry(appear.ObjectData.TextureEntry, 0, appear.ObjectData.TextureEntry.Length); | ||
5264 | |||
5265 | handlerSetAppearance(te, visualparams); | ||
5285 | } | 5266 | } |
5286 | catch (Exception e) | 5267 | catch (Exception e) |
5287 | { | 5268 | { |
@@ -6624,8 +6605,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6624 | if (m_imageManager != null) | 6605 | if (m_imageManager != null) |
6625 | { | 6606 | { |
6626 | m_imageManager.EnqueueReq(args); | 6607 | m_imageManager.EnqueueReq(args); |
6627 | lock (m_textureRequestTimer) | ||
6628 | m_textureRequestTimer.Start(); | ||
6629 | } | 6608 | } |
6630 | } | 6609 | } |
6631 | } | 6610 | } |
@@ -11026,5 +11005,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11026 | } | 11005 | } |
11027 | 11006 | ||
11028 | #endregion | 11007 | #endregion |
11008 | |||
11009 | public void SendRebakeAvatarTextures(UUID textureID) | ||
11010 | { | ||
11011 | RebakeAvatarTexturesPacket pack = | ||
11012 | (RebakeAvatarTexturesPacket)PacketPool.Instance.GetPacket(PacketType.RebakeAvatarTextures); | ||
11013 | |||
11014 | pack.TextureData = new RebakeAvatarTexturesPacket.TextureDataBlock(); | ||
11015 | pack.TextureData.TextureID = textureID; | ||
11016 | OutPacket(pack, ThrottleOutPacketType.Task); | ||
11017 | } | ||
11029 | } | 11018 | } |
11030 | } | 11019 | } |