mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
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
This commit is contained in:
@@ -30,8 +30,8 @@ namespace OpenSim.UserServer
|
||||
|
||||
public override void CustomiseResponse(ref System.Collections.Hashtable response, UserProfile theUser)
|
||||
{
|
||||
uint circode = (uint)response["circuit_code"];
|
||||
theUser.AddSimCircuit(circode, LLUUID.Random());
|
||||
Int32 circode = (Int32)response["circuit_code"];
|
||||
theUser.AddSimCircuit((uint)circode, LLUUID.Random());
|
||||
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() + "]}";
|
||||
response["sim_port"] = m_port;
|
||||
response["sim_ip"] = m_ipAddr;
|
||||
@@ -40,18 +40,18 @@ namespace OpenSim.UserServer
|
||||
|
||||
string first;
|
||||
string last;
|
||||
if (response.Contains("first"))
|
||||
if (response.Contains("first_name"))
|
||||
{
|
||||
first = (string)response["first"];
|
||||
first = (string)response["first_name"];
|
||||
}
|
||||
else
|
||||
{
|
||||
first = "test";
|
||||
}
|
||||
|
||||
if (response.Contains("last"))
|
||||
if (response.Contains("last_name"))
|
||||
{
|
||||
last = (string)response["last"];
|
||||
last = (string)response["last_name"];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -67,12 +67,14 @@ namespace OpenSim.UserServer
|
||||
_login.Last = last;
|
||||
_login.Agent = new LLUUID((string)response["agent_id"]) ;
|
||||
_login.Session = new LLUUID((string)response["session_id"]);
|
||||
_login.SecureSession = new LLUUID((string)response["secure_session_id"]);
|
||||
_login.BaseFolder = null;
|
||||
_login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]);
|
||||
|
||||
//working on local computer if so lets add to the gridserver's list of sessions?
|
||||
if (m_gridServer.GetName() == "Local")
|
||||
{
|
||||
Console.WriteLine("adding login data to gridserver");
|
||||
((LocalGridBase)this.m_gridServer).AddNewSession(_login);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,11 +66,12 @@ namespace OpenSim.UserServer
|
||||
private int m_simPort;
|
||||
private string m_simAddr;
|
||||
|
||||
public LoginServer(IGridServer gridServer, string simAddr, int simPort)
|
||||
public LoginServer(IGridServer gridServer, string simAddr, int simPort , bool useAccounts)
|
||||
{
|
||||
m_gridServer = gridServer;
|
||||
m_simPort = simPort;
|
||||
m_simAddr = simAddr;
|
||||
this.userAccounts = useAccounts;
|
||||
}
|
||||
|
||||
// InitializeLogin: initialize the login
|
||||
@@ -395,6 +396,15 @@ namespace OpenSim.UserServer
|
||||
return Regex.Replace(BitConverter.ToString(encodedBytes), "-", "").ToLower();
|
||||
}
|
||||
|
||||
public bool CreateUserAccount(string firstName, string lastName, string password)
|
||||
{
|
||||
Console.WriteLine("creating new user account");
|
||||
string mdPassword = EncodePassword(password);
|
||||
Console.WriteLine("with password: " + mdPassword);
|
||||
this.userManager.CreateNewProfile(firstName, lastName, mdPassword);
|
||||
return true;
|
||||
}
|
||||
|
||||
//IUserServer implementation
|
||||
public AgentInventory RequestAgentsInventory(LLUUID agentID)
|
||||
{
|
||||
@@ -407,6 +417,11 @@ namespace OpenSim.UserServer
|
||||
return aInventory;
|
||||
}
|
||||
|
||||
public bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SetServerInfo(string ServerUrl, string SendKey, string RecvKey)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user