aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer
diff options
context:
space:
mode:
authorlbsa712007-05-17 13:04:14 +0000
committerlbsa712007-05-17 13:04:14 +0000
commit65a7e3b6cba34e9efbc235b289e427af1f849088 (patch)
tree1d9f54d8a5d656261e00aaed4ffb4eb9d72aa8d8 /OpenSim.RegionServer
parent* refactored a bit and added error msg (diff)
downloadopensim-SC_OLD-65a7e3b6cba34e9efbc235b289e427af1f849088.zip
opensim-SC_OLD-65a7e3b6cba34e9efbc235b289e427af1f849088.tar.gz
opensim-SC_OLD-65a7e3b6cba34e9efbc235b289e427af1f849088.tar.bz2
opensim-SC_OLD-65a7e3b6cba34e9efbc235b289e427af1f849088.tar.xz
* more refactoring and error message
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/SimClient.Grid.cs23
1 files changed, 15 insertions, 8 deletions
diff --git a/OpenSim.RegionServer/SimClient.Grid.cs b/OpenSim.RegionServer/SimClient.Grid.cs
index 3ae419a..e5bd4ff 100644
--- a/OpenSim.RegionServer/SimClient.Grid.cs
+++ b/OpenSim.RegionServer/SimClient.Grid.cs
@@ -41,7 +41,13 @@ namespace OpenSim
41 41
42 foreach (Hashtable neighbour in gridServer.neighbours) 42 foreach (Hashtable neighbour in gridServer.neighbours)
43 { 43 {
44 Console.WriteLine("http://" + neighbour["sim_ip"] + ":" + neighbour["sim_port"]); 44 string neighbourIPStr = (string)neighbour["sim_ip"];
45 System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr);
46 ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]);
47 string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString();
48
49 Console.WriteLine(reqUrl);
50
45 SimParams = new Hashtable(); 51 SimParams = new Hashtable();
46 SimParams["session_id"] = agentCircuit.SessionID.ToString(); 52 SimParams["session_id"] = agentCircuit.SessionID.ToString();
47 SimParams["secure_session_id"] = agentCircuit.SecureSessionID.ToString(); 53 SimParams["secure_session_id"] = agentCircuit.SecureSessionID.ToString();
@@ -54,17 +60,18 @@ namespace OpenSim
54 SendParams.Add(SimParams); 60 SendParams.Add(SimParams);
55 61
56 GridReq = new XmlRpcRequest("expect_user", SendParams); 62 GridReq = new XmlRpcRequest("expect_user", SendParams);
57 GridResp = GridReq.Send("http://" + neighbour["sim_ip"] + ":" + neighbour["sim_port"], 3000); 63 GridResp = GridReq.Send(reqUrl, 3000);
58 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); 64 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
59 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); 65 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)); 66 enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
61 System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse((string)neighbour["sim_ip"]); 67
68
62 byte[] byteIP = neighbourIP.GetAddressBytes(); 69 byte[] byteIP = neighbourIP.GetAddressBytes();
63 enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24; 70 enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
64 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16; 71 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
65 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8; 72 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
66 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0]; 73 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
67 enablesimpacket.SimulatorInfo.Port = (ushort)Convert.ToInt32(neighbour["sim_port"]); 74 enablesimpacket.SimulatorInfo.Port = neighbourPort;
68 enablePackets.Add(enablesimpacket); 75 enablePackets.Add(enablesimpacket);
69 } 76 }
70 Thread.Sleep(3000); 77 Thread.Sleep(3000);
@@ -74,10 +81,10 @@ namespace OpenSim
74 } 81 }
75 enablePackets.Clear(); 82 enablePackets.Clear();
76 } 83 }
77 } 84 else
78 else 85 {
79 { 86 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "SimClient.cs: Couldn't find AgentCircuit for CircuitCode {0}.", CircuitCode);
80 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "SimClient.cs: Couldn't find AgentCircuit for CircuitCode {0}.", CircuitCode ); 87 }
81 } 88 }
82 } 89 }
83 90