diff options
Diffstat (limited to '')
19 files changed, 288 insertions, 32 deletions
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index 3fd2fcf..81ef225 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs | |||
@@ -151,7 +151,10 @@ namespace OpenSim.Services.AssetService | |||
151 | public virtual string Store(AssetBase asset) | 151 | public virtual string Store(AssetBase asset) |
152 | { | 152 | { |
153 | //m_log.DebugFormat("[ASSET SERVICE]: Store asset {0} {1}", asset.Name, asset.ID); | 153 | //m_log.DebugFormat("[ASSET SERVICE]: Store asset {0} {1}", asset.Name, asset.ID); |
154 | m_Database.StoreAsset(asset); | 154 | if (!m_Database.StoreAsset(asset)) |
155 | { | ||
156 | return UUID.Zero.ToString(); | ||
157 | } | ||
155 | 158 | ||
156 | return asset.ID; | 159 | return asset.ID; |
157 | } | 160 | } |
diff --git a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs index edc1097..5980f0c 100644 --- a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs +++ b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs | |||
@@ -31,6 +31,8 @@ using log4net; | |||
31 | using Nini.Config; | 31 | using Nini.Config; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using OpenSim.Services.Base; | 33 | using OpenSim.Services.Base; |
34 | using OpenSim.Server.Base; | ||
35 | using OpenSim.Services.Interfaces; | ||
34 | using OpenSim.Data; | 36 | using OpenSim.Data; |
35 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
36 | 38 | ||
@@ -49,6 +51,12 @@ namespace OpenSim.Services.AuthenticationService | |||
49 | MethodBase.GetCurrentMethod().DeclaringType); | 51 | MethodBase.GetCurrentMethod().DeclaringType); |
50 | 52 | ||
51 | protected IAuthenticationData m_Database; | 53 | protected IAuthenticationData m_Database; |
54 | protected IUserAccountService m_UserAccountService = null; | ||
55 | |||
56 | public AuthenticationServiceBase(IConfigSource config, IUserAccountService acct) : this(config) | ||
57 | { | ||
58 | m_UserAccountService = acct; | ||
59 | } | ||
52 | 60 | ||
53 | public AuthenticationServiceBase(IConfigSource config) : base(config) | 61 | public AuthenticationServiceBase(IConfigSource config) : base(config) |
54 | { | 62 | { |
diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs index 17619ff..cf7496f 100644 --- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs | |||
@@ -51,6 +51,12 @@ namespace OpenSim.Services.AuthenticationService | |||
51 | LogManager.GetLogger( | 51 | LogManager.GetLogger( |
52 | MethodBase.GetCurrentMethod().DeclaringType); | 52 | MethodBase.GetCurrentMethod().DeclaringType); |
53 | 53 | ||
54 | public PasswordAuthenticationService(IConfigSource config, IUserAccountService userService) : | ||
55 | base(config, userService) | ||
56 | { | ||
57 | m_log.Debug("[AUTH SERVICE]: Started with User Account access"); | ||
58 | } | ||
59 | |||
54 | public PasswordAuthenticationService(IConfigSource config) : | 60 | public PasswordAuthenticationService(IConfigSource config) : |
55 | base(config) | 61 | base(config) |
56 | { | 62 | { |
@@ -58,28 +64,70 @@ namespace OpenSim.Services.AuthenticationService | |||
58 | 64 | ||
59 | public string Authenticate(UUID principalID, string password, int lifetime) | 65 | public string Authenticate(UUID principalID, string password, int lifetime) |
60 | { | 66 | { |
67 | m_log.DebugFormat("[AUTH SERVICE]: Authenticating for {0}, user account service present: {1}", principalID, m_UserAccountService != null); | ||
61 | AuthenticationData data = m_Database.Get(principalID); | 68 | AuthenticationData data = m_Database.Get(principalID); |
69 | UserAccount user = null; | ||
70 | if (m_UserAccountService != null) | ||
71 | user = m_UserAccountService.GetUserAccount(UUID.Zero, principalID); | ||
72 | |||
73 | if (data == null || data.Data == null) | ||
74 | { | ||
75 | m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID); | ||
76 | return String.Empty; | ||
77 | } | ||
78 | |||
79 | if (!data.Data.ContainsKey("passwordHash") || | ||
80 | !data.Data.ContainsKey("passwordSalt")) | ||
81 | { | ||
82 | return String.Empty; | ||
83 | } | ||
84 | |||
85 | string hashed = Util.Md5Hash(password + ":" + | ||
86 | data.Data["passwordSalt"].ToString()); | ||
87 | |||
88 | m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString()); | ||
62 | 89 | ||
63 | if (data != null && data.Data != null) | 90 | if (data.Data["passwordHash"].ToString() == hashed) |
64 | { | 91 | { |
65 | if (!data.Data.ContainsKey("passwordHash") || | 92 | return GetToken(principalID, lifetime); |
93 | } | ||
94 | |||
95 | if (user == null) | ||
96 | { | ||
97 | m_log.DebugFormat("[PASS AUTH]: No user record for {0}", principalID); | ||
98 | return String.Empty; | ||
99 | } | ||
100 | |||
101 | int impersonateFlag = 1 << 6; | ||
102 | |||
103 | if ((user.UserFlags & impersonateFlag) == 0) | ||
104 | return String.Empty; | ||
105 | |||
106 | List<UserAccount> accounts = m_UserAccountService.GetUserAccountsWhere(UUID.Zero, "UserLevel >= 200"); | ||
107 | if (accounts == null || accounts.Count == 0) | ||
108 | return String.Empty; | ||
109 | |||
110 | foreach (UserAccount a in accounts) | ||
111 | { | ||
112 | data = m_Database.Get(a.PrincipalID); | ||
113 | if (data == null || data.Data == null || | ||
114 | !data.Data.ContainsKey("passwordHash") || | ||
66 | !data.Data.ContainsKey("passwordSalt")) | 115 | !data.Data.ContainsKey("passwordSalt")) |
67 | { | 116 | { |
68 | return String.Empty; | 117 | continue; |
69 | } | 118 | } |
70 | 119 | ||
71 | string hashed = Util.Md5Hash(password + ":" + | 120 | hashed = Util.Md5Hash(password + ":" + |
72 | data.Data["passwordSalt"].ToString()); | 121 | data.Data["passwordSalt"].ToString()); |
73 | 122 | ||
74 | m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString()); | ||
75 | |||
76 | if (data.Data["passwordHash"].ToString() == hashed) | 123 | if (data.Data["passwordHash"].ToString() == hashed) |
77 | { | 124 | { |
125 | m_log.DebugFormat("[PASS AUTH]: {0} {1} impersonating {2}, proceeding with login", a.FirstName, a.LastName, principalID); | ||
78 | return GetToken(principalID, lifetime); | 126 | return GetToken(principalID, lifetime); |
79 | } | 127 | } |
80 | } | 128 | } |
81 | 129 | ||
82 | m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID); | 130 | m_log.DebugFormat("[PASS AUTH]: Impersonation of {0} failed", principalID); |
83 | return String.Empty; | 131 | return String.Empty; |
84 | } | 132 | } |
85 | } | 133 | } |
diff --git a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs index d1a5b0f..6d9aae3 100644 --- a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs | |||
@@ -47,6 +47,11 @@ namespace OpenSim.Services.AuthenticationService | |||
47 | // LogManager.GetLogger( | 47 | // LogManager.GetLogger( |
48 | // MethodBase.GetCurrentMethod().DeclaringType); | 48 | // MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | public WebkeyAuthenticationService(IConfigSource config, IUserAccountService userService) : | ||
51 | base(config, userService) | ||
52 | { | ||
53 | } | ||
54 | |||
50 | public WebkeyAuthenticationService(IConfigSource config) : | 55 | public WebkeyAuthenticationService(IConfigSource config) : |
51 | base(config) | 56 | base(config) |
52 | { | 57 | { |
diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index 65b3537..ad18a23 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | |||
@@ -30,6 +30,7 @@ using System; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Timers; | ||
33 | using Nini.Config; | 34 | using Nini.Config; |
34 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Console; | 36 | using OpenSim.Framework.Console; |
@@ -48,7 +49,9 @@ namespace OpenSim.Services.Connectors | |||
48 | 49 | ||
49 | private string m_ServerURI = String.Empty; | 50 | private string m_ServerURI = String.Empty; |
50 | private IImprovedAssetCache m_Cache = null; | 51 | private IImprovedAssetCache m_Cache = null; |
51 | 52 | private int m_retryCounter; | |
53 | private Dictionary<int, List<AssetBase>> m_retryQueue = new Dictionary<int, List<AssetBase>>(); | ||
54 | private Timer m_retryTimer; | ||
52 | public AssetServicesConnector() | 55 | public AssetServicesConnector() |
53 | { | 56 | { |
54 | } | 57 | } |
@@ -85,6 +88,55 @@ namespace OpenSim.Services.Connectors | |||
85 | MainConsole.Instance.Commands.AddCommand("asset", false, "dump asset", | 88 | MainConsole.Instance.Commands.AddCommand("asset", false, "dump asset", |
86 | "dump asset <id> <file>", | 89 | "dump asset <id> <file>", |
87 | "dump one cached asset", HandleDumpAsset); | 90 | "dump one cached asset", HandleDumpAsset); |
91 | |||
92 | m_retryTimer = new Timer(); | ||
93 | m_retryTimer.Elapsed += new ElapsedEventHandler(retryCheck); | ||
94 | m_retryTimer.Interval = 60000; | ||
95 | } | ||
96 | |||
97 | protected void retryCheck(object source, ElapsedEventArgs e) | ||
98 | { | ||
99 | m_retryCounter++; | ||
100 | if (m_retryCounter > 60) m_retryCounter -= 60; | ||
101 | List<int> keys = new List<int>(); | ||
102 | foreach (int a in m_retryQueue.Keys) | ||
103 | { | ||
104 | keys.Add(a); | ||
105 | } | ||
106 | foreach (int a in keys) | ||
107 | { | ||
108 | //We exponentially fall back on frequency until we reach one attempt per hour | ||
109 | //The net result is that we end up in the queue for roughly 24 hours.. | ||
110 | //24 hours worth of assets could be a lot, so the hope is that the region admin | ||
111 | //will have gotten the asset connector back online quickly! | ||
112 | |||
113 | int timefactor = a ^ 2; | ||
114 | if (timefactor > 60) | ||
115 | { | ||
116 | timefactor = 60; | ||
117 | } | ||
118 | |||
119 | //First, find out if we care about this timefactor | ||
120 | if (timefactor % a == 0) | ||
121 | { | ||
122 | //Yes, we do! | ||
123 | List<AssetBase> retrylist = m_retryQueue[a]; | ||
124 | m_retryQueue.Remove(a); | ||
125 | |||
126 | foreach(AssetBase ass in retrylist) | ||
127 | { | ||
128 | Store(ass); //Store my ass. This function will put it back in the dictionary if it fails | ||
129 | } | ||
130 | } | ||
131 | } | ||
132 | |||
133 | if (m_retryQueue.Count == 0) | ||
134 | { | ||
135 | //It might only be one tick per minute, but I have | ||
136 | //repented and abandoned my wasteful ways | ||
137 | m_retryCounter = 0; | ||
138 | m_retryTimer.Stop(); | ||
139 | } | ||
88 | } | 140 | } |
89 | 141 | ||
90 | protected void SetCache(IImprovedAssetCache cache) | 142 | protected void SetCache(IImprovedAssetCache cache) |
@@ -99,8 +151,8 @@ namespace OpenSim.Services.Connectors | |||
99 | AssetBase asset = null; | 151 | AssetBase asset = null; |
100 | if (m_Cache != null) | 152 | if (m_Cache != null) |
101 | asset = m_Cache.Get(id); | 153 | asset = m_Cache.Get(id); |
102 | 154 | ||
103 | if (asset == null) | 155 | if (asset == null || asset.Data == null || asset.Data.Length == 0) |
104 | { | 156 | { |
105 | asset = SynchronousRestObjectRequester. | 157 | asset = SynchronousRestObjectRequester. |
106 | MakeRequest<int, AssetBase>("GET", uri, 0); | 158 | MakeRequest<int, AssetBase>("GET", uri, 0); |
@@ -177,7 +229,7 @@ namespace OpenSim.Services.Connectors | |||
177 | if (m_Cache != null) | 229 | if (m_Cache != null) |
178 | asset = m_Cache.Get(id); | 230 | asset = m_Cache.Get(id); |
179 | 231 | ||
180 | if (asset == null) | 232 | if (asset == null || asset.Data == null || asset.Data.Length == 0) |
181 | { | 233 | { |
182 | bool result = false; | 234 | bool result = false; |
183 | 235 | ||
@@ -204,11 +256,10 @@ namespace OpenSim.Services.Connectors | |||
204 | 256 | ||
205 | public string Store(AssetBase asset) | 257 | public string Store(AssetBase asset) |
206 | { | 258 | { |
259 | if (m_Cache != null) | ||
260 | m_Cache.Cache(asset); | ||
207 | if (asset.Temporary || asset.Local) | 261 | if (asset.Temporary || asset.Local) |
208 | { | 262 | { |
209 | if (m_Cache != null) | ||
210 | m_Cache.Cache(asset); | ||
211 | |||
212 | return asset.ID; | 263 | return asset.ID; |
213 | } | 264 | } |
214 | 265 | ||
@@ -218,24 +269,57 @@ namespace OpenSim.Services.Connectors | |||
218 | try | 269 | try |
219 | { | 270 | { |
220 | newID = SynchronousRestObjectRequester. | 271 | newID = SynchronousRestObjectRequester. |
221 | MakeRequest<AssetBase, string>("POST", uri, asset); | 272 | MakeRequest<AssetBase, string>("POST", uri, asset, 25); |
273 | if (newID == null || newID == "") | ||
274 | { | ||
275 | newID = UUID.Zero.ToString(); | ||
276 | } | ||
222 | } | 277 | } |
223 | catch (Exception e) | 278 | catch (Exception e) |
224 | { | 279 | { |
225 | m_log.WarnFormat("[ASSET CONNECTOR]: Unable to send asset {0} to asset server. Reason: {1}", asset.ID, e.Message); | 280 | newID = UUID.Zero.ToString(); |
226 | } | 281 | } |
227 | 282 | ||
228 | if (newID != String.Empty) | 283 | if (newID == UUID.Zero.ToString()) |
229 | { | 284 | { |
230 | // Placing this here, so that this work with old asset servers that don't send any reply back | 285 | //The asset upload failed, put it in a queue for later |
231 | // SynchronousRestObjectRequester returns somethins that is not an empty string | 286 | asset.UploadAttempts++; |
232 | if (newID != null) | 287 | if (asset.UploadAttempts > 30) |
233 | asset.ID = newID; | 288 | { |
234 | 289 | //By this stage we've been in the queue for a good few hours; | |
235 | if (m_Cache != null) | 290 | //We're going to drop the asset. |
236 | m_Cache.Cache(asset); | 291 | m_log.ErrorFormat("[Assets] Dropping asset {0} - Upload has been in the queue for too long.", asset.ID.ToString()); |
292 | } | ||
293 | else | ||
294 | { | ||
295 | if (!m_retryQueue.ContainsKey(asset.UploadAttempts)) | ||
296 | { | ||
297 | m_retryQueue.Add(asset.UploadAttempts, new List<AssetBase>()); | ||
298 | } | ||
299 | List<AssetBase> m_queue = m_retryQueue[asset.UploadAttempts]; | ||
300 | m_queue.Add(asset); | ||
301 | m_log.WarnFormat("[Assets] Upload failed: {0} - Requeuing asset for another run.", asset.ID.ToString()); | ||
302 | m_retryTimer.Start(); | ||
303 | } | ||
304 | } | ||
305 | else | ||
306 | { | ||
307 | if (asset.UploadAttempts > 0) | ||
308 | { | ||
309 | m_log.InfoFormat("[Assets] Upload of {0} succeeded after {1} failed attempts", asset.ID.ToString(), asset.UploadAttempts.ToString()); | ||
310 | } | ||
311 | if (newID != String.Empty) | ||
312 | { | ||
313 | // Placing this here, so that this work with old asset servers that don't send any reply back | ||
314 | // SynchronousRestObjectRequester returns somethins that is not an empty string | ||
315 | if (newID != null) | ||
316 | asset.ID = newID; | ||
317 | |||
318 | if (m_Cache != null) | ||
319 | m_Cache.Cache(asset); | ||
320 | } | ||
237 | } | 321 | } |
238 | return newID; | 322 | return asset.ID; |
239 | } | 323 | } |
240 | 324 | ||
241 | public bool UpdateContent(string id, byte[] data) | 325 | public bool UpdateContent(string id, byte[] data) |
diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs index 4b25ac8..10499e2 100644 --- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs +++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs | |||
@@ -131,4 +131,4 @@ namespace OpenSim.Services.Connectors | |||
131 | return landData; | 131 | return landData; |
132 | } | 132 | } |
133 | } | 133 | } |
134 | } \ No newline at end of file | 134 | } |
diff --git a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs index 41ebeaf..f1c99ce 100644 --- a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs | |||
@@ -300,6 +300,17 @@ namespace OpenSim.Services.Connectors | |||
300 | { | 300 | { |
301 | pinfo = new PresenceInfo((Dictionary<string, object>)replyData["result"]); | 301 | pinfo = new PresenceInfo((Dictionary<string, object>)replyData["result"]); |
302 | } | 302 | } |
303 | else | ||
304 | { | ||
305 | if (replyData["result"].ToString() == "null") | ||
306 | return null; | ||
307 | |||
308 | m_log.DebugFormat("[PRESENCE CONNECTOR]: Invalid reply (result not dictionary) received from presence server when querying for sessionID {0}", sessionID.ToString()); | ||
309 | } | ||
310 | } | ||
311 | else | ||
312 | { | ||
313 | m_log.DebugFormat("[PRESENCE CONNECTOR]: Invalid reply received from presence server when querying for sessionID {0}", sessionID.ToString()); | ||
303 | } | 314 | } |
304 | 315 | ||
305 | return pinfo; | 316 | return pinfo; |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 8076fab..f86eba3 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | |||
@@ -135,6 +135,8 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
135 | 135 | ||
136 | public string RegisterRegion(UUID scopeID, GridRegion regionInfo) | 136 | public string RegisterRegion(UUID scopeID, GridRegion regionInfo) |
137 | { | 137 | { |
138 | IPEndPoint ext = regionInfo.ExternalEndPoint; | ||
139 | if (ext == null) return "Region registration for " + regionInfo.RegionName + " failed: Could not resolve EndPoint"; | ||
138 | // Generate and upload our map tile in PNG format to the SimianGrid AddMapTile service | 140 | // Generate and upload our map tile in PNG format to the SimianGrid AddMapTile service |
139 | Scene scene; | 141 | Scene scene; |
140 | if (m_scenes.TryGetValue(regionInfo.RegionID, out scene)) | 142 | if (m_scenes.TryGetValue(regionInfo.RegionID, out scene)) |
@@ -150,7 +152,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
150 | { "ServerURI", OSD.FromString(regionInfo.ServerURI) }, | 152 | { "ServerURI", OSD.FromString(regionInfo.ServerURI) }, |
151 | { "InternalAddress", OSD.FromString(regionInfo.InternalEndPoint.Address.ToString()) }, | 153 | { "InternalAddress", OSD.FromString(regionInfo.InternalEndPoint.Address.ToString()) }, |
152 | { "InternalPort", OSD.FromInteger(regionInfo.InternalEndPoint.Port) }, | 154 | { "InternalPort", OSD.FromInteger(regionInfo.InternalEndPoint.Port) }, |
153 | { "ExternalAddress", OSD.FromString(regionInfo.ExternalEndPoint.Address.ToString()) }, | 155 | { "ExternalAddress", OSD.FromString(ext.Address.ToString()) }, |
154 | { "ExternalPort", OSD.FromInteger(regionInfo.ExternalEndPoint.Port) }, | 156 | { "ExternalPort", OSD.FromInteger(regionInfo.ExternalEndPoint.Port) }, |
155 | { "MapTexture", OSD.FromUUID(regionInfo.TerrainImage) }, | 157 | { "MapTexture", OSD.FromUUID(regionInfo.TerrainImage) }, |
156 | { "Access", OSD.FromInteger(regionInfo.Access) }, | 158 | { "Access", OSD.FromInteger(regionInfo.Access) }, |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 9c150ee..394c2b7 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | |||
@@ -191,6 +191,11 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
191 | return accounts; | 191 | return accounts; |
192 | } | 192 | } |
193 | 193 | ||
194 | public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query) | ||
195 | { | ||
196 | return null; | ||
197 | } | ||
198 | |||
194 | public bool StoreUserAccount(UserAccount data) | 199 | public bool StoreUserAccount(UserAccount data) |
195 | { | 200 | { |
196 | m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name); | 201 | m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name); |
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 4e3cfa5..4382005 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -356,7 +356,9 @@ namespace OpenSim.Services.Connectors.Simulation | |||
356 | 356 | ||
357 | public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent) | 357 | public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent) |
358 | { | 358 | { |
359 | IPEndPoint ext = destination.ExternalEndPoint; | ||
359 | agent = null; | 360 | agent = null; |
361 | if (ext == null) return false; | ||
360 | // Eventually, we want to use a caps url instead of the agentID | 362 | // Eventually, we want to use a caps url instead of the agentID |
361 | string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; | 363 | string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; |
362 | 364 | ||
@@ -505,12 +507,14 @@ namespace OpenSim.Services.Connectors.Simulation | |||
505 | return true; | 507 | return true; |
506 | } | 508 | } |
507 | 509 | ||
508 | public bool CloseAgent(GridRegion destination, UUID id) | 510 | private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly) |
509 | { | 511 | { |
510 | string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; | 512 | string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; |
511 | 513 | ||
512 | WebRequest request = WebRequest.Create(uri); | 514 | WebRequest request = WebRequest.Create(uri); |
513 | request.Method = "DELETE"; | 515 | request.Method = "DELETE"; |
516 | if (ChildOnly) | ||
517 | request.Method += "CHILD"; | ||
514 | request.Timeout = 10000; | 518 | request.Timeout = 10000; |
515 | 519 | ||
516 | StreamReader sr = null; | 520 | StreamReader sr = null; |
@@ -543,6 +547,16 @@ namespace OpenSim.Services.Connectors.Simulation | |||
543 | return true; | 547 | return true; |
544 | } | 548 | } |
545 | 549 | ||
550 | public bool CloseChildAgent(GridRegion destination, UUID id) | ||
551 | { | ||
552 | return CloseAgent(destination, id, true); | ||
553 | } | ||
554 | |||
555 | public bool CloseAgent(GridRegion destination, UUID id) | ||
556 | { | ||
557 | return CloseAgent(destination, id, false); | ||
558 | } | ||
559 | |||
546 | #endregion Agents | 560 | #endregion Agents |
547 | 561 | ||
548 | #region Objects | 562 | #region Objects |
@@ -554,6 +568,8 @@ namespace OpenSim.Services.Connectors.Simulation | |||
554 | 568 | ||
555 | public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) | 569 | public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) |
556 | { | 570 | { |
571 | IPEndPoint ext = destination.ExternalEndPoint; | ||
572 | if (ext == null) return false; | ||
557 | string uri | 573 | string uri |
558 | = destination.ServerURI + ObjectPath() + sog.UUID + "/"; | 574 | = destination.ServerURI + ObjectPath() + sog.UUID + "/"; |
559 | //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); | 575 | //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); |
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs index 2a5df83..205a4aa 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs | |||
@@ -187,6 +187,11 @@ namespace OpenSim.Services.Connectors | |||
187 | return accounts; | 187 | return accounts; |
188 | } | 188 | } |
189 | 189 | ||
190 | public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where) | ||
191 | { | ||
192 | return null; // Not implemented for regions | ||
193 | } | ||
194 | |||
190 | public virtual bool StoreUserAccount(UserAccount data) | 195 | public virtual bool StoreUserAccount(UserAccount data) |
191 | { | 196 | { |
192 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | 197 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
diff --git a/OpenSim/Services/HypergridService/UserAccountCache.cs b/OpenSim/Services/HypergridService/UserAccountCache.cs index 3e9aea1..c431060 100644 --- a/OpenSim/Services/HypergridService/UserAccountCache.cs +++ b/OpenSim/Services/HypergridService/UserAccountCache.cs | |||
@@ -89,6 +89,11 @@ namespace OpenSim.Services.HypergridService | |||
89 | return null; | 89 | return null; |
90 | } | 90 | } |
91 | 91 | ||
92 | public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query) | ||
93 | { | ||
94 | return null; | ||
95 | } | ||
96 | |||
92 | public List<UserAccount> GetUserAccounts(UUID scopeID, string query) | 97 | public List<UserAccount> GetUserAccounts(UUID scopeID, string query) |
93 | { | 98 | { |
94 | return null; | 99 | return null; |
diff --git a/OpenSim/Services/Interfaces/IAttachmentsService.cs b/OpenSim/Services/Interfaces/IAttachmentsService.cs new file mode 100644 index 0000000..bdde369 --- /dev/null +++ b/OpenSim/Services/Interfaces/IAttachmentsService.cs | |||
@@ -0,0 +1,17 @@ | |||
1 | //////////////////////////////////////////////////////////////// | ||
2 | // | ||
3 | // (c) 2009, 2010 Careminster Limited and Melanie Thielker | ||
4 | // | ||
5 | // All rights reserved | ||
6 | // | ||
7 | using System; | ||
8 | using Nini.Config; | ||
9 | |||
10 | namespace OpenSim.Services.Interfaces | ||
11 | { | ||
12 | public interface IAttachmentsService | ||
13 | { | ||
14 | string Get(string id); | ||
15 | void Store(string id, string data); | ||
16 | } | ||
17 | } | ||
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index a34f0be..f569fc8 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs | |||
@@ -300,9 +300,13 @@ namespace OpenSim.Services.Interfaces | |||
300 | } | 300 | } |
301 | catch (SocketException e) | 301 | catch (SocketException e) |
302 | { | 302 | { |
303 | throw new Exception( | 303 | /*throw new Exception( |
304 | "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + | 304 | "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + |
305 | e + "' attached to this exception", e); | 305 | e + "' attached to this exception", e);*/ |
306 | // Don't throw a fatal exception here, instead, return Null and handle it in the caller. | ||
307 | // Reason is, on systems such as OSgrid it has occured that known hostnames stop | ||
308 | // resolving and thus make surrounding regions crash out with this exception. | ||
309 | return null; | ||
306 | } | 310 | } |
307 | 311 | ||
308 | return new IPEndPoint(ia, m_internalEndPoint.Port); | 312 | return new IPEndPoint(ia, m_internalEndPoint.Port); |
@@ -360,6 +364,12 @@ namespace OpenSim.Services.Interfaces | |||
360 | if (kvp.ContainsKey("regionName")) | 364 | if (kvp.ContainsKey("regionName")) |
361 | RegionName = (string)kvp["regionName"]; | 365 | RegionName = (string)kvp["regionName"]; |
362 | 366 | ||
367 | if (kvp.ContainsKey("access")) | ||
368 | { | ||
369 | byte access = Convert.ToByte((string)kvp["access"]); | ||
370 | Maturity = (int)Util.ConvertAccessLevelToMaturity(access); | ||
371 | } | ||
372 | |||
363 | if (kvp.ContainsKey("serverIP")) | 373 | if (kvp.ContainsKey("serverIP")) |
364 | { | 374 | { |
365 | //int port = 0; | 375 | //int port = 0; |
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 12e8982..1f8474c 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs | |||
@@ -73,6 +73,14 @@ namespace OpenSim.Services.Interfaces | |||
73 | bool ReleaseAgent(UUID originRegion, UUID id, string uri); | 73 | bool ReleaseAgent(UUID originRegion, UUID id, string uri); |
74 | 74 | ||
75 | /// <summary> | 75 | /// <summary> |
76 | /// Close child agent. | ||
77 | /// </summary> | ||
78 | /// <param name="regionHandle"></param> | ||
79 | /// <param name="id"></param> | ||
80 | /// <returns></returns> | ||
81 | bool CloseChildAgent(GridRegion destination, UUID id); | ||
82 | |||
83 | /// <summary> | ||
76 | /// Close agent. | 84 | /// Close agent. |
77 | /// </summary> | 85 | /// </summary> |
78 | /// <param name="regionHandle"></param> | 86 | /// <param name="regionHandle"></param> |
diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index 9c992e0..80258d6 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs | |||
@@ -150,6 +150,7 @@ namespace OpenSim.Services.Interfaces | |||
150 | /// <param name="query"></param> | 150 | /// <param name="query"></param> |
151 | /// <returns></returns> | 151 | /// <returns></returns> |
152 | List<UserAccount> GetUserAccounts(UUID scopeID, string query); | 152 | List<UserAccount> GetUserAccounts(UUID scopeID, string query); |
153 | List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where); | ||
153 | 154 | ||
154 | /// <summary> | 155 | /// <summary> |
155 | /// Store the data given, wich replaces the stored data, therefore must be complete. | 156 | /// Store the data given, wich replaces the stored data, therefore must be complete. |
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index f985ab2..e98cc22 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -56,6 +56,7 @@ namespace OpenSim.Services.LLLoginService | |||
56 | public static LLFailedLoginResponse InventoryProblem; | 56 | public static LLFailedLoginResponse InventoryProblem; |
57 | public static LLFailedLoginResponse DeadRegionProblem; | 57 | public static LLFailedLoginResponse DeadRegionProblem; |
58 | public static LLFailedLoginResponse LoginBlockedProblem; | 58 | public static LLFailedLoginResponse LoginBlockedProblem; |
59 | public static LLFailedLoginResponse UnverifiedAccountProblem; | ||
59 | public static LLFailedLoginResponse AlreadyLoggedInProblem; | 60 | public static LLFailedLoginResponse AlreadyLoggedInProblem; |
60 | public static LLFailedLoginResponse InternalError; | 61 | public static LLFailedLoginResponse InternalError; |
61 | 62 | ||
@@ -76,6 +77,10 @@ namespace OpenSim.Services.LLLoginService | |||
76 | LoginBlockedProblem = new LLFailedLoginResponse("presence", | 77 | LoginBlockedProblem = new LLFailedLoginResponse("presence", |
77 | "Logins are currently restricted. Please try again later.", | 78 | "Logins are currently restricted. Please try again later.", |
78 | "false"); | 79 | "false"); |
80 | UnverifiedAccountProblem = new LLFailedLoginResponse("presence", | ||
81 | "Your account has not yet been verified. Please check " + | ||
82 | "your email and click the provided link.", | ||
83 | "false"); | ||
79 | AlreadyLoggedInProblem = new LLFailedLoginResponse("presence", | 84 | AlreadyLoggedInProblem = new LLFailedLoginResponse("presence", |
80 | "You appear to be already logged in. " + | 85 | "You appear to be already logged in. " + |
81 | "If this is not the case please wait for your session to timeout. " + | 86 | "If this is not the case please wait for your session to timeout. " + |
@@ -325,6 +330,7 @@ namespace OpenSim.Services.LLLoginService | |||
325 | private void FillOutRegionData(GridRegion destination) | 330 | private void FillOutRegionData(GridRegion destination) |
326 | { | 331 | { |
327 | IPEndPoint endPoint = destination.ExternalEndPoint; | 332 | IPEndPoint endPoint = destination.ExternalEndPoint; |
333 | if (endPoint == null) return; | ||
328 | SimAddress = endPoint.Address.ToString(); | 334 | SimAddress = endPoint.Address.ToString(); |
329 | SimPort = (uint)endPoint.Port; | 335 | SimPort = (uint)endPoint.Port; |
330 | RegionX = (uint)destination.RegionLocX; | 336 | RegionX = (uint)destination.RegionLocX; |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 281b6e3..93e4a8f 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -113,7 +113,8 @@ namespace OpenSim.Services.LLLoginService | |||
113 | Object[] args = new Object[] { config }; | 113 | Object[] args = new Object[] { config }; |
114 | m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); | 114 | m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); |
115 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); | 115 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); |
116 | m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args); | 116 | Object[] authArgs = new Object[] { config, m_UserAccountService }; |
117 | m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, authArgs); | ||
117 | m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args); | 118 | m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args); |
118 | 119 | ||
119 | if (gridService != string.Empty) | 120 | if (gridService != string.Empty) |
@@ -229,6 +230,12 @@ namespace OpenSim.Services.LLLoginService | |||
229 | return LLFailedLoginResponse.UserProblem; | 230 | return LLFailedLoginResponse.UserProblem; |
230 | } | 231 | } |
231 | 232 | ||
233 | if (account.UserLevel < 0) | ||
234 | { | ||
235 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: Unverified account"); | ||
236 | return LLFailedLoginResponse.UnverifiedAccountProblem; | ||
237 | } | ||
238 | |||
232 | if (account.UserLevel < m_MinLoginLevel) | 239 | if (account.UserLevel < m_MinLoginLevel) |
233 | { | 240 | { |
234 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: login is blocked for user level {0}", account.UserLevel); | 241 | m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: login is blocked for user level {0}", account.UserLevel); |
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index f376cf8..de6d32c 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -282,6 +282,21 @@ namespace OpenSim.Services.UserAccountService | |||
282 | return ret; | 282 | return ret; |
283 | } | 283 | } |
284 | 284 | ||
285 | public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string where) | ||
286 | { | ||
287 | UserAccountData[] d = m_Database.GetUsersWhere(scopeID, where); | ||
288 | |||
289 | if (d == null) | ||
290 | return new List<UserAccount>(); | ||
291 | |||
292 | List<UserAccount> ret = new List<UserAccount>(); | ||
293 | |||
294 | foreach (UserAccountData data in d) | ||
295 | ret.Add(MakeUserAccount(data)); | ||
296 | |||
297 | return ret; | ||
298 | } | ||
299 | |||
285 | #endregion | 300 | #endregion |
286 | 301 | ||
287 | #region Console commands | 302 | #region Console commands |