aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/UserManagerBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/UserManagerBase.cs')
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs38
1 files changed, 37 insertions, 1 deletions
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 5d62e5e..bea56ea 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -31,6 +31,7 @@ using System.Collections.Generic;
31using System.Reflection; 31using System.Reflection;
32using System.Security.Cryptography; 32using System.Security.Cryptography;
33using libsecondlife; 33using libsecondlife;
34using libsecondlife.StructuredData;
34using Nwc.XmlRpc; 35using Nwc.XmlRpc;
35using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
36 37
@@ -394,6 +395,41 @@ namespace OpenSim.Framework.UserManagement
394 profile.currentAgent = agent; 395 profile.currentAgent = agent;
395 } 396 }
396 397
398 public void CreateAgent(UserProfileData profile, LLSD request)
399 {
400 UserAgentData agent = new UserAgentData();
401
402 // User connection
403 agent.agentOnline = true;
404
405 // Generate sessions
406 RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
407 byte[] randDataS = new byte[16];
408 byte[] randDataSS = new byte[16];
409 rand.GetBytes(randDataS);
410 rand.GetBytes(randDataSS);
411
412 agent.secureSessionID = new LLUUID(randDataSS, 0);
413 agent.sessionID = new LLUUID(randDataS, 0);
414
415 // Profile UUID
416 agent.UUID = profile.UUID;
417
418 // Current position (from Home)
419 agent.currentHandle = profile.homeRegion;
420 agent.currentPos = profile.homeLocation;
421
422 // What time did the user login?
423 agent.loginTime = Util.UnixTimeSinceEpoch();
424 agent.logoutTime = 0;
425
426 // Current location
427 agent.regionID = LLUUID.Zero; // Fill in later
428 agent.currentRegion = LLUUID.Zero; // Fill in later
429
430 profile.currentAgent = agent;
431 }
432
397 /// <summary> 433 /// <summary>
398 /// Saves a target agent to the database 434 /// Saves a target agent to the database
399 /// </summary> 435 /// </summary>
@@ -445,4 +481,4 @@ namespace OpenSim.Framework.UserManagement
445 public abstract UserProfileData SetupMasterUser(string firstName, string lastName, string password); 481 public abstract UserProfileData SetupMasterUser(string firstName, string lastName, string password);
446 public abstract UserProfileData SetupMasterUser(LLUUID uuid); 482 public abstract UserProfileData SetupMasterUser(LLUUID uuid);
447 } 483 }
448} \ No newline at end of file 484}