IUserService.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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 OpenSim 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.Collections.Generic;
  28. using OpenMetaverse;
  29. namespace OpenSim.Framework.Communications
  30. {
  31. public interface IUserService
  32. {
  33. /// <summary>
  34. /// Loads a user profile by name
  35. /// </summary>
  36. /// <param name="firstName">First name</param>
  37. /// <param name="lastName">Last name</param>
  38. /// <returns>A user profile. Returns null if no profile is found</returns>
  39. UserProfileData GetUserProfile(string firstName, string lastName);
  40. /// <summary>
  41. /// Loads a user profile from a database by UUID
  42. /// </summary>
  43. /// <param name="userId">The target UUID</param>
  44. /// <returns>A user profile. Returns null if no user profile is found.</returns>
  45. UserProfileData GetUserProfile(UUID userId);
  46. UserAgentData GetAgentByUUID(UUID userId);
  47. void ClearUserAgent(UUID avatarID);
  48. List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID QueryID, string Query);
  49. UserProfileData SetupMasterUser(string firstName, string lastName);
  50. UserProfileData SetupMasterUser(string firstName, string lastName, string password);
  51. UserProfileData SetupMasterUser(UUID userId);
  52. /// <summary>
  53. /// Update the user's profile.
  54. /// </summary>
  55. /// <param name="data">UserProfileData object with updated data. Should be obtained
  56. /// via a call to GetUserProfile().</param>
  57. /// <returns>true if the update could be applied, false if it could not be applied.</returns>
  58. bool UpdateUserProfile(UserProfileData data);
  59. /// <summary>
  60. /// Adds a new friend to the database for XUser
  61. /// </summary>
  62. /// <param name="friendlistowner">The agent that who's friends list is being added to</param>
  63. /// <param name="friend">The agent that being added to the friends list of the friends list owner</param>
  64. /// <param name="perms">A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects </param>
  65. void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms);
  66. /// <summary>
  67. /// Delete friend on friendlistowner's friendlist.
  68. /// </summary>
  69. /// <param name="friendlistowner">The agent that who's friends list is being updated</param>
  70. /// <param name="friend">The Ex-friend agent</param>
  71. void RemoveUserFriend(UUID friendlistowner, UUID friend);
  72. /// <summary>
  73. /// Update permissions for friend on friendlistowner's friendlist.
  74. /// </summary>
  75. /// <param name="friendlistowner">The agent that who's friends list is being updated</param>
  76. /// <param name="friend">The agent that is getting or loosing permissions</param>
  77. /// <param name="perms">A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects </param>
  78. void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms);
  79. /// <summary>
  80. /// Logs off a user on the user server
  81. /// </summary>
  82. /// <param name="userid">UUID of the user</param>
  83. /// <param name="regionid">UUID of the Region</param>
  84. /// <param name="regionhandle">regionhandle</param>
  85. /// <param name="position">final position</param>
  86. /// <param name="lookat">final lookat</param>
  87. void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat);
  88. /// <summary>
  89. /// Logs off a user on the user server (deprecated as of 2008-08-27)
  90. /// </summary>
  91. /// <param name="userid">UUID of the user</param>
  92. /// <param name="regionid">UUID of the Region</param>
  93. /// <param name="regionhandle">regionhandle</param>
  94. /// <param name="posx">final position x</param>
  95. /// <param name="posy">final position y</param>
  96. /// <param name="posz">final position z</param>
  97. void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz);
  98. /// <summary>
  99. /// Returns a list of FriendsListItems that describe the friends and permissions in the friend relationship
  100. /// for UUID friendslistowner
  101. /// </summary>
  102. /// <param name="friendlistowner">The agent that we're retreiving the friends Data.</param>
  103. List<FriendListItem> GetUserFriendList(UUID friendlistowner);
  104. /// <summary>
  105. /// Get's the User Appearance
  106. // AvatarAppearance GetUserAppearance(UUID user);
  107. // void UpdateUserAppearance(UUID user, AvatarAppearance appearance);
  108. // void AddAttachment(UUID user, UUID attach);
  109. // void RemoveAttachment(UUID user, UUID attach);
  110. // List<UUID> GetAttachments(UUID user);
  111. }
  112. }