diff options
author | MW | 2007-03-28 18:10:52 +0000 |
---|---|---|
committer | MW | 2007-03-28 18:10:52 +0000 |
commit | 35fa85069e792579ebd44a974053d6dce288ea0a (patch) | |
tree | 8a5629c4f5e0a51e20a05123c4b1b9ea9f49f61e /OpenSim.RegionServer/UserServer | |
parent | * log file name conflict (diff) | |
download | opensim-SC_OLD-35fa85069e792579ebd44a974053d6dce288ea0a.zip opensim-SC_OLD-35fa85069e792579ebd44a974053d6dce288ea0a.tar.gz opensim-SC_OLD-35fa85069e792579ebd44a974053d6dce288ea0a.tar.bz2 opensim-SC_OLD-35fa85069e792579ebd44a974053d6dce288ea0a.tar.xz |
After hours of searching for a bug, it works - User accounts in sandbox mode, currently they are not persistent between restarts (ie restarting opensim.exe) but should be persistent between sessions (login/ logout).
Use the -account command line arg to enable them and then create new accounts through the web interface
Diffstat (limited to 'OpenSim.RegionServer/UserServer')
-rw-r--r-- | OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs | 14 | ||||
-rw-r--r-- | OpenSim.RegionServer/UserServer/LoginServer.cs | 17 |
2 files changed, 24 insertions, 7 deletions
diff --git a/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs b/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs index eee1c3a..b31feda 100644 --- a/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs +++ b/OpenSim.RegionServer/UserServer/LocalUserProfileManager.cs | |||
@@ -30,8 +30,8 @@ namespace OpenSim.UserServer | |||
30 | 30 | ||
31 | public override void CustomiseResponse(ref System.Collections.Hashtable response, UserProfile theUser) | 31 | public override void CustomiseResponse(ref System.Collections.Hashtable response, UserProfile theUser) |
32 | { | 32 | { |
33 | uint circode = (uint)response["circuit_code"]; | 33 | Int32 circode = (Int32)response["circuit_code"]; |
34 | theUser.AddSimCircuit(circode, LLUUID.Random()); | 34 | theUser.AddSimCircuit((uint)circode, LLUUID.Random()); |
35 | response["home"] = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}"; | 35 | response["home"] = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}"; |
36 | response["sim_port"] = m_port; | 36 | response["sim_port"] = m_port; |
37 | response["sim_ip"] = m_ipAddr; | 37 | response["sim_ip"] = m_ipAddr; |
@@ -40,18 +40,18 @@ namespace OpenSim.UserServer | |||
40 | 40 | ||
41 | string first; | 41 | string first; |
42 | string last; | 42 | string last; |
43 | if (response.Contains("first")) | 43 | if (response.Contains("first_name")) |
44 | { | 44 | { |
45 | first = (string)response["first"]; | 45 | first = (string)response["first_name"]; |
46 | } | 46 | } |
47 | else | 47 | else |
48 | { | 48 | { |
49 | first = "test"; | 49 | first = "test"; |
50 | } | 50 | } |
51 | 51 | ||
52 | if (response.Contains("last")) | 52 | if (response.Contains("last_name")) |
53 | { | 53 | { |
54 | last = (string)response["last"]; | 54 | last = (string)response["last_name"]; |
55 | } | 55 | } |
56 | else | 56 | else |
57 | { | 57 | { |
@@ -67,12 +67,14 @@ namespace OpenSim.UserServer | |||
67 | _login.Last = last; | 67 | _login.Last = last; |
68 | _login.Agent = new LLUUID((string)response["agent_id"]) ; | 68 | _login.Agent = new LLUUID((string)response["agent_id"]) ; |
69 | _login.Session = new LLUUID((string)response["session_id"]); | 69 | _login.Session = new LLUUID((string)response["session_id"]); |
70 | _login.SecureSession = new LLUUID((string)response["secure_session_id"]); | ||
70 | _login.BaseFolder = null; | 71 | _login.BaseFolder = null; |
71 | _login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]); | 72 | _login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]); |
72 | 73 | ||
73 | //working on local computer if so lets add to the gridserver's list of sessions? | 74 | //working on local computer if so lets add to the gridserver's list of sessions? |
74 | if (m_gridServer.GetName() == "Local") | 75 | if (m_gridServer.GetName() == "Local") |
75 | { | 76 | { |
77 | Console.WriteLine("adding login data to gridserver"); | ||
76 | ((LocalGridBase)this.m_gridServer).AddNewSession(_login); | 78 | ((LocalGridBase)this.m_gridServer).AddNewSession(_login); |
77 | } | 79 | } |
78 | } | 80 | } |
diff --git a/OpenSim.RegionServer/UserServer/LoginServer.cs b/OpenSim.RegionServer/UserServer/LoginServer.cs index 0bbe0b0..7b4c1f0 100644 --- a/OpenSim.RegionServer/UserServer/LoginServer.cs +++ b/OpenSim.RegionServer/UserServer/LoginServer.cs | |||
@@ -66,11 +66,12 @@ namespace OpenSim.UserServer | |||
66 | private int m_simPort; | 66 | private int m_simPort; |
67 | private string m_simAddr; | 67 | private string m_simAddr; |
68 | 68 | ||
69 | public LoginServer(IGridServer gridServer, string simAddr, int simPort) | 69 | public LoginServer(IGridServer gridServer, string simAddr, int simPort , bool useAccounts) |
70 | { | 70 | { |
71 | m_gridServer = gridServer; | 71 | m_gridServer = gridServer; |
72 | m_simPort = simPort; | 72 | m_simPort = simPort; |
73 | m_simAddr = simAddr; | 73 | m_simAddr = simAddr; |
74 | this.userAccounts = useAccounts; | ||
74 | } | 75 | } |
75 | 76 | ||
76 | // InitializeLogin: initialize the login | 77 | // InitializeLogin: initialize the login |
@@ -395,6 +396,15 @@ namespace OpenSim.UserServer | |||
395 | return Regex.Replace(BitConverter.ToString(encodedBytes), "-", "").ToLower(); | 396 | return Regex.Replace(BitConverter.ToString(encodedBytes), "-", "").ToLower(); |
396 | } | 397 | } |
397 | 398 | ||
399 | public bool CreateUserAccount(string firstName, string lastName, string password) | ||
400 | { | ||
401 | Console.WriteLine("creating new user account"); | ||
402 | string mdPassword = EncodePassword(password); | ||
403 | Console.WriteLine("with password: " + mdPassword); | ||
404 | this.userManager.CreateNewProfile(firstName, lastName, mdPassword); | ||
405 | return true; | ||
406 | } | ||
407 | |||
398 | //IUserServer implementation | 408 | //IUserServer implementation |
399 | public AgentInventory RequestAgentsInventory(LLUUID agentID) | 409 | public AgentInventory RequestAgentsInventory(LLUUID agentID) |
400 | { | 410 | { |
@@ -407,6 +417,11 @@ namespace OpenSim.UserServer | |||
407 | return aInventory; | 417 | return aInventory; |
408 | } | 418 | } |
409 | 419 | ||
420 | public bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory) | ||
421 | { | ||
422 | return true; | ||
423 | } | ||
424 | |||
410 | public void SetServerInfo(string ServerUrl, string SendKey, string RecvKey) | 425 | public void SetServerInfo(string ServerUrl, string SendKey, string RecvKey) |
411 | { | 426 | { |
412 | 427 | ||