aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/SimClient.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/SimClient.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs
index acc873d..cb9e757 100644
--- a/OpenSim.RegionServer/SimClient.cs
+++ b/OpenSim.RegionServer/SimClient.cs
@@ -368,6 +368,7 @@ namespace OpenSim
368 if (this.m_child) this.UpgradeClient(); 368 if (this.m_child) this.UpgradeClient();
369 ClientAvatar.CompleteMovement(m_world); 369 ClientAvatar.CompleteMovement(m_world);
370 ClientAvatar.SendInitialPosition(); 370 ClientAvatar.SendInitialPosition();
371 this.EnableNeighbours();
371 break; 372 break;
372 case PacketType.RegionHandshakeReply: 373 case PacketType.RegionHandshakeReply:
373 m_world.SendLayerData(this); 374 m_world.SendLayerData(this);
@@ -1147,5 +1148,45 @@ namespace OpenSim
1147 1148
1148 //now should get other regions maps from gridserver 1149 //now should get other regions maps from gridserver
1149 } 1150 }
1151
1152 public void EnableNeighbours()
1153 {
1154 if ((this.m_gridServer.GetName() == "Remote") && (!this.m_child))
1155 {
1156 Hashtable SimParams;
1157 ArrayList SendParams;
1158 XmlRpcRequest GridReq;
1159 XmlRpcResponse GridResp;
1160 foreach (Hashtable neighbour in ((RemoteGridBase)this.m_gridServer).neighbours)
1161 {
1162 Console.WriteLine( "http://" + neighbour["sim_ip"] + ":" + neighbour["sim_port"]);
1163 SimParams = new Hashtable();
1164 SimParams["session_id"] = ((RemoteGridBase)this.m_gridServer).agentcircuits[CircuitCode].SessionID.ToString();
1165 SimParams["secure_session_id"] = ((RemoteGridBase)this.m_gridServer).agentcircuits[CircuitCode].SecureSessionID.ToString();
1166 SimParams["firstname"] = ((RemoteGridBase)this.m_gridServer).agentcircuits[CircuitCode].firstname;
1167 SimParams["lastname"] = ((RemoteGridBase)this.m_gridServer).agentcircuits[CircuitCode].lastname;
1168 SimParams["agent_id"] = ((RemoteGridBase)this.m_gridServer).agentcircuits[CircuitCode].AgentID.ToString();
1169 SimParams["circuit_code"] = (Int32)this.CircuitCode;
1170 SimParams["child_agent"] = "1";
1171 SendParams = new ArrayList();
1172 SendParams.Add(SimParams);
1173
1174 GridReq = new XmlRpcRequest("expect_user", SendParams);
1175 GridResp = GridReq.Send("http://" + neighbour["sim_ip"] + ":" + neighbour["sim_port"], 3000);
1176 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
1177 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
1178 enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
1179 System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse((string)neighbour["sim_ip"]);
1180 byte[] byteIP = neighbourIP.GetAddressBytes();
1181 enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
1182 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
1183 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
1184 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
1185 enablesimpacket.SimulatorInfo.Port = (ushort)Convert.ToInt32(neighbour["sim_port"]);
1186 Thread.Sleep(3000);
1187 this.OutPacket(enablesimpacket);
1188 }
1189 }
1190 }
1150 } 1191 }
1151} 1192}