diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/OpenSim.RegionServer/ClientView.Grid.cs | 71 |
1 files changed, 39 insertions, 32 deletions
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.Grid.cs b/OpenSim/OpenSim.RegionServer/ClientView.Grid.cs index a3b191c..5229dbd 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.Grid.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.Grid.cs | |||
@@ -35,38 +35,45 @@ namespace OpenSim | |||
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 | try |
39 | System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr); | 39 | { |
40 | ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]); | 40 | string neighbourIPStr = (string)neighbour["sim_ip"]; |
41 | string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString(); | 41 | System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr); |
42 | 42 | ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]); | |
43 | Console.WriteLine(reqUrl); | 43 | string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString(); |
44 | 44 | ||
45 | SimParams = new Hashtable(); | 45 | Console.WriteLine(reqUrl); |
46 | SimParams["session_id"] = this.SessionID.ToString(); | 46 | |
47 | SimParams["secure_session_id"] = this.SecureSessionID.ToString(); | 47 | SimParams = new Hashtable(); |
48 | SimParams["firstname"] = this.ClientAvatar.firstname; | 48 | SimParams["session_id"] = this.SessionID.ToString(); |
49 | SimParams["lastname"] = this.ClientAvatar.lastname; | 49 | SimParams["secure_session_id"] = this.SecureSessionID.ToString(); |
50 | SimParams["agent_id"] = this.AgentID.ToString(); | 50 | SimParams["firstname"] = this.ClientAvatar.firstname; |
51 | SimParams["circuit_code"] = (Int32)this.CircuitCode; | 51 | SimParams["lastname"] = this.ClientAvatar.lastname; |
52 | SimParams["child_agent"] = "1"; | 52 | SimParams["agent_id"] = this.AgentID.ToString(); |
53 | SendParams = new ArrayList(); | 53 | SimParams["circuit_code"] = (Int32)this.CircuitCode; |
54 | SendParams.Add(SimParams); | 54 | SimParams["child_agent"] = "1"; |
55 | 55 | SendParams = new ArrayList(); | |
56 | GridReq = new XmlRpcRequest("expect_user", SendParams); | 56 | SendParams.Add(SimParams); |
57 | GridResp = GridReq.Send(reqUrl, 3000); | 57 | |
58 | EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); | 58 | GridReq = new XmlRpcRequest("expect_user", SendParams); |
59 | enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); | 59 | GridResp = GridReq.Send(reqUrl, 3000); |
60 | enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256)); | 60 | EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); |
61 | 61 | enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); | |
62 | 62 | enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256)); | |
63 | byte[] byteIP = neighbourIP.GetAddressBytes(); | 63 | |
64 | enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24; | 64 | |
65 | enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16; | 65 | byte[] byteIP = neighbourIP.GetAddressBytes(); |
66 | enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8; | 66 | enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24; |
67 | enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0]; | 67 | enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16; |
68 | enablesimpacket.SimulatorInfo.Port = neighbourPort; | 68 | enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8; |
69 | enablePackets.Add(enablesimpacket); | 69 | enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0]; |
70 | enablesimpacket.SimulatorInfo.Port = neighbourPort; | ||
71 | enablePackets.Add(enablesimpacket); | ||
72 | } | ||
73 | catch (Exception e) | ||
74 | { | ||
75 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Could not connect to neighbour " + neighbour["sim_ip"] + ":" + neighbour["sim_port"] + ", continuing."); | ||
76 | } | ||
70 | } | 77 | } |
71 | Thread.Sleep(3000); | 78 | Thread.Sleep(3000); |
72 | foreach (Packet enable in enablePackets) | 79 | foreach (Packet enable in enablePackets) |