Starts to readd the changes from revisions 768,769 and 770 before Adam notices they got lost in the restructuring.

zircon^2
MW 2007-05-24 13:31:08 +00:00
parent f1af78d684
commit 5a6ee35df9
1 changed files with 34 additions and 27 deletions

View File

@ -35,38 +35,45 @@ namespace OpenSim
foreach (Hashtable neighbour in gridServer.neighbours) foreach (Hashtable neighbour in gridServer.neighbours)
{ {
string neighbourIPStr = (string)neighbour["sim_ip"]; try
System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse(neighbourIPStr); {
ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]); string neighbourIPStr = (string)neighbour["sim_ip"];
string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString(); 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); Console.WriteLine(reqUrl);
SimParams = new Hashtable(); SimParams = new Hashtable();
SimParams["session_id"] = this.SessionID.ToString(); SimParams["session_id"] = this.SessionID.ToString();
SimParams["secure_session_id"] = this.SecureSessionID.ToString(); SimParams["secure_session_id"] = this.SecureSessionID.ToString();
SimParams["firstname"] = this.ClientAvatar.firstname; SimParams["firstname"] = this.ClientAvatar.firstname;
SimParams["lastname"] = this.ClientAvatar.lastname; SimParams["lastname"] = this.ClientAvatar.lastname;
SimParams["agent_id"] = this.AgentID.ToString(); SimParams["agent_id"] = this.AgentID.ToString();
SimParams["circuit_code"] = (Int32)this.CircuitCode; SimParams["circuit_code"] = (Int32)this.CircuitCode;
SimParams["child_agent"] = "1"; SimParams["child_agent"] = "1";
SendParams = new ArrayList(); SendParams = new ArrayList();
SendParams.Add(SimParams); SendParams.Add(SimParams);
GridReq = new XmlRpcRequest("expect_user", SendParams); GridReq = new XmlRpcRequest("expect_user", SendParams);
GridResp = GridReq.Send(reqUrl, 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));
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 = neighbourPort; enablesimpacket.SimulatorInfo.Port = neighbourPort;
enablePackets.Add(enablesimpacket); enablePackets.Add(enablesimpacket);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Could not connect to neighbour " + neighbour["sim_ip"] + ":" + neighbour["sim_port"] + ", continuing.");
}
} }
Thread.Sleep(3000); Thread.Sleep(3000);
foreach (Packet enable in enablePackets) foreach (Packet enable in enablePackets)