aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMW2007-05-14 21:04:14 +0000
committerMW2007-05-14 21:04:14 +0000
commita889caf20028c8f9680afb27335ec6cac8f1e9f1 (patch)
treefde4ee9bfd9af2dc6c204c81ba0ac907cebbec31
parentset the default region x,y and sim port to 0 in UserProfileManager. XmlRpcLog... (diff)
downloadopensim-SC_OLD-a889caf20028c8f9680afb27335ec6cac8f1e9f1.zip
opensim-SC_OLD-a889caf20028c8f9680afb27335ec6cac8f1e9f1.tar.gz
opensim-SC_OLD-a889caf20028c8f9680afb27335ec6cac8f1e9f1.tar.bz2
opensim-SC_OLD-a889caf20028c8f9680afb27335ec6cac8f1e9f1.tar.xz
moved the EnableNeighbours code to after the client has completed the move to the region
-rw-r--r--OpenSim.RegionServer/OpenSimMain.cs37
-rw-r--r--OpenSim.RegionServer/SimClient.cs41
2 files changed, 42 insertions, 36 deletions
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs
index 9fb7c4e..52abf63 100644
--- a/OpenSim.RegionServer/OpenSimMain.cs
+++ b/OpenSim.RegionServer/OpenSimMain.cs
@@ -543,42 +543,7 @@ namespace OpenSim
543 this._packetServer.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser); 543 this._packetServer.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);
544 544
545 //if (!((RemoteGridBase)GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].child) 545 //if (!((RemoteGridBase)GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].child)
546 if ((this.GridServers.GridServer.GetName() == "Remote") && (!isChildAgent)) 546
547 {
548 Hashtable SimParams;
549 ArrayList SendParams;
550 XmlRpcRequest GridReq;
551 XmlRpcResponse GridResp;
552 foreach (Hashtable neighbour in ((RemoteGridBase)this.GridServers.GridServer).neighbours)
553 {
554 m_console.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"http://" + neighbour["sim_ip"] + ":" + neighbour["sim_port"]);
555 SimParams = new Hashtable();
556 SimParams["session_id"] = ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].SessionID.ToString();
557 SimParams["secure_session_id"] = ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].SecureSessionID.ToString();
558 SimParams["firstname"] = ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].firstname;
559 SimParams["lastname"] = ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].lastname;
560 SimParams["agent_id"] = ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].AgentID.ToString();
561 SimParams["circuit_code"] = (Int32)useCircuit.CircuitCode.Code;
562 SimParams["child_agent"] = "1";
563 SendParams = new ArrayList();
564 SendParams.Add(SimParams);
565
566 GridReq = new XmlRpcRequest("expect_user", SendParams);
567 GridResp = GridReq.Send("http://" + neighbour["sim_ip"] + ":" + neighbour["sim_port"], 3000);
568 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
569 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
570 enablesimpacket.SimulatorInfo.Handle = Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
571 System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse((string)neighbour["sim_ip"]);
572 byte[] byteIP = neighbourIP.GetAddressBytes();
573 enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24;
574 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16;
575 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8;
576 enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0];
577 enablesimpacket.SimulatorInfo.Port = (ushort)Convert.ToInt32(neighbour["sim_port"]);
578 Thread.Sleep(3000);
579 _packetServer.ClientThreads[useCircuit.CircuitCode.Code].OutPacket(enablesimpacket);
580 }
581 }
582 547
583 } 548 }
584 else 549 else
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}