* Turned RegionProfileService non-static

0.6.3-post-fixes
lbsa71 2009-02-12 10:16:11 +00:00
parent 792b7cba2f
commit c3a4810e91
3 changed files with 13 additions and 10 deletions

View File

@ -13,7 +13,7 @@ namespace OpenSim.Data
/// <summary>
/// Request sim data based on arbitrary key/value
/// </summary>
private static RegionProfileData RequestSimData(Uri gridserverUrl, string gridserverSendkey, string keyField, string keyValue)
private RegionProfileData RequestSimData(Uri gridserverUrl, string gridserverSendkey, string keyField, string keyValue)
{
Hashtable requestData = new Hashtable();
requestData[keyField] = keyValue;
@ -57,7 +57,7 @@ namespace OpenSim.Data
/// <param name="gridserverRecvkey"></param>
/// <returns>The sim profile. Null if there was a request failure</returns>
/// <remarks>This method should be statics</remarks>
public static RegionProfileData RequestSimProfileData(UUID regionId, Uri gridserverUrl,
public RegionProfileData RequestSimProfileData(UUID regionId, Uri gridserverUrl,
string gridserverSendkey, string gridserverRecvkey)
{
return RequestSimData(gridserverUrl, gridserverSendkey, "region_UUID", regionId.Guid.ToString());
@ -71,7 +71,7 @@ namespace OpenSim.Data
/// <param name="gridserver_sendkey"></param>
/// <param name="gridserver_recvkey"></param>
/// <returns>The sim profile. Null if there was a request failure</returns>
public static RegionProfileData RequestSimProfileData(ulong region_handle, Uri gridserver_url,
public RegionProfileData RequestSimProfileData(ulong region_handle, Uri gridserver_url,
string gridserver_sendkey, string gridserver_recvkey)
{
return RequestSimData(gridserver_url, gridserver_sendkey, "region_handle", region_handle.ToString());
@ -85,7 +85,7 @@ namespace OpenSim.Data
/// <param name="gridserverSendkey"></param>
/// <param name="gridserverRecvkey"></param>
/// <returns>The sim profile. Null if there was a request failure</returns>
public static RegionProfileData RequestSimProfileData(string regionName, Uri gridserverUrl,
public RegionProfileData RequestSimProfileData(string regionName, Uri gridserverUrl,
string gridserverSendkey, string gridserverRecvkey)
{
return RequestSimData(gridserverUrl, gridserverSendkey, "region_name_search", regionName );

View File

@ -32,6 +32,7 @@ using System.Reflection;
using log4net;
using log4net.Config;
using OpenMetaverse;
using OpenSim.Data;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
@ -167,7 +168,7 @@ namespace OpenSim.Grid.UserServer
protected virtual void StartupLoginService(IInterServiceInventoryServices inventoryService)
{
m_loginService = new UserLoginService(
m_userManager, inventoryService, new LibraryRootFolder(Cfg.LibraryXmlfile), Cfg, Cfg.DefaultStartupMsg);
m_userManager, inventoryService, new LibraryRootFolder(Cfg.LibraryXmlfile), Cfg, Cfg.DefaultStartupMsg, new RegionProfileService());
}
protected virtual void AddHttpHandlers()

View File

@ -59,15 +59,17 @@ namespace OpenSim.Grid.UserServer
private UserLoggedInAtLocation handlerUserLoggedInAtLocation;
public UserConfig m_config;
private readonly RegionProfileService m_regionProfileService;
public UserLoginService(
UserManagerBase userManager, IInterServiceInventoryServices inventoryService,
LibraryRootFolder libraryRootFolder,
UserConfig config, string welcomeMess)
UserConfig config, string welcomeMess, RegionProfileService regionProfileService)
: base(userManager, libraryRootFolder, welcomeMess)
{
m_config = config;
m_inventoryService = inventoryService;
m_regionProfileService = regionProfileService;
}
public void setloginlevel(int level)
@ -86,7 +88,7 @@ namespace OpenSim.Grid.UserServer
RegionProfileData SimInfo;
try
{
SimInfo = RegionProfileService.RequestSimProfileData(
SimInfo = m_regionProfileService.RequestSimProfileData(
theUser.CurrentAgent.Handle, m_config.GridServerURL,
m_config.GridSendKey, m_config.GridRecvKey);
@ -302,20 +304,20 @@ namespace OpenSim.Grid.UserServer
protected RegionProfileData RequestClosestRegion(string region)
{
return RegionProfileService.RequestSimProfileData(region,
return m_regionProfileService.RequestSimProfileData(region,
m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey);
}
protected RegionProfileData GetRegionInfo(ulong homeRegionHandle)
{
return RegionProfileService.RequestSimProfileData(homeRegionHandle,
return m_regionProfileService.RequestSimProfileData(homeRegionHandle,
m_config.GridServerURL, m_config.GridSendKey,
m_config.GridRecvKey);
}
protected RegionProfileData GetRegionInfo(UUID homeRegionId)
{
return RegionProfileService.RequestSimProfileData(homeRegionId,
return m_regionProfileService.RequestSimProfileData(homeRegionId,
m_config.GridServerURL, m_config.GridSendKey,
m_config.GridRecvKey);
}