IHypergridServices.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 OpenSimulator 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;
  28. using System.Net;
  29. using System.Collections.Generic;
  30. using OpenSim.Framework;
  31. using OpenMetaverse;
  32. namespace OpenSim.Services.Interfaces
  33. {
  34. public interface IGatekeeperService
  35. {
  36. bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason, out int sizeX, out int sizeY);
  37. /// <summary>
  38. /// Returns the region a Hypergrid visitor should enter.
  39. /// </summary>
  40. /// <remarks>
  41. /// Usually the returned region will be the requested region. But the grid can choose to
  42. /// redirect the user to another region: e.g., a default gateway region.
  43. /// </remarks>
  44. /// <param name="regionID">The region the visitor *wants* to enter</param>
  45. /// <param name="agentID">The visitor's User ID. Will be missing (UUID.Zero) in older OpenSims.</param>
  46. /// <param name="agentHomeURI">The visitor's Home URI. Will be missing (null) in older OpenSims.</param>
  47. /// <param name="message">[out] A message to show to the user (optional, may be null)</param>
  48. /// <returns>The region the visitor should enter, or null if no region can be found / is allowed</returns>
  49. GridRegion GetHyperlinkRegion(UUID regionID, UUID agentID, string agentHomeURI, out string message);
  50. bool LoginAgent(GridRegion source, AgentCircuitData aCircuit, GridRegion destination, out string reason);
  51. }
  52. public interface IUserAgentService
  53. {
  54. bool LoginAgentToGrid(GridRegion source, AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, bool fromLogin, out string reason);
  55. void LogoutAgent(UUID userID, UUID sessionID);
  56. /// <summary>
  57. /// Returns the home region of a remote user.
  58. /// </summary>
  59. /// <returns>On success: the user's home region. If the user doesn't exist: null.</returns>
  60. /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks>
  61. GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt);
  62. /// <summary>
  63. /// Returns the Server URLs of a remote user.
  64. /// </summary>
  65. /// <returns>On success: the user's Server URLs. If the user doesn't exist: an empty dictionary.</returns>
  66. /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks>
  67. Dictionary<string, object> GetServerURLs(UUID userID);
  68. /// <summary>
  69. /// Returns the UserInfo of a remote user.
  70. /// </summary>
  71. /// <returns>On success: the user's UserInfo. If the user doesn't exist: an empty dictionary.</returns>
  72. /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks>
  73. Dictionary<string, object> GetUserInfo(UUID userID);
  74. /// <summary>
  75. /// Returns the current location of a remote user.
  76. /// </summary>
  77. /// <returns>On success: the user's Server URLs. If the user doesn't exist: "".</returns>
  78. /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks>
  79. string LocateUser(UUID userID);
  80. /// <summary>
  81. /// Returns the Universal User Identifier for 'targetUserID' on behalf of 'userID'.
  82. /// </summary>
  83. /// <returns>On success: the user's UUI. If the user doesn't exist: "".</returns>
  84. /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks>
  85. string GetUUI(UUID userID, UUID targetUserID);
  86. /// <summary>
  87. /// Returns the remote user that has the given name.
  88. /// </summary>
  89. /// <returns>On success: the user's UUID. If the user doesn't exist: UUID.Zero.</returns>
  90. /// <remarks>Throws an exception if an error occurs (e.g., can't contact the server).</remarks>
  91. UUID GetUUID(String first, String last);
  92. // Returns the local friends online
  93. [Obsolete]
  94. List<UUID> StatusNotification(List<string> friends, UUID userID, bool online);
  95. bool IsAgentComingHome(UUID sessionID, string thisGridExternalName);
  96. bool VerifyAgent(UUID sessionID, string token);
  97. bool VerifyClient(UUID sessionID, string reportedIP);
  98. }
  99. public interface IInstantMessage
  100. {
  101. bool IncomingInstantMessage(GridInstantMessage im);
  102. bool OutgoingInstantMessage(GridInstantMessage im, string url, bool foreigner);
  103. }
  104. public interface IFriendsSimConnector
  105. {
  106. bool StatusNotify(UUID userID, UUID friendID, bool online);
  107. bool LocalFriendshipOffered(UUID toID, GridInstantMessage im);
  108. bool LocalFriendshipApproved(UUID userID, string userName, UUID friendID);
  109. }
  110. public interface IHGFriendsService
  111. {
  112. int GetFriendPerms(UUID userID, UUID friendID);
  113. bool NewFriendship(FriendInfo finfo, bool verified);
  114. bool DeleteFriendship(FriendInfo finfo, string secret);
  115. bool FriendshipOffered(UUID from, string fromName, UUID to, string message);
  116. bool ValidateFriendshipOffered(UUID fromID, UUID toID);
  117. // Returns the local friends online
  118. List<UUID> StatusNotification(List<string> friends, UUID userID, bool online);
  119. }
  120. public interface IInstantMessageSimConnector
  121. {
  122. bool SendInstantMessage(GridInstantMessage im);
  123. }
  124. }