UserProfileData.cs 7.6 KB

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