UserData.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using libsecondlife;
  5. namespace OpenGrid.Framework.Data
  6. {
  7. public interface IUserData
  8. {
  9. /// <summary>
  10. /// Returns a user profile from a database via their UUID
  11. /// </summary>
  12. /// <param name="user">The accounts UUID</param>
  13. /// <returns>The user data profile</returns>
  14. UserProfileData getUserByUUID(LLUUID user);
  15. /// <summary>
  16. /// Returns a users profile by searching their username
  17. /// </summary>
  18. /// <param name="name">The users username</param>
  19. /// <returns>The user data profile</returns>
  20. UserProfileData getUserByName(string name);
  21. /// <summary>
  22. /// Returns a users profile by searching their username parts
  23. /// </summary>
  24. /// <param name="fname">Account firstname</param>
  25. /// <param name="lname">Account lastname</param>
  26. /// <returns>The user data profile</returns>
  27. UserProfileData getUserByName(string fname, string lname);
  28. /// <summary>
  29. /// Returns the current agent for a user searching by it's UUID
  30. /// </summary>
  31. /// <param name="user">The users UUID</param>
  32. /// <returns>The current agent session</returns>
  33. UserAgentData getAgentByUUID(LLUUID user);
  34. /// <summary>
  35. /// Returns the current session agent for a user searching by username
  36. /// </summary>
  37. /// <param name="name">The users account name</param>
  38. /// <returns>The current agent session</returns>
  39. UserAgentData getAgentByName(string name);
  40. /// <summary>
  41. /// Returns the current session agent for a user searching by username parts
  42. /// </summary>
  43. /// <param name="fname">The users first account name</param>
  44. /// <param name="lname">The users account surname</param>
  45. /// <returns>The current agent session</returns>
  46. UserAgentData getAgentByName(string fname, string lname);
  47. /// <summary>
  48. /// Adds a new User profile to the database
  49. /// </summary>
  50. /// <param name="user">UserProfile to add</param>
  51. void addNewUserProfile(UserProfileData user);
  52. /// <summary>
  53. /// Adds a new agent to the database
  54. /// </summary>
  55. /// <param name="agent">The agent to add</param>
  56. void addNewUserAgent(UserAgentData agent);
  57. /// <summary>
  58. /// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES)
  59. /// </summary>
  60. /// <param name="from">The account to transfer from</param>
  61. /// <param name="to">The account to transfer to</param>
  62. /// <param name="amount">The amount to transfer</param>
  63. /// <returns>Successful?</returns>
  64. bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount);
  65. /// <summary>
  66. /// Attempts to move inventory between accounts, if inventory is copyable it will be copied into the target account.
  67. /// </summary>
  68. /// <param name="from">User to transfer from</param>
  69. /// <param name="to">User to transfer to</param>
  70. /// <param name="inventory">Specified inventory item</param>
  71. /// <returns>Successful?</returns>
  72. bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory);
  73. /// <summary>
  74. /// Returns the plugin version
  75. /// </summary>
  76. /// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns>
  77. string getVersion();
  78. /// <summary>
  79. /// Returns the plugin name
  80. /// </summary>
  81. /// <returns>Plugin name, eg MySQL User Provider</returns>
  82. string getName();
  83. /// <summary>
  84. /// Initialises the plugin (artificial constructor)
  85. /// </summary>
  86. void Initialise();
  87. }
  88. }