diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs | 69 |
1 files changed, 54 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs index d5fae23..d914a57 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs | |||
@@ -41,13 +41,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
41 | { | 41 | { |
42 | public class LocalGridUserServicesConnector : ISharedRegionModule, IGridUserService | 42 | public class LocalGridUserServicesConnector : ISharedRegionModule, IGridUserService |
43 | { | 43 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | private static readonly ILog m_log = |
45 | LogManager.GetLogger( | ||
46 | MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | 47 | ||
46 | private IGridUserService m_service; | 48 | private IGridUserService m_GridUserService; |
49 | |||
50 | private ActivityDetector m_ActivityDetector; | ||
47 | 51 | ||
48 | private bool m_Enabled = false; | 52 | private bool m_Enabled = false; |
49 | 53 | ||
50 | public Type ReplaceableInterface | 54 | #region ISharedRegionModule |
55 | |||
56 | public Type ReplaceableInterface | ||
51 | { | 57 | { |
52 | get { return null; } | 58 | get { return null; } |
53 | } | 59 | } |
@@ -68,7 +74,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
68 | IConfig userConfig = source.Configs["GridUserService"]; | 74 | IConfig userConfig = source.Configs["GridUserService"]; |
69 | if (userConfig == null) | 75 | if (userConfig == null) |
70 | { | 76 | { |
71 | m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: GridUserService missing from ini files"); | 77 | m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: GridUserService missing from OpenSim.ini"); |
72 | return; | 78 | return; |
73 | } | 79 | } |
74 | 80 | ||
@@ -81,15 +87,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
81 | } | 87 | } |
82 | 88 | ||
83 | Object[] args = new Object[] { source }; | 89 | Object[] args = new Object[] { source }; |
84 | m_service = ServerUtils.LoadPlugin<IGridUserService>(serviceDll, args); | 90 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(serviceDll, args); |
85 | 91 | ||
86 | if (m_service == null) | 92 | if (m_GridUserService == null) |
87 | { | 93 | { |
88 | m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: Can't load GridUser service"); | 94 | m_log.ErrorFormat( |
95 | "[LOCAL GRID USER SERVICE CONNECTOR]: Cannot load user account service specified as {0}", serviceDll); | ||
89 | return; | 96 | return; |
90 | } | 97 | } |
98 | |||
99 | m_ActivityDetector = new ActivityDetector(this); | ||
100 | |||
91 | m_Enabled = true; | 101 | m_Enabled = true; |
92 | m_log.Info("[LOCAL GRID USER SERVICE CONNECTOR]: Local GridUser connector enabled"); | 102 | |
103 | m_log.Info("[LOCAL GRID USER SERVICE CONNECTOR]: Local grid user connector enabled"); | ||
93 | } | 104 | } |
94 | } | 105 | } |
95 | } | 106 | } |
@@ -111,29 +122,57 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
111 | if (!m_Enabled) | 122 | if (!m_Enabled) |
112 | return; | 123 | return; |
113 | 124 | ||
114 | scene.RegisterModuleInterface<IGridUserService>(m_service); | 125 | scene.RegisterModuleInterface<IGridUserService>(m_GridUserService); |
126 | m_ActivityDetector.AddRegion(scene); | ||
115 | } | 127 | } |
116 | 128 | ||
117 | public void RemoveRegion(Scene scene) | 129 | public void RemoveRegion(Scene scene) |
118 | { | 130 | { |
119 | if (!m_Enabled) | 131 | if (!m_Enabled) |
120 | return; | 132 | return; |
133 | |||
134 | scene.UnregisterModuleInterface<IGridUserService>(this); | ||
135 | m_ActivityDetector.RemoveRegion(scene); | ||
121 | } | 136 | } |
122 | 137 | ||
123 | public void RegionLoaded(Scene scene) | 138 | public void RegionLoaded(Scene scene) |
124 | { | 139 | { |
125 | if (!m_Enabled) | 140 | if (!m_Enabled) |
126 | return; | 141 | return; |
142 | |||
143 | m_log.InfoFormat("[LOCAL GRID USER SERVICE CONNECTOR]: Enabled local grid user for region {0}", scene.RegionInfo.RegionName); | ||
127 | } | 144 | } |
128 | 145 | ||
129 | public GridUserInfo GetGridUserInfo(string userID) | 146 | #endregion |
147 | |||
148 | #region IGridUserService | ||
149 | |||
150 | public GridUserInfo LoggedIn(string userID) | ||
130 | { | 151 | { |
131 | return m_service.GetGridUserInfo(userID); | 152 | return m_GridUserService.LoggedIn(userID); |
132 | } | 153 | } |
133 | 154 | ||
134 | public bool StoreGridUserInfo(GridUserInfo info) | 155 | public bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) |
135 | { | 156 | { |
136 | return m_service.StoreGridUserInfo(info); | 157 | return m_GridUserService.LoggedOut(userID, regionID, lastPosition, lastLookAt); |
137 | } | 158 | } |
159 | |||
160 | public bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt) | ||
161 | { | ||
162 | return m_GridUserService.SetHome(userID, homeID, homePosition, homeLookAt); | ||
163 | } | ||
164 | |||
165 | public bool SetLastPosition(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) | ||
166 | { | ||
167 | return m_GridUserService.SetLastPosition(userID, regionID, lastPosition, lastLookAt); | ||
168 | } | ||
169 | |||
170 | public GridUserInfo GetGridUserInfo(string userID) | ||
171 | { | ||
172 | return m_GridUserService.GetGridUserInfo(userID); | ||
173 | } | ||
174 | |||
175 | #endregion | ||
176 | |||
138 | } | 177 | } |
139 | } \ No newline at end of file | 178 | } |