From a9dde515ba7d35b6069a3b2cd8b66bb72b007801 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 22 Jun 2007 18:28:49 +0000 Subject: SandBox mode login now shares a base class with the grid mode user server. To allow people to login without creating accounts first in sandbox mode anytime a login request is received without a matching account already being in the database, a new account will be made. (also in sandbox mode, passwords aren't currently used). --- Common/OpenSim.Servers/LoginResponse.cs | 58 ++++++++++++--------------------- Common/OpenSim.Servers/LoginServer.cs | 31 ++---------------- 2 files changed, 23 insertions(+), 66 deletions(-) (limited to 'Common/OpenSim.Servers') diff --git a/Common/OpenSim.Servers/LoginResponse.cs b/Common/OpenSim.Servers/LoginResponse.cs index debfe43..dc4732c 100644 --- a/Common/OpenSim.Servers/LoginResponse.cs +++ b/Common/OpenSim.Servers/LoginResponse.cs @@ -72,7 +72,7 @@ namespace OpenSim.UserServer private ArrayList initialOutfit; private ArrayList agentInventory; - private UserProfile userProfile; + private UserInfo userProfile; private LLUUID agentID; private LLUUID sessionID; @@ -131,7 +131,7 @@ namespace OpenSim.UserServer this.uiConfigHash = new Hashtable(); this.defaultXmlRpcResponse = new XmlRpcResponse(); - this.userProfile = new UserProfile(); + this.userProfile = new UserInfo(); this.inventoryRoot = new ArrayList(); this.initialOutfit = new ArrayList(); this.agentInventory = new ArrayList(); @@ -181,28 +181,9 @@ namespace OpenSim.UserServer this.AddClassifiedCategory((Int32)8, "Service"); this.AddClassifiedCategory((Int32)9, "Personal"); - int SessionRand = Util.RandomClass.Next(1, 999); - this.SessionID = new LLUUID("aaaabbbb-0200-" + SessionRand.ToString("0000") + "-8664-58f53e442797"); + this.SessionID = LLUUID.Random(); this.SecureSessionID = LLUUID.Random(); - - this.userProfile.Inventory.CreateRootFolder(this.userProfile.UUID, true); - this.baseFolderID = this.userProfile.Inventory.GetFolderID("Textures"); - this.inventoryFolderID = this.userProfile.Inventory.GetFolderID("My Inventory-"); - Hashtable InventoryRootHash = new Hashtable(); - InventoryRootHash["folder_id"] = this.userProfile.Inventory.InventoryRoot.FolderID.ToStringHyphenated(); - this.inventoryRoot.Add(InventoryRootHash); - - Hashtable TempHash; - foreach (InventoryFolder InvFolder in this.userProfile.Inventory.InventoryFolders.Values) - { - TempHash = new Hashtable(); - TempHash["name"] = InvFolder.FolderName; - TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); - TempHash["version"] = (Int32)InvFolder.Version; - TempHash["type_default"] = (Int32)InvFolder.DefaultType; - TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); - this.agentInventory.Add(TempHash); - } + this.AgentID = LLUUID.Random(); Hashtable InitialOutfitHash = new Hashtable(); InitialOutfitHash["folder_name"] = "Nightclub Female"; @@ -219,15 +200,6 @@ namespace OpenSim.UserServer } // SetDefaultValues - protected virtual LLUUID GetAgentId() - { - // todo - LLUUID Agent; - int AgentRand = Util.RandomClass.Next(1, 9999); - Agent = new LLUUID("99998888-0100-" + AgentRand.ToString("0000") + "-8ec1-0b1d5cd6aead"); - return Agent; - } // GetAgentId - private XmlRpcResponse GenerateFailureResponse(string reason, string message, string login) { // Overwrite any default values; @@ -287,9 +259,6 @@ namespace OpenSim.UserServer this.AddToUIConfig("allow_first_life", this.allowFirstLife); this.uiConfig.Add(this.uiConfigHash); - // Create a agent and session LLUUID - this.agentID = this.GetAgentId(); - responseData["sim_port"] = this.SimPort; responseData["sim_ip"] = this.SimAddress; responseData["agent_id"] = this.AgentID.ToStringHyphenated(); @@ -320,6 +289,9 @@ namespace OpenSim.UserServer responseData["region_x"] = (Int32)this.RegionX * 256; responseData["region_y"] = (Int32)this.RegionY * 256; + //responseData["inventory-lib-root"] = new ArrayList(); // todo + //responseData["buddy-list"] = new ArrayList(); // todo + responseData["login"] = "true"; this.xmlRpcResponse.Value = responseData; @@ -355,6 +327,7 @@ namespace OpenSim.UserServer // this.classifiedCategoriesHash.Clear(); } // SetClassifiedCategory + #region Properties public string Login { get @@ -667,5 +640,16 @@ namespace OpenSim.UserServer } } // ErrorMessage - } // LoginResponse -} // namespace OpenSim.UserServer \ No newline at end of file + #endregion + + + public class UserInfo + { + public string firstname; + public string lastname; + public ulong homeregionhandle; + public LLVector3 homepos; + public LLVector3 homelookat; + } + } +} \ No newline at end of file diff --git a/Common/OpenSim.Servers/LoginServer.cs b/Common/OpenSim.Servers/LoginServer.cs index 1243147..e5373dd 100644 --- a/Common/OpenSim.Servers/LoginServer.cs +++ b/Common/OpenSim.Servers/LoginServer.cs @@ -148,36 +148,14 @@ namespace OpenSim.UserServer NumClients++; - // Create a agent and session LLUUID - // Agent = GetAgentId(first, last); - // int SessionRand = Util.RandomClass.Next(1, 999); - // Session = new LLUUID("aaaabbbb-0200-" + SessionRand.ToString("0000") + "-8664-58f53e442797"); - // LLUUID secureSess = LLUUID.Random(); - loginResponse.SimPort = m_simPort.ToString(); loginResponse.SimAddress = m_simAddr.ToString(); - // loginResponse.AgentID = Agent.ToStringHyphenated(); - // loginResponse.SessionID = Session.ToStringHyphenated(); - // loginResponse.SecureSessionID = secureSess.ToStringHyphenated(); + loginResponse.CircuitCode = (Int32)(Util.RandomClass.Next()); XmlRpcResponse response = loginResponse.ToXmlRpcResponse(); Hashtable responseData = (Hashtable)response.Value; - //inventory - /* ArrayList InventoryList = (ArrayList)responseData["inventory-skeleton"]; - Hashtable Inventory1 = (Hashtable)InventoryList[0]; - Hashtable Inventory2 = (Hashtable)InventoryList[1]; - LLUUID BaseFolderID = LLUUID.Random(); - LLUUID InventoryFolderID = LLUUID.Random(); - Inventory2["name"] = "Textures"; - Inventory2["folder_id"] = BaseFolderID.ToStringHyphenated(); - Inventory2["type_default"] = 0; - Inventory1["folder_id"] = InventoryFolderID.ToStringHyphenated(); - - ArrayList InventoryRoot = (ArrayList)responseData["inventory-root"]; - Hashtable Inventoryroot = (Hashtable)InventoryRoot[0]; - Inventoryroot["folder_id"] = InventoryFolderID.ToStringHyphenated(); - */ + CustomiseLoginResponse(responseData, first, last); Login _login = new Login(); @@ -191,11 +169,6 @@ namespace OpenSim.UserServer _login.BaseFolder = loginResponse.BaseFolderID; _login.InventoryFolder = loginResponse.InventoryFolderID; - //working on local computer if so lets add to the gridserver's list of sessions? - /* if (m_gridServer.GetName() == "Local") - { - ((LocalGridBase)m_gridServer).AddNewSession(_login); - }*/ ulong reghand = Helpers.UIntsToLong((regionX * 256), (regionY * 256)); AddSession(reghand,_login); -- cgit v1.1