UserData.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * Copyright (c) Contributors, http://www.openmetaverse.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. */
  28. using libsecondlife;
  29. namespace OpenSim.Framework.Data
  30. {
  31. /// <summary>
  32. /// An interface for connecting to user storage servers.
  33. /// </summary>
  34. public interface IUserData
  35. {
  36. /// <summary>
  37. /// Returns a user profile from a database via their UUID
  38. /// </summary>
  39. /// <param name="user">The accounts UUID</param>
  40. /// <returns>The user data profile</returns>
  41. UserProfileData getUserByUUID(LLUUID user);
  42. /// <summary>
  43. /// Returns a users profile by searching their username
  44. /// </summary>
  45. /// <param name="name">The users username</param>
  46. /// <returns>The user data profile</returns>
  47. UserProfileData getUserByName(string name);
  48. /// <summary>
  49. /// Returns a users profile by searching their username parts
  50. /// </summary>
  51. /// <param name="fname">Account firstname</param>
  52. /// <param name="lname">Account lastname</param>
  53. /// <returns>The user data profile</returns>
  54. UserProfileData getUserByName(string fname, string lname);
  55. /// <summary>
  56. /// Returns the current agent for a user searching by it's UUID
  57. /// </summary>
  58. /// <param name="user">The users UUID</param>
  59. /// <returns>The current agent session</returns>
  60. UserAgentData getAgentByUUID(LLUUID user);
  61. /// <summary>
  62. /// Returns the current session agent for a user searching by username
  63. /// </summary>
  64. /// <param name="name">The users account name</param>
  65. /// <returns>The current agent session</returns>
  66. UserAgentData getAgentByName(string name);
  67. /// <summary>
  68. /// Returns the current session agent for a user searching by username parts
  69. /// </summary>
  70. /// <param name="fname">The users first account name</param>
  71. /// <param name="lname">The users account surname</param>
  72. /// <returns>The current agent session</returns>
  73. UserAgentData getAgentByName(string fname, string lname);
  74. /// <summary>
  75. /// Adds a new User profile to the database
  76. /// </summary>
  77. /// <param name="user">UserProfile to add</param>
  78. void addNewUserProfile(UserProfileData user);
  79. /// <summary>
  80. /// Adds a new agent to the database
  81. /// </summary>
  82. /// <param name="agent">The agent to add</param>
  83. void addNewUserAgent(UserAgentData agent);
  84. /// <summary>
  85. /// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES)
  86. /// </summary>
  87. /// <param name="from">The account to transfer from</param>
  88. /// <param name="to">The account to transfer to</param>
  89. /// <param name="amount">The amount to transfer</param>
  90. /// <returns>Successful?</returns>
  91. bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount);
  92. /// <summary>
  93. /// Attempts to move inventory between accounts, if inventory is copyable it will be copied into the target account.
  94. /// </summary>
  95. /// <param name="from">User to transfer from</param>
  96. /// <param name="to">User to transfer to</param>
  97. /// <param name="inventory">Specified inventory item</param>
  98. /// <returns>Successful?</returns>
  99. bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory);
  100. /// <summary>
  101. /// Returns the plugin version
  102. /// </summary>
  103. /// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns>
  104. string getVersion();
  105. /// <summary>
  106. /// Returns the plugin name
  107. /// </summary>
  108. /// <returns>Plugin name, eg MySQL User Provider</returns>
  109. string getName();
  110. /// <summary>
  111. /// Initialises the plugin (artificial constructor)
  112. /// </summary>
  113. void Initialise();
  114. }
  115. }