aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2009-09-27 20:44:43 -0700
committerDiva Canto2009-09-27 20:44:43 -0700
commit0766b6dc34b972026846360767a20e2f11325c70 (patch)
treea5b64851a2feafdf5782df63fb327c0f7036ebb2
parentFixed an issue with the PresenceModule in "gridmode", introduced by my fixing... (diff)
downloadopensim-SC_OLD-0766b6dc34b972026846360767a20e2f11325c70.zip
opensim-SC_OLD-0766b6dc34b972026846360767a20e2f11325c70.tar.gz
opensim-SC_OLD-0766b6dc34b972026846360767a20e2f11325c70.tar.bz2
opensim-SC_OLD-0766b6dc34b972026846360767a20e2f11325c70.tar.xz
Fixed the connection from User server to GridServer.
-rw-r--r--OpenSim/Grid/UserServer.Modules/UserLoginService.cs62
-rw-r--r--prebuild.xml3
2 files changed, 33 insertions, 32 deletions
diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs
index 01d5537..2ca5ada 100644
--- a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs
@@ -34,6 +34,7 @@ using System.Text.RegularExpressions;
34using log4net; 34using log4net;
35using Nwc.XmlRpc; 35using Nwc.XmlRpc;
36using OpenMetaverse; 36using OpenMetaverse;
37using Nini.Config;
37using OpenSim.Data; 38using OpenSim.Data;
38using OpenSim.Framework; 39using OpenSim.Framework;
39using OpenSim.Framework.Communications; 40using OpenSim.Framework.Communications;
@@ -42,6 +43,9 @@ using OpenSim.Framework.Communications.Cache;
42using OpenSim.Framework.Capabilities; 43using OpenSim.Framework.Capabilities;
43using OpenSim.Framework.Servers; 44using OpenSim.Framework.Servers;
44using OpenSim.Framework.Servers.HttpServer; 45using OpenSim.Framework.Servers.HttpServer;
46using OpenSim.Services.Interfaces;
47using OpenSim.Services.Connectors;
48using GridRegion = OpenSim.Services.Interfaces.GridRegion;
45 49
46namespace OpenSim.Grid.UserServer.Modules 50namespace OpenSim.Grid.UserServer.Modules
47{ 51{
@@ -63,6 +67,8 @@ namespace OpenSim.Grid.UserServer.Modules
63 public UserConfig m_config; 67 public UserConfig m_config;
64 private readonly IRegionProfileRouter m_regionProfileService; 68 private readonly IRegionProfileRouter m_regionProfileService;
65 69
70 private IGridService m_GridService;
71
66 protected BaseHttpServer m_httpServer; 72 protected BaseHttpServer m_httpServer;
67 73
68 public UserLoginService( 74 public UserLoginService(
@@ -76,6 +82,8 @@ namespace OpenSim.Grid.UserServer.Modules
76 m_defaultHomeY = m_config.DefaultY; 82 m_defaultHomeY = m_config.DefaultY;
77 m_interInventoryService = inventoryService; 83 m_interInventoryService = inventoryService;
78 m_regionProfileService = regionProfileService; 84 m_regionProfileService = regionProfileService;
85
86 m_GridService = new GridServicesConnector(config.GridServerURL.ToString());
79 } 87 }
80 88
81 public void RegisterHandlers(BaseHttpServer httpServer, bool registerLLSDHandler, bool registerOpenIDHandlers) 89 public void RegisterHandlers(BaseHttpServer httpServer, bool registerLLSDHandler, bool registerOpenIDHandlers)
@@ -203,47 +211,37 @@ namespace OpenSim.Grid.UserServer.Modules
203 211
204 protected override RegionInfo RequestClosestRegion(string region) 212 protected override RegionInfo RequestClosestRegion(string region)
205 { 213 {
206 RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(region, 214 return GridRegionToRegionInfo(m_GridService.GetRegionByName(UUID.Zero, region));
207 m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey);
208
209 if (profileData != null)
210 {
211 return profileData.ToRegionInfo();
212 }
213 else
214 {
215 return null;
216 }
217 } 215 }
218 216
219 protected override RegionInfo GetRegionInfo(ulong homeRegionHandle) 217 protected override RegionInfo GetRegionInfo(ulong homeRegionHandle)
220 { 218 {
221 RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(homeRegionHandle, 219 uint x = 0, y = 0;
222 m_config.GridServerURL, m_config.GridSendKey, 220 Utils.LongToUInts(homeRegionHandle, out x, out y);
223 m_config.GridRecvKey); 221 return GridRegionToRegionInfo(m_GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y));
224 if (profileData != null)
225 {
226 return profileData.ToRegionInfo();
227 }
228 else
229 {
230 return null;
231 }
232 } 222 }
233 223
234 protected override RegionInfo GetRegionInfo(UUID homeRegionId) 224 protected override RegionInfo GetRegionInfo(UUID homeRegionId)
235 { 225 {
236 RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(homeRegionId, 226 return GridRegionToRegionInfo(m_GridService.GetRegionByUUID(UUID.Zero, homeRegionId));
237 m_config.GridServerURL, m_config.GridSendKey, 227 }
238 m_config.GridRecvKey); 228
239 if (profileData != null) 229 private RegionInfo GridRegionToRegionInfo(GridRegion gregion)
240 { 230 {
241 return profileData.ToRegionInfo(); 231 if (gregion == null)
242 }
243 else
244 {
245 return null; 232 return null;
246 } 233
234 RegionInfo rinfo = new RegionInfo();
235 rinfo.ExternalHostName = gregion.ExternalHostName;
236 rinfo.HttpPort = gregion.HttpPort;
237 rinfo.InternalEndPoint = gregion.InternalEndPoint;
238 rinfo.RegionID = gregion.RegionID;
239 rinfo.RegionLocX = (uint)(gregion.RegionLocX / Constants.RegionSize);
240 rinfo.RegionLocY = (uint)(gregion.RegionLocY / Constants.RegionSize);
241 rinfo.RegionName = gregion.RegionName;
242 rinfo.ScopeID = gregion.ScopeID;
243
244 return rinfo;
247 } 245 }
248 246
249 protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient) 247 protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)
diff --git a/prebuild.xml b/prebuild.xml
index adbbc45..76da2e1 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -980,6 +980,8 @@
980 <Reference name="OpenSim.Framework.Servers"/> 980 <Reference name="OpenSim.Framework.Servers"/>
981 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 981 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
982 <Reference name="OpenSim.Framework.Statistics"/> 982 <Reference name="OpenSim.Framework.Statistics"/>
983 <Reference name="OpenSim.Services.Interfaces"/>
984 <Reference name="OpenSim.Services.Connectors"/>
983 <Reference name="OpenSim.Grid.Framework"/> 985 <Reference name="OpenSim.Grid.Framework"/>
984 <Reference name="OpenSim.Grid.Communications.OGS1"/> 986 <Reference name="OpenSim.Grid.Communications.OGS1"/>
985 <Reference name="OpenMetaverse.dll"/> 987 <Reference name="OpenMetaverse.dll"/>
@@ -988,6 +990,7 @@
988 <Reference name="XMLRPC.dll"/> 990 <Reference name="XMLRPC.dll"/>
989 <Reference name="log4net.dll"/> 991 <Reference name="log4net.dll"/>
990 <Reference name="DotNetOpenId.dll"/> 992 <Reference name="DotNetOpenId.dll"/>
993 <Reference name="Nini.dll"/>
991 994
992 <Files> 995 <Files>
993 <Match pattern="*.cs" recurse="true"/> 996 <Match pattern="*.cs" recurse="true"/>