32 using OpenMetaverse.Packets;
33 using OpenSim.Framework;
34 using OpenSim.Region.ClientStack.LindenUDP;
35 using OpenSim.Region.Framework.Scenes;
37 namespace OpenSim.Tests.Common
47 public static class ClientStackHelpers
50 Scene scene,
LLUDPServer udpServer, UUID agentId, UUID sessionId, uint circuitCode)
52 IPEndPoint testEp =
new IPEndPoint(IPAddress.Loopback, 999);
54 UseCircuitCodePacket uccp =
new UseCircuitCodePacket();
56 UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock
57 =
new UseCircuitCodePacket.CircuitCodeBlock();
58 uccpCcBlock.Code = circuitCode;
59 uccpCcBlock.ID = agentId;
60 uccpCcBlock.SessionID = sessionId;
61 uccp.CircuitCode = uccpCcBlock;
63 byte[] uccpBytes = uccp.ToBytes();
64 UDPPacketBuffer upb =
new UDPPacketBuffer(testEp, uccpBytes.Length);
65 upb.DataLength = uccpBytes.Length;
66 Buffer.BlockCopy(uccpBytes, 0, upb.Data, 0, uccpBytes.Length);
69 acd.AgentID = agentId;
70 acd.SessionID = sessionId;
72 scene.AuthenticateHandler.AddNewCircuit(circuitCode, acd);
74 udpServer.PacketReceived(upb);
76 return scene.GetScenePresence(agentId);
79 public static TestLLUDPServer AddUdpServer(
Scene scene)
81 return AddUdpServer(scene,
new IniConfigSource());
84 public static TestLLUDPServer AddUdpServer(
Scene scene, IniConfigSource configSource)
89 TestLLUDPServer udpServer =
new TestLLUDPServer(IPAddress.Any, ref port, 0,
false, configSource, acm);
90 udpServer.AddScene(scene);
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
The LLUDP server for a region. This handles incoming and outgoing packets for all UDP connections to ...