aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid
diff options
context:
space:
mode:
authormingchen2007-07-05 15:15:28 +0000
committermingchen2007-07-05 15:15:28 +0000
commit583f2a9de8e503773a427facd5f81a82b40bd585 (patch)
tree35d434db32056e7d0b231f56f2732c031c130a1d /OpenSim/Grid
parent* Tweaks to Java engine (uses less threads). Added support for OnFrame and On... (diff)
downloadopensim-SC_OLD-583f2a9de8e503773a427facd5f81a82b40bd585.zip
opensim-SC_OLD-583f2a9de8e503773a427facd5f81a82b40bd585.tar.gz
opensim-SC_OLD-583f2a9de8e503773a427facd5f81a82b40bd585.tar.bz2
opensim-SC_OLD-583f2a9de8e503773a427facd5f81a82b40bd585.tar.xz
*Removed SimProfile.cs as it is no longer needed (in favor of SimProfileData)
*Added simulator_data_request XMLRPC method to request data from the grid server about a sim instead of faking its login *Login is progressing, now just getting an XML error (http://pastebin.com/942515) -- if you can fix this, throw MingChen in IRC a Private Message
Diffstat (limited to 'OpenSim/Grid')
-rw-r--r--OpenSim/Grid/GridServer/GridManager.cs35
-rw-r--r--OpenSim/Grid/GridServer/Main.cs1
-rw-r--r--OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj4
-rw-r--r--OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build2
-rw-r--r--OpenSim/Grid/UserServer/UserManager.cs21
5 files changed, 49 insertions, 14 deletions
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs
index 1e457b3..422385d 100644
--- a/OpenSim/Grid/GridServer/GridManager.cs
+++ b/OpenSim/Grid/GridServer/GridManager.cs
@@ -268,6 +268,7 @@ namespace OpenSim.Grid.GridServer
268 TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256)); 268 TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256));
269 TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/"; 269 TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/";
270 270
271 Console.WriteLine("NEW SIM: " + TheSim.serverURI);
271 TheSim.regionName = (string)requestData["sim_name"]; 272 TheSim.regionName = (string)requestData["sim_name"];
272 TheSim.UUID = new LLUUID((string)requestData["UUID"]); 273 TheSim.UUID = new LLUUID((string)requestData["UUID"]);
273 274
@@ -376,6 +377,40 @@ namespace OpenSim.Grid.GridServer
376 return response; 377 return response;
377 } 378 }
378 379
380 public XmlRpcResponse XmlRpcSimulatorDataRequestMethod(XmlRpcRequest request)
381 {
382 Hashtable requestData = (Hashtable)request.Params[0];
383 Hashtable responseData = new Hashtable();
384 SimProfileData simData = null;
385 if (requestData.ContainsKey("region_UUID"))
386 {
387 simData = getRegion(new LLUUID((string)requestData["region_UUID"]));
388 }
389 else if (requestData.ContainsKey("region_handle"))
390 {
391 simData = getRegion(Convert.ToUInt64((string)requestData["region_handle"]));
392 }
393
394 if (simData == null)
395 {
396 //Sim does not exist
397 responseData["error"] = "Sim does not exist";
398 }
399 else
400 {
401 responseData["sim_ip"] = simData.serverIP;
402 responseData["sim_port"] = simData.serverPort.ToString();
403 responseData["region_locx"] = simData.regionLocX;
404 responseData["region_locy"] = simData.regionLocY;
405 responseData["region_UUID"] = simData.UUID.UUID.ToString();
406 responseData["region_name"] = simData.regionName;
407 }
408
409 XmlRpcResponse response = new XmlRpcResponse();
410 response.Value = responseData;
411 return response;
412 }
413
379 public XmlRpcResponse XmlRpcMapBlockMethod(XmlRpcRequest request) 414 public XmlRpcResponse XmlRpcMapBlockMethod(XmlRpcRequest request)
380 { 415 {
381 int xmin=980, ymin=980, xmax=1020, ymax=1020; 416 int xmin=980, ymin=980, xmax=1020, ymax=1020;
diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs
index a990ff7..dc5e4fa 100644
--- a/OpenSim/Grid/GridServer/Main.cs
+++ b/OpenSim/Grid/GridServer/Main.cs
@@ -125,6 +125,7 @@ namespace OpenSim.Grid.GridServer
125 //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); 125 //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback);
126 126
127 httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod); 127 httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod);
128 httpServer.AddXmlRPCHandler("simulator_data_request", m_gridManager.XmlRpcSimulatorDataRequestMethod);
128 httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod); 129 httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod);
129 130
130 httpServer.AddStreamHandler(new RestStreamHandler("GET", "/sims/", m_gridManager.RestGetSimMethod )); 131 httpServer.AddStreamHandler(new RestStreamHandler("GET", "/sims/", m_gridManager.RestGetSimMethod ));
diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj
index 424072e..7fbb581 100644
--- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj
+++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.csproj
@@ -114,10 +114,10 @@
114 </ProjectReference> 114 </ProjectReference>
115 </ItemGroup> 115 </ItemGroup>
116 <ItemGroup> 116 <ItemGroup>
117 <Compile Include="GridManager.cs"> 117 <Compile Include="Main.cs">
118 <SubType>Code</SubType> 118 <SubType>Code</SubType>
119 </Compile> 119 </Compile>
120 <Compile Include="Main.cs"> 120 <Compile Include="GridManager.cs">
121 <SubType>Code</SubType> 121 <SubType>Code</SubType>
122 </Compile> 122 </Compile>
123 <Compile Include="Properties\AssemblyInfo.cs"> 123 <Compile Include="Properties\AssemblyInfo.cs">
diff --git a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build
index 4cadf1d..45cf353 100644
--- a/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build
+++ b/OpenSim/Grid/GridServer/OpenSim.Grid.GridServer.exe.build
@@ -11,8 +11,8 @@
11 <resources prefix="OpenSim.Grid.GridServer" dynamicprefix="true" > 11 <resources prefix="OpenSim.Grid.GridServer" dynamicprefix="true" >
12 </resources> 12 </resources>
13 <sources failonempty="true"> 13 <sources failonempty="true">
14 <include name="GridManager.cs" />
15 <include name="Main.cs" /> 14 <include name="Main.cs" />
15 <include name="GridManager.cs" />
16 <include name="Properties/AssemblyInfo.cs" /> 16 <include name="Properties/AssemblyInfo.cs" />
17 </sources> 17 </sources>
18 <references basedir="${project::get-base-directory()}"> 18 <references basedir="${project::get-base-directory()}">
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs
index 4610a9d..4216515 100644
--- a/OpenSim/Grid/UserServer/UserManager.cs
+++ b/OpenSim/Grid/UserServer/UserManager.cs
@@ -29,7 +29,6 @@ using System;
29using System.Collections; 29using System.Collections;
30using Nwc.XmlRpc; 30using Nwc.XmlRpc;
31using OpenSim.Framework.Data; 31using OpenSim.Framework.Data;
32using OpenSim.Framework.Sims;
33using OpenSim.Framework.UserManagement; 32using OpenSim.Framework.UserManagement;
34 33
35namespace OpenSim.Grid.UserServer 34namespace OpenSim.Grid.UserServer
@@ -48,23 +47,23 @@ namespace OpenSim.Grid.UserServer
48 public override void CustomiseResponse( LoginResponse response, UserProfileData theUser) 47 public override void CustomiseResponse( LoginResponse response, UserProfileData theUser)
49 { 48 {
50 // Load information from the gridserver 49 // Load information from the gridserver
51 SimProfile SimInfo = new SimProfile(); 50 SimProfileData SimInfo = new SimProfileData();
52 SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); 51 SimInfo = SimInfo.RequestSimProfileData(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey);
53 52
54 // Customise the response 53 // Customise the response
55 // Home Location 54 // Home Location
56 response.Home = "{'region_handle':[r" + (SimInfo.RegionLocX * 256).ToString() + ",r" + (SimInfo.RegionLocY * 256).ToString() + "], " + 55 response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + (SimInfo.regionLocY * 256).ToString() + "], " +
57 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + 56 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
58 "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; 57 "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
59 58
60 // Destination 59 // Destination
61 response.SimAddress = SimInfo.sim_ip; 60 response.SimAddress = SimInfo.serverIP;
62 response.SimPort = (Int32)SimInfo.sim_port; 61 response.SimPort = (Int32)SimInfo.serverPort;
63 response.RegionX = SimInfo.RegionLocY ; 62 response.RegionX = SimInfo.regionLocX;
64 response.RegionY = SimInfo.RegionLocX ; 63 response.RegionY = SimInfo.regionLocX;
65 64
66 // Notify the target of an incoming user 65 // Notify the target of an incoming user
67 Console.WriteLine("Notifying " + SimInfo.regionname + " (" + SimInfo.caps_url + ")"); 66 Console.WriteLine("Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI+ ")");
68 67
69 // Prepare notification 68 // Prepare notification
70 Hashtable SimParams = new Hashtable(); 69 Hashtable SimParams = new Hashtable();
@@ -83,11 +82,11 @@ namespace OpenSim.Grid.UserServer
83 82
84 // Update agent with target sim 83 // Update agent with target sim
85 theUser.currentAgent.currentRegion = SimInfo.UUID; 84 theUser.currentAgent.currentRegion = SimInfo.UUID;
86 theUser.currentAgent.currentHandle = SimInfo.regionhandle; 85 theUser.currentAgent.currentHandle = SimInfo.regionHandle;
87 86
88 // Send 87 // Send
89 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); 88 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
90 XmlRpcResponse GridResp = GridReq.Send(SimInfo.caps_url, 3000); 89 XmlRpcResponse GridResp = GridReq.Send(SimInfo.serverURI, 3000);
91 } 90 }
92 } 91 }
93} 92}