TemporaryUserProfilePlugin.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Collections.Generic;
  29. using System.Reflection;
  30. using log4net;
  31. using OpenMetaverse;
  32. using OpenSim.Data;
  33. namespace OpenSim.Framework.Communications
  34. {
  35. /// <summary>
  36. /// Plugin for managing temporary user profiles.
  37. /// </summary>
  38. public class TemporaryUserProfilePlugin : IUserDataPlugin
  39. {
  40. //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  41. protected Dictionary<UUID, UserProfileData> m_profiles = new Dictionary<UUID, UserProfileData>();
  42. public string Name { get { return "TemporaryUserProfilePlugin"; } }
  43. public string Version { get { return "0.1"; } }
  44. public void Initialise() {}
  45. public void Initialise(string connect) {}
  46. public void Dispose() {}
  47. public UserProfileData GetUserByUUID(UUID user)
  48. {
  49. //m_log.DebugFormat("[TEMP USER PROFILE]: Received request for {0}", user);
  50. lock (m_profiles)
  51. {
  52. if (m_profiles.ContainsKey(user))
  53. return m_profiles[user];
  54. else
  55. return null;
  56. }
  57. }
  58. public UserProfileData GetUserByName(string fname, string lname)
  59. {
  60. // We deliberately don't look up a temporary profile by name so that we don't obscure non-temporary
  61. // profiles.
  62. return null;
  63. }
  64. public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
  65. {
  66. //m_log.DebugFormat("[TEMP USER PROFILE]: Adding {0} {1}", userProfile.Name, userProfile.ID);
  67. lock (m_profiles)
  68. {
  69. m_profiles[userProfile.ID] = userProfile;
  70. }
  71. }
  72. public UserProfileData GetUserByUri(Uri uri) { return null; }
  73. public List<AvatarPickerAvatar> GeneratePickerResults(UUID queryID, string query) { return null; }
  74. public UserAgentData GetAgentByUUID(UUID user) { return null; }
  75. public UserAgentData GetAgentByName(string name) { return null; }
  76. public UserAgentData GetAgentByName(string fname, string lname) { return null; }
  77. public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) {}
  78. public void AddNewUserProfile(UserProfileData user) {}
  79. public bool UpdateUserProfile(UserProfileData user) { return false; }
  80. public void AddNewUserAgent(UserAgentData agent) {}
  81. public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) {}
  82. public void RemoveUserFriend(UUID friendlistowner, UUID friend) {}
  83. public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) {}
  84. public List<FriendListItem> GetUserFriendList(UUID friendlistowner) { return null; }
  85. public Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos(List<UUID> uuids) { return null; }
  86. public bool MoneyTransferRequest(UUID from, UUID to, uint amount) { return false; }
  87. public bool InventoryTransferRequest(UUID from, UUID to, UUID inventory) { return false; }
  88. public AvatarAppearance GetUserAppearance(UUID user) { return null; }
  89. public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) {}
  90. public void ResetAttachments(UUID userID) {}
  91. public void LogoutUsers(UUID regionID) {}
  92. }
  93. }