diff options
author | Justin Clarke Casey | 2009-04-22 22:19:43 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-04-22 22:19:43 +0000 |
commit | 342126b7b9ca386f9160daecb51ecc14487a5f9f (patch) | |
tree | a485a50aebead411fa2f38528b4c0b7ba19e91db /OpenSim/Framework/Communications/UserManagerBase.cs | |
parent | * Resolve http://opensimulator.org/mantis/view.php?id=3509 by passing up the ... (diff) | |
download | opensim-SC_OLD-342126b7b9ca386f9160daecb51ecc14487a5f9f.zip opensim-SC_OLD-342126b7b9ca386f9160daecb51ecc14487a5f9f.tar.gz opensim-SC_OLD-342126b7b9ca386f9160daecb51ecc14487a5f9f.tar.bz2 opensim-SC_OLD-342126b7b9ca386f9160daecb51ecc14487a5f9f.tar.xz |
* Resolve http://opensimulator.org/mantis/view.php?id=3509 by putting some service initialization into CommsManager
* What is really needed is a plugin and interface request system as being done for region modules
Diffstat (limited to 'OpenSim/Framework/Communications/UserManagerBase.cs')
-rw-r--r-- | OpenSim/Framework/Communications/UserManagerBase.cs | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index a269b59..2d0bf63 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -35,6 +35,7 @@ using Nwc.XmlRpc; | |||
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenMetaverse.StructuredData; | 36 | using OpenMetaverse.StructuredData; |
37 | using OpenSim.Data; | 37 | using OpenSim.Data; |
38 | using OpenSim.Framework.Communications; | ||
38 | using OpenSim.Framework.Statistics; | 39 | using OpenSim.Framework.Statistics; |
39 | 40 | ||
40 | namespace OpenSim.Framework.Communications | 41 | namespace OpenSim.Framework.Communications |
@@ -52,15 +53,15 @@ namespace OpenSim.Framework.Communications | |||
52 | /// </value> | 53 | /// </value> |
53 | private List<IUserDataPlugin> m_plugins = new List<IUserDataPlugin>(); | 54 | private List<IUserDataPlugin> m_plugins = new List<IUserDataPlugin>(); |
54 | 55 | ||
55 | protected IInterServiceInventoryServices m_interServiceInventoryService; | 56 | protected CommunicationsManager m_commsManager; |
56 | 57 | ||
57 | /// <summary> | 58 | /// <summary> |
58 | /// Constructor | 59 | /// Constructor |
59 | /// </summary> | 60 | /// </summary> |
60 | /// <param name="interServiceInventoryService"></param> | 61 | /// <param name="commsManager"></param> |
61 | public UserManagerBase(IInterServiceInventoryServices interServiceInventoryService) | 62 | public UserManagerBase(CommunicationsManager commsManager) |
62 | { | 63 | { |
63 | m_interServiceInventoryService = interServiceInventoryService; | 64 | m_commsManager = commsManager; |
64 | } | 65 | } |
65 | 66 | ||
66 | /// <summary> | 67 | /// <summary> |
@@ -296,48 +297,48 @@ namespace OpenSim.Framework.Communications | |||
296 | return null; | 297 | return null; |
297 | } | 298 | } |
298 | 299 | ||
299 | /// <summary> | ||
300 | /// Loads a user's friend list | ||
301 | /// </summary> | ||
302 | /// <param name="name">the UUID of the friend list owner</param> | ||
303 | /// <returns>A List of FriendListItems that contains info about the user's friends</returns> | ||
304 | public virtual List<FriendListItem> GetUserFriendList(UUID ownerID) | 300 | public virtual List<FriendListItem> GetUserFriendList(UUID ownerID) |
305 | { | 301 | { |
302 | List<FriendListItem> allFriends = new List<FriendListItem>(); | ||
303 | |||
306 | foreach (IUserDataPlugin plugin in m_plugins) | 304 | foreach (IUserDataPlugin plugin in m_plugins) |
307 | { | 305 | { |
308 | try | 306 | try |
309 | { | 307 | { |
310 | List<FriendListItem> result = plugin.GetUserFriendList(ownerID); | 308 | List<FriendListItem> friends = plugin.GetUserFriendList(ownerID); |
311 | 309 | ||
312 | if (result != null) | 310 | if (friends != null) |
313 | return result; | 311 | allFriends.AddRange(friends); |
314 | } | 312 | } |
315 | catch (Exception e) | 313 | catch (Exception e) |
316 | { | 314 | { |
317 | m_log.Info("[USERSTORAGE]: Unable to GetUserFriendList via " + plugin.Name + "(" + e.ToString() + ")"); | 315 | m_log.Error("[USERSTORAGE]: Unable to GetUserFriendList via " + plugin.Name + "(" + e.ToString() + ")"); |
318 | } | 316 | } |
319 | } | 317 | } |
320 | 318 | ||
321 | return null; | 319 | return allFriends; |
322 | } | 320 | } |
323 | 321 | ||
324 | public virtual Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos (List<UUID> uuids) | 322 | public virtual Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos (List<UUID> uuids) |
325 | { | 323 | { |
324 | //Dictionary<UUID, FriendRegionInfo> allFriendRegions = new Dictionary<UUID, FriendRegionInfo>(); | ||
325 | |||
326 | foreach (IUserDataPlugin plugin in m_plugins) | 326 | foreach (IUserDataPlugin plugin in m_plugins) |
327 | { | 327 | { |
328 | try | 328 | try |
329 | { | 329 | { |
330 | Dictionary<UUID, FriendRegionInfo> result = plugin.GetFriendRegionInfos(uuids); | 330 | Dictionary<UUID, FriendRegionInfo> friendRegions = plugin.GetFriendRegionInfos(uuids); |
331 | 331 | ||
332 | if (result != null) | 332 | if (friendRegions != null) |
333 | return result; | 333 | return friendRegions; |
334 | } | 334 | } |
335 | catch (Exception e) | 335 | catch (Exception e) |
336 | { | 336 | { |
337 | m_log.Info("[USERSTORAGE]: Unable to GetFriendRegionInfos via " + plugin.Name + "(" + e.ToString() + ")"); | 337 | m_log.Info("[USERSTORAGE]: Unable to GetFriendRegionInfos via " + plugin.Name + "(" + e.ToString() + ")"); |
338 | } | 338 | } |
339 | } | 339 | } |
340 | return null; | 340 | |
341 | return new Dictionary<UUID, FriendRegionInfo>(); | ||
341 | } | 342 | } |
342 | 343 | ||
343 | public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) | 344 | public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) |
@@ -662,7 +663,7 @@ namespace OpenSim.Framework.Communications | |||
662 | } | 663 | } |
663 | else | 664 | else |
664 | { | 665 | { |
665 | m_interServiceInventoryService.CreateNewUserInventory(userProf.ID); | 666 | m_commsManager.InterServiceInventoryService.CreateNewUserInventory(userProf.ID); |
666 | 667 | ||
667 | return userProf.ID; | 668 | return userProf.ID; |
668 | } | 669 | } |
@@ -731,13 +732,17 @@ namespace OpenSim.Framework.Communications | |||
731 | { | 732 | { |
732 | try | 733 | try |
733 | { | 734 | { |
734 | return plugin.GetUserAppearance(user); | 735 | AvatarAppearance appearance = plugin.GetUserAppearance(user); |
736 | |||
737 | if (appearance != null) | ||
738 | return appearance; | ||
735 | } | 739 | } |
736 | catch (Exception e) | 740 | catch (Exception e) |
737 | { | 741 | { |
738 | m_log.InfoFormat("[USERSTORAGE]: Unable to find user appearance {0} via {1} ({2})", user.ToString(), plugin.Name, e.ToString()); | 742 | m_log.InfoFormat("[USERSTORAGE]: Unable to find user appearance {0} via {1} ({2})", user.ToString(), plugin.Name, e.ToString()); |
739 | } | 743 | } |
740 | } | 744 | } |
745 | |||
741 | return null; | 746 | return null; |
742 | } | 747 | } |
743 | 748 | ||