* De-duplicated login service some more

* Normalized m_inventoryService
  * Pulled AddActiveGestures up
0.6.5-rc1
lbsa71 2009-03-20 06:49:12 +00:00
parent 2a76b2a417
commit feaa645071
4 changed files with 36 additions and 85 deletions

View File

@ -241,25 +241,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler()); m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler());
} }
//private LocalLoginService CreateLoginService(LibraryRootFolder libraryRootFolder, IInterServiceInventoryServices inventoryService, LocalUserServices userService, LocalBackEndServices backendService)
//{
// LocalLoginService loginService =
// new LocalLoginService(
// userService, m_openSim.ConfigurationSettings.StandaloneWelcomeMessage, inventoryService, backendService, m_openSim.NetServersInfo,
// m_openSim.ConfigurationSettings.StandaloneAuthenticate, libraryRootFolder);
// // set up XMLRPC handler for client's initial login request message
// m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod);
// // provides the web form login
// m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin);
// // Provides the LLSD login
// m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod);
// return loginService;
//}
private void CreateGridInfoService() private void CreateGridInfoService()
{ {
// provide grid info // provide grid info

View File

@ -51,11 +51,6 @@ namespace OpenSim.Client.Linden
protected NetworkServersInfo m_serversInfo; protected NetworkServersInfo m_serversInfo;
protected bool m_authUsers = false; protected bool m_authUsers = false;
/// <summary>
/// Used by the login service to make requests to the inventory service.
/// </summary>
protected IInterServiceInventoryServices m_interServiceInventoryService;
/// <summary> /// <summary>
/// Used to make requests to the local regions. /// Used to make requests to the local regions.
/// </summary> /// </summary>
@ -74,7 +69,7 @@ namespace OpenSim.Client.Linden
m_defaultHomeY = this.m_serversInfo.DefaultHomeLocY; m_defaultHomeY = this.m_serversInfo.DefaultHomeLocY;
m_authUsers = authenticate; m_authUsers = authenticate;
m_interServiceInventoryService = interServiceInventoryService; m_inventoryService = interServiceInventoryService;
m_regionsConnector = regionsConnector; m_regionsConnector = regionsConnector;
} }
@ -141,33 +136,6 @@ namespace OpenSim.Client.Linden
return m_regionsConnector.RequestNeighbourInfo(homeRegionId); return m_regionsConnector.RequestNeighbourInfo(homeRegionId);
} }
/// <summary>
/// Add active gestures of the user to the login response.
/// </summary>
/// <param name="response">
/// A <see cref="LoginResponse"/>
/// </param>
/// <param name="theUser">
/// A <see cref="UserProfileData"/>
/// </param>
protected override void AddActiveGestures(LoginResponse response, UserProfileData theUser)
{
List<InventoryItemBase> gestures = m_interServiceInventoryService.GetActiveGestures(theUser.ID);
//m_log.DebugFormat("[LOGIN]: AddActiveGestures, found {0}", gestures == null ? 0 : gestures.Count);
ArrayList list = new ArrayList();
if (gestures != null)
{
foreach (InventoryItemBase gesture in gestures)
{
Hashtable item = new Hashtable();
item["item_id"] = gesture.ID.ToString();
item["asset_id"] = gesture.AssetID.ToString();
list.Add(item);
}
}
response.ActiveGestures = list;
}
/// <summary> /// <summary>
/// Prepare a login to the given region. This involves both telling the region to expect a connection /// Prepare a login to the given region. This involves both telling the region to expect a connection
/// and appropriately customising the response to the user. /// and appropriately customising the response to the user.
@ -243,13 +211,13 @@ namespace OpenSim.Client.Linden
// See LoginService // See LoginService
protected override InventoryData GetInventorySkeleton(UUID userID) protected override InventoryData GetInventorySkeleton(UUID userID)
{ {
List<InventoryFolderBase> folders = m_interServiceInventoryService.GetInventorySkeleton(userID); List<InventoryFolderBase> folders = m_inventoryService.GetInventorySkeleton(userID);
// If we have user auth but no inventory folders for some reason, create a new set of folders. // If we have user auth but no inventory folders for some reason, create a new set of folders.
if (null == folders || 0 == folders.Count) if (null == folders || 0 == folders.Count)
{ {
m_interServiceInventoryService.CreateNewUserInventory(userID); m_inventoryService.CreateNewUserInventory(userID);
folders = m_interServiceInventoryService.GetInventorySkeleton(userID); folders = m_inventoryService.GetInventorySkeleton(userID);
} }
UUID rootID = UUID.Zero; UUID rootID = UUID.Zero;

View File

@ -59,6 +59,11 @@ namespace OpenSim.Framework.Communications
protected uint m_defaultHomeX; protected uint m_defaultHomeX;
protected uint m_defaultHomeY; protected uint m_defaultHomeY;
/// <summary>
/// Used by the login service to make requests to the inventory service.
/// </summary>
protected IInterServiceInventoryServices m_inventoryService;
/// <summary> /// <summary>
/// Constructor /// Constructor
/// </summary> /// </summary>
@ -1008,7 +1013,33 @@ namespace OpenSim.Framework.Communications
protected abstract RegionInfo RequestClosestRegion(string region); protected abstract RegionInfo RequestClosestRegion(string region);
protected abstract RegionInfo GetRegionInfo(ulong homeRegionHandle); protected abstract RegionInfo GetRegionInfo(ulong homeRegionHandle);
protected abstract RegionInfo GetRegionInfo(UUID homeRegionId); protected abstract RegionInfo GetRegionInfo(UUID homeRegionId);
protected abstract void AddActiveGestures(LoginResponse response, UserProfileData theUser);
protected abstract bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response); protected abstract bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response);
/// <summary>
/// Add active gestures of the user to the login response.
/// </summary>
/// <param name="response">
/// A <see cref="LoginResponse"/>
/// </param>
/// <param name="theUser">
/// A <see cref="UserProfileData"/>
/// </param>
protected void AddActiveGestures(LoginResponse response, UserProfileData theUser)
{
List<InventoryItemBase> gestures = m_inventoryService.GetActiveGestures(theUser.ID);
//m_log.DebugFormat("[LOGIN]: AddActiveGestures, found {0}", gestures == null ? 0 : gestures.Count);
ArrayList list = new ArrayList();
if (gestures != null)
{
foreach (InventoryItemBase gesture in gestures)
{
Hashtable item = new Hashtable();
item["item_id"] = gesture.ID.ToString();
item["asset_id"] = gesture.AssetID.ToString();
list.Add(item);
}
}
response.ActiveGestures = list;
}
} }
} }

