diff --git a/OpenSim/Framework/ClientInfo.cs b/OpenSim/Framework/ClientInfo.cs index 7771f679c2..fbd18b5636 100644 --- a/OpenSim/Framework/ClientInfo.cs +++ b/OpenSim/Framework/ClientInfo.cs @@ -45,5 +45,14 @@ namespace OpenSim.Framework public uint sequence; public byte[] usecircuit; public EndPoint userEP; + + public int resendThrottle; + public int landThrottle; + public int windThrottle; + public int cloudThrottle; + public int taskThrottle; + public int assetThrottle; + public int textureThrottle; + public int totalThrottle; } -} \ No newline at end of file +} diff --git a/OpenSim/Grid/UserServer.Modules/UserManager.cs b/OpenSim/Grid/UserServer.Modules/UserManager.cs index c6c3a1ab6a..1f4b07d8be 100644 --- a/OpenSim/Grid/UserServer.Modules/UserManager.cs +++ b/OpenSim/Grid/UserServer.Modules/UserManager.cs @@ -248,6 +248,9 @@ namespace OpenSim.Grid.UserServer.Modules { string query = (string) requestData["avatar_name"]; + if (null == query) + return CreateUnknownUserErrorResponse(); + // Regex objAlphaNumericPattern = new Regex("[^a-zA-Z0-9]"); string[] querysplit = query.Split(' '); diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index f3e3d4f71a..2f3f198255 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -561,8 +561,12 @@ namespace OpenSim { int port = regionInfo.InternalEndPoint.Port; - // set initial originRegionID to RegionID in RegionInfo. (it needs for loding prims) - regionInfo.originRegionID = regionInfo.RegionID; + // set initial RegionID to originRegionID in RegionInfo. (it needs for loding prims) + // Commented this out because otherwise regions can't register with + // the grid as there is already another region with the same UUID + // at those coordinates. This is required for the load balancer to work. + // --Mike, 2009.02.25 + //regionInfo.originRegionID = regionInfo.RegionID; // set initial ServerURI regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.InternalEndPoint.Port; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index e643a0eed4..825e87a697 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -2584,6 +2584,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendCoarseLocationUpdate(List CoarseLocations) { + if (!IsActive) return; // We don't need to update inactive clients. + CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); // TODO: don't create new blocks if recycling an old packet int total = CoarseLocations.Count; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index 23118a2692..427022295e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs @@ -196,13 +196,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP // configuration! // - if ((m_SynchronizeClient != null) && (!m_Client.IsActive)) - { - if (m_SynchronizeClient(m_Client.Scene, packet, - m_Client.AgentId, throttlePacketType)) - return; - } - packet.Header.Sequence = 0; lock (m_NeedAck) @@ -480,26 +473,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (packet == null) return; - // If this client is on another partial instance, no need - // to handle packets - // - if (!m_Client.IsActive && packet.Type != PacketType.LogoutRequest) - { - PacketPool.Instance.ReturnPacket(packet); - return; - } - - // Any packet can have some packet acks in the header. - // Process them here - // - if (packet.Header.AppendedAcks) - { - foreach (uint id in packet.Header.AckList) - { - ProcessAck(id); - } - } - // When too many acks are needed to be sent, the client sends // a packet consisting of acks only // @@ -516,10 +489,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP PacketPool.Instance.ReturnPacket(packet); return; } - else if (packet.Type == PacketType.StartPingCheck) + + // Any packet can have some packet acks in the header. + // Process them here + // + if (packet.Header.AppendedAcks) + { + foreach (uint id in packet.Header.AckList) + { + ProcessAck(id); + } + } + + // If this client is on another partial instance, no need + // to handle packets + // + if (!m_Client.IsActive && packet.Type != PacketType.LogoutRequest) + { + PacketPool.Instance.ReturnPacket(packet); + return; + } + + if (packet.Type == PacketType.StartPingCheck) { StartPingCheckPacket startPing = (StartPingCheckPacket)packet; - CompletePingCheckPacket endPing + CompletePingCheckPacket endPing = (CompletePingCheckPacket)PacketPool.Instance.GetPacket(PacketType.CompletePingCheck); endPing.PingID.PingID = startPing.PingID.PingID; @@ -639,6 +633,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP info.sequence = m_Sequence; + float multiplier = m_PacketQueue.ThrottleMultiplier; + info.resendThrottle = (int) (m_PacketQueue.ResendThrottle.Throttle / multiplier); + info.landThrottle = (int) (m_PacketQueue.LandThrottle.Throttle / multiplier); + info.windThrottle = (int) (m_PacketQueue.WindThrottle.Throttle / multiplier); + info.cloudThrottle = (int) (m_PacketQueue.CloudThrottle.Throttle / multiplier); + info.taskThrottle = (int) (m_PacketQueue.TaskThrottle.Throttle / multiplier); + info.assetThrottle = (int) (m_PacketQueue.AssetThrottle.Throttle / multiplier); + info.textureThrottle = (int) (m_PacketQueue.TextureThrottle.Throttle / multiplier); + info.totalThrottle = (int) (m_PacketQueue.TotalThrottle.Throttle / multiplier); + return info; } @@ -676,6 +680,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP } m_Sequence = info.sequence; + + m_PacketQueue.ResendThrottle.Throttle = info.resendThrottle; + m_PacketQueue.LandThrottle.Throttle = info.landThrottle; + m_PacketQueue.WindThrottle.Throttle = info.windThrottle; + m_PacketQueue.CloudThrottle.Throttle = info.cloudThrottle; + m_PacketQueue.TaskThrottle.Throttle = info.taskThrottle; + m_PacketQueue.AssetThrottle.Throttle = info.assetThrottle; + m_PacketQueue.TextureThrottle.Throttle = info.textureThrottle; + m_PacketQueue.TotalThrottle.Throttle = info.totalThrottle; } public void AddImportantPacket(PacketType type) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 1c398d98fd..6bfa864614 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -69,18 +69,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP // This value also determines how many times per throttletimems the timer will run // If throttleimems is 1000 ms, then the timer will fire every 1000/7 milliseconds + private float throttleMultiplier = 2.0f; // Default value really doesn't matter. private int throttleTimeDivisor = 7; private int throttletimems = 1000; - private LLPacketThrottle ResendThrottle; - private LLPacketThrottle LandThrottle; - private LLPacketThrottle WindThrottle; - private LLPacketThrottle CloudThrottle; - private LLPacketThrottle TaskThrottle; - private LLPacketThrottle AssetThrottle; - private LLPacketThrottle TextureThrottle; - private LLPacketThrottle TotalThrottle; + internal LLPacketThrottle ResendThrottle; + internal LLPacketThrottle LandThrottle; + internal LLPacketThrottle WindThrottle; + internal LLPacketThrottle CloudThrottle; + internal LLPacketThrottle TaskThrottle; + internal LLPacketThrottle AssetThrottle; + internal LLPacketThrottle TextureThrottle; + internal LLPacketThrottle TotalThrottle; // private long LastThrottle; // private long ThrottleInterval; @@ -108,6 +109,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP TextureOutgoingPacketQueue = new Queue(); AssetOutgoingPacketQueue = new Queue(); + // Store the throttle multiplier for posterity. + throttleMultiplier = userSettings.ClientThrottleMultipler; + // Set up the throttle classes (min, max, current) in bits per second ResendThrottle = new LLPacketThrottle(5000, 100000, 16000, userSettings.ClientThrottleMultipler); LandThrottle = new LLPacketThrottle(1000, 100000, 2000, userSettings.ClientThrottleMultipler); @@ -624,5 +628,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP { return SendQueue.GetQueueArray(); } + + public float ThrottleMultiplier + { + get { return throttleMultiplier; } + } } } diff --git a/OpenSim/Region/Framework/Scenes/Animation.cs b/OpenSim/Region/Framework/Scenes/Animation.cs index 7c3e010586..1e697bde09 100644 --- a/OpenSim/Region/Framework/Scenes/Animation.cs +++ b/OpenSim/Region/Framework/Scenes/Animation.cs @@ -25,11 +25,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using OpenMetaverse; using OpenMetaverse.StructuredData; namespace OpenSim.Region.Framework.Scenes { + [Serializable] public class Animation { private UUID animID; diff --git a/OpenSim/Region/Framework/Scenes/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/AnimationSet.cs index ab651666c4..8e259544ff 100644 --- a/OpenSim/Region/Framework/Scenes/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/AnimationSet.cs @@ -25,11 +25,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using OpenMetaverse; namespace OpenSim.Region.Framework.Scenes { + [Serializable] public class AnimationSet { public static AvatarAnimations Animations = new AvatarAnimations(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6fade39b50..db0a2d204f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2048,17 +2048,22 @@ namespace OpenSim.Region.Framework.Scenes /// public void SendTerseUpdateToClient(IClientAPI remoteClient) { - m_perfMonMS = System.Environment.TickCount; + // If the client is inactive, it's getting its updates from another + // server. + if (remoteClient.IsActive) + { + m_perfMonMS = System.Environment.TickCount; - Vector3 pos = m_pos; - Vector3 vel = Velocity; - Quaternion rot = m_bodyRot; - pos.Z -= m_appearance.HipOffset; - remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new Vector3(pos.X, pos.Y, pos.Z), - new Vector3(vel.X, vel.Y, vel.Z), rot); + Vector3 pos = m_pos; + Vector3 vel = Velocity; + Quaternion rot = m_bodyRot; + pos.Z -= m_appearance.HipOffset; + remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new Vector3(pos.X, pos.Y, pos.Z), + new Vector3(vel.X, vel.Y, vel.Z), rot); - m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); - m_scene.AddAgentUpdates(1); + m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); + m_scene.AddAgentUpdates(1); + } } ///