diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 1091078..54359eb 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -325,6 +325,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
325 | /// </summary> | 325 | /// </summary> |
326 | public LLImageManager ImageManager { get; private set; } | 326 | public LLImageManager ImageManager { get; private set; } |
327 | 327 | ||
328 | public JobEngine m_asyncPacketProcess; | ||
328 | private readonly LLUDPServer m_udpServer; | 329 | private readonly LLUDPServer m_udpServer; |
329 | private readonly LLUDPClient m_udpClient; | 330 | private readonly LLUDPClient m_udpClient; |
330 | private readonly UUID m_sessionId; | 331 | private readonly UUID m_sessionId; |
@@ -378,7 +379,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
378 | protected Scene m_scene; | 379 | protected Scene m_scene; |
379 | protected string m_firstName; | 380 | protected string m_firstName; |
380 | protected string m_lastName; | 381 | protected string m_lastName; |
381 | protected Thread m_clientThread; | ||
382 | protected Vector3 m_startpos; | 382 | protected Vector3 m_startpos; |
383 | protected UUID m_activeGroupID; | 383 | protected UUID m_activeGroupID; |
384 | protected string m_activeGroupName = String.Empty; | 384 | protected string m_activeGroupName = String.Empty; |
@@ -529,7 +529,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
529 | m_prioritizer = new Prioritizer(m_scene); | 529 | m_prioritizer = new Prioritizer(m_scene); |
530 | 530 | ||
531 | RegisterLocalPacketHandlers(); | 531 | RegisterLocalPacketHandlers(); |
532 | 532 | string name = string.Format("AsyncInUDP-{0}",m_agentId.ToString()); | |
533 | m_asyncPacketProcess = new JobEngine(name, name, 10000); | ||
533 | IsActive = true; | 534 | IsActive = true; |
534 | } | 535 | } |
535 | 536 | ||
@@ -592,6 +593,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
592 | if (OnConnectionClosed != null) | 593 | if (OnConnectionClosed != null) |
593 | OnConnectionClosed(this); | 594 | OnConnectionClosed(this); |
594 | 595 | ||
596 | m_asyncPacketProcess.Stop(); | ||
595 | 597 | ||
596 | // Flush all of the packets out of the UDP server for this client | 598 | // Flush all of the packets out of the UDP server for this client |
597 | if (m_udpServer != null) | 599 | if (m_udpServer != null) |
@@ -778,12 +780,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
778 | cinfo.AsyncRequests[packet.Type.ToString()]++; | 780 | cinfo.AsyncRequests[packet.Type.ToString()]++; |
779 | 781 | ||
780 | object obj = new AsyncPacketProcess(this, pprocessor.method, packet); | 782 | object obj = new AsyncPacketProcess(this, pprocessor.method, packet); |
781 | 783 | /* | |
782 | if (pprocessor.InEngine) | 784 | if (pprocessor.InEngine) |
783 | m_udpServer.IpahEngine.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj)); | 785 | m_udpServer.IpahEngine.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj)); |
784 | else | 786 | else |
785 | Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString()); | 787 | Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString()); |
786 | 788 | */ | |
789 | m_asyncPacketProcess.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj)); | ||
787 | result = true; | 790 | result = true; |
788 | } | 791 | } |
789 | else | 792 | else |
@@ -841,6 +844,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
841 | 844 | ||
842 | public virtual void Start() | 845 | public virtual void Start() |
843 | { | 846 | { |
847 | m_asyncPacketProcess.Start(); | ||
844 | m_scene.AddNewAgent(this, PresenceType.User); | 848 | m_scene.AddNewAgent(this, PresenceType.User); |
845 | 849 | ||
846 | // RefreshGroupMembership(); | 850 | // RefreshGroupMembership(); |
@@ -6036,8 +6040,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6036 | AddLocalPacketHandler(PacketType.ObjectExtraParams, HandleObjectExtraParams); | 6040 | AddLocalPacketHandler(PacketType.ObjectExtraParams, HandleObjectExtraParams); |
6037 | AddLocalPacketHandler(PacketType.ObjectDuplicate, HandleObjectDuplicate); | 6041 | AddLocalPacketHandler(PacketType.ObjectDuplicate, HandleObjectDuplicate); |
6038 | AddLocalPacketHandler(PacketType.RequestMultipleObjects, HandleRequestMultipleObjects); | 6042 | AddLocalPacketHandler(PacketType.RequestMultipleObjects, HandleRequestMultipleObjects); |
6039 | AddLocalPacketHandler(PacketType.ObjectSelect, HandleObjectSelect); | 6043 | AddLocalPacketHandler(PacketType.ObjectSelect, HandleObjectSelect, true, true); |
6040 | AddLocalPacketHandler(PacketType.ObjectDeselect, HandleObjectDeselect); | 6044 | AddLocalPacketHandler(PacketType.ObjectDeselect, HandleObjectDeselect, true, true); |
6041 | AddLocalPacketHandler(PacketType.ObjectPosition, HandleObjectPosition); | 6045 | AddLocalPacketHandler(PacketType.ObjectPosition, HandleObjectPosition); |
6042 | AddLocalPacketHandler(PacketType.ObjectScale, HandleObjectScale); | 6046 | AddLocalPacketHandler(PacketType.ObjectScale, HandleObjectScale); |
6043 | AddLocalPacketHandler(PacketType.ObjectRotation, HandleObjectRotation); | 6047 | AddLocalPacketHandler(PacketType.ObjectRotation, HandleObjectRotation); |
@@ -8030,19 +8034,41 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8030 | return true; | 8034 | return true; |
8031 | } | 8035 | } |
8032 | 8036 | ||
8037 | Dictionary<uint, uint> objImageSeqs = null; | ||
8038 | double lastobjImageSeqsMS = 0.0; | ||
8039 | |||
8033 | private bool HandleObjectImage(IClientAPI sender, Packet Pack) | 8040 | private bool HandleObjectImage(IClientAPI sender, Packet Pack) |
8034 | { | 8041 | { |
8035 | ObjectImagePacket imagePack = (ObjectImagePacket)Pack; | 8042 | ObjectImagePacket imagePack = (ObjectImagePacket)Pack; |
8036 | 8043 | ||
8037 | UpdatePrimTexture handlerUpdatePrimTexture = null; | 8044 | UpdatePrimTexture handlerUpdatePrimTexture = OnUpdatePrimTexture; |
8045 | if (handlerUpdatePrimTexture == null) | ||
8046 | return true; | ||
8047 | |||
8048 | double now = Util.GetTimeStampMS(); | ||
8049 | if(objImageSeqs == null || ( now - lastobjImageSeqsMS > 30000.0)) | ||
8050 | { | ||
8051 | objImageSeqs = null; // yeah i know superstition... | ||
8052 | objImageSeqs = new Dictionary<uint, uint>(16); | ||
8053 | } | ||
8054 | |||
8055 | lastobjImageSeqsMS = now; | ||
8056 | uint seq = Pack.Header.Sequence; | ||
8057 | uint id; | ||
8058 | uint lastseq; | ||
8059 | |||
8060 | ObjectImagePacket.ObjectDataBlock o; | ||
8038 | for (int i = 0; i < imagePack.ObjectData.Length; i++) | 8061 | for (int i = 0; i < imagePack.ObjectData.Length; i++) |
8039 | { | 8062 | { |
8040 | handlerUpdatePrimTexture = OnUpdatePrimTexture; | 8063 | o = imagePack.ObjectData[i]; |
8041 | if (handlerUpdatePrimTexture != null) | 8064 | id = o.ObjectLocalID; |
8042 | { | 8065 | if(objImageSeqs.TryGetValue(id, out lastseq)) |
8043 | handlerUpdatePrimTexture(imagePack.ObjectData[i].ObjectLocalID, | 8066 | { |
8044 | imagePack.ObjectData[i].TextureEntry, this); | 8067 | if(seq <= lastseq) |
8045 | } | 8068 | continue; |
8069 | } | ||
8070 | objImageSeqs[id] = seq; | ||
8071 | handlerUpdatePrimTexture(id, o.TextureEntry, this); | ||
8046 | } | 8072 | } |
8047 | return true; | 8073 | return true; |
8048 | } | 8074 | } |