aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs3
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs20
2 files changed, 18 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index b786989..2e9af74 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -395,8 +395,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
395 "[CLIENT]: Adding new circuit for agent {0}, circuit code {1}", 395 "[CLIENT]: Adding new circuit for agent {0}, circuit code {1}",
396 useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code); 396 useCircuit.CircuitCode.ID, useCircuit.CircuitCode.Code);
397 397
398 clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); 398 clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
399
400 isNewCircuit = true; 399 isNewCircuit = true;
401 } 400 }
402 } 401 }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
index 29f0c20..c90aecf 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/BasicCircuitTests.cs
@@ -28,6 +28,7 @@
28using System.Net; 28using System.Net;
29using log4net; 29using log4net;
30using NUnit.Framework; 30using NUnit.Framework;
31using OpenMetaverse;
31using OpenMetaverse.Packets; 32using OpenMetaverse.Packets;
32using OpenSim.Framework; 33using OpenSim.Framework;
33using OpenSim.Framework.Communications; 34using OpenSim.Framework.Communications;
@@ -58,18 +59,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
58 [Test] 59 [Test]
59 public void TestAddClient() 60 public void TestAddClient()
60 { 61 {
62 uint myCircuitCode = 123456;
63 UUID myAgentUuid = UUID.Parse("00000000-0000-0000-0000-000000000001");
64 UUID mySessionUuid = UUID.Parse("00000000-0000-0000-0000-000000000002");
65
61 TestLLUDPServer testLLUDPServer = new TestLLUDPServer(); 66 TestLLUDPServer testLLUDPServer = new TestLLUDPServer();
62 ClientStackUserSettings userSettings = new ClientStackUserSettings(); 67 ClientStackUserSettings userSettings = new ClientStackUserSettings();
63 68
69 AgentCircuitManager acm = new AgentCircuitManager();
70 AgentCircuitData acd = new AgentCircuitData();
71 acd.AgentID = myAgentUuid;
72 acd.SessionID = mySessionUuid;
73 acm.AddNewCircuit(myCircuitCode, acd);
74
64 uint port = 666; 75 uint port = 666;
65 testLLUDPServer.Initialise(null, ref port, 0, false, userSettings, null, new AgentCircuitManager()); 76 testLLUDPServer.Initialise(null, ref port, 0, false, userSettings, null, acm);
66 LLPacketServer packetServer = new LLPacketServer(testLLUDPServer, userSettings); 77 LLPacketServer packetServer = new LLPacketServer(testLLUDPServer, userSettings);
67 testLLUDPServer.LocalScene = new MockScene(); 78 testLLUDPServer.LocalScene = new MockScene();
68 79
69 UseCircuitCodePacket uccp = new UseCircuitCodePacket(); 80 UseCircuitCodePacket uccp = new UseCircuitCodePacket();
81
70 UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock 82 UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock
71 = new OpenMetaverse.Packets.UseCircuitCodePacket.CircuitCodeBlock(); 83 = new OpenMetaverse.Packets.UseCircuitCodePacket.CircuitCodeBlock();
72 uccpCcBlock.Code = 123456; 84 uccpCcBlock.Code = myCircuitCode;
85 uccpCcBlock.ID = myAgentUuid;
86 uccpCcBlock.SessionID = mySessionUuid;
73 uccp.CircuitCode = uccpCcBlock; 87 uccp.CircuitCode = uccpCcBlock;
74 88
75 EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); 89 EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999);
@@ -78,7 +92,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
78 testLLUDPServer.ReceiveData(null); 92 testLLUDPServer.ReceiveData(null);
79 93
80 Assert.IsFalse(testLLUDPServer.HasCircuit(101)); 94 Assert.IsFalse(testLLUDPServer.HasCircuit(101));
81 Assert.IsTrue(testLLUDPServer.HasCircuit(123456)); 95 Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode));
82 } 96 }
83 } 97 }
84} 98}