From d756fa01aea63e9b50be00a6f1f229ff7afef779 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 22 Oct 2009 18:57:14 +0900 Subject: Add copyright header. Formatting cleanup. --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 0ba76ec..5acf25f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -827,7 +827,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int i = x1; i <= x2; i++) SendLayerData(i, y1, map); - // Column + // Column for (int j = y1 + 1; j <= y2; j++) SendLayerData(x2, j, map); -- cgit v1.1 From 588361e2a2398b963871762c2b5485c6a086cf47 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 23 Oct 2009 01:02:36 -0700 Subject: Experimental change to use an immutable array for iterating ScenePresences, avoiding locking and copying the list each time it is accessed --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 141 ++++++++++----------- 1 file changed, 70 insertions(+), 71 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 5acf25f..e81ff4b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -4434,6 +4434,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected virtual void RegisterLocalPacketHandlers() { AddLocalPacketHandler(PacketType.LogoutRequest, Logout); + AddLocalPacketHandler(PacketType.AgentUpdate, HandleAgentUpdate); AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect); AddLocalPacketHandler(PacketType.AgentCachedTexture, AgentTextureCached); AddLocalPacketHandler(PacketType.MultipleObjectUpdate, MultipleObjUpdate); @@ -4446,6 +4447,75 @@ namespace OpenSim.Region.ClientStack.LindenUDP #region Packet Handlers + private bool HandleAgentUpdate(IClientAPI sener, Packet Pack) + { + if (OnAgentUpdate != null) + { + bool update = false; + AgentUpdatePacket agenUpdate = (AgentUpdatePacket)Pack; + + #region Packet Session and User Check + if (agenUpdate.AgentData.SessionID != SessionId || agenUpdate.AgentData.AgentID != AgentId) + return false; + #endregion + + AgentUpdatePacket.AgentDataBlock x = agenUpdate.AgentData; + + // We can only check when we have something to check + // against. + + if (lastarg != null) + { + update = + ( + (x.BodyRotation != lastarg.BodyRotation) || + (x.CameraAtAxis != lastarg.CameraAtAxis) || + (x.CameraCenter != lastarg.CameraCenter) || + (x.CameraLeftAxis != lastarg.CameraLeftAxis) || + (x.CameraUpAxis != lastarg.CameraUpAxis) || + (x.ControlFlags != lastarg.ControlFlags) || + (x.Far != lastarg.Far) || + (x.Flags != lastarg.Flags) || + (x.State != lastarg.State) || + (x.HeadRotation != lastarg.HeadRotation) || + (x.SessionID != lastarg.SessionID) || + (x.AgentID != lastarg.AgentID) + ); + } + else + update = true; + + // These should be ordered from most-likely to + // least likely to change. I've made an initial + // guess at that. + + if (update) + { + AgentUpdateArgs arg = new AgentUpdateArgs(); + arg.AgentID = x.AgentID; + arg.BodyRotation = x.BodyRotation; + arg.CameraAtAxis = x.CameraAtAxis; + arg.CameraCenter = x.CameraCenter; + arg.CameraLeftAxis = x.CameraLeftAxis; + arg.CameraUpAxis = x.CameraUpAxis; + arg.ControlFlags = x.ControlFlags; + arg.Far = x.Far; + arg.Flags = x.Flags; + arg.HeadRotation = x.HeadRotation; + arg.SessionID = x.SessionID; + arg.State = x.State; + UpdateAgent handlerAgentUpdate = OnAgentUpdate; + lastarg = arg; // save this set of arguments for nexttime + if (handlerAgentUpdate != null) + OnAgentUpdate(this, arg); + + handlerAgentUpdate = null; + } + } + + return true; + } + private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack) { MoneyTransferRequestPacket money = (MoneyTransferRequestPacket)Pack; @@ -5631,77 +5701,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; - case PacketType.AgentUpdate: - if (OnAgentUpdate != null) - { - bool update = false; - AgentUpdatePacket agenUpdate = (AgentUpdatePacket)Pack; - - #region Packet Session and User Check - if (m_checkPackets) - { - if (agenUpdate.AgentData.SessionID != SessionId || - agenUpdate.AgentData.AgentID != AgentId) - break; - } - #endregion - - AgentUpdatePacket.AgentDataBlock x = agenUpdate.AgentData; - - // We can only check when we have something to check - // against. - - if (lastarg != null) - { - update = - ( - (x.BodyRotation != lastarg.BodyRotation) || - (x.CameraAtAxis != lastarg.CameraAtAxis) || - (x.CameraCenter != lastarg.CameraCenter) || - (x.CameraLeftAxis != lastarg.CameraLeftAxis) || - (x.CameraUpAxis != lastarg.CameraUpAxis) || - (x.ControlFlags != lastarg.ControlFlags) || - (x.Far != lastarg.Far) || - (x.Flags != lastarg.Flags) || - (x.State != lastarg.State) || - (x.HeadRotation != lastarg.HeadRotation) || - (x.SessionID != lastarg.SessionID) || - (x.AgentID != lastarg.AgentID) - ); - } - else - update = true; - - // These should be ordered from most-likely to - // least likely to change. I've made an initial - // guess at that. - - if (update) - { - AgentUpdateArgs arg = new AgentUpdateArgs(); - arg.AgentID = x.AgentID; - arg.BodyRotation = x.BodyRotation; - arg.CameraAtAxis = x.CameraAtAxis; - arg.CameraCenter = x.CameraCenter; - arg.CameraLeftAxis = x.CameraLeftAxis; - arg.CameraUpAxis = x.CameraUpAxis; - arg.ControlFlags = x.ControlFlags; - arg.Far = x.Far; - arg.Flags = x.Flags; - arg.HeadRotation = x.HeadRotation; - arg.SessionID = x.SessionID; - arg.State = x.State; - UpdateAgent handlerAgentUpdate = OnAgentUpdate; - lastarg = arg; // save this set of arguments for nexttime - if (handlerAgentUpdate != null) - OnAgentUpdate(this, arg); - - handlerAgentUpdate = null; - } - - } - break; - case PacketType.AgentAnimation: AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack; -- cgit v1.1 From 4c45b5fd3c6b636552b819c6a56c1a3c23683bfb Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 23 Oct 2009 10:35:47 -0700 Subject: Cleaning up OpenSim.ini.example for LLUDP. The [LLClient] section has been removed and several new parameters have been added to [ClientStack.LindenUDP] --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index e81ff4b..6f0b177 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -346,15 +346,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected int m_terrainCheckerCount; protected uint m_agentFOVCounter; - // These numbers are guesses at a decent tradeoff between responsiveness - // of the interest list and throughput. Lower is more responsive, higher - // is better throughput - protected int m_primTerseUpdatesPerPacket = 25; - protected int m_primFullUpdatesPerPacket = 100; - protected int m_avatarTerseUpdatesPerPacket = 10; - /// Number of texture packets to put on the queue each time the - /// OnQueueEmpty event is triggered for the texture category - protected int m_textureSendLimit = 20; protected IAssetService m_assetService; private IHyperAssetService m_hyperAssets; @@ -3333,7 +3324,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP lock (m_avatarTerseUpdates.SyncRoot) { - int count = Math.Min(m_avatarTerseUpdates.Count, m_avatarTerseUpdatesPerPacket); + int count = Math.Min(m_avatarTerseUpdates.Count, m_udpServer.AvatarTerseUpdatesPerPacket); if (count == 0) return; @@ -3418,7 +3409,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP lock (m_primFullUpdates.SyncRoot) { - int count = Math.Min(m_primFullUpdates.Count, m_primFullUpdatesPerPacket); + int count = Math.Min(m_primFullUpdates.Count, m_udpServer.PrimFullUpdatesPerPacket); if (count == 0) return; @@ -3462,7 +3453,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP lock (m_primTerseUpdates.SyncRoot) { - int count = Math.Min(m_primTerseUpdates.Count, m_primTerseUpdatesPerPacket); + int count = Math.Min(m_primTerseUpdates.Count, m_udpServer.PrimTerseUpdatesPerPacket); if (count == 0) return; @@ -3585,7 +3576,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP void ProcessTextureRequests() { if (m_imageManager != null) - m_imageManager.ProcessImageQueue(m_textureSendLimit); + m_imageManager.ProcessImageQueue(m_udpServer.TextureSendLimit); } public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) -- cgit v1.1 From ad624f703d75c048d4bb0fc1f8bbe02ef20dd2dd Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Mon, 26 Oct 2009 13:41:20 -0700 Subject: ParcelObjectOwnersReplyPacket has null DataBlock when a client requests a list of their prims in the region and none exist. Instead of leaving pack.Data null, this patch sets a new DataBlock[0]; --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 6f0b177..edfb13c 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -4158,6 +4158,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP pack.Data = dataBlock; } + else + { + pack.Data = new ParcelObjectOwnersReplyPacket.DataBlock[0]; + } pack.Header.Zerocoded = true; this.OutPacket(pack, ThrottleOutPacketType.Task); } -- cgit v1.1 From b6651ce79017bc7c6d1df66757e26a74bacfc36f Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 26 Oct 2009 18:22:32 -0700 Subject: * Double the priority on avatar bake texture requests to get avatars rezzing in faster than the surrounding scene * Adds duplicate tracking for SceneObjectParts and ScenePresences to avoid sending out duplicate ImprovedTerseObjectUpdate packets --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index edfb13c..31028b3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -6756,11 +6756,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (OnRequestTexture != null) { TextureRequestArgs args = new TextureRequestArgs(); - args.RequestedAssetID = imageRequest.RequestImage[i].Image; - args.DiscardLevel = imageRequest.RequestImage[i].DiscardLevel; - args.PacketNumber = imageRequest.RequestImage[i].Packet; - args.Priority = imageRequest.RequestImage[i].DownloadPriority; + + RequestImagePacket.RequestImageBlock block = imageRequest.RequestImage[i]; + + args.RequestedAssetID = block.Image; + args.DiscardLevel = block.DiscardLevel; + args.PacketNumber = block.Packet; + args.Priority = block.DownloadPriority; args.requestSequence = imageRequest.Header.Sequence; + + // NOTE: This is not a built in part of the LLUDP protocol, but we double the + // priority of avatar textures to get avatars rezzing in faster than the + // surrounding scene + if ((ImageType)block.Type == ImageType.Baked) + args.Priority *= 2.0f; + //handlerTextureRequest = OnRequestTexture; //if (handlerTextureRequest != null) -- cgit v1.1 From c75d4156487b35aac47aa6818144862a99bb841c Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 27 Oct 2009 00:26:56 -0700 Subject: * Converts ClientManager.ForEach() (and as a result, Scene.ForEachClient()) to use a non-blocking parallel method when operating in async mode * Minor code readability cleanup --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 31028b3..f6a7a0c 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -2105,12 +2105,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks) { ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect); - packet.Effect = effectBlocks; + packet.Header.Reliable = false; + packet.Header.Zerocoded = true; packet.AgentData.AgentID = AgentId; packet.AgentData.SessionID = SessionId; - packet.Header.Reliable = false; - packet.Header.Zerocoded = true; + + packet.Effect = effectBlocks; + OutPacket(packet, ThrottleOutPacketType.State); } -- cgit v1.1