* more refactoring and error message
parent
51581dba75
commit
65a7e3b6cb
|
@ -41,7 +41,13 @@ namespace OpenSim
|
||||||
|
|
||||||
foreach (Hashtable neighbour in gridServer.neighbours)
|
foreach (Hashtable neighbour in gridServer.neighbours)
|
||||||
{
|
{
|
||||||
Console.WriteLine("http://" + neighbour["sim_ip"] + ":" + neighbour["sim_port"]);
|
string neighbourIPStr = (string)neighbour["sim_ip"];
|
||||||
|
System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr);
|
||||||
|
ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]);
|
||||||
|
string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString();
|
||||||
|
|
||||||
|
Console.WriteLine(reqUrl);
|
||||||
|
|
||||||
SimParams = new Hashtable();
|
SimParams = new Hashtable();
|
||||||
SimParams["session_id"] = agentCircuit.SessionID.ToString();
|
SimParams["session_id"] = agentCircuit.SessionID.ToString();
|
||||||
SimParams["secure_session_id"] = agentCircuit.SecureSessionID.ToString();
|
SimParams["secure_session_id"] = agentCircuit.SecureSessionID.ToString();
|
||||||
|
@ -54,17 +60,18 @@ namespace OpenSim
|
||||||
SendParams.Add(SimParams);
|
SendParams.Add(SimParams);
|
||||||
|
|
||||||
GridReq = new XmlRpcRequest("expect_user", SendParams);
|
GridReq = new XmlRpcRequest("expect_user", SendParams);
|
||||||
GridResp = GridReq.Send("http://" + neighbour["sim_ip"] + ":" + neighbour["sim_port"], 3000);
|
GridResp = GridReq.Send(reqUrl, 3000);
|
||||||
EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
|
EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
|
||||||
enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
|
enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
|
||||||
enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
|
enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
|
||||||
System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse((string)neighbour["sim_ip"]);
|
|
||||||
|
|
||||||
byte[] byteIP = neighbourIP.GetAddressBytes();
|
byte[] byteIP = neighbourIP.GetAddressBytes();
|
||||||
enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
|
enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
|
||||||
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
|
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
|
||||||
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
|
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
|
||||||
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
|
enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
|
||||||
enablesimpacket.SimulatorInfo.Port = (ushort)Convert.ToInt32(neighbour["sim_port"]);
|
enablesimpacket.SimulatorInfo.Port = neighbourPort;
|
||||||
enablePackets.Add(enablesimpacket);
|
enablePackets.Add(enablesimpacket);
|
||||||
}
|
}
|
||||||
Thread.Sleep(3000);
|
Thread.Sleep(3000);
|
||||||
|
@ -74,10 +81,10 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
enablePackets.Clear();
|
enablePackets.Clear();
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "SimClient.cs: Couldn't find AgentCircuit for CircuitCode {0}.", CircuitCode);
|
||||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "SimClient.cs: Couldn't find AgentCircuit for CircuitCode {0}.", CircuitCode );
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue