diff options
author | Melanie | 2013-04-28 19:03:39 +0200 |
---|---|---|
committer | Melanie | 2013-04-28 19:03:39 +0200 |
commit | 4275d7a839d7380ee50aeadc38a31dd467bd891e (patch) | |
tree | 1e589fc3b448b580d1cc25b52215ef5ce2d7ae78 /OpenSim/Region/ClientStack/Linden/UDP | |
parent | Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff) | |
parent | Controller module for dynamic floaters (WIP) (diff) | |
download | opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.zip opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.tar.gz opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.tar.bz2 opensim-SC-4275d7a839d7380ee50aeadc38a31dd467bd891e.tar.xz |
Merge branch 'avination-current' of ssh://3dhosting.de/var/git/careminster into avination-current
Conflicts:
bin/Regions/Regions.ini.example
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP')
6 files changed, 104 insertions, 164 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index fd82db7..98160c9 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -51,6 +51,7 @@ using RegionFlags = OpenMetaverse.RegionFlags; | |||
51 | using Nini.Config; | 51 | using Nini.Config; |
52 | 52 | ||
53 | using System.IO; | 53 | using System.IO; |
54 | using PermissionMask = OpenSim.Framework.PermissionMask; | ||
54 | 55 | ||
55 | namespace OpenSim.Region.ClientStack.LindenUDP | 56 | namespace OpenSim.Region.ClientStack.LindenUDP |
56 | { | 57 | { |
@@ -822,6 +823,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
822 | handshake.RegionInfo3.ProductName = Util.StringToBytes256(regionInfo.RegionType); | 823 | handshake.RegionInfo3.ProductName = Util.StringToBytes256(regionInfo.RegionType); |
823 | handshake.RegionInfo3.ProductSKU = Utils.EmptyBytes; | 824 | handshake.RegionInfo3.ProductSKU = Utils.EmptyBytes; |
824 | 825 | ||
826 | handshake.RegionInfo4 = new RegionHandshakePacket.RegionInfo4Block[0]; | ||
825 | // OutPacket(handshake, ThrottleOutPacketType.Task); | 827 | // OutPacket(handshake, ThrottleOutPacketType.Task); |
826 | // use same as MoveAgentIntoRegion (both should be task ) | 828 | // use same as MoveAgentIntoRegion (both should be task ) |
827 | OutPacket(handshake, ThrottleOutPacketType.Unknown); | 829 | OutPacket(handshake, ThrottleOutPacketType.Unknown); |
@@ -901,9 +903,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
901 | } | 903 | } |
902 | } | 904 | } |
903 | 905 | ||
904 | public void SendGenericMessage(string method, List<string> message) | 906 | public void SendGenericMessage(string method, UUID invoice, List<string> message) |
905 | { | 907 | { |
906 | GenericMessagePacket gmp = new GenericMessagePacket(); | 908 | GenericMessagePacket gmp = new GenericMessagePacket(); |
909 | |||
910 | gmp.AgentData.AgentID = AgentId; | ||
911 | gmp.AgentData.SessionID = m_sessionId; | ||
912 | gmp.AgentData.TransactionID = invoice; | ||
913 | |||
907 | gmp.MethodData.Method = Util.StringToBytes256(method); | 914 | gmp.MethodData.Method = Util.StringToBytes256(method); |
908 | gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; | 915 | gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; |
909 | int i = 0; | 916 | int i = 0; |
@@ -916,9 +923,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
916 | OutPacket(gmp, ThrottleOutPacketType.Task); | 923 | OutPacket(gmp, ThrottleOutPacketType.Task); |
917 | } | 924 | } |
918 | 925 | ||
919 | public void SendGenericMessage(string method, List<byte[]> message) | 926 | public void SendGenericMessage(string method, UUID invoice, List<byte[]> message) |
920 | { | 927 | { |
921 | GenericMessagePacket gmp = new GenericMessagePacket(); | 928 | GenericMessagePacket gmp = new GenericMessagePacket(); |
929 | |||
930 | gmp.AgentData.AgentID = AgentId; | ||
931 | gmp.AgentData.SessionID = m_sessionId; | ||
932 | gmp.AgentData.TransactionID = invoice; | ||
933 | |||
922 | gmp.MethodData.Method = Util.StringToBytes256(method); | 934 | gmp.MethodData.Method = Util.StringToBytes256(method); |
923 | gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; | 935 | gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; |
924 | int i = 0; | 936 | int i = 0; |
@@ -1801,7 +1813,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1801 | 1813 | ||
1802 | public void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item) | 1814 | public void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item) |
1803 | { | 1815 | { |
1804 | const uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; | 1816 | // Fudge this value. It's only needed to make the CRC anyway |
1817 | const uint FULL_MASK_PERMISSIONS = (uint)0x7fffffff; | ||
1805 | 1818 | ||
1806 | FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket)PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply); | 1819 | FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket)PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply); |
1807 | // TODO: don't create new blocks if recycling an old packet | 1820 | // TODO: don't create new blocks if recycling an old packet |
@@ -2006,7 +2019,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2006 | 2019 | ||
2007 | protected void SendBulkUpdateInventoryItem(InventoryItemBase item) | 2020 | protected void SendBulkUpdateInventoryItem(InventoryItemBase item) |
2008 | { | 2021 | { |
2009 | const uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; | 2022 | const uint FULL_MASK_PERMISSIONS = (uint)0x7ffffff; |
2010 | 2023 | ||
2011 | BulkUpdateInventoryPacket bulkUpdate | 2024 | BulkUpdateInventoryPacket bulkUpdate |
2012 | = (BulkUpdateInventoryPacket)PacketPool.Instance.GetPacket(PacketType.BulkUpdateInventory); | 2025 | = (BulkUpdateInventoryPacket)PacketPool.Instance.GetPacket(PacketType.BulkUpdateInventory); |
@@ -2065,7 +2078,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2065 | /// <see>IClientAPI.SendInventoryItemCreateUpdate(InventoryItemBase)</see> | 2078 | /// <see>IClientAPI.SendInventoryItemCreateUpdate(InventoryItemBase)</see> |
2066 | public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId) | 2079 | public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId) |
2067 | { | 2080 | { |
2068 | const uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; | 2081 | const uint FULL_MASK_PERMISSIONS = (uint)0x7fffffff; |
2069 | 2082 | ||
2070 | UpdateCreateInventoryItemPacket InventoryReply | 2083 | UpdateCreateInventoryItemPacket InventoryReply |
2071 | = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket( | 2084 | = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket( |
@@ -2654,7 +2667,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2654 | byte physshapetype = part.PhysicsShapeType; | 2667 | byte physshapetype = part.PhysicsShapeType; |
2655 | float density = part.Density; | 2668 | float density = part.Density; |
2656 | float friction = part.Friction; | 2669 | float friction = part.Friction; |
2657 | float bounce = part.Bounciness; | 2670 | float bounce = part.Restitution; |
2658 | float gravmod = part.GravityModifier; | 2671 | float gravmod = part.GravityModifier; |
2659 | 2672 | ||
2660 | eq.partPhysicsProperties(localid, physshapetype, density, friction, bounce, gravmod,AgentId); | 2673 | eq.partPhysicsProperties(localid, physshapetype, density, friction, bounce, gravmod,AgentId); |
@@ -3604,7 +3617,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3604 | 3617 | ||
3605 | avp.Sender.IsTrial = false; | 3618 | avp.Sender.IsTrial = false; |
3606 | avp.Sender.ID = agentID; | 3619 | avp.Sender.ID = agentID; |
3607 | m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); | 3620 | avp.AppearanceData = new AvatarAppearancePacket.AppearanceDataBlock[0]; |
3621 | //m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); | ||
3608 | OutPacket(avp, ThrottleOutPacketType.Task); | 3622 | OutPacket(avp, ThrottleOutPacketType.Task); |
3609 | } | 3623 | } |
3610 | 3624 | ||
@@ -3892,6 +3906,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3892 | { | 3906 | { |
3893 | part.Shape.LightEntry = false; | 3907 | part.Shape.LightEntry = false; |
3894 | } | 3908 | } |
3909 | |||
3910 | if (part.Shape != null && (part.Shape.SculptType == (byte)SculptType.Mesh)) | ||
3911 | { | ||
3912 | // Ensure that mesh has at least 8 valid faces | ||
3913 | part.Shape.ProfileBegin = 12500; | ||
3914 | part.Shape.ProfileEnd = 0; | ||
3915 | part.Shape.ProfileHollow = 27500; | ||
3916 | } | ||
3917 | } | ||
3918 | |||
3919 | if (part.Shape != null && (part.Shape.SculptType == (byte)SculptType.Mesh)) | ||
3920 | { | ||
3921 | // Ensure that mesh has at least 8 valid faces | ||
3922 | part.Shape.ProfileBegin = 12500; | ||
3923 | part.Shape.ProfileEnd = 0; | ||
3924 | part.Shape.ProfileHollow = 27500; | ||
3895 | } | 3925 | } |
3896 | } | 3926 | } |
3897 | 3927 | ||
@@ -4208,7 +4238,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4208 | pack.Stat = stats.StatsBlock; | 4238 | pack.Stat = stats.StatsBlock; |
4209 | 4239 | ||
4210 | pack.Header.Reliable = false; | 4240 | pack.Header.Reliable = false; |
4211 | 4241 | pack.RegionInfo = new SimStatsPacket.RegionInfoBlock[0]; | |
4212 | OutPacket(pack, ThrottleOutPacketType.Task); | 4242 | OutPacket(pack, ThrottleOutPacketType.Task); |
4213 | } | 4243 | } |
4214 | 4244 | ||
@@ -4599,7 +4629,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4599 | rinfopack.AgentData = new RegionInfoPacket.AgentDataBlock(); | 4629 | rinfopack.AgentData = new RegionInfoPacket.AgentDataBlock(); |
4600 | rinfopack.AgentData.AgentID = AgentId; | 4630 | rinfopack.AgentData.AgentID = AgentId; |
4601 | rinfopack.AgentData.SessionID = SessionId; | 4631 | rinfopack.AgentData.SessionID = SessionId; |
4602 | 4632 | rinfopack.RegionInfo3 = new RegionInfoPacket.RegionInfo3Block[0]; | |
4603 | 4633 | ||
4604 | OutPacket(rinfopack, ThrottleOutPacketType.Task); | 4634 | OutPacket(rinfopack, ThrottleOutPacketType.Task); |
4605 | } | 4635 | } |
@@ -4952,6 +4982,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4952 | position = part.OffsetPosition + presence.OffsetPosition * part.RotationOffset; | 4982 | position = part.OffsetPosition + presence.OffsetPosition * part.RotationOffset; |
4953 | rotation = part.RotationOffset * presence.Rotation; | 4983 | rotation = part.RotationOffset * presence.Rotation; |
4954 | } | 4984 | } |
4985 | angularVelocity = Vector3.Zero; | ||
4986 | } | ||
4987 | else | ||
4988 | { | ||
4989 | angularVelocity = presence.AngularVelocity; | ||
4990 | rotation = presence.Rotation; | ||
4955 | } | 4991 | } |
4956 | 4992 | ||
4957 | attachPoint = 0; | 4993 | attachPoint = 0; |
@@ -4963,9 +4999,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4963 | // in that direction, even though we don't model this on the server. Implementing this in the future | 4999 | // in that direction, even though we don't model this on the server. Implementing this in the future |
4964 | // may improve movement smoothness. | 5000 | // may improve movement smoothness. |
4965 | // acceleration = new Vector3(1, 0, 0); | 5001 | // acceleration = new Vector3(1, 0, 0); |
4966 | 5002 | ||
4967 | angularVelocity = Vector3.Zero; | ||
4968 | |||
4969 | if (sendTexture) | 5003 | if (sendTexture) |
4970 | textureEntry = presence.Appearance.Texture.GetBytes(); | 5004 | textureEntry = presence.Appearance.Texture.GetBytes(); |
4971 | else | 5005 | else |
@@ -6575,19 +6609,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6575 | #endregion | 6609 | #endregion |
6576 | 6610 | ||
6577 | AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit; | 6611 | AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit; |
6578 | if (handlerAgentRequestSit != null) | ||
6579 | if (!(agentRequestSit.AgentData == null | ||
6580 | || agentRequestSit.TargetObject == null | ||
6581 | || agentRequestSit.TargetObject.TargetID == null | ||
6582 | || agentRequestSit.TargetObject.Offset == null)) | ||
6583 | { | ||
6584 | var sp = m_scene.GetScenePresence(agentRequestSit.AgentData.AgentID); | ||
6585 | if (sp == null || sp.ParentID != 0) // ignore packet if agent is already sitting | ||
6586 | return true; | ||
6587 | 6612 | ||
6588 | handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID, | 6613 | if (handlerAgentRequestSit != null) |
6589 | agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); | 6614 | handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID, |
6590 | } | 6615 | agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); |
6591 | } | 6616 | } |
6592 | return true; | 6617 | return true; |
6593 | } | 6618 | } |
@@ -7193,7 +7218,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7193 | 7218 | ||
7194 | if (handlerUpdatePrimFlags != null) | 7219 | if (handlerUpdatePrimFlags != null) |
7195 | { | 7220 | { |
7196 | byte[] data = Pack.ToBytes(); | 7221 | // byte[] data = Pack.ToBytes(); |
7197 | // 46,47,48 are special positions within the packet | 7222 | // 46,47,48 are special positions within the packet |
7198 | // This may change so perhaps we need a better way | 7223 | // This may change so perhaps we need a better way |
7199 | // of storing this (OMV.FlagUpdatePacket.UsePhysics,etc?) | 7224 | // of storing this (OMV.FlagUpdatePacket.UsePhysics,etc?) |
@@ -9835,7 +9860,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9835 | EconomyDataRequest handlerEconomoyDataRequest = OnEconomyDataRequest; | 9860 | EconomyDataRequest handlerEconomoyDataRequest = OnEconomyDataRequest; |
9836 | if (handlerEconomoyDataRequest != null) | 9861 | if (handlerEconomoyDataRequest != null) |
9837 | { | 9862 | { |
9838 | handlerEconomoyDataRequest(AgentId); | 9863 | handlerEconomoyDataRequest(this); |
9839 | } | 9864 | } |
9840 | return true; | 9865 | return true; |
9841 | } | 9866 | } |
@@ -12242,11 +12267,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12242 | if (logPacket) | 12267 | if (logPacket) |
12243 | m_log.DebugFormat( | 12268 | m_log.DebugFormat( |
12244 | "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}", | 12269 | "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}", |
12245 | Name, SceneAgent.IsChildAgent ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type); | 12270 | Name, SceneAgent.IsChildAgent ? "child" : "root ", Scene.Name, packet.Type); |
12246 | } | 12271 | } |
12247 | 12272 | ||
12248 | if (!ProcessPacketMethod(packet)) | 12273 | if (!ProcessPacketMethod(packet)) |
12249 | m_log.Warn("[CLIENT]: unhandled packet " + packet.Type); | 12274 | m_log.WarnFormat( |
12275 | "[CLIENT]: Unhandled packet {0} from {1} ({2}) in {3}. Ignoring.", | ||
12276 | packet.Type, Name, SceneAgent.IsChildAgent ? "child" : "root ", Scene.Name); | ||
12250 | } | 12277 | } |
12251 | 12278 | ||
12252 | private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) | 12279 | private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) |
@@ -12454,6 +12481,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
12454 | return String.Empty; | 12481 | return String.Empty; |
12455 | } | 12482 | } |
12456 | 12483 | ||
12484 | public OSDMap OReport(string uptime, string version) | ||
12485 | { | ||
12486 | return new OSDMap(); | ||
12487 | } | ||
12488 | |||
12457 | /// <summary> | 12489 | /// <summary> |
12458 | /// Make an asset request to the asset service in response to a client request. | 12490 | /// Make an asset request to the asset service in response to a client request. |
12459 | /// </summary> | 12491 | /// </summary> |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index da1ccb3..4154ef2 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -281,25 +281,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
281 | m_shouldCollectStats = false; | 281 | m_shouldCollectStats = false; |
282 | if (config != null) | 282 | if (config != null) |
283 | { | 283 | { |
284 | if (config.Contains("enabled") && config.GetBoolean("enabled")) | 284 | m_shouldCollectStats = config.GetBoolean("Enabled", false); |
285 | { | 285 | binStatsMaxFilesize = TimeSpan.FromSeconds(config.GetInt("packet_headers_period_seconds", 300)); |
286 | if (config.Contains("collect_packet_headers")) | 286 | binStatsDir = config.GetString("stats_dir", "."); |
287 | m_shouldCollectStats = config.GetBoolean("collect_packet_headers"); | 287 | m_aggregatedBWStats = config.GetBoolean("aggregatedBWStats", false); |
288 | if (config.Contains("packet_headers_period_seconds")) | 288 | } |
289 | { | 289 | #endregion BinaryStats |
290 | binStatsMaxFilesize = TimeSpan.FromSeconds(config.GetInt("region_stats_period_seconds")); | ||
291 | } | ||
292 | if (config.Contains("stats_dir")) | ||
293 | { | ||
294 | binStatsDir = config.GetString("stats_dir"); | ||
295 | } | ||
296 | } | ||
297 | else | ||
298 | { | ||
299 | m_shouldCollectStats = false; | ||
300 | } | ||
301 | } | ||
302 | #endregion BinaryStats | ||
303 | 290 | ||
304 | m_throttle = new TokenBucket(null, sceneThrottleBps); | 291 | m_throttle = new TokenBucket(null, sceneThrottleBps); |
305 | ThrottleRates = new ThrottleRates(configSource); | 292 | ThrottleRates = new ThrottleRates(configSource); |
@@ -1309,8 +1296,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1309 | static object binStatsLogLock = new object(); | 1296 | static object binStatsLogLock = new object(); |
1310 | static string binStatsDir = ""; | 1297 | static string binStatsDir = ""; |
1311 | 1298 | ||
1299 | //for Aggregated In/Out BW logging | ||
1300 | static bool m_aggregatedBWStats = false; | ||
1301 | static long m_aggregatedBytesIn = 0; | ||
1302 | static long m_aggregatedByestOut = 0; | ||
1303 | static object aggBWStatsLock = new object(); | ||
1304 | |||
1305 | public static long AggregatedLLUDPBytesIn | ||
1306 | { | ||
1307 | get { return m_aggregatedBytesIn; } | ||
1308 | } | ||
1309 | public static long AggregatedLLUDPBytesOut | ||
1310 | { | ||
1311 | get {return m_aggregatedByestOut;} | ||
1312 | } | ||
1313 | |||
1312 | public static void LogPacketHeader(bool incoming, uint circuit, byte flags, PacketType packetType, ushort size) | 1314 | public static void LogPacketHeader(bool incoming, uint circuit, byte flags, PacketType packetType, ushort size) |
1313 | { | 1315 | { |
1316 | if (m_aggregatedBWStats) | ||
1317 | { | ||
1318 | lock (aggBWStatsLock) | ||
1319 | { | ||
1320 | if (incoming) | ||
1321 | m_aggregatedBytesIn += size; | ||
1322 | else | ||
1323 | m_aggregatedByestOut += size; | ||
1324 | } | ||
1325 | } | ||
1326 | |||
1314 | if (!m_shouldCollectStats) return; | 1327 | if (!m_shouldCollectStats) return; |
1315 | 1328 | ||
1316 | // Binary logging format is TTTTTTTTCCCCFPPPSS, T=Time, C=Circuit, F=Flags, P=PacketType, S=size | 1329 | // Binary logging format is TTTTTTTTCCCCFPPPSS, T=Time, C=Circuit, F=Flags, P=PacketType, S=size |
@@ -1903,112 +1916,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1903 | } | 1916 | } |
1904 | } | 1917 | } |
1905 | } | 1918 | } |
1906 | |||
1907 | internal class DoubleQueue<T> where T:class | ||
1908 | { | ||
1909 | private Queue<T> m_lowQueue = new Queue<T>(); | ||
1910 | private Queue<T> m_highQueue = new Queue<T>(); | ||
1911 | |||
1912 | private object m_syncRoot = new object(); | ||
1913 | private Semaphore m_s = new Semaphore(0, 1); | ||
1914 | |||
1915 | public DoubleQueue() | ||
1916 | { | ||
1917 | } | ||
1918 | |||
1919 | public virtual int Count | ||
1920 | { | ||
1921 | get { return m_highQueue.Count + m_lowQueue.Count; } | ||
1922 | } | ||
1923 | |||
1924 | public virtual void Enqueue(T data) | ||
1925 | { | ||
1926 | Enqueue(m_lowQueue, data); | ||
1927 | } | ||
1928 | |||
1929 | public virtual void EnqueueLow(T data) | ||
1930 | { | ||
1931 | Enqueue(m_lowQueue, data); | ||
1932 | } | ||
1933 | |||
1934 | public virtual void EnqueueHigh(T data) | ||
1935 | { | ||
1936 | Enqueue(m_highQueue, data); | ||
1937 | } | ||
1938 | |||
1939 | private void Enqueue(Queue<T> q, T data) | ||
1940 | { | ||
1941 | lock (m_syncRoot) | ||
1942 | { | ||
1943 | m_lowQueue.Enqueue(data); | ||
1944 | m_s.WaitOne(0); | ||
1945 | m_s.Release(); | ||
1946 | } | ||
1947 | } | ||
1948 | |||
1949 | public virtual T Dequeue() | ||
1950 | { | ||
1951 | return Dequeue(Timeout.Infinite); | ||
1952 | } | ||
1953 | |||
1954 | public virtual T Dequeue(int tmo) | ||
1955 | { | ||
1956 | return Dequeue(TimeSpan.FromMilliseconds(tmo)); | ||
1957 | } | ||
1958 | |||
1959 | public virtual T Dequeue(TimeSpan wait) | ||
1960 | { | ||
1961 | T res = null; | ||
1962 | |||
1963 | if (!Dequeue(wait, ref res)) | ||
1964 | return null; | ||
1965 | |||
1966 | return res; | ||
1967 | } | ||
1968 | |||
1969 | public bool Dequeue(int timeout, ref T res) | ||
1970 | { | ||
1971 | return Dequeue(TimeSpan.FromMilliseconds(timeout), ref res); | ||
1972 | } | ||
1973 | |||
1974 | public bool Dequeue(TimeSpan wait, ref T res) | ||
1975 | { | ||
1976 | if (!m_s.WaitOne(wait)) | ||
1977 | return false; | ||
1978 | |||
1979 | lock (m_syncRoot) | ||
1980 | { | ||
1981 | if (m_highQueue.Count > 0) | ||
1982 | res = m_highQueue.Dequeue(); | ||
1983 | else | ||
1984 | res = m_lowQueue.Dequeue(); | ||
1985 | |||
1986 | if (m_highQueue.Count == 0 && m_lowQueue.Count == 0) | ||
1987 | return true; | ||
1988 | |||
1989 | try | ||
1990 | { | ||
1991 | m_s.Release(); | ||
1992 | } | ||
1993 | catch | ||
1994 | { | ||
1995 | } | ||
1996 | |||
1997 | return true; | ||
1998 | } | ||
1999 | } | ||
2000 | |||
2001 | public virtual void Clear() | ||
2002 | { | ||
2003 | |||
2004 | lock (m_syncRoot) | ||
2005 | { | ||
2006 | // Make sure sem count is 0 | ||
2007 | m_s.WaitOne(0); | ||
2008 | |||
2009 | m_lowQueue.Clear(); | ||
2010 | m_highQueue.Clear(); | ||
2011 | } | ||
2012 | } | ||
2013 | } | ||
2014 | } | 1919 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs index 2aeb4cc..7035e38 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs | |||
@@ -204,9 +204,12 @@ namespace OpenMetaverse | |||
204 | { | 204 | { |
205 | UDPPacketBuffer buf; | 205 | UDPPacketBuffer buf; |
206 | 206 | ||
207 | if (UsePools) | 207 | // FIXME: Disabled for now as this causes issues with reused packet objects interfering with each other |
208 | buf = Pool.GetObject(); | 208 | // on Windows with m_asyncPacketHandling = true, though this has not been seen on Linux. |
209 | else | 209 | // Possibly some unexpected issue with fetching UDP data concurrently with multiple threads. Requires more investigation. |
210 | // if (UsePools) | ||
211 | // buf = Pool.GetObject(); | ||
212 | // else | ||
210 | buf = new UDPPacketBuffer(); | 213 | buf = new UDPPacketBuffer(); |
211 | 214 | ||
212 | if (IsRunningInbound) | 215 | if (IsRunningInbound) |
@@ -287,8 +290,8 @@ namespace OpenMetaverse | |||
287 | catch (ObjectDisposedException) { } | 290 | catch (ObjectDisposedException) { } |
288 | finally | 291 | finally |
289 | { | 292 | { |
290 | if (UsePools) | 293 | // if (UsePools) |
291 | Pool.ReturnObject(buffer); | 294 | // Pool.ReturnObject(buffer); |
292 | 295 | ||
293 | // Synchronous mode waits until the packet callback completes | 296 | // Synchronous mode waits until the packet callback completes |
294 | // before starting the receive to fetch another packet | 297 | // before starting the receive to fetch another packet |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs b/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs index af2f6f8..98ef72f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs | |||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices; | |||
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
32 | [assembly: AssemblyVersion("0.7.5.*")] | 32 | [assembly: AssemblyVersion("0.7.6.*")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs index 5fcf376..7d9f581 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs | |||
@@ -43,7 +43,7 @@ using OpenSim.Tests.Common.Mock; | |||
43 | namespace OpenSim.Region.ClientStack.LindenUDP.Tests | 43 | namespace OpenSim.Region.ClientStack.LindenUDP.Tests |
44 | { | 44 | { |
45 | [TestFixture] | 45 | [TestFixture] |
46 | public class LLImageManagerTests | 46 | public class LLImageManagerTests : OpenSimTestCase |
47 | { | 47 | { |
48 | private AssetBase m_testImageAsset; | 48 | private AssetBase m_testImageAsset; |
49 | private Scene scene; | 49 | private Scene scene; |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/PacketHandlerTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/PacketHandlerTests.cs index 0f88ec6..5f73a94 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/PacketHandlerTests.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/PacketHandlerTests.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
39 | /// Tests for the LL packet handler | 39 | /// Tests for the LL packet handler |
40 | /// </summary> | 40 | /// </summary> |
41 | [TestFixture] | 41 | [TestFixture] |
42 | public class PacketHandlerTests | 42 | public class PacketHandlerTests : OpenSimTestCase |
43 | { | 43 | { |
44 | // [Test] | 44 | // [Test] |
45 | // /// <summary> | 45 | // /// <summary> |