opensim – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | eva | 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 | |||
28 | using System; |
||
29 | using OpenMetaverse; |
||
30 | |||
31 | namespace OpenSim.Framework |
||
32 | { |
||
33 | /// <summary> |
||
34 | /// Information about a particular user known to the userserver |
||
35 | /// </summary> |
||
36 | public class UserProfileData |
||
37 | { |
||
38 | /// <summary> |
||
39 | /// A UNIX Timestamp (seconds since epoch) for the users creation |
||
40 | /// </summary> |
||
41 | private int m_created; |
||
42 | |||
43 | /// <summary> |
||
44 | /// The users last registered agent (filled in on the user server) |
||
45 | /// </summary> |
||
46 | private UserAgentData m_currentAgent; |
||
47 | |||
48 | /// <summary> |
||
49 | /// The first component of a users account name |
||
50 | /// </summary> |
||
51 | private string m_firstname; |
||
52 | |||
53 | /// <summary> |
||
54 | /// The coordinates inside the region of the home location |
||
55 | /// </summary> |
||
56 | private Vector3 m_homeLocation; |
||
57 | |||
58 | /// <summary> |
||
59 | /// Where the user will be looking when they rez. |
||
60 | /// </summary> |
||
61 | private Vector3 m_homeLookAt; |
||
62 | |||
63 | private uint m_homeRegionX; |
||
64 | private uint m_homeRegionY; |
||
65 | |||
66 | /// <summary> |
||
67 | /// The ID value for this user |
||
68 | /// </summary> |
||
69 | private UUID m_id; |
||
70 | |||
71 | /// <summary> |
||
72 | /// A UNIX Timestamp for the users last login date / time |
||
73 | /// </summary> |
||
74 | private int m_lastLogin; |
||
75 | |||
76 | /// <summary> |
||
77 | /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) |
||
78 | /// </summary> |
||
79 | /// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks> |
||
80 | private string m_passwordHash; |
||
81 | |||
82 | /// <summary> |
||
83 | /// The salt used for the users hash, should be 32 bytes or longer |
||
84 | /// </summary> |
||
85 | private string m_passwordSalt; |
||
86 | |||
87 | /// <summary> |
||
88 | /// The about text listed in a users profile. |
||
89 | /// </summary> |
||
90 | private string m_profileAboutText = String.Empty; |
||
91 | |||
92 | /// <summary> |
||
93 | /// A uint mask containing the "I can do" fields of the users profile |
||
94 | /// </summary> |
||
95 | private uint m_profileCanDoMask; |
||
96 | |||
97 | /// <summary> |
||
98 | /// The profile image for the users first life tab |
||
99 | /// </summary> |
||
100 | private UUID m_profileFirstImage; |
||
101 | |||
102 | /// <summary> |
||
103 | /// The first life about text listed in a users profile |
||
104 | /// </summary> |
||
105 | private string m_profileFirstText = String.Empty; |
||
106 | |||
107 | /// <summary> |
||
108 | /// The profile image for an avatar stored on the asset server |
||
109 | /// </summary> |
||
110 | private UUID m_profileImage; |
||
111 | |||
112 | /// <summary> |
||
113 | /// A uint mask containing the "I want to do" part of the users profile |
||
114 | /// </summary> |
||
115 | private uint m_profileWantDoMask; // Profile window "I want to" mask |
||
116 | |||
117 | /// <summary> |
||
118 | /// The profile url for an avatar |
||
119 | /// </summary> |
||
120 | private string m_profileUrl; |
||
121 | |||
122 | /// <summary> |
||
123 | /// The second component of a users account name |
||
124 | /// </summary> |
||
125 | private string m_surname; |
||
126 | |||
127 | /// <summary> |
||
128 | /// A valid email address for the account. Useful for password reset requests. |
||
129 | /// </summary> |
||
130 | private string m_email = String.Empty; |
||
131 | |||
132 | /// <summary> |
||
133 | /// A URI to the users asset server, used for foreigners and large grids. |
||
134 | /// </summary> |
||
135 | private string m_userAssetUri = String.Empty; |
||
136 | |||
137 | /// <summary> |
||
138 | /// A URI to the users inventory server, used for foreigners and large grids |
||
139 | /// </summary> |
||
140 | private string m_userInventoryUri = String.Empty; |
||
141 | |||
142 | /// <summary> |
||
143 | /// The last used Web_login_key |
||
144 | /// </summary> |
||
145 | private UUID m_webLoginKey; |
||
146 | |||
147 | // Data for estates and other goodies |
||
148 | // to get away from per-machine configs a little |
||
149 | // |
||
150 | private int m_userFlags; |
||
151 | private int m_godLevel; |
||
152 | private string m_customType; |
||
153 | private UUID m_partner; |
||
154 | |||
155 | /// <summary> |
||
156 | /// The regionhandle of the users preferred home region. If |
||
157 | /// multiple sims occupy the same spot, the grid may decide |
||
158 | /// which region the user logs into |
||
159 | /// </summary> |
||
160 | public virtual ulong HomeRegion |
||
161 | { |
||
162 | get |
||
163 | { |
||
164 | return Util.RegionWorldLocToHandle(Util.RegionToWorldLoc(m_homeRegionX), Util.RegionToWorldLoc(m_homeRegionY)); |
||
165 | // return Utils.UIntsToLong( m_homeRegionX * (uint)Constants.RegionSize, m_homeRegionY * (uint)Constants.RegionSize); |
||
166 | } |
||
167 | |||
168 | set |
||
169 | { |
||
170 | uint regionWorldLocX, regionWorldLocY; |
||
171 | Util.RegionHandleToWorldLoc(value, out regionWorldLocX, out regionWorldLocY); |
||
172 | m_homeRegionX = Util.WorldToRegionLoc(regionWorldLocX); |
||
173 | m_homeRegionY = Util.WorldToRegionLoc(regionWorldLocY); |
||
174 | // m_homeRegionX = (uint) (value >> 40); |
||
175 | // m_homeRegionY = (((uint) (value)) >> 8); |
||
176 | } |
||
177 | } |
||
178 | |||
179 | private UUID m_homeRegionId; |
||
180 | /// <summary> |
||
181 | /// The regionID of the users home region. This is unique; |
||
182 | /// even if the position of the region changes within the |
||
183 | /// grid, this will refer to the same region. |
||
184 | /// </summary> |
||
185 | public UUID HomeRegionID |
||
186 | { |
||
187 | get { return m_homeRegionId; } |
||
188 | set { m_homeRegionId = value; } |
||
189 | } |
||
190 | |||
191 | // Property wrappers |
||
192 | public UUID ID |
||
193 | { |
||
194 | get { return m_id; } |
||
195 | set { m_id = value; } |
||
196 | } |
||
197 | |||
198 | public UUID WebLoginKey |
||
199 | { |
||
200 | get { return m_webLoginKey; } |
||
201 | set { m_webLoginKey = value; } |
||
202 | } |
||
203 | |||
204 | public string FirstName |
||
205 | { |
||
206 | get { return m_firstname; } |
||
207 | set { m_firstname = value; } |
||
208 | } |
||
209 | |||
210 | public string SurName |
||
211 | { |
||
212 | get { return m_surname; } |
||
213 | set { m_surname = value; } |
||
214 | } |
||
215 | |||
216 | /// <value> |
||
217 | /// The concatentation of the various name components. |
||
218 | /// </value> |
||
219 | public string Name |
||
220 | { |
||
221 | get { return String.Format("{0} {1}", m_firstname, m_surname); } |
||
222 | } |
||
223 | |||
224 | public string Email |
||
225 | { |
||
226 | get { return m_email; } |
||
227 | set { m_email = value; } |
||
228 | } |
||
229 | |||
230 | public string PasswordHash |
||
231 | { |
||
232 | get { return m_passwordHash; } |
||
233 | set { m_passwordHash = value; } |
||
234 | } |
||
235 | |||
236 | public string PasswordSalt |
||
237 | { |
||
238 | get { return m_passwordSalt; } |
||
239 | set { m_passwordSalt = value; } |
||
240 | } |
||
241 | |||
242 | public uint HomeRegionX |
||
243 | { |
||
244 | get { return m_homeRegionX; } |
||
245 | set { m_homeRegionX = value; } |
||
246 | } |
||
247 | |||
248 | public uint HomeRegionY |
||
249 | { |
||
250 | get { return m_homeRegionY; } |
||
251 | set { m_homeRegionY = value; } |
||
252 | } |
||
253 | |||
254 | public Vector3 HomeLocation |
||
255 | { |
||
256 | get { return m_homeLocation; } |
||
257 | set { m_homeLocation = value; } |
||
258 | } |
||
259 | |||
260 | // for handy serialization |
||
261 | public float HomeLocationX |
||
262 | { |
||
263 | get { return m_homeLocation.X; } |
||
264 | set { m_homeLocation.X = value; } |
||
265 | } |
||
266 | |||
267 | public float HomeLocationY |
||
268 | { |
||
269 | get { return m_homeLocation.Y; } |
||
270 | set { m_homeLocation.Y = value; } |
||
271 | } |
||
272 | |||
273 | public float HomeLocationZ |
||
274 | { |
||
275 | get { return m_homeLocation.Z; } |
||
276 | set { m_homeLocation.Z = value; } |
||
277 | } |
||
278 | |||
279 | |||
280 | public Vector3 HomeLookAt |
||
281 | { |
||
282 | get { return m_homeLookAt; } |
||
283 | set { m_homeLookAt = value; } |
||
284 | } |
||
285 | |||
286 | // for handy serialization |
||
287 | public float HomeLookAtX |
||
288 | { |
||
289 | get { return m_homeLookAt.X; } |
||
290 | set { m_homeLookAt.X = value; } |
||
291 | } |
||
292 | |||
293 | public float HomeLookAtY |
||
294 | { |
||
295 | get { return m_homeLookAt.Y; } |
||
296 | set { m_homeLookAt.Y = value; } |
||
297 | } |
||
298 | |||
299 | public float HomeLookAtZ |
||
300 | { |
||
301 | get { return m_homeLookAt.Z; } |
||
302 | set { m_homeLookAt.Z = value; } |
||
303 | } |
||
304 | |||
305 | public int Created |
||
306 | { |
||
307 | get { return m_created; } |
||
308 | set { m_created = value; } |
||
309 | } |
||
310 | |||
311 | public int LastLogin |
||
312 | { |
||
313 | get { return m_lastLogin; } |
||
314 | set { m_lastLogin = value; } |
||
315 | } |
||
316 | |||
317 | public string UserInventoryURI |
||
318 | { |
||
319 | get { return m_userInventoryUri; } |
||
320 | set { m_userInventoryUri = value; } |
||
321 | } |
||
322 | |||
323 | public string UserAssetURI |
||
324 | { |
||
325 | get { return m_userAssetUri; } |
||
326 | set { m_userAssetUri = value; } |
||
327 | } |
||
328 | |||
329 | public uint CanDoMask |
||
330 | { |
||
331 | get { return m_profileCanDoMask; } |
||
332 | set { m_profileCanDoMask = value; } |
||
333 | } |
||
334 | |||
335 | public uint WantDoMask |
||
336 | { |
||
337 | get { return m_profileWantDoMask; } |
||
338 | set { m_profileWantDoMask = value; } |
||
339 | } |
||
340 | |||
341 | public string AboutText |
||
342 | { |
||
343 | get { return m_profileAboutText; } |
||
344 | set { m_profileAboutText = value; } |
||
345 | } |
||
346 | |||
347 | public string FirstLifeAboutText |
||
348 | { |
||
349 | get { return m_profileFirstText; } |
||
350 | set { m_profileFirstText = value; } |
||
351 | } |
||
352 | |||
353 | public string ProfileUrl |
||
354 | { |
||
355 | get { return m_profileUrl; } |
||
356 | set { m_profileUrl = value; } |
||
357 | } |
||
358 | |||
359 | public UUID Image |
||
360 | { |
||
361 | get { return m_profileImage; } |
||
362 | set { m_profileImage = value; } |
||
363 | } |
||
364 | |||
365 | public UUID FirstLifeImage |
||
366 | { |
||
367 | get { return m_profileFirstImage; } |
||
368 | set { m_profileFirstImage = value; } |
||
369 | } |
||
370 | |||
371 | public UserAgentData CurrentAgent |
||
372 | { |
||
373 | get { return m_currentAgent; } |
||
374 | set { m_currentAgent = value; } |
||
375 | } |
||
376 | |||
377 | public int UserFlags |
||
378 | { |
||
379 | get { return m_userFlags; } |
||
380 | set { m_userFlags = value; } |
||
381 | } |
||
382 | |||
383 | public int GodLevel |
||
384 | { |
||
385 | get { return m_godLevel; } |
||
386 | set { m_godLevel = value; } |
||
387 | } |
||
388 | |||
389 | public string CustomType |
||
390 | { |
||
391 | get { return m_customType; } |
||
392 | set { m_customType = value; } |
||
393 | } |
||
394 | |||
395 | public UUID Partner |
||
396 | { |
||
397 | get { return m_partner; } |
||
398 | set { m_partner = value; } |
||
399 | } |
||
400 | } |
||
401 | } |