View File

@ -53,8 +53,6 @@ namespace OpenSim.Grid.UserServer.Modules
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected IInterServiceInventoryServices m_inventoryService;
public event UserLoggedInAtLocation OnUserLoggedInAtLocation; public event UserLoggedInAtLocation OnUserLoggedInAtLocation;
private UserLoggedInAtLocation handlerUserLoggedInAtLocation; private UserLoggedInAtLocation handlerUserLoggedInAtLocation;
@ -244,33 +242,6 @@ namespace OpenSim.Grid.UserServer.Modules
} }
} }
/// <summary>
/// Add active gestures of the user to the login response.
/// </summary>
/// <param name="response">
/// A <see cref="LoginResponse"/>
/// </param>
/// <param name="theUser">
/// A <see cref="UserProfileData"/>
/// </param>
protected override void AddActiveGestures(LoginResponse response, UserProfileData theUser)
{
List<InventoryItemBase> gestures = m_inventoryService.GetActiveGestures(theUser.ID);
//m_log.DebugFormat("[LOGIN]: AddActiveGestures, found {0}", gestures == null ? 0 : gestures.Count);
ArrayList list = new ArrayList();
if (gestures != null)
{
foreach (InventoryItemBase gesture in gestures)
{
Hashtable item = new Hashtable();
item["item_id"] = gesture.ID.ToString();
item["asset_id"] = gesture.AssetID.ToString();
list.Add(item);
}
}
response.ActiveGestures = list;
}
protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response) protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response)
{ {
return PrepareLoginToRegion(RegionProfileData.FromRegionInfo(regionInfo), user, response); return PrepareLoginToRegion(RegionProfileData.FromRegionInfo(regionInfo), user, response);