Justin, I must have been dyslexic when I wrote UserGridService as the name for it. GridUserService makes more sense; it's the user of the grid, "grid user". I changed it everywhere.
parent
395f343498
commit
5171464ac1
|
@ -33,7 +33,7 @@ using OpenSim.Framework;
|
|||
namespace OpenSim.Data
|
||||
{
|
||||
// This MUST be a ref type!
|
||||
public class UserGridData
|
||||
public class GridUserData
|
||||
{
|
||||
public string UserID;
|
||||
public Dictionary<string, string> Data;
|
||||
|
@ -42,9 +42,9 @@ namespace OpenSim.Data
|
|||
/// <summary>
|
||||
/// An interface for connecting to the user grid datastore
|
||||
/// </summary>
|
||||
public interface IUserGridData
|
||||
public interface IGridUserData
|
||||
{
|
||||
UserGridData GetUserGridData(string userID);
|
||||
bool StoreUserGridData(UserGridData data);
|
||||
GridUserData GetGridUserData(string userID);
|
||||
bool StoreGridUserData(GridUserData data);
|
||||
}
|
||||
}
|
|
@ -40,15 +40,15 @@ namespace OpenSim.Data.MySQL
|
|||
/// <summary>
|
||||
/// A MySQL Interface for user grid data
|
||||
/// </summary>
|
||||
public class MySQLUserGridData : MySQLGenericTableHandler<UserGridData>, IUserGridData
|
||||
public class MySQLGridUserData : MySQLGenericTableHandler<GridUserData>, IGridUserData
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MySQLUserGridData(string connectionString, string realm) : base(connectionString, realm, "UserGrid") {}
|
||||
public MySQLGridUserData(string connectionString, string realm) : base(connectionString, realm, "UserGrid") {}
|
||||
|
||||
public UserGridData GetUserGridData(string userID)
|
||||
public GridUserData GetGridUserData(string userID)
|
||||
{
|
||||
UserGridData[] ret = Get("UserID", userID);
|
||||
GridUserData[] ret = Get("UserID", userID);
|
||||
|
||||
if (ret.Length == 0)
|
||||
return null;
|
||||
|
@ -56,7 +56,7 @@ namespace OpenSim.Data.MySQL
|
|||
return ret[0];
|
||||
}
|
||||
|
||||
public bool StoreUserGridData(UserGridData data)
|
||||
public bool StoreGridUserData(GridUserData data)
|
||||
{
|
||||
return Store(data);
|
||||
}
|
|
@ -37,13 +37,13 @@ using OpenSim.Services.Interfaces;
|
|||
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserGrid
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser
|
||||
{
|
||||
public class LocalUserGridServicesConnector : ISharedRegionModule, IUserGridService
|
||||
public class LocalGridUserServicesConnector : ISharedRegionModule, IGridUserService
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IUserGridService m_service;
|
||||
private IGridUserService m_service;
|
||||
|
||||
private bool m_Enabled = false;
|
||||
|
||||
|
@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserGrid
|
|||
|
||||
public string Name
|
||||
{
|
||||
get { return "LocalUserGridServicesConnector"; }
|
||||
get { return "LocalGridUserServicesConnector"; }
|
||||
}
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
|
@ -62,13 +62,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserGrid
|
|||
IConfig moduleConfig = source.Configs["Modules"];
|
||||
if (moduleConfig != null)
|
||||
{
|
||||
string name = moduleConfig.GetString("UserGridServices", "");
|
||||
string name = moduleConfig.GetString("GridUserServices", "");
|
||||
if (name == Name)
|
||||
{
|
||||
IConfig userConfig = source.Configs["UserGridService"];
|
||||
IConfig userConfig = source.Configs["GridUserService"];
|
||||
if (userConfig == null)
|
||||
{
|
||||
m_log.Error("[LOCAL USER GRID SERVICE CONNECTOR]: UserGridService missing from ini files");
|
||||
m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: GridUserService missing from ini files");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -76,20 +76,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserGrid
|
|||
|
||||
if (serviceDll == String.Empty)
|
||||
{
|
||||
m_log.Error("[LOCAL USER GRID SERVICE CONNECTOR]: No LocalServiceModule named in section UserGridService");
|
||||
m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: No LocalServiceModule named in section GridUserService");
|
||||
return;
|
||||
}
|
||||
|
||||
Object[] args = new Object[] { source };
|
||||
m_service = ServerUtils.LoadPlugin<IUserGridService>(serviceDll, args);
|
||||
m_service = ServerUtils.LoadPlugin<IGridUserService>(serviceDll, args);
|
||||
|
||||
if (m_service == null)
|
||||
{
|
||||
m_log.Error("[LOCAL USER GRID SERVICE CONNECTOR]: Can't load UserGrid service");
|
||||
m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: Can't load GridUser service");
|
||||
return;
|
||||
}
|
||||
m_Enabled = true;
|
||||
m_log.Info("[LOCAL USER GRID SERVICE CONNECTOR]: Local UserGrid connector enabled");
|
||||
m_log.Info("[LOCAL GRID USER SERVICE CONNECTOR]: Local GridUser connector enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserGrid
|
|||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
scene.RegisterModuleInterface<IUserGridService>(m_service);
|
||||
scene.RegisterModuleInterface<IGridUserService>(m_service);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
|
@ -126,14 +126,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserGrid
|
|||
return;
|
||||
}
|
||||
|
||||
public UserGridInfo GetUserGridInfo(string userID)
|
||||
public GridUserInfo GetGridUserInfo(string userID)
|
||||
{
|
||||
return m_service.GetUserGridInfo(userID);
|
||||
return m_service.GetGridUserInfo(userID);
|
||||
}
|
||||
|
||||
public bool StoreUserGridInfo(UserGridInfo info)
|
||||
public bool StoreGridUserInfo(GridUserInfo info)
|
||||
{
|
||||
return m_service.StoreUserGridInfo(info);
|
||||
return m_service.StoreGridUserInfo(info);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,9 +29,9 @@ using System;
|
|||
|
||||
namespace OpenSim.Services.Connectors
|
||||
{
|
||||
public class UserGridServiceConnector
|
||||
public class GridUserServiceConnector
|
||||
{
|
||||
public UserGridServiceConnector()
|
||||
public GridUserServiceConnector()
|
||||
{
|
||||
}
|
||||
}
|
|
@ -34,16 +34,16 @@ namespace OpenSim.Services.Interfaces
|
|||
/// <summary>
|
||||
/// Records user information specific to a grid but which is not part of a user's account.
|
||||
/// </summary>
|
||||
public class UserGridInfo
|
||||
public class GridUserInfo
|
||||
{
|
||||
public string UserID;
|
||||
public UUID HomeRegionID;
|
||||
public Vector3 HomePosition;
|
||||
public Vector3 HomeLookAt;
|
||||
|
||||
public UserGridInfo() {}
|
||||
public GridUserInfo() {}
|
||||
|
||||
public UserGridInfo(Dictionary<string, object> kvp)
|
||||
public GridUserInfo(Dictionary<string, object> kvp)
|
||||
{
|
||||
if (kvp.ContainsKey("UserID"))
|
||||
UserID = kvp["UserID"].ToString();
|
||||
|
@ -67,9 +67,9 @@ namespace OpenSim.Services.Interfaces
|
|||
}
|
||||
}
|
||||
|
||||
public interface IUserGridService
|
||||
public interface IGridUserService
|
||||
{
|
||||
UserGridInfo GetUserGridInfo(string userID);
|
||||
bool StoreUserGridInfo(UserGridInfo info);
|
||||
GridUserInfo GetGridUserInfo(string userID);
|
||||
bool StoreGridUserInfo(GridUserInfo info);
|
||||
}
|
||||
}
|
|
@ -39,20 +39,20 @@ using log4net;
|
|||
|
||||
namespace OpenSim.Services.UserAccountService
|
||||
{
|
||||
public class UserGridService : UserGridServiceBase, IUserGridService
|
||||
public class GridUserService : GridUserServiceBase, IGridUserService
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public UserGridService(IConfigSource config) : base(config)
|
||||
public GridUserService(IConfigSource config) : base(config)
|
||||
{
|
||||
m_log.Debug("[USER GRID SERVICE]: Starting user grid service");
|
||||
}
|
||||
|
||||
public UserGridInfo GetUserGridInfo(string userID)
|
||||
public GridUserInfo GetGridUserInfo(string userID)
|
||||
{
|
||||
UserGridData d = m_Database.GetUserGridData(userID);
|
||||
GridUserData d = m_Database.GetGridUserData(userID);
|
||||
|
||||
UserGridInfo info = new UserGridInfo();
|
||||
GridUserInfo info = new GridUserInfo();
|
||||
info.UserID = d.UserID;
|
||||
info.HomeRegionID = new UUID(d.Data["HomeRegionID"]);
|
||||
info.HomePosition = Vector3.Parse(d.Data["HomePosition"]);
|
||||
|
@ -61,16 +61,16 @@ namespace OpenSim.Services.UserAccountService
|
|||
return info;
|
||||
}
|
||||
|
||||
public bool StoreUserGridInfo(UserGridInfo info)
|
||||
public bool StoreGridUserInfo(GridUserInfo info)
|
||||
{
|
||||
UserGridData d = new UserGridData();
|
||||
GridUserData d = new GridUserData();
|
||||
|
||||
d.Data["UserID"] = info.UserID;
|
||||
d.Data["HomeRegionID"] = info.HomeRegionID.ToString();
|
||||
d.Data["HomePosition"] = info.HomePosition.ToString();
|
||||
d.Data["HomeLookAt"] = info.HomeLookAt.ToString();
|
||||
|
||||
return m_Database.StoreUserGridData(d);
|
||||
return m_Database.StoreGridUserData(d);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -35,15 +35,15 @@ using OpenSim.Services.Base;
|
|||
|
||||
namespace OpenSim.Services.UserAccountService
|
||||
{
|
||||
public class UserGridServiceBase : ServiceBase
|
||||
public class GridUserServiceBase : ServiceBase
|
||||
{
|
||||
protected IUserGridData m_Database = null;
|
||||
protected IGridUserData m_Database = null;
|
||||
|
||||
public UserGridServiceBase(IConfigSource config) : base(config)
|
||||
public GridUserServiceBase(IConfigSource config) : base(config)
|
||||
{
|
||||
string dllName = String.Empty;
|
||||
string connString = String.Empty;
|
||||
string realm = "UserGrid";
|
||||
string realm = "GridUser";
|
||||
|
||||
//
|
||||
// Try reading the [DatabaseService] section, if it exists
|
||||
|
@ -58,9 +58,9 @@ namespace OpenSim.Services.UserAccountService
|
|||
}
|
||||
|
||||
//
|
||||
// [PresenceService] section overrides [DatabaseService], if it exists
|
||||
// [GridUsetService] section overrides [DatabaseService], if it exists
|
||||
//
|
||||
IConfig presenceConfig = config.Configs["PresenceService"];
|
||||
IConfig presenceConfig = config.Configs["GridUserService"];
|
||||
if (presenceConfig != null)
|
||||
{
|
||||
dllName = presenceConfig.GetString("StorageProvider", dllName);
|
||||
|
@ -74,7 +74,7 @@ namespace OpenSim.Services.UserAccountService
|
|||
if (dllName.Equals(String.Empty))
|
||||
throw new Exception("No StorageProvider configured");
|
||||
|
||||
m_Database = LoadPlugin<IUserGridData>(dllName, new Object[] { connString, realm });
|
||||
m_Database = LoadPlugin<IGridUserData>(dllName, new Object[] { connString, realm });
|
||||
if (m_Database == null)
|
||||
throw new Exception("Could not find a storage interface in the given module " + dllName);
|
||||
}
|
Loading…
Reference in New Issue