UserAgentData.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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 OpenMetaverse;
  29. namespace OpenSim.Framework
  30. {
  31. /// <summary>
  32. /// Information about a users session
  33. /// </summary>
  34. public class UserAgentData
  35. {
  36. /// <summary>
  37. /// The UUID of the users avatar (not the agent!)
  38. /// </summary>
  39. private UUID UUID;
  40. /// <summary>
  41. /// The session ID for the user (also the agent ID)
  42. /// </summary>
  43. private UUID sessionID;
  44. /// <summary>
  45. /// The "secure" session ID for the user
  46. /// </summary>
  47. /// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks>
  48. private UUID secureSessionID;
  49. /// <summary>
  50. /// The IP address of the user
  51. /// </summary>
  52. private string agentIP = String.Empty;
  53. /// <summary>
  54. /// The port of the user
  55. /// </summary>
  56. private uint agentPort;
  57. /// <summary>
  58. /// Is the user online?
  59. /// </summary>
  60. private bool agentOnline;
  61. /// <summary>
  62. /// A unix timestamp from when the user logged in
  63. /// </summary>
  64. private int loginTime;
  65. /// <summary>
  66. /// When this agent expired and logged out, 0 if still online
  67. /// </summary>
  68. private int logoutTime;
  69. /// <summary>
  70. /// Region ID the user is logged into
  71. /// </summary>
  72. private UUID regionID;
  73. /// <summary>
  74. /// Region handle of the current region the user is in
  75. /// </summary>
  76. private ulong regionHandle;
  77. /// <summary>
  78. /// The position of the user within the region
  79. /// </summary>
  80. private Vector3 currentPos;
  81. /// <summary>
  82. /// Current direction the user is looking at
  83. /// </summary>
  84. private Vector3 currentLookAt = Vector3.Zero;
  85. /// <summary>
  86. /// The region the user logged into initially
  87. /// </summary>
  88. private UUID originRegionID;
  89. public virtual UUID ProfileID
  90. {
  91. get { return UUID; }
  92. set { UUID = value; }
  93. }
  94. public virtual UUID SessionID
  95. {
  96. get { return sessionID; }
  97. set { sessionID = value; }
  98. }
  99. public virtual UUID SecureSessionID
  100. {
  101. get { return secureSessionID; }
  102. set { secureSessionID = value; }
  103. }
  104. public virtual string AgentIP
  105. {
  106. get { return agentIP; }
  107. set { agentIP = value; }
  108. }
  109. public virtual uint AgentPort
  110. {
  111. get { return agentPort; }
  112. set { agentPort = value; }
  113. }
  114. public virtual bool AgentOnline
  115. {
  116. get { return agentOnline; }
  117. set { agentOnline = value; }
  118. }
  119. public virtual int LoginTime
  120. {
  121. get { return loginTime; }
  122. set { loginTime = value; }
  123. }
  124. public virtual int LogoutTime
  125. {
  126. get { return logoutTime; }
  127. set { logoutTime = value; }
  128. }
  129. public virtual UUID Region
  130. {
  131. get { return regionID; }
  132. set { regionID = value; }
  133. }
  134. public virtual ulong Handle
  135. {
  136. get { return regionHandle; }
  137. set { regionHandle = value; }
  138. }
  139. public virtual Vector3 Position
  140. {
  141. get { return currentPos; }
  142. set { currentPos = value; }
  143. }
  144. /* 2008-08-28-tyre: Not really useful
  145. public virtual float PositionX
  146. {
  147. get { return currentPos.X; }
  148. set { currentPos.X = value; }
  149. }
  150. public virtual float PositionY
  151. {
  152. get { return currentPos.Y; }
  153. set { currentPos.Y = value; }
  154. }
  155. public virtual float PositionZ
  156. {
  157. get { return currentPos.Z; }
  158. set { currentPos.Z = value; }
  159. }
  160. */
  161. public virtual Vector3 LookAt
  162. {
  163. get { return currentLookAt; }
  164. set { currentLookAt = value; }
  165. }
  166. public virtual UUID InitialRegion
  167. {
  168. get { return originRegionID; }
  169. set { originRegionID = value; }
  170. }
  171. }
  172. }