diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Communications/LoginService.cs | 14 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/UserManagerBase.cs | 62 | ||||
-rw-r--r-- | OpenSim/Framework/UserAgentData.cs | 133 |
3 files changed, 159 insertions, 50 deletions
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 4f314bc..afe7359 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs | |||
@@ -184,13 +184,13 @@ namespace OpenSim.Framework.UserManagement | |||
184 | else | 184 | else |
185 | { | 185 | { |
186 | // If we already have a session... | 186 | // If we already have a session... |
187 | if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline) | 187 | if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.AgentOnline) |
188 | { | 188 | { |
189 | //TODO: The following statements can cause trouble: | 189 | //TODO: The following statements can cause trouble: |
190 | // If agentOnline could not turn from true back to false normally | 190 | // If agentOnline could not turn from true back to false normally |
191 | // because of some problem, for instance, the crashment of server or client, | 191 | // because of some problem, for instance, the crashment of server or client, |
192 | // the user cannot log in any longer. | 192 | // the user cannot log in any longer. |
193 | userProfile.CurrentAgent.agentOnline = false; | 193 | userProfile.CurrentAgent.AgentOnline = false; |
194 | m_userManager.CommitAgent(ref userProfile); | 194 | m_userManager.CommitAgent(ref userProfile); |
195 | 195 | ||
196 | // Reject the login | 196 | // Reject the login |
@@ -225,8 +225,8 @@ namespace OpenSim.Framework.UserManagement | |||
225 | logResponse.Lastname = userProfile.SurName; | 225 | logResponse.Lastname = userProfile.SurName; |
226 | logResponse.Firstname = userProfile.FirstName; | 226 | logResponse.Firstname = userProfile.FirstName; |
227 | logResponse.AgentID = agentID.ToString(); | 227 | logResponse.AgentID = agentID.ToString(); |
228 | logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString(); | 228 | logResponse.SessionID = userProfile.CurrentAgent.SessionID.ToString(); |
229 | logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString(); | 229 | logResponse.SecureSessionID = userProfile.CurrentAgent.SecureSessionID.ToString(); |
230 | logResponse.InventoryRoot = InventoryRoot; | 230 | logResponse.InventoryRoot = InventoryRoot; |
231 | logResponse.InventorySkeleton = AgentInventoryArray; | 231 | logResponse.InventorySkeleton = AgentInventoryArray; |
232 | logResponse.InventoryLibrary = GetInventoryLibrary(); | 232 | logResponse.InventoryLibrary = GetInventoryLibrary(); |
@@ -334,7 +334,7 @@ namespace OpenSim.Framework.UserManagement | |||
334 | else | 334 | else |
335 | { | 335 | { |
336 | // If we already have a session... | 336 | // If we already have a session... |
337 | if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline) | 337 | if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.AgentOnline) |
338 | { | 338 | { |
339 | userProfile.CurrentAgent = null; | 339 | userProfile.CurrentAgent = null; |
340 | m_userManager.CommitAgent(ref userProfile); | 340 | m_userManager.CommitAgent(ref userProfile); |
@@ -367,8 +367,8 @@ namespace OpenSim.Framework.UserManagement | |||
367 | logResponse.Lastname = userProfile.SurName; | 367 | logResponse.Lastname = userProfile.SurName; |
368 | logResponse.Firstname = userProfile.FirstName; | 368 | logResponse.Firstname = userProfile.FirstName; |
369 | logResponse.AgentID = agentID.ToString(); | 369 | logResponse.AgentID = agentID.ToString(); |
370 | logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString(); | 370 | logResponse.SessionID = userProfile.CurrentAgent.SessionID.ToString(); |
371 | logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString(); | 371 | logResponse.SecureSessionID = userProfile.CurrentAgent.SecureSessionID.ToString(); |
372 | logResponse.InventoryRoot = InventoryRoot; | 372 | logResponse.InventoryRoot = InventoryRoot; |
373 | logResponse.InventorySkeleton = AgentInventoryArray; | 373 | logResponse.InventorySkeleton = AgentInventoryArray; |
374 | logResponse.InventoryLibrary = GetInventoryLibrary(); | 374 | logResponse.InventoryLibrary = GetInventoryLibrary(); |
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 91c284c..0473701 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -342,7 +342,7 @@ namespace OpenSim.Framework.UserManagement | |||
342 | UserAgentData agent = new UserAgentData(); | 342 | UserAgentData agent = new UserAgentData(); |
343 | 343 | ||
344 | // User connection | 344 | // User connection |
345 | agent.agentOnline = true; | 345 | agent.AgentOnline = true; |
346 | 346 | ||
347 | // Generate sessions | 347 | // Generate sessions |
348 | RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); | 348 | RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); |
@@ -351,15 +351,15 @@ namespace OpenSim.Framework.UserManagement | |||
351 | rand.GetBytes(randDataS); | 351 | rand.GetBytes(randDataS); |
352 | rand.GetBytes(randDataSS); | 352 | rand.GetBytes(randDataSS); |
353 | 353 | ||
354 | agent.secureSessionID = new LLUUID(randDataSS, 0); | 354 | agent.SecureSessionID = new LLUUID(randDataSS, 0); |
355 | agent.sessionID = new LLUUID(randDataS, 0); | 355 | agent.SessionID = new LLUUID(randDataS, 0); |
356 | 356 | ||
357 | // Profile UUID | 357 | // Profile UUID |
358 | agent.UUID = profile.ID; | 358 | agent.ProfileID = profile.ID; |
359 | 359 | ||
360 | // Current position (from Home) | 360 | // Current position (from Home) |
361 | agent.currentHandle = profile.HomeRegion; | 361 | agent.CurrentHandle = profile.HomeRegion; |
362 | agent.currentPos = profile.HomeLocation; | 362 | agent.CurrentPos = profile.HomeLocation; |
363 | 363 | ||
364 | // If user specified additional start, use that | 364 | // If user specified additional start, use that |
365 | if (requestData.ContainsKey("start")) | 365 | if (requestData.ContainsKey("start")) |
@@ -367,16 +367,16 @@ namespace OpenSim.Framework.UserManagement | |||
367 | string startLoc = ((string)requestData["start"]).Trim(); | 367 | string startLoc = ((string)requestData["start"]).Trim(); |
368 | if (("last" == startLoc) && (profile.CurrentAgent != null)) | 368 | if (("last" == startLoc) && (profile.CurrentAgent != null)) |
369 | { | 369 | { |
370 | if ((profile.CurrentAgent.currentPos.X > 0) | 370 | if ((profile.CurrentAgent.CurrentPos.X > 0) |
371 | && (profile.CurrentAgent.currentPos.Y > 0) | 371 | && (profile.CurrentAgent.CurrentPos.Y > 0) |
372 | && (profile.CurrentAgent.currentPos.Z > 0) | 372 | && (profile.CurrentAgent.CurrentPos.Z > 0) |
373 | ) | 373 | ) |
374 | { | 374 | { |
375 | // TODO: Right now, currentRegion has not been used in GridServer for requesting region. | 375 | // TODO: Right now, currentRegion has not been used in GridServer for requesting region. |
376 | // TODO: It is only using currentHandle. | 376 | // TODO: It is only using currentHandle. |
377 | agent.currentRegion = profile.CurrentAgent.currentRegion; | 377 | agent.CurrentRegion = profile.CurrentAgent.CurrentRegion; |
378 | agent.currentHandle = profile.CurrentAgent.currentHandle; | 378 | agent.CurrentHandle = profile.CurrentAgent.CurrentHandle; |
379 | agent.currentPos = profile.CurrentAgent.currentPos; | 379 | agent.CurrentPos = profile.CurrentAgent.CurrentPos; |
380 | } | 380 | } |
381 | } | 381 | } |
382 | 382 | ||
@@ -399,12 +399,12 @@ namespace OpenSim.Framework.UserManagement | |||
399 | } | 399 | } |
400 | 400 | ||
401 | // What time did the user login? | 401 | // What time did the user login? |
402 | agent.loginTime = Util.UnixTimeSinceEpoch(); | 402 | agent.LoginTime = Util.UnixTimeSinceEpoch(); |
403 | agent.logoutTime = 0; | 403 | agent.LogoutTime = 0; |
404 | 404 | ||
405 | // Current location | 405 | // Current location |
406 | agent.regionID = LLUUID.Zero; // Fill in later | 406 | agent.RegionID = LLUUID.Zero; // Fill in later |
407 | agent.currentRegion = LLUUID.Zero; // Fill in later | 407 | agent.CurrentRegion = LLUUID.Zero; // Fill in later |
408 | 408 | ||
409 | profile.CurrentAgent = agent; | 409 | profile.CurrentAgent = agent; |
410 | } | 410 | } |
@@ -437,16 +437,16 @@ namespace OpenSim.Framework.UserManagement | |||
437 | userAgent = userProfile.CurrentAgent; | 437 | userAgent = userProfile.CurrentAgent; |
438 | if (userAgent != null) | 438 | if (userAgent != null) |
439 | { | 439 | { |
440 | userAgent.agentOnline = false; | 440 | userAgent.AgentOnline = false; |
441 | userAgent.logoutTime = Util.UnixTimeSinceEpoch(); | 441 | userAgent.LogoutTime = Util.UnixTimeSinceEpoch(); |
442 | //userAgent.sessionID = LLUUID.Zero; | 442 | //userAgent.sessionID = LLUUID.Zero; |
443 | if (regionid != LLUUID.Zero) | 443 | if (regionid != LLUUID.Zero) |
444 | { | 444 | { |
445 | userAgent.currentRegion = regionid; | 445 | userAgent.CurrentRegion = regionid; |
446 | } | 446 | } |
447 | 447 | ||
448 | userAgent.currentHandle = regionhandle; | 448 | userAgent.CurrentHandle = regionhandle; |
449 | userAgent.currentPos = currentPos; | 449 | userAgent.CurrentPos = currentPos; |
450 | userProfile.CurrentAgent = userAgent; | 450 | userProfile.CurrentAgent = userAgent; |
451 | 451 | ||
452 | CommitAgent(ref userProfile); | 452 | CommitAgent(ref userProfile); |
@@ -468,7 +468,7 @@ namespace OpenSim.Framework.UserManagement | |||
468 | UserAgentData agent = new UserAgentData(); | 468 | UserAgentData agent = new UserAgentData(); |
469 | 469 | ||
470 | // User connection | 470 | // User connection |
471 | agent.agentOnline = true; | 471 | agent.AgentOnline = true; |
472 | 472 | ||
473 | // Generate sessions | 473 | // Generate sessions |
474 | RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); | 474 | RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); |
@@ -477,23 +477,23 @@ namespace OpenSim.Framework.UserManagement | |||
477 | rand.GetBytes(randDataS); | 477 | rand.GetBytes(randDataS); |
478 | rand.GetBytes(randDataSS); | 478 | rand.GetBytes(randDataSS); |
479 | 479 | ||
480 | agent.secureSessionID = new LLUUID(randDataSS, 0); | 480 | agent.SecureSessionID = new LLUUID(randDataSS, 0); |
481 | agent.sessionID = new LLUUID(randDataS, 0); | 481 | agent.SessionID = new LLUUID(randDataS, 0); |
482 | 482 | ||
483 | // Profile UUID | 483 | // Profile UUID |
484 | agent.UUID = profile.ID; | 484 | agent.ProfileID = profile.ID; |
485 | 485 | ||
486 | // Current position (from Home) | 486 | // Current position (from Home) |
487 | agent.currentHandle = profile.HomeRegion; | 487 | agent.CurrentHandle = profile.HomeRegion; |
488 | agent.currentPos = profile.HomeLocation; | 488 | agent.CurrentPos = profile.HomeLocation; |
489 | 489 | ||
490 | // What time did the user login? | 490 | // What time did the user login? |
491 | agent.loginTime = Util.UnixTimeSinceEpoch(); | 491 | agent.LoginTime = Util.UnixTimeSinceEpoch(); |
492 | agent.logoutTime = 0; | 492 | agent.LogoutTime = 0; |
493 | 493 | ||
494 | // Current location | 494 | // Current location |
495 | agent.regionID = LLUUID.Zero; // Fill in later | 495 | agent.RegionID = LLUUID.Zero; // Fill in later |
496 | agent.currentRegion = LLUUID.Zero; // Fill in later | 496 | agent.CurrentRegion = LLUUID.Zero; // Fill in later |
497 | 497 | ||
498 | profile.CurrentAgent = agent; | 498 | profile.CurrentAgent = agent; |
499 | } | 499 | } |
diff --git a/OpenSim/Framework/UserAgentData.cs b/OpenSim/Framework/UserAgentData.cs index 8c6baf0..18e8580 100644 --- a/OpenSim/Framework/UserAgentData.cs +++ b/OpenSim/Framework/UserAgentData.cs | |||
@@ -38,62 +38,171 @@ namespace OpenSim.Framework | |||
38 | /// <summary> | 38 | /// <summary> |
39 | /// The UUID of the users avatar (not the agent!) | 39 | /// The UUID of the users avatar (not the agent!) |
40 | /// </summary> | 40 | /// </summary> |
41 | public LLUUID UUID; | 41 | private LLUUID UUID; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// The IP address of the user | 44 | /// The IP address of the user |
45 | /// </summary> | 45 | /// </summary> |
46 | public string agentIP = String.Empty; | 46 | private string agentIP = String.Empty; |
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | /// The port of the user | 49 | /// The port of the user |
50 | |||
50 | /// </summary> | 51 | /// </summary> |
51 | public uint agentPort; | 52 | private uint agentPort; |
52 | 53 | ||
53 | /// <summary> | 54 | /// <summary> |
54 | /// Is the user online? | 55 | /// Is the user online? |
55 | /// </summary> | 56 | /// </summary> |
56 | public bool agentOnline; | 57 | private bool agentOnline; |
57 | 58 | ||
58 | /// <summary> | 59 | /// <summary> |
59 | /// The session ID for the user (also the agent ID) | 60 | /// The session ID for the user (also the agent ID) |
60 | /// </summary> | 61 | /// </summary> |
61 | public LLUUID sessionID; | 62 | private LLUUID sessionID; |
62 | 63 | ||
63 | /// <summary> | 64 | /// <summary> |
64 | /// The "secure" session ID for the user | 65 | /// The "secure" session ID for the user |
65 | /// </summary> | 66 | /// </summary> |
66 | /// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks> | 67 | /// <remarks>Not very secure. Dont rely on it for anything more than Linden Lab does.</remarks> |
67 | public LLUUID secureSessionID; | 68 | private LLUUID secureSessionID; |
68 | 69 | ||
69 | /// <summary> | 70 | /// <summary> |
70 | /// The region the user logged into initially | 71 | /// The region the user logged into initially |
71 | /// </summary> | 72 | /// </summary> |
72 | public LLUUID regionID; | 73 | private LLUUID regionID; |
73 | 74 | ||
74 | /// <summary> | 75 | /// <summary> |
75 | /// A unix timestamp from when the user logged in | 76 | /// A unix timestamp from when the user logged in |
76 | /// </summary> | 77 | /// </summary> |
77 | public int loginTime; | 78 | private int loginTime; |
78 | 79 | ||
79 | /// <summary> | 80 | /// <summary> |
80 | /// When this agent expired and logged out, 0 if still online | 81 | /// When this agent expired and logged out, 0 if still online |
81 | /// </summary> | 82 | /// </summary> |
82 | public int logoutTime; | 83 | private int logoutTime; |
83 | 84 | ||
84 | /// <summary> | 85 | /// <summary> |
85 | /// Current region the user is logged into | 86 | /// Current region the user is logged into |
86 | /// </summary> | 87 | /// </summary> |
87 | public LLUUID currentRegion; | 88 | private LLUUID currentRegion; |
88 | 89 | ||
89 | /// <summary> | 90 | /// <summary> |
90 | /// Region handle of the current region the user is in | 91 | /// Region handle of the current region the user is in |
91 | /// </summary> | 92 | /// </summary> |
92 | public ulong currentHandle; | 93 | private ulong currentHandle; |
93 | 94 | ||
94 | /// <summary> | 95 | /// <summary> |
95 | /// The position of the user within the region | 96 | /// The position of the user within the region |
96 | /// </summary> | 97 | /// </summary> |
97 | public LLVector3 currentPos; | 98 | private LLVector3 currentPos; |
99 | |||
100 | public LLUUID ProfileID { | ||
101 | get { | ||
102 | return UUID; | ||
103 | } | ||
104 | set { | ||
105 | UUID = value; | ||
106 | } | ||
107 | } | ||
108 | |||
109 | public string AgentIP { | ||
110 | get { | ||
111 | return agentIP; | ||
112 | } | ||
113 | set { | ||
114 | agentIP = value; | ||
115 | } | ||
116 | } | ||
117 | |||
118 | public uint AgentPort { | ||
119 | get { | ||
120 | return agentPort; | ||
121 | } | ||
122 | set { | ||
123 | agentPort = value; | ||
124 | } | ||
125 | } | ||
126 | |||
127 | public bool AgentOnline { | ||
128 | get { | ||
129 | return agentOnline; | ||
130 | } | ||
131 | set { | ||
132 | agentOnline = value; | ||
133 | } | ||
134 | } | ||
135 | |||
136 | public LLUUID SessionID { | ||
137 | get { | ||
138 | return sessionID; | ||
139 | } | ||
140 | set { | ||
141 | sessionID = value; | ||
142 | } | ||
143 | } | ||
144 | |||
145 | public LLUUID SecureSessionID { | ||
146 | get { | ||
147 | return secureSessionID; | ||
148 | } | ||
149 | set { | ||
150 | secureSessionID = value; | ||
151 | } | ||
152 | } | ||
153 | |||
154 | public LLUUID RegionID { | ||
155 | get { | ||
156 | return regionID; | ||
157 | } | ||
158 | set { | ||
159 | regionID = value; | ||
160 | } | ||
161 | } | ||
162 | |||
163 | public int LoginTime { | ||
164 | get { | ||
165 | return loginTime; | ||
166 | } | ||
167 | set { | ||
168 | loginTime = value; | ||
169 | } | ||
170 | } | ||
171 | |||
172 | public int LogoutTime { | ||
173 | get { | ||
174 | return logoutTime; | ||
175 | } | ||
176 | set { | ||
177 | logoutTime = value; | ||
178 | } | ||
179 | } | ||
180 | |||
181 | public LLUUID CurrentRegion { | ||
182 | get { | ||
183 | return currentRegion; | ||
184 | } | ||
185 | set { | ||
186 | currentRegion = value; | ||
187 | } | ||
188 | } | ||
189 | |||
190 | public ulong CurrentHandle { | ||
191 | get { | ||
192 | return currentHandle; | ||
193 | } | ||
194 | set { | ||
195 | currentHandle = value; | ||
196 | } | ||
197 | } | ||
198 | |||
199 | public LLVector3 CurrentPos { | ||
200 | get { | ||
201 | return currentPos; | ||
202 | } | ||
203 | set { | ||
204 | currentPos = value; | ||
205 | } | ||
206 | } | ||
98 | } | 207 | } |
99 | } | 208 | } |