UserProfileData.cs 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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. /// A UNIX Timestamp (seconds since epoch) for the users creation
  38. /// </summary>
  39. private int _created;
  40. /// <summary>
  41. /// The users last registered agent (filled in on the user server)
  42. /// </summary>
  43. private UserAgentData _currentAgent;
  44. /// <summary>
  45. /// The first component of a users account name
  46. /// </summary>
  47. private string _firstname;
  48. /// <summary>
  49. /// The coordinates inside the region of the home location
  50. /// </summary>
  51. private LLVector3 _homeLocation;
  52. /// <summary>
  53. /// Where the user will be looking when they rez.
  54. /// </summary>
  55. private LLVector3 _homeLookAt;
  56. private uint _homeRegionX;
  57. private uint _homeRegionY;
  58. /// <summary>
  59. /// The ID value for this user
  60. /// </summary>
  61. private LLUUID _id;
  62. /// <summary>
  63. /// A UNIX Timestamp for the users last login date / time
  64. /// </summary>
  65. private int _lastLogin;
  66. /// <summary>
  67. /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt)
  68. /// </summary>
  69. /// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks>
  70. private string _passwordHash;
  71. /// <summary>
  72. /// The salt used for the users hash, should be 32 bytes or longer
  73. /// </summary>
  74. private string _passwordSalt;
  75. /// <summary>
  76. /// The about text listed in a users profile.
  77. /// </summary>
  78. private string _profileAboutText = String.Empty;
  79. /// <summary>
  80. /// A uint mask containing the "I can do" fields of the users profile
  81. /// </summary>
  82. private uint _profileCanDoMask;
  83. /// <summary>
  84. /// The profile image for the users first life tab
  85. /// </summary>
  86. private LLUUID _profileFirstImage;
  87. /// <summary>
  88. /// The first life about text listed in a users profile
  89. /// </summary>
  90. private string _profileFirstText = String.Empty;
  91. /// <summary>
  92. /// The profile image for an avatar stored on the asset server
  93. /// </summary>
  94. private LLUUID _profileImage;
  95. /// <summary>
  96. /// A uint mask containing the "I want to do" part of the users profile
  97. /// </summary>
  98. private uint _profileWantDoMask; // Profile window "I want to" mask
  99. private LLUUID _rootInventoryFolderID;
  100. /// <summary>
  101. /// The second component of a users account name
  102. /// </summary>
  103. private string _surname;
  104. /// <summary>
  105. /// A URI to the users asset server, used for foreigners and large grids.
  106. /// </summary>
  107. private string _userAssetURI = String.Empty;
  108. /// <summary>
  109. /// A URI to the users inventory server, used for foreigners and large grids
  110. /// </summary>
  111. private string _userInventoryURI = String.Empty;
  112. /// <summary>
  113. /// The last used Web_login_key
  114. /// </summary>
  115. private LLUUID _webLoginKey;
  116. /// <summary>
  117. /// 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
  118. /// </summary>
  119. public ulong HomeRegion
  120. {
  121. get { return Helpers.UIntsToLong((_homeRegionX * (uint) Constants.RegionSize), (_homeRegionY * (uint) Constants.RegionSize)); }
  122. set
  123. {
  124. _homeRegionX = (uint) (value >> 40);
  125. _homeRegionY = (((uint) (value)) >> 8);
  126. }
  127. }
  128. // Property wrappers
  129. public LLUUID ID
  130. {
  131. get { return _id; }
  132. set { _id = value; }
  133. }
  134. public LLUUID WebLoginKey
  135. {
  136. get { return _webLoginKey; }
  137. set { _webLoginKey = value; }
  138. }
  139. public string FirstName
  140. {
  141. get { return _firstname; }
  142. set { _firstname = value; }
  143. }
  144. public string SurName
  145. {
  146. get { return _surname; }
  147. set { _surname = value; }
  148. }
  149. public string PasswordHash
  150. {
  151. get { return _passwordHash; }
  152. set { _passwordHash = value; }
  153. }
  154. public string PasswordSalt
  155. {
  156. get { return _passwordSalt; }
  157. set { _passwordSalt = value; }
  158. }
  159. public uint HomeRegionX
  160. {
  161. get { return _homeRegionX; }
  162. set { _homeRegionX = value; }
  163. }
  164. public uint HomeRegionY
  165. {
  166. get { return _homeRegionY; }
  167. set { _homeRegionY = value; }
  168. }
  169. public LLVector3 HomeLocation
  170. {
  171. get { return _homeLocation; }
  172. set { _homeLocation = value; }
  173. }
  174. // for handy serialization
  175. public float HomeLocationX
  176. {
  177. get { return _homeLocation.X; }
  178. set { _homeLocation.X = value; }
  179. }
  180. public float HomeLocationY
  181. {
  182. get { return _homeLocation.Y; }
  183. set { _homeLocation.Y = value; }
  184. }
  185. public float HomeLocationZ
  186. {
  187. get { return _homeLocation.Z; }
  188. set { _homeLocation.Z = value; }
  189. }
  190. public LLVector3 HomeLookAt
  191. {
  192. get { return _homeLookAt; }
  193. set { _homeLookAt = value; }
  194. }
  195. // for handy serialization
  196. public float HomeLookAtX
  197. {
  198. get { return _homeLookAt.X; }
  199. set { _homeLookAt.X = value; }
  200. }
  201. public float HomeLookAtY
  202. {
  203. get { return _homeLookAt.Y; }
  204. set { _homeLookAt.Y = value; }
  205. }
  206. public float HomeLookAtZ
  207. {
  208. get { return _homeLookAt.Z; }
  209. set { _homeLookAt.Z = value; }
  210. }
  211. public int Created
  212. {
  213. get { return _created; }
  214. set { _created = value; }
  215. }
  216. public int LastLogin
  217. {
  218. get { return _lastLogin; }
  219. set { _lastLogin = value; }
  220. }
  221. public LLUUID RootInventoryFolderID
  222. {
  223. get { return _rootInventoryFolderID; }
  224. set { _rootInventoryFolderID = value; }
  225. }
  226. public string UserInventoryURI
  227. {
  228. get { return _userInventoryURI; }
  229. set { _userInventoryURI = value; }
  230. }
  231. public string UserAssetURI
  232. {
  233. get { return _userAssetURI; }
  234. set { _userAssetURI = value; }
  235. }
  236. public uint CanDoMask
  237. {
  238. get { return _profileCanDoMask; }
  239. set { _profileCanDoMask = value; }
  240. }
  241. public uint WantDoMask
  242. {
  243. get { return _profileWantDoMask; }
  244. set { _profileWantDoMask = value; }
  245. }
  246. public string AboutText
  247. {
  248. get { return _profileAboutText; }
  249. set { _profileAboutText = value; }
  250. }
  251. public string FirstLifeAboutText
  252. {
  253. get { return _profileFirstText; }
  254. set { _profileFirstText = value; }
  255. }
  256. public LLUUID Image
  257. {
  258. get { return _profileImage; }
  259. set { _profileImage = value; }
  260. }
  261. public LLUUID FirstLifeImage
  262. {
  263. get { return _profileFirstImage; }
  264. set { _profileFirstImage = value; }
  265. }
  266. public UserAgentData CurrentAgent
  267. {
  268. get { return _currentAgent; }
  269. set { _currentAgent = value; }
  270. }
  271. }
  272. }