IUserService.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 libsecondlife;
  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="fname">First name</param>
  37. /// <param name="lname">Last name</param>
  38. /// <returns>A user profile. Returns null if no profile is found</returns>
  39. UserProfileData GetUserProfile(string firstName, string lastName);
  40. //UserProfileData GetUserProfile(string name);
  41. /// <summary>
  42. /// Loads a user profile from a database by UUID
  43. /// </summary>
  44. /// <param name="uuid">The target UUID</param>
  45. /// <returns>A user profile. Returns null if no user profile is found.</returns>
  46. UserProfileData GetUserProfile(LLUUID userId);
  47. UserAgentData GetAgentByUUID(LLUUID userId);
  48. void ClearUserAgent(LLUUID avatarID);
  49. List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(LLUUID QueryID, string Query);
  50. UserProfileData SetupMasterUser(string firstName, string lastName);
  51. UserProfileData SetupMasterUser(string firstName, string lastName, string password);
  52. UserProfileData SetupMasterUser(LLUUID userId);
  53. /// <summary>
  54. ///
  55. /// </summary>
  56. /// <param name="user"></param>
  57. LLUUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY);
  58. /// <summary>
  59. /// Update the user's profile.
  60. /// </summary>
  61. /// <param name="data">UserProfileData object with updated data. Should be obtained
  62. /// via a call to GetUserProfile().</param>
  63. /// <returns>true if the update could be applied, false if it could not be applied.</returns>
  64. bool UpdateUserProfile(UserProfileData data);
  65. /// <summary>
  66. /// Adds a new friend to the database for XUser
  67. /// </summary>
  68. /// <param name="friendlistowner">The agent that who's friends list is being added to</param>
  69. /// <param name="friend">The agent that being added to the friends list of the friends list owner</param>
  70. /// <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>
  71. void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms);
  72. /// <summary>
  73. /// Delete 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 Ex-friend agent</param>
  77. void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend);
  78. /// <summary>
  79. /// Update permissions for friend on friendlistowner's friendlist.
  80. /// </summary>
  81. /// <param name="friendlistowner">The agent that who's friends list is being updated</param>
  82. /// <param name="friend">The agent that is getting or loosing permissions</param>
  83. /// <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>
  84. void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms);
  85. /// <summary>
  86. /// Updates a user profile
  87. /// </summary>
  88. /// <param name="UserProfile">Profile to update</param>
  89. /// <returns></returns>
  90. bool UpdateUserProfileProperties(UserProfileData UserProfile);
  91. /// <summary>
  92. /// Logs off a user on the user server
  93. /// </summary>
  94. /// <param name="UserID">UUID of the user</param>
  95. /// <param name="regionData">UUID of the Region</param>
  96. /// <param name="posx">final position x</param>
  97. /// <param name="posy">final position y</param>
  98. /// <param name="posz">final position z</param>
  99. void LogOffUser(LLUUID userid, LLUUID regionid, ulong regionhandle, float posx, float posy, float posz);
  100. /// <summary>
  101. /// Returns a list of FriendsListItems that describe the friends and permissions in the friend relationship for LLUUID friendslistowner
  102. /// </summary>
  103. /// <param name="friendlistowner">The agent that we're retreiving the friends Data.</param>
  104. List<FriendListItem> GetUserFriendList(LLUUID friendlistowner);
  105. /// <summary>
  106. /// Updates the current region the User is in
  107. /// </summary>
  108. /// <param name="avatarid">User Region the Avatar is IN</param>
  109. /// <param name="retionuuid">User Region the Avatar is IN</param>
  110. void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle);
  111. /// <summary>
  112. /// Get's the User Appearance
  113. // AvatarAppearance GetUserAppearance(LLUUID user);
  114. // void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance);
  115. // void AddAttachment(LLUUID user, LLUUID attach);
  116. // void RemoveAttachment(LLUUID user, LLUUID attach);
  117. // List<LLUUID> GetAttachments(LLUUID user);
  118. }
  119. }