29 using System.Collections.Generic;
30 using System.Reflection;
34 using OpenSim.Region.Framework.Interfaces;
35 using OpenSim.Region.Framework.Scenes;
36 using OpenSim.Server.Base;
37 using OpenSim.Services.Interfaces;
41 namespace OpenSim.
Region.CoreModules.ServiceConnectorsOut.GridUser
43 [Extension(Path =
"/OpenSim/RegionModules", NodeName =
"RegionModule", Id =
"LocalGridUserServicesConnector")]
46 private static readonly ILog m_log =
48 MethodBase.GetCurrentMethod().DeclaringType);
54 private bool m_Enabled =
false;
56 #region ISharedRegionModule
58 public Type ReplaceableInterface
65 get {
return "LocalGridUserServicesConnector"; }
70 IConfig moduleConfig = source.Configs[
"Modules"];
71 if (moduleConfig != null)
73 string name = moduleConfig.GetString(
"GridUserServices",
"");
76 IConfig userConfig = source.Configs[
"GridUserService"];
77 if (userConfig == null)
79 m_log.Error(
"[LOCAL GRID USER SERVICE CONNECTOR]: GridUserService missing from OpenSim.ini");
83 string serviceDll = userConfig.GetString(
"LocalServiceModule", String.Empty);
85 if (serviceDll ==
String.Empty)
87 m_log.Error(
"[LOCAL GRID USER SERVICE CONNECTOR]: No LocalServiceModule named in section GridUserService");
92 m_GridUserService = ServerUtils.LoadPlugin<
IGridUserService>(serviceDll, args);
94 if (m_GridUserService == null)
97 "[LOCAL GRID USER SERVICE CONNECTOR]: Cannot load user account service specified as {0}", serviceDll);
105 m_log.Info(
"[LOCAL GRID USER SERVICE CONNECTOR]: Local grid user connector enabled");
128 m_ActivityDetector.AddRegion(scene);
137 m_ActivityDetector.RemoveRegion(scene);
145 m_log.InfoFormat(
"[LOCAL GRID USER SERVICE CONNECTOR]: Enabled local grid user for region {0}", scene.RegionInfo.RegionName);
150 #region IGridUserService
154 return m_GridUserService.LoggedIn(userID);
157 public bool LoggedOut(
string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt)
159 return m_GridUserService.LoggedOut(userID, sessionID, regionID, lastPosition, lastLookAt);
162 public bool SetHome(
string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt)
164 return m_GridUserService.SetHome(userID, homeID, homePosition, homeLookAt);
167 public bool SetLastPosition(
string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt)
169 return m_GridUserService.SetLastPosition(userID, sessionID, regionID, lastPosition, lastLookAt);
174 return m_GridUserService.GetGridUserInfo(userID);
178 return m_GridUserService.GetGridUserInfo(userID);
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt)
Informs the grid that a user is logged out and to remove any session data for them ...
Records user information specific to a grid but which is not part of a user's account.
bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt)
Stores the last known user position at the grid level
GridUserInfo LoggedIn(string userID)
bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt)
GridUserInfo[] GetGridUserInfo(string[] userID)
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
GridUserInfo GetGridUserInfo(string userID)
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
void Initialise(IConfigSource source)
This is called to initialize the region module. For shared modules, this is called exactly once...