diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
13 files changed, 76 insertions, 75 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/ILLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/ILLPacketHandler.cs index 665c773..32a4ad4 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/ILLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/ILLPacketHandler.cs | |||
@@ -31,7 +31,7 @@ using OpenMetaverse.Packets; | |||
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | 32 | ||
33 | namespace OpenSim.Region.ClientStack.LindenUDP | 33 | namespace OpenSim.Region.ClientStack.LindenUDP |
34 | { | 34 | { |
35 | public delegate void PacketStats(int inPackets, int outPackets, int unAckedBytes); | 35 | public delegate void PacketStats(int inPackets, int outPackets, int unAckedBytes); |
36 | public delegate void PacketDrop(Packet pack, Object id); | 36 | public delegate void PacketDrop(Packet pack, Object id); |
37 | public delegate bool SynchronizeClientHandler(IScene scene, Packet packet, UUID agentID, ThrottleOutPacketType throttlePacketType); | 37 | public delegate bool SynchronizeClientHandler(IScene scene, Packet packet, UUID agentID, ThrottleOutPacketType throttlePacketType); |
@@ -61,7 +61,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
61 | /// <summary> | 61 | /// <summary> |
62 | /// Take action depending on the type and contents of an received packet. | 62 | /// Take action depending on the type and contents of an received packet. |
63 | /// </summary> | 63 | /// </summary> |
64 | /// <param name="item"></param> | 64 | /// <param name="item"></param> |
65 | void ProcessInPacket(LLQueItem item); | 65 | void ProcessInPacket(LLQueItem item); |
66 | 66 | ||
67 | void ProcessOutPacket(LLQueItem item); | 67 | void ProcessOutPacket(LLQueItem item); |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs index 6cffd70..638c765 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | |||
@@ -127,7 +127,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
127 | } | 127 | } |
128 | else | 128 | else |
129 | { | 129 | { |
130 | m_asset = asset; | 130 | m_asset = asset; |
131 | } | 131 | } |
132 | RunUpdate(); | 132 | RunUpdate(); |
133 | } | 133 | } |
@@ -198,7 +198,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
198 | try | 198 | try |
199 | { | 199 | { |
200 | Buffer.BlockCopy(m_asset.Data, 0, firstImageData, 0, (int)cFirstPacketSize); | 200 | Buffer.BlockCopy(m_asset.Data, 0, firstImageData, 0, (int)cFirstPacketSize); |
201 | client.SendImageFirstPart(TexturePacketCount(), m_requestedUUID, (uint)m_asset.Data.Length, firstImageData, 2); | 201 | client.SendImageFirstPart(TexturePacketCount(), m_requestedUUID, (uint)m_asset.Data.Length, firstImageData, 2); |
202 | } | 202 | } |
203 | catch (Exception) | 203 | catch (Exception) |
204 | { | 204 | { |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 912cbf1..88ace6a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -2332,7 +2332,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2332 | return itemBlock; | 2332 | return itemBlock; |
2333 | } | 2333 | } |
2334 | 2334 | ||
2335 | public void SendBulkUpdateInventory(InventoryNodeBase node) | 2335 | public void SendBulkUpdateInventory(InventoryNodeBase node) |
2336 | { | 2336 | { |
2337 | if (node is InventoryItemBase) | 2337 | if (node is InventoryItemBase) |
2338 | SendBulkUpdateInventoryItem((InventoryItemBase)node); | 2338 | SendBulkUpdateInventoryItem((InventoryItemBase)node); |
@@ -2937,7 +2937,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2937 | else if (m_avatarTerseUpdates.Count == 1) | 2937 | else if (m_avatarTerseUpdates.Count == 1) |
2938 | { | 2938 | { |
2939 | lock (m_avatarTerseUpdateTimer) | 2939 | lock (m_avatarTerseUpdateTimer) |
2940 | m_avatarTerseUpdateTimer.Start(); | 2940 | m_avatarTerseUpdateTimer.Start(); |
2941 | } | 2941 | } |
2942 | } | 2942 | } |
2943 | } | 2943 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 798c1e7..c427870 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs | |||
@@ -143,7 +143,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
143 | TextureThrottle = new LLPacketThrottle(1000, throttleMaxBPS / 2, 4000, userSettings.ClientThrottleMultipler); | 143 | TextureThrottle = new LLPacketThrottle(1000, throttleMaxBPS / 2, 4000, userSettings.ClientThrottleMultipler); |
144 | 144 | ||
145 | 145 | ||
146 | // Total Throttle trumps all - it is the number of bits in total that are allowed to go out per second. | 146 | // Total Throttle trumps all - it is the number of bits in total that are allowed to go out per second. |
147 | 147 | ||
148 | 148 | ||
149 | ThrottleSettings totalThrottleSettings = userSettings.TotalThrottleSettings; | 149 | ThrottleSettings totalThrottleSettings = userSettings.TotalThrottleSettings; |
@@ -410,7 +410,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
410 | { | 410 | { |
411 | LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue(); | 411 | LLQueItem qpack = ResendOutgoingPacketQueue.Dequeue(); |
412 | 412 | ||
413 | SendQueue.Enqueue(qpack); | 413 | SendQueue.Enqueue(qpack); |
414 | TotalThrottle.AddBytes(qpack.Length); | 414 | TotalThrottle.AddBytes(qpack.Length); |
415 | ResendThrottle.AddBytes(qpack.Length); | 415 | ResendThrottle.AddBytes(qpack.Length); |
416 | 416 | ||
@@ -470,7 +470,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
470 | { | 470 | { |
471 | LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue(); | 471 | LLQueItem qpack = TextureOutgoingPacketQueue.Dequeue(); |
472 | 472 | ||
473 | SendQueue.Enqueue(qpack); | 473 | SendQueue.Enqueue(qpack); |
474 | TotalThrottle.AddBytes(qpack.Length); | 474 | TotalThrottle.AddBytes(qpack.Length); |
475 | TextureThrottle.AddBytes(qpack.Length); | 475 | TextureThrottle.AddBytes(qpack.Length); |
476 | qchanged = true; | 476 | qchanged = true; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs index 56219d1..70d94e7 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs | |||
@@ -48,11 +48,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
48 | /// <summary> | 48 | /// <summary> |
49 | /// Tweakable user settings | 49 | /// Tweakable user settings |
50 | /// </summary> | 50 | /// </summary> |
51 | private ClientStackUserSettings m_userSettings; | 51 | private ClientStackUserSettings m_userSettings; |
52 | 52 | ||
53 | public LLPacketServer(ILLClientStackNetworkHandler networkHandler, ClientStackUserSettings userSettings) | 53 | public LLPacketServer(ILLClientStackNetworkHandler networkHandler, ClientStackUserSettings userSettings) |
54 | { | 54 | { |
55 | m_userSettings = userSettings; | 55 | m_userSettings = userSettings; |
56 | m_networkHandler = networkHandler; | 56 | m_networkHandler = networkHandler; |
57 | 57 | ||
58 | m_networkHandler.RegisterPacketServer(this); | 58 | m_networkHandler.RegisterPacketServer(this); |
@@ -114,7 +114,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
114 | sessionInfo = circuitManager.AuthenticateSession(sessionId, agentId, circuitCode); | 114 | sessionInfo = circuitManager.AuthenticateSession(sessionId, agentId, circuitCode); |
115 | 115 | ||
116 | if (!sessionInfo.Authorised) | 116 | if (!sessionInfo.Authorised) |
117 | return false; | 117 | return false; |
118 | 118 | ||
119 | return true; | 119 | return true; |
120 | } | 120 | } |
@@ -129,7 +129,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
129 | /// <param name="proxyEP"></param> | 129 | /// <param name="proxyEP"></param> |
130 | /// <returns> | 130 | /// <returns> |
131 | /// true if a new circuit was created, false if a circuit with the given circuit code already existed | 131 | /// true if a new circuit was created, false if a circuit with the given circuit code already existed |
132 | /// </returns> | 132 | /// </returns> |
133 | public virtual bool AddNewClient( | 133 | public virtual bool AddNewClient( |
134 | EndPoint epSender, UseCircuitCodePacket useCircuit, | 134 | EndPoint epSender, UseCircuitCodePacket useCircuit, |
135 | AuthenticateResponse sessionInfo, EndPoint proxyEP) | 135 | AuthenticateResponse sessionInfo, EndPoint proxyEP) |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs index 01bff6d..52effc5 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketThrottle.cs | |||
@@ -26,7 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | namespace OpenSim.Region.ClientStack.LindenUDP | 28 | namespace OpenSim.Region.ClientStack.LindenUDP |
29 | { | 29 | { |
30 | public class LLPacketThrottle | 30 | public class LLPacketThrottle |
31 | { | 31 | { |
32 | private readonly int m_maxAllowableThrottle; | 32 | private readonly int m_maxAllowableThrottle; |
@@ -49,7 +49,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
49 | public int Min | 49 | public int Min |
50 | { | 50 | { |
51 | get { return m_minAllowableThrottle; } | 51 | get { return m_minAllowableThrottle; } |
52 | } | 52 | } |
53 | 53 | ||
54 | public int Current | 54 | public int Current |
55 | { | 55 | { |
@@ -105,13 +105,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
105 | 105 | ||
106 | public int Throttle | 106 | public int Throttle |
107 | { | 107 | { |
108 | get { return m_currentThrottle; } | 108 | get { return m_currentThrottle; } |
109 | set | 109 | set |
110 | { | 110 | { |
111 | if (value < m_minAllowableThrottle) | 111 | if (value < m_minAllowableThrottle) |
112 | { | 112 | { |
113 | m_currentThrottle = m_minAllowableThrottle; | 113 | m_currentThrottle = m_minAllowableThrottle; |
114 | } | 114 | } |
115 | else if (value > m_maxAllowableThrottle) | 115 | else if (value > m_maxAllowableThrottle) |
116 | { | 116 | { |
117 | m_currentThrottle = m_maxAllowableThrottle; | 117 | m_currentThrottle = m_maxAllowableThrottle; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 9ee8df5..c779b08 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -166,7 +166,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
166 | userSettings.ClientThrottleMultipler = config.GetFloat("client_throttle_multiplier"); | 166 | userSettings.ClientThrottleMultipler = config.GetFloat("client_throttle_multiplier"); |
167 | if (config.Contains("client_socket_rcvbuf_size")) | 167 | if (config.Contains("client_socket_rcvbuf_size")) |
168 | m_clientSocketReceiveBuffer = config.GetInt("client_socket_rcvbuf_size"); | 168 | m_clientSocketReceiveBuffer = config.GetInt("client_socket_rcvbuf_size"); |
169 | } | 169 | } |
170 | 170 | ||
171 | m_log.DebugFormat("[CLIENT]: client_throttle_multiplier = {0}", userSettings.ClientThrottleMultipler); | 171 | m_log.DebugFormat("[CLIENT]: client_throttle_multiplier = {0}", userSettings.ClientThrottleMultipler); |
172 | m_log.DebugFormat("[CLIENT]: client_socket_rcvbuf_size = {0}", (m_clientSocketReceiveBuffer != 0 ? | 172 | m_log.DebugFormat("[CLIENT]: client_socket_rcvbuf_size = {0}", (m_clientSocketReceiveBuffer != 0 ? |
@@ -228,7 +228,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
228 | { | 228 | { |
229 | m_log.Debug("[CLIENT]: " + e); | 229 | m_log.Debug("[CLIENT]: " + e); |
230 | } | 230 | } |
231 | } | 231 | } |
232 | 232 | ||
233 | 233 | ||
234 | if (proxyPortOffset != 0) | 234 | if (proxyPortOffset != 0) |
@@ -254,7 +254,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
254 | if (packet != null) | 254 | if (packet != null) |
255 | { | 255 | { |
256 | if (packet.Type == PacketType.UseCircuitCode) | 256 | if (packet.Type == PacketType.UseCircuitCode) |
257 | AddNewClient((UseCircuitCodePacket)packet, epSender, epProxy); | 257 | AddNewClient((UseCircuitCodePacket)packet, epSender, epProxy); |
258 | else | 258 | else |
259 | ProcessInPacket(packet, epSender); | 259 | ProcessInPacket(packet, epSender); |
260 | } | 260 | } |
@@ -290,7 +290,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
290 | catch (Exception e) | 290 | catch (Exception e) |
291 | { | 291 | { |
292 | m_log.Error("[CLIENT]: Exception in processing packet - ignoring: ", e); | 292 | m_log.Error("[CLIENT]: Exception in processing packet - ignoring: ", e); |
293 | } | 293 | } |
294 | } | 294 | } |
295 | 295 | ||
296 | /// <summary> | 296 | /// <summary> |
@@ -299,7 +299,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
299 | protected virtual void BeginReceive() | 299 | protected virtual void BeginReceive() |
300 | { | 300 | { |
301 | m_socket.BeginReceiveFrom( | 301 | m_socket.BeginReceiveFrom( |
302 | RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref reusedEpSender, ReceivedData, null); | 302 | RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref reusedEpSender, ReceivedData, null); |
303 | } | 303 | } |
304 | 304 | ||
305 | /// <summary> | 305 | /// <summary> |
@@ -322,7 +322,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
322 | // ENDLESS LOOP ON PURPOSE! | 322 | // ENDLESS LOOP ON PURPOSE! |
323 | // Reset connection and get next UDP packet off the buffer | 323 | // Reset connection and get next UDP packet off the buffer |
324 | // If the UDP packet is part of the same stream, this will happen several hundreds of times before | 324 | // If the UDP packet is part of the same stream, this will happen several hundreds of times before |
325 | // the next set of UDP data is for a valid client. | 325 | // the next set of UDP data is for a valid client. |
326 | 326 | ||
327 | try | 327 | try |
328 | { | 328 | { |
@@ -347,7 +347,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
347 | m_log.ErrorFormat("[CLIENT]: Exception thrown during BeginReceive(): {0}", ex); | 347 | m_log.ErrorFormat("[CLIENT]: Exception thrown during BeginReceive(): {0}", ex); |
348 | } | 348 | } |
349 | } | 349 | } |
350 | } | 350 | } |
351 | 351 | ||
352 | /// <summary> | 352 | /// <summary> |
353 | /// Close a client circuit. This is done in response to an exception on receive, and should not be called | 353 | /// Close a client circuit. This is done in response to an exception on receive, and should not be called |
@@ -363,12 +363,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
363 | { | 363 | { |
364 | m_packetServer.CloseCircuit(circuit); | 364 | m_packetServer.CloseCircuit(circuit); |
365 | 365 | ||
366 | if (e != null) | 366 | if (e != null) |
367 | m_log.ErrorFormat( | 367 | m_log.ErrorFormat( |
368 | "[CLIENT]: Closed circuit {0} {1} due to exception {2}", circuit, reusedEpSender, e); | 368 | "[CLIENT]: Closed circuit {0} {1} due to exception {2}", circuit, reusedEpSender, e); |
369 | } | 369 | } |
370 | } | 370 | } |
371 | } | 371 | } |
372 | 372 | ||
373 | /// <summary> | 373 | /// <summary> |
374 | /// Finish the process of asynchronously receiving the next bit of raw data | 374 | /// Finish the process of asynchronously receiving the next bit of raw data |
@@ -410,7 +410,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
410 | { | 410 | { |
411 | m_log.DebugFormat("[CLIENT]: ObjectDisposedException: Object {0} disposed.", e.ObjectName); | 411 | m_log.DebugFormat("[CLIENT]: ObjectDisposedException: Object {0} disposed.", e.ObjectName); |
412 | // Uhh, what object, and why? this needs better handling. | 412 | // Uhh, what object, and why? this needs better handling. |
413 | } | 413 | } |
414 | 414 | ||
415 | return hasReceivedOkay; | 415 | return hasReceivedOkay; |
416 | } | 416 | } |
@@ -422,10 +422,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
422 | /// <param name="epSender"></param> | 422 | /// <param name="epSender"></param> |
423 | /// <param name="epProxy"></param> | 423 | /// <param name="epProxy"></param> |
424 | protected virtual void AddNewClient(UseCircuitCodePacket useCircuit, EndPoint epSender, EndPoint epProxy) | 424 | protected virtual void AddNewClient(UseCircuitCodePacket useCircuit, EndPoint epSender, EndPoint epProxy) |
425 | { | 425 | { |
426 | //Slave regions don't accept new clients | 426 | //Slave regions don't accept new clients |
427 | if (m_localScene.RegionStatus != RegionStatus.SlaveScene) | 427 | if (m_localScene.RegionStatus != RegionStatus.SlaveScene) |
428 | { | 428 | { |
429 | AuthenticateResponse sessionInfo; | 429 | AuthenticateResponse sessionInfo; |
430 | bool isNewCircuit = false; | 430 | bool isNewCircuit = false; |
431 | 431 | ||
@@ -441,8 +441,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
441 | lock (clientCircuits) | 441 | lock (clientCircuits) |
442 | { | 442 | { |
443 | if (!clientCircuits.ContainsKey(epSender)) | 443 | if (!clientCircuits.ContainsKey(epSender)) |
444 | { | 444 | { |
445 | clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); | 445 | clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); |
446 | isNewCircuit = true; | 446 | isNewCircuit = true; |
447 | } | 447 | } |
448 | } | 448 | } |
@@ -461,9 +461,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
461 | 461 | ||
462 | //m_log.DebugFormat( | 462 | //m_log.DebugFormat( |
463 | // "[CONNECTION SUCCESS]: Incoming client {0} (circuit code {1}) received and authenticated for {2}", | 463 | // "[CONNECTION SUCCESS]: Incoming client {0} (circuit code {1}) received and authenticated for {2}", |
464 | // useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code, m_localScene.RegionInfo.RegionName); | 464 | // useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code, m_localScene.RegionInfo.RegionName); |
465 | } | 465 | } |
466 | } | 466 | } |
467 | 467 | ||
468 | // Ack the UseCircuitCode packet | 468 | // Ack the UseCircuitCode packet |
469 | PacketAckPacket ack_it = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck); | 469 | PacketAckPacket ack_it = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck); |
@@ -605,7 +605,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
605 | useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); | 605 | useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); |
606 | 606 | ||
607 | return; | 607 | return; |
608 | } | 608 | } |
609 | 609 | ||
610 | lock (clientCircuits) | 610 | lock (clientCircuits) |
611 | { | 611 | { |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs index f2a8bd2..c45d11f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUtil.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using OpenMetaverse; | 28 | using OpenMetaverse; |
29 | 29 | ||
30 | namespace OpenSim.Region.ClientStack.LindenUDP | 30 | namespace OpenSim.Region.ClientStack.LindenUDP |
31 | { | 31 | { |
32 | public class LLUtil | 32 | public class LLUtil |
33 | { | 33 | { |
34 | /// <summary> | 34 | /// <summary> |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs index 9fb1041..daab84f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
54 | catch | 54 | catch |
55 | { | 55 | { |
56 | // I don't care, just leave log4net off | 56 | // I don't care, just leave log4net off |
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | /// <summary> | 60 | /// <summary> |
@@ -63,20 +63,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
63 | /// <param name="scene"></param> | 63 | /// <param name="scene"></param> |
64 | /// <param name="testLLUDPServer"></param> | 64 | /// <param name="testLLUDPServer"></param> |
65 | /// <param name="testPacketServer"></param> | 65 | /// <param name="testPacketServer"></param> |
66 | /// <param name="acm">Agent circuit manager used in setting up the stack</param> | 66 | /// <param name="acm">Agent circuit manager used in setting up the stack</param> |
67 | protected void SetupStack( | 67 | protected void SetupStack( |
68 | IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, | 68 | IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, |
69 | out AgentCircuitManager acm) | 69 | out AgentCircuitManager acm) |
70 | { | 70 | { |
71 | IConfigSource configSource = new IniConfigSource(); | 71 | IConfigSource configSource = new IniConfigSource(); |
72 | ClientStackUserSettings userSettings = new ClientStackUserSettings(); | 72 | ClientStackUserSettings userSettings = new ClientStackUserSettings(); |
73 | testLLUDPServer = new TestLLUDPServer(); | 73 | testLLUDPServer = new TestLLUDPServer(); |
74 | acm = new AgentCircuitManager(); | 74 | acm = new AgentCircuitManager(); |
75 | 75 | ||
76 | uint port = 666; | 76 | uint port = 666; |
77 | testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm); | 77 | testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm); |
78 | testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); | 78 | testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); |
79 | testLLUDPServer.LocalScene = scene; | 79 | testLLUDPServer.LocalScene = scene; |
80 | } | 80 | } |
81 | 81 | ||
82 | /// <summary> | 82 | /// <summary> |
@@ -124,7 +124,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
124 | 124 | ||
125 | acm.AddNewCircuit(circuitCode, acd); | 125 | acm.AddNewCircuit(circuitCode, acd); |
126 | 126 | ||
127 | testLLUDPServer.LoadReceive(uccp, epSender); | 127 | testLLUDPServer.LoadReceive(uccp, epSender); |
128 | testLLUDPServer.ReceiveData(null); | 128 | testLLUDPServer.ReceiveData(null); |
129 | } | 129 | } |
130 | 130 | ||
@@ -142,15 +142,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
142 | onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb }; | 142 | onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb }; |
143 | onp.Header.Zerocoded = false; | 143 | onp.Header.Zerocoded = false; |
144 | 144 | ||
145 | return onp; | 145 | return onp; |
146 | } | 146 | } |
147 | 147 | ||
148 | /// <summary> | 148 | /// <summary> |
149 | /// Test adding a client to the stack | 149 | /// Test adding a client to the stack |
150 | /// </summary> | 150 | /// </summary> |
151 | [Test, LongRunning] | 151 | [Test, LongRunning] |
152 | public void TestAddClient() | 152 | public void TestAddClient() |
153 | { | 153 | { |
154 | TestHelper.InMethod(); | 154 | TestHelper.InMethod(); |
155 | 155 | ||
156 | uint myCircuitCode = 123456; | 156 | uint myCircuitCode = 123456; |
@@ -177,7 +177,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
177 | 177 | ||
178 | EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); | 178 | EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); |
179 | 179 | ||
180 | testLLUDPServer.LoadReceive(uccp, testEp); | 180 | testLLUDPServer.LoadReceive(uccp, testEp); |
181 | testLLUDPServer.ReceiveData(null); | 181 | testLLUDPServer.ReceiveData(null); |
182 | 182 | ||
183 | // Circuit shouildn't exist since the circuit manager doesn't know about this circuit for authentication yet | 183 | // Circuit shouildn't exist since the circuit manager doesn't know about this circuit for authentication yet |
@@ -185,8 +185,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
185 | 185 | ||
186 | acm.AddNewCircuit(myCircuitCode, acd); | 186 | acm.AddNewCircuit(myCircuitCode, acd); |
187 | 187 | ||
188 | testLLUDPServer.LoadReceive(uccp, testEp); | 188 | testLLUDPServer.LoadReceive(uccp, testEp); |
189 | testLLUDPServer.ReceiveData(null); | 189 | testLLUDPServer.ReceiveData(null); |
190 | 190 | ||
191 | // Should succeed now | 191 | // Should succeed now |
192 | Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); | 192 | Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode)); |
@@ -196,24 +196,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
196 | /// <summary> | 196 | /// <summary> |
197 | /// Test removing a client from the stack | 197 | /// Test removing a client from the stack |
198 | /// </summary> | 198 | /// </summary> |
199 | [Test] | 199 | [Test] |
200 | public void TestRemoveClient() | 200 | public void TestRemoveClient() |
201 | { | 201 | { |
202 | TestHelper.InMethod(); | 202 | TestHelper.InMethod(); |
203 | 203 | ||
204 | uint myCircuitCode = 123457; | 204 | uint myCircuitCode = 123457; |
205 | 205 | ||
206 | TestLLUDPServer testLLUDPServer; | 206 | TestLLUDPServer testLLUDPServer; |
207 | TestLLPacketServer testLLPacketServer; | 207 | TestLLPacketServer testLLPacketServer; |
208 | AgentCircuitManager acm; | 208 | AgentCircuitManager acm; |
209 | SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm); | 209 | SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm); |
210 | AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm); | 210 | AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm); |
211 | 211 | ||
212 | testLLUDPServer.RemoveClientCircuit(myCircuitCode); | 212 | testLLUDPServer.RemoveClientCircuit(myCircuitCode); |
213 | Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode)); | 213 | Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode)); |
214 | 214 | ||
215 | // Check that removing a non-existant circuit doesn't have any bad effects | 215 | // Check that removing a non-existant circuit doesn't have any bad effects |
216 | testLLUDPServer.RemoveClientCircuit(101); | 216 | testLLUDPServer.RemoveClientCircuit(101); |
217 | Assert.IsFalse(testLLUDPServer.HasCircuit(101)); | 217 | Assert.IsFalse(testLLUDPServer.HasCircuit(101)); |
218 | } | 218 | } |
219 | 219 | ||
@@ -232,8 +232,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
232 | TestLLUDPServer testLLUDPServer; | 232 | TestLLUDPServer testLLUDPServer; |
233 | TestLLPacketServer testLLPacketServer; | 233 | TestLLPacketServer testLLPacketServer; |
234 | AgentCircuitManager acm; | 234 | AgentCircuitManager acm; |
235 | SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); | 235 | SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); |
236 | AddClient(myCircuitCode, testEp, testLLUDPServer, acm); | 236 | AddClient(myCircuitCode, testEp, testLLUDPServer, acm); |
237 | 237 | ||
238 | byte[] data = new byte[] { 0x01, 0x02, 0x03, 0x04 }; | 238 | byte[] data = new byte[] { 0x01, 0x02, 0x03, 0x04 }; |
239 | 239 | ||
@@ -252,7 +252,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
252 | testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "helloooo"), testEp); | 252 | testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "helloooo"), testEp); |
253 | testLLUDPServer.ReceiveData(null); | 253 | testLLUDPServer.ReceiveData(null); |
254 | 254 | ||
255 | Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(1)); | 255 | Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(1)); |
256 | Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(1)); | 256 | Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(1)); |
257 | } | 257 | } |
258 | 258 | ||
@@ -270,17 +270,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
270 | uint circuitCodeA = 130000; | 270 | uint circuitCodeA = 130000; |
271 | EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300); | 271 | EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300); |
272 | UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300"); | 272 | UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300"); |
273 | UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300"); | 273 | UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300"); |
274 | 274 | ||
275 | uint circuitCodeB = 130001; | 275 | uint circuitCodeB = 130001; |
276 | EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301); | 276 | EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301); |
277 | UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301"); | 277 | UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301"); |
278 | UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301"); | 278 | UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301"); |
279 | 279 | ||
280 | TestLLUDPServer testLLUDPServer; | 280 | TestLLUDPServer testLLUDPServer; |
281 | TestLLPacketServer testLLPacketServer; | 281 | TestLLPacketServer testLLPacketServer; |
282 | AgentCircuitManager acm; | 282 | AgentCircuitManager acm; |
283 | SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); | 283 | SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm); |
284 | AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm); | 284 | AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm); |
285 | AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm); | 285 | AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm); |
286 | 286 | ||
@@ -292,8 +292,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
292 | 292 | ||
293 | Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA)); | 293 | Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA)); |
294 | 294 | ||
295 | Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3)); | 295 | Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3)); |
296 | Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3)); | 296 | Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3)); |
297 | } | 297 | } |
298 | } | 298 | } |
299 | } | 299 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs index c831f68..34c21aa 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using OpenMetaverse; | 28 | using OpenMetaverse; |
29 | using OpenSim.Framework; | 29 | using OpenSim.Framework; |
30 | using OpenSim.Region.Framework.Scenes; | 30 | using OpenSim.Region.Framework.Scenes; |
31 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
31 | 32 | ||
32 | namespace OpenSim.Region.ClientStack.LindenUDP.Tests | 33 | namespace OpenSim.Region.ClientStack.LindenUDP.Tests |
33 | { | 34 | { |
@@ -58,7 +59,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
58 | 59 | ||
59 | public override void RemoveClient(UUID agentID) {} | 60 | public override void RemoveClient(UUID agentID) {} |
60 | public override void CloseAllAgents(uint circuitcode) {} | 61 | public override void CloseAllAgents(uint circuitcode) {} |
61 | public override bool OtherRegionUp(RegionInfo thisRegion) { return false; } | 62 | public override void OtherRegionUp(GridRegion otherRegion) { } |
62 | 63 | ||
63 | /// <summary> | 64 | /// <summary> |
64 | /// Doesn't really matter what the call is - we're using this to test that a packet has actually been received | 65 | /// Doesn't really matter what the call is - we're using this to test that a packet has actually been received |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs index 8b11ccc..cde155b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/PacketHandlerTests.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
45 | [Test] | 45 | [Test] |
46 | /// <summary> | 46 | /// <summary> |
47 | /// More a placeholder, really | 47 | /// More a placeholder, really |
48 | /// </summary> | 48 | /// </summary> |
49 | public void InPacketTest() | 49 | public void InPacketTest() |
50 | { | 50 | { |
51 | TestHelper.InMethod(); | 51 | TestHelper.InMethod(); |
@@ -87,20 +87,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
87 | /// <param name="scene"></param> | 87 | /// <param name="scene"></param> |
88 | /// <param name="testLLUDPServer"></param> | 88 | /// <param name="testLLUDPServer"></param> |
89 | /// <param name="testPacketServer"></param> | 89 | /// <param name="testPacketServer"></param> |
90 | /// <param name="acm">Agent circuit manager used in setting up the stack</param> | 90 | /// <param name="acm">Agent circuit manager used in setting up the stack</param> |
91 | protected void SetupStack( | 91 | protected void SetupStack( |
92 | IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, | 92 | IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, |
93 | out AgentCircuitManager acm) | 93 | out AgentCircuitManager acm) |
94 | { | 94 | { |
95 | IConfigSource configSource = new IniConfigSource(); | 95 | IConfigSource configSource = new IniConfigSource(); |
96 | ClientStackUserSettings userSettings = new ClientStackUserSettings(); | 96 | ClientStackUserSettings userSettings = new ClientStackUserSettings(); |
97 | testLLUDPServer = new TestLLUDPServer(); | 97 | testLLUDPServer = new TestLLUDPServer(); |
98 | acm = new AgentCircuitManager(); | 98 | acm = new AgentCircuitManager(); |
99 | 99 | ||
100 | uint port = 666; | 100 | uint port = 666; |
101 | testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm); | 101 | testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm); |
102 | testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); | 102 | testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); |
103 | testLLUDPServer.LocalScene = scene; | 103 | testLLUDPServer.LocalScene = scene; |
104 | } | 104 | } |
105 | } | 105 | } |
106 | } | 106 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs index d055969..1fba847 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLPacketServer.cs | |||
@@ -31,7 +31,7 @@ using OpenMetaverse.Packets; | |||
31 | namespace OpenSim.Region.ClientStack.LindenUDP.Tests | 31 | namespace OpenSim.Region.ClientStack.LindenUDP.Tests |
32 | { | 32 | { |
33 | public class TestLLPacketServer : LLPacketServer | 33 | public class TestLLPacketServer : LLPacketServer |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// Record counts of packets received | 36 | /// Record counts of packets received |
37 | /// </summary> | 37 | /// </summary> |
@@ -49,7 +49,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
49 | m_packetsReceived[packet.Type]++; | 49 | m_packetsReceived[packet.Type]++; |
50 | else | 50 | else |
51 | m_packetsReceived[packet.Type] = 1; | 51 | m_packetsReceived[packet.Type] = 1; |
52 | } | 52 | } |
53 | 53 | ||
54 | public int GetTotalPacketsReceived() | 54 | public int GetTotalPacketsReceived() |
55 | { | 55 | { |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs index 1dffefb..f98586d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
66 | ChunkSenderTuple tuple = m_chunksToLoad.Dequeue(); | 66 | ChunkSenderTuple tuple = m_chunksToLoad.Dequeue(); |
67 | RecvBuffer = tuple.Data; | 67 | RecvBuffer = tuple.Data; |
68 | numBytes = tuple.Data.Length; | 68 | numBytes = tuple.Data.Length; |
69 | epSender = tuple.Sender; | 69 | epSender = tuple.Sender; |
70 | 70 | ||
71 | return true; | 71 | return true; |
72 | } | 72 | } |
@@ -114,7 +114,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
114 | { | 114 | { |
115 | while (m_chunksToLoad.Count > 0) | 115 | while (m_chunksToLoad.Count > 0) |
116 | OnReceivedData(result); | 116 | OnReceivedData(result); |
117 | } | 117 | } |
118 | 118 | ||
119 | /// <summary> | 119 | /// <summary> |
120 | /// Has a circuit with the given code been established? | 120 | /// Has a circuit with the given code been established? |
@@ -134,7 +134,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
134 | /// Record the data and sender tuple | 134 | /// Record the data and sender tuple |
135 | /// </summary> | 135 | /// </summary> |
136 | public class ChunkSenderTuple | 136 | public class ChunkSenderTuple |
137 | { | 137 | { |
138 | public byte[] Data; | 138 | public byte[] Data; |
139 | public EndPoint Sender; | 139 | public EndPoint Sender; |
140 | public bool BeginReceiveException; | 140 | public bool BeginReceiveException; |