aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/AuthenticateSessionsBase.cs1
-rw-r--r--OpenSim.RegionServer/PacketServer.cs10
-rw-r--r--OpenSim.RegionServer/SimClient.Grid.cs84
-rw-r--r--OpenSim.RegionServer/UDPServer.cs47
4 files changed, 74 insertions, 68 deletions
diff --git a/OpenSim.RegionServer/AuthenticateSessionsBase.cs b/OpenSim.RegionServer/AuthenticateSessionsBase.cs
index cf6a055..f784f54 100644
--- a/OpenSim.RegionServer/AuthenticateSessionsBase.cs
+++ b/OpenSim.RegionServer/AuthenticateSessionsBase.cs
@@ -82,6 +82,7 @@ namespace OpenSim
82 this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname; 82 this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname;
83 this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos; 83 this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos;
84 } 84 }
85
85 } 86 }
86 } 87 }
87} 88}
diff --git a/OpenSim.RegionServer/PacketServer.cs b/OpenSim.RegionServer/PacketServer.cs
index 098076e..b60d10f 100644
--- a/OpenSim.RegionServer/PacketServer.cs
+++ b/OpenSim.RegionServer/PacketServer.cs
@@ -26,7 +26,7 @@ namespace OpenSim
26 } 26 }
27 } 27 }
28 28
29 public void ClientInPacket(uint circuitCode, Packet packet) 29 public virtual void ClientInPacket(uint circuitCode, Packet packet)
30 { 30 {
31 if (this.ClientThreads.ContainsKey(circuitCode)) 31 if (this.ClientThreads.ContainsKey(circuitCode))
32 { 32 {
@@ -34,22 +34,22 @@ namespace OpenSim
34 } 34 }
35 } 35 }
36 36
37 public bool AddNewCircuitCodeClient(uint circuitCode) 37 public virtual bool AddNewCircuitCodeClient(uint circuitCode)
38 { 38 {
39 return false; 39 return false;
40 } 40 }
41 41
42 public void SendPacketToAllClients(Packet packet) 42 public virtual void SendPacketToAllClients(Packet packet)
43 { 43 {
44 44
45 } 45 }
46 46
47 public void SendPacketToAllExcept(Packet packet, SimClient simClient) 47 public virtual void SendPacketToAllExcept(Packet packet, SimClient simClient)
48 { 48 {
49 49
50 } 50 }
51 51
52 public virtual void AddClientPacketHanlder(PacketType packetType, PacketMethod handler) 52 public virtual void AddClientPacketHandler(PacketType packetType, PacketMethod handler)
53 { 53 {
54 54
55 } 55 }
diff --git a/OpenSim.RegionServer/SimClient.Grid.cs b/OpenSim.RegionServer/SimClient.Grid.cs
index 755a79c..493d4d7 100644
--- a/OpenSim.RegionServer/SimClient.Grid.cs
+++ b/OpenSim.RegionServer/SimClient.Grid.cs
@@ -33,48 +33,48 @@ namespace OpenSim
33 33
34 RemoteGridBase gridServer = (RemoteGridBase)this.m_gridServer; 34 RemoteGridBase gridServer = (RemoteGridBase)this.m_gridServer;
35 35
36 foreach (Hashtable neighbour in gridServer.neighbours) 36 foreach (Hashtable neighbour in gridServer.neighbours)
37 { 37 {
38 string neighbourIPStr = (string)neighbour["sim_ip"]; 38 string neighbourIPStr = (string)neighbour["sim_ip"];
39 System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr); 39 System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr);
40 ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]); 40 ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]);
41 string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString(); 41 string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString();
42 42
43 Console.WriteLine(reqUrl); 43 Console.WriteLine(reqUrl);
44 44
45 SimParams = new Hashtable(); 45 SimParams = new Hashtable();
46 SimParams["session_id"] = this.SessionID.ToString(); 46 SimParams["session_id"] = this.SessionID.ToString();
47 SimParams["secure_session_id"] = this.SecureSessionID.ToString(); 47 SimParams["secure_session_id"] = this.SecureSessionID.ToString();
48 SimParams["firstname"] = this.ClientAvatar.firstname; 48 SimParams["firstname"] = this.ClientAvatar.firstname;
49 SimParams["lastname"] = this.ClientAvatar.lastname; 49 SimParams["lastname"] = this.ClientAvatar.lastname;
50 SimParams["agent_id"] = this.AgentID.ToString(); 50 SimParams["agent_id"] = this.AgentID.ToString();
51 SimParams["circuit_code"] = (Int32)this.CircuitCode; 51 SimParams["circuit_code"] = (Int32)this.CircuitCode;
52 SimParams["child_agent"] = "1"; 52 SimParams["child_agent"] = "1";
53 SendParams = new ArrayList(); 53 SendParams = new ArrayList();
54 SendParams.Add(SimParams); 54 SendParams.Add(SimParams);
55 55
56 GridReq = new XmlRpcRequest("expect_user", SendParams); 56 GridReq = new XmlRpcRequest("expect_user", SendParams);
57 GridResp = GridReq.Send(reqUrl, 3000); 57 GridResp = GridReq.Send(reqUrl, 3000);
58 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); 58 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
59 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); 59 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
60 enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256)); 60 enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
61 61
62 62
63 byte[] byteIP = neighbourIP.GetAddressBytes(); 63 byte[] byteIP = neighbourIP.GetAddressBytes();
64 enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24; 64 enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
65 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16; 65 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
66 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8; 66 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
67 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0]; 67 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
68 enablesimpacket.SimulatorInfo.Port = neighbourPort; 68 enablesimpacket.SimulatorInfo.Port = neighbourPort;
69 enablePackets.Add(enablesimpacket); 69 enablePackets.Add(enablesimpacket);
70 } 70 }
71 Thread.Sleep(3000); 71 Thread.Sleep(3000);
72 foreach (Packet enable in enablePackets) 72 foreach (Packet enable in enablePackets)
73 { 73 {
74 this.OutPacket(enable); 74 this.OutPacket(enable);
75 } 75 }
76 enablePackets.Clear(); 76 enablePackets.Clear();
77 77
78 } 78 }
79 } 79 }
80 80
diff --git a/OpenSim.RegionServer/UDPServer.cs b/OpenSim.RegionServer/UDPServer.cs
index b3b61c5..5c41485 100644
--- a/OpenSim.RegionServer/UDPServer.cs
+++ b/OpenSim.RegionServer/UDPServer.cs
@@ -28,26 +28,26 @@ namespace OpenSim
28 28
29 public class UDPServer : OpenSimNetworkHandler 29 public class UDPServer : OpenSimNetworkHandler
30 { 30 {
31 private Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); 31 protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
32 public Socket Server; 32 public Socket Server;
33 private IPEndPoint ServerIncoming; 33 protected IPEndPoint ServerIncoming;
34 private byte[] RecvBuffer = new byte[4096]; 34 protected byte[] RecvBuffer = new byte[4096];
35 private byte[] ZeroBuffer = new byte[8192]; 35 protected byte[] ZeroBuffer = new byte[8192];
36 private IPEndPoint ipeSender; 36 protected IPEndPoint ipeSender;
37 private EndPoint epSender; 37 protected EndPoint epSender;
38 private AsyncCallback ReceivedData; 38 protected AsyncCallback ReceivedData;
39 private PacketServer _packetServer; 39 protected PacketServer _packetServer;
40 40
41 private int listenPort; 41 protected int listenPort;
42 private Grid m_gridServers; 42 protected Grid m_gridServers;
43 private World m_localWorld; 43 protected World m_localWorld;
44 private AssetCache m_assetCache; 44 protected AssetCache m_assetCache;
45 private InventoryCache m_inventoryCache; 45 protected InventoryCache m_inventoryCache;
46 private RegionInfo m_regionData; 46 protected RegionInfo m_regionData;
47 private bool m_sandbox = false; 47 protected bool m_sandbox = false;
48 private bool user_accounts = false; 48 protected bool user_accounts = false;
49 private ConsoleBase m_console; 49 protected ConsoleBase m_console;
50 private AuthenticateSessionsBase m_authenticateSessionsClass; 50 protected AuthenticateSessionsBase m_authenticateSessionsClass;
51 51
52 public AuthenticateSessionHandler AuthenticateHandler; 52 public AuthenticateSessionHandler AuthenticateHandler;
53 53
@@ -83,12 +83,17 @@ namespace OpenSim
83 this.user_accounts = accounts; 83 this.user_accounts = accounts;
84 this.m_console = console; 84 this.m_console = console;
85 this.m_authenticateSessionsClass = authenticateClass; 85 this.m_authenticateSessionsClass = authenticateClass;
86 PacketServer packetServer = new PacketServer(this); 86 this.CreatePacketServer();
87 87
88 //set up delegate for authenticate sessions 88 //set up delegate for authenticate sessions
89 this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_authenticateSessionsClass.AuthenticateSession); 89 this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_authenticateSessionsClass.AuthenticateSession);
90 } 90 }
91 91
92 protected virtual void CreatePacketServer()
93 {
94 PacketServer packetServer = new PacketServer(this);
95 }
96
92 protected virtual void OnReceivedData(IAsyncResult result) 97 protected virtual void OnReceivedData(IAsyncResult result)
93 { 98 {
94 ipeSender = new IPEndPoint(IPAddress.Any, 0); 99 ipeSender = new IPEndPoint(IPAddress.Any, 0);
@@ -152,7 +157,7 @@ namespace OpenSim
152 157
153 } 158 }
154 159
155 public void RegisterPacketServer(PacketServer server) 160 public virtual void RegisterPacketServer(PacketServer server)
156 { 161 {
157 this._packetServer = server; 162 this._packetServer = server;
158 } 163 }