GridData.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. */
  28. using System.Collections.Generic;
  29. using libsecondlife;
  30. namespace OpenSim.Framework.Data
  31. {
  32. public class AvatarPickerAvatar
  33. {
  34. public LLUUID AvatarID;
  35. public string firstName;
  36. public string lastName;
  37. public AvatarPickerAvatar()
  38. {
  39. }
  40. }
  41. public enum DataResponse
  42. {
  43. RESPONSE_OK,
  44. RESPONSE_AUTHREQUIRED,
  45. RESPONSE_INVALIDCREDENTIALS,
  46. RESPONSE_ERROR
  47. }
  48. /// <summary>
  49. /// A standard grid interface
  50. /// </summary>
  51. public interface IGridData
  52. {
  53. /// <summary>
  54. /// Returns a sim profile from a regionHandle
  55. /// </summary>
  56. /// <param name="regionHandle">A 64bit Region Handle</param>
  57. /// <returns>A simprofile</returns>
  58. RegionProfileData GetProfileByHandle(ulong regionHandle);
  59. /// <summary>
  60. /// Returns a sim profile from a UUID
  61. /// </summary>
  62. /// <param name="UUID">A 128bit UUID</param>
  63. /// <returns>A sim profile</returns>
  64. RegionProfileData GetProfileByLLUUID(LLUUID UUID);
  65. /// <summary>
  66. /// Returns all profiles within the specified range
  67. /// </summary>
  68. /// <param name="Xmin">Minimum sim coordinate (X)</param>
  69. /// <param name="Ymin">Minimum sim coordinate (Y)</param>
  70. /// <param name="Xmax">Maximum sim coordinate (X)</param>
  71. /// <param name="Ymin">Maximum sim coordinate (Y)</param>
  72. /// <returns>An array containing all the sim profiles in the specified range</returns>
  73. RegionProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax);
  74. List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query);
  75. /// <summary>
  76. /// Authenticates a sim by use of its recv key.
  77. /// WARNING: Insecure
  78. /// </summary>
  79. /// <param name="UUID">The UUID sent by the sim</param>
  80. /// <param name="regionHandle">The regionhandle sent by the sim</param>
  81. /// <param name="simrecvkey">The receiving key sent by the sim</param>
  82. /// <returns>Whether the sim has been authenticated</returns>
  83. bool AuthenticateSim(LLUUID UUID, ulong regionHandle, string simrecvkey);
  84. /// <summary>
  85. /// Initialises the interface
  86. /// </summary>
  87. void Initialise();
  88. /// <summary>
  89. /// Closes the interface
  90. /// </summary>
  91. void Close();
  92. /// <summary>
  93. /// The plugin being loaded
  94. /// </summary>
  95. /// <returns>A string containing the plugin name</returns>
  96. string getName();
  97. /// <summary>
  98. /// The plugins version
  99. /// </summary>
  100. /// <returns>A string containing the plugin version</returns>
  101. string getVersion();
  102. /// <summary>
  103. /// Adds a new profile to the database
  104. /// </summary>
  105. /// <param name="profile">The profile to add</param>
  106. /// <returns>RESPONSE_OK if successful, error if not.</returns>
  107. DataResponse AddProfile(RegionProfileData profile);
  108. ReservationData GetReservationAtPoint(uint x, uint y);
  109. }
  110. }