mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +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:
@@ -75,10 +75,20 @@ namespace OpenSim
|
||||
private Dictionary<uint, SimClient> m_clientThreads;
|
||||
private AssetCache m_assetCache;
|
||||
private IGridServer m_gridServer;
|
||||
private IUserServer m_userServer = null;
|
||||
private OpenSimNetworkHandler m_application;
|
||||
private InventoryCache m_inventoryCache;
|
||||
private bool m_sandboxMode;
|
||||
|
||||
|
||||
public IUserServer UserServer
|
||||
{
|
||||
set
|
||||
{
|
||||
this.m_userServer = value;
|
||||
}
|
||||
}
|
||||
|
||||
private void ack_pack(Packet Pack)
|
||||
{
|
||||
//libsecondlife.Packets.PacketAckPacket ack_it = new PacketAckPacket();
|
||||
@@ -241,6 +251,15 @@ namespace OpenSim
|
||||
{
|
||||
client.OutPacket(kill);
|
||||
}
|
||||
if (this.m_userServer != null)
|
||||
{
|
||||
this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.m_inventoryCache.ClientLeaving(this.AgentID, null);
|
||||
}
|
||||
|
||||
m_gridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
|
||||
lock (m_world.Entities)
|
||||
{
|
||||
@@ -657,12 +676,16 @@ namespace OpenSim
|
||||
// Create Inventory, currently only works for sandbox mode
|
||||
if (m_sandboxMode)
|
||||
{
|
||||
AgentInventory inventory = null;
|
||||
if (sessionInfo.LoginInfo.InventoryFolder != null)
|
||||
{
|
||||
this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder);
|
||||
inventory = this.CreateInventory(sessionInfo.LoginInfo.InventoryFolder);
|
||||
if (sessionInfo.LoginInfo.BaseFolder != null)
|
||||
{
|
||||
m_inventoryCache.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder);
|
||||
if (!inventory.HasFolder(sessionInfo.LoginInfo.BaseFolder))
|
||||
{
|
||||
m_inventoryCache.CreateNewInventoryFolder(this, sessionInfo.LoginInfo.BaseFolder);
|
||||
}
|
||||
this.newAssetFolder = sessionInfo.LoginInfo.BaseFolder;
|
||||
AssetBase[] inventorySet = m_assetCache.CreateNewInventorySet(this.AgentID);
|
||||
if (inventorySet != null)
|
||||
@@ -683,12 +706,23 @@ namespace OpenSim
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateInventory(LLUUID baseFolder)
|
||||
private AgentInventory CreateInventory(LLUUID baseFolder)
|
||||
{
|
||||
AgentInventory inventory = new AgentInventory();
|
||||
inventory.AgentID = this.AgentID;
|
||||
m_inventoryCache.AddNewAgentsInventory(inventory);
|
||||
m_inventoryCache.CreateNewInventoryFolder(this, baseFolder);
|
||||
AgentInventory inventory = null;
|
||||
if (this.m_userServer != null)
|
||||
{
|
||||
// a user server is set so request the inventory from it
|
||||
inventory = m_inventoryCache.FetchAgentsInventory(this.AgentID, m_userServer);
|
||||
}
|
||||
else
|
||||
{
|
||||
inventory = new AgentInventory();
|
||||
inventory.AgentID = this.AgentID;
|
||||
inventory.CreateRootFolder(this.AgentID, false);
|
||||
m_inventoryCache.AddNewAgentsInventory(inventory);
|
||||
m_inventoryCache.CreateNewInventoryFolder(this, baseFolder);
|
||||
}
|
||||
return inventory;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user