UserProfileData.cs 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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. using System;
  28. using libsecondlife;
  29. namespace OpenSim.Framework
  30. {
  31. /// <summary>
  32. /// Information about a particular user known to the userserver
  33. /// </summary>
  34. public class UserProfileData
  35. {
  36. /// <summary>
  37. /// The ID value for this user
  38. /// </summary>
  39. public LLUUID UUID;
  40. /// <summary>
  41. /// The last used Web_login_key
  42. /// </summary>
  43. public LLUUID webLoginKey;
  44. /// <summary>
  45. /// The first component of a users account name
  46. /// </summary>
  47. public string username;
  48. /// <summary>
  49. /// The second component of a users account name
  50. /// </summary>
  51. public string surname;
  52. /// <summary>
  53. /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt)
  54. /// </summary>
  55. /// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks>
  56. public string passwordHash;
  57. /// <summary>
  58. /// The salt used for the users hash, should be 32 bytes or longer
  59. /// </summary>
  60. public string passwordSalt;
  61. /// <summary>
  62. /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into
  63. /// </summary>
  64. public ulong homeRegion
  65. {
  66. get { return Helpers.UIntsToLong((homeRegionX * (uint)Constants.RegionSize), (homeRegionY * (uint)Constants.RegionSize)); }
  67. set
  68. {
  69. homeRegionX = (uint) (value >> 40);
  70. homeRegionY = (((uint) (value)) >> 8);
  71. }
  72. }
  73. public uint homeRegionX;
  74. public uint homeRegionY;
  75. /// <summary>
  76. /// The coordinates inside the region of the home location
  77. /// </summary>
  78. public LLVector3 homeLocation;
  79. /// <summary>
  80. /// Where the user will be looking when they rez.
  81. /// </summary>
  82. public LLVector3 homeLookAt;
  83. /// <summary>
  84. /// A UNIX Timestamp (seconds since epoch) for the users creation
  85. /// </summary>
  86. public int created;
  87. /// <summary>
  88. /// A UNIX Timestamp for the users last login date / time
  89. /// </summary>
  90. public int lastLogin;
  91. public LLUUID rootInventoryFolderID;
  92. /// <summary>
  93. /// A URI to the users inventory server, used for foreigners and large grids
  94. /// </summary>
  95. public string userInventoryURI = String.Empty;
  96. /// <summary>
  97. /// A URI to the users asset server, used for foreigners and large grids.
  98. /// </summary>
  99. public string userAssetURI = String.Empty;
  100. /// <summary>
  101. /// A uint mask containing the "I can do" fields of the users profile
  102. /// </summary>
  103. public uint profileCanDoMask;
  104. /// <summary>
  105. /// A uint mask containing the "I want to do" part of the users profile
  106. /// </summary>
  107. public uint profileWantDoMask; // Profile window "I want to" mask
  108. /// <summary>
  109. /// The about text listed in a users profile.
  110. /// </summary>
  111. public string profileAboutText = String.Empty;
  112. /// <summary>
  113. /// The first life about text listed in a users profile
  114. /// </summary>
  115. public string profileFirstText = String.Empty;
  116. /// <summary>
  117. /// The profile image for an avatar stored on the asset server
  118. /// </summary>
  119. public LLUUID profileImage;
  120. /// <summary>
  121. /// The profile image for the users first life tab
  122. /// </summary>
  123. public LLUUID profileFirstImage;
  124. /// <summary>
  125. /// The users last registered agent (filled in on the user server)
  126. /// </summary>
  127. public UserAgentData currentAgent;
  128. }
  129. /// <summary>
  130. /// Information about a users session
  131. /// </summary>
  132. public class UserAgentData
  133. {
  134. /// <summary>
  135. /// The UUID of the users avatar (not the agent!)
  136. /// </summary>
  137. public LLUUID UUID;
  138. /// <summary>
  139. /// The IP address of the user
  140. /// </summary>
  141. public string agentIP = String.Empty;
  142. /// <summary>
  143. /// The port of the user
  144. /// </summary>
  145. public uint agentPort;
  146. /// <summary>
  147. /// Is the user online?
  148. /// </summary>
  149. public bool agentOnline;
  150. /// <summary>
  151. /// The session ID for the user (also the agent ID)
  152. /// </summary>
  153. public LLUUID sessionID;
  154. /// <summary>
  155. /// The "secure" session ID for the user
  156. /// </summary>
  157. /// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks>
  158. public LLUUID secureSessionID;
  159. /// <summary>
  160. /// The region the user logged into initially
  161. /// </summary>
  162. public LLUUID regionID;
  163. /// <summary>
  164. /// A unix timestamp from when the user logged in
  165. /// </summary>
  166. public int loginTime;
  167. /// <summary>
  168. /// When this agent expired and logged out, 0 if still online
  169. /// </summary>
  170. public int logoutTime;
  171. /// <summary>
  172. /// Current region the user is logged into
  173. /// </summary>
  174. public LLUUID currentRegion;
  175. /// <summary>
  176. /// Region handle of the current region the user is in
  177. /// </summary>
  178. public ulong currentHandle;
  179. /// <summary>
  180. /// The position of the user within the region
  181. /// </summary>
  182. public LLVector3 currentPos;
  183. }
  184. }