From 67e12b95ea7b68f4904a7484d77ecfd787d16d0c Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 30 Oct 2007 09:05:31 +0000 Subject: * Optimized usings * Shortened type references * Removed redundant 'this' qualifier --- .../Communications/Local/LocalLoginService.cs | 49 ++++++++++++---------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region/Communications/Local/LocalLoginService.cs') diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 1043683..aa1a0d9 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -30,9 +30,9 @@ using System; using System.Collections; using System.Collections.Generic; using libsecondlife; -using OpenSim.Framework.Communications; using OpenSim.Framework; using OpenSim.Framework.UserManagement; +using InventoryFolder=OpenSim.Framework.InventoryFolder; namespace OpenSim.Region.Communications.Local { @@ -49,23 +49,23 @@ namespace OpenSim.Region.Communications.Local public event LoginToRegionEvent OnLoginToRegion; - public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate) + public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent, + NetworkServersInfo serversInfo, bool authenticate) : base(userManager, welcomeMess) { m_Parent = parent; this.serversInfo = serversInfo; defaultHomeX = this.serversInfo.DefaultHomeLocX; defaultHomeY = this.serversInfo.DefaultHomeLocY; - this.authUsers = authenticate; + authUsers = authenticate; } public override UserProfileData GetTheUser(string firstname, string lastname) { - UserProfileData profile = this.m_userManager.GetUserProfile(firstname, lastname); + UserProfileData profile = m_userManager.GetUserProfile(firstname, lastname); if (profile != null) { - return profile; } @@ -73,9 +73,9 @@ namespace OpenSim.Region.Communications.Local { //no current user account so make one Console.WriteLine("No User account found so creating a new one "); - this.m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY); + m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY); - profile = this.m_userManager.GetUserProfile(firstname, lastname); + profile = m_userManager.GetUserProfile(firstname, lastname); if (profile != null) { m_Parent.InventoryService.CreateNewUserInventory(profile.UUID); @@ -113,18 +113,22 @@ namespace OpenSim.Region.Communications.Local if (reg != null) { - response.Home = "{'region_handle':[r" + (reg.RegionLocX * 256).ToString() + ",r" + (reg.RegionLocY * 256).ToString() + "], " + - "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + - "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; + response.Home = "{'region_handle':[r" + (reg.RegionLocX*256).ToString() + ",r" + + (reg.RegionLocY*256).ToString() + "], " + + "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + + "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; string capsPath = Util.GetRandomCapsPath(); response.SimAddress = reg.ExternalEndPoint.Address.ToString(); - response.SimPort = (Int32)reg.ExternalEndPoint.Port; + response.SimPort = (Int32) reg.ExternalEndPoint.Port; response.RegionX = reg.RegionLocX; response.RegionY = reg.RegionLocY; - - response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; - // response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/"; + + response.SeedCapability = "http://" + reg.ExternalHostName + ":" + + serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; + // response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/"; theUser.currentAgent.currentRegion = reg.RegionID; theUser.currentAgent.currentHandle = reg.RegionHandle; @@ -135,11 +139,11 @@ namespace OpenSim.Region.Communications.Local _login.Agent = response.AgentID; _login.Session = response.SessionID; _login.SecureSession = response.SecureSessionID; - _login.CircuitCode = (uint)response.CircuitCode; + _login.CircuitCode = (uint) response.CircuitCode; _login.StartPos = new LLVector3(128, 128, 70); _login.CapsPath = capsPath; - if( OnLoginToRegion != null ) + if (OnLoginToRegion != null) { OnLoginToRegion(currentRegion, _login); } @@ -148,7 +152,6 @@ namespace OpenSim.Region.Communications.Local { Console.WriteLine("not found region " + currentRegion); } - } protected override InventoryData CreateInventoryData(LLUUID userID) @@ -168,8 +171,8 @@ namespace OpenSim.Region.Communications.Local TempHash = new Hashtable(); TempHash["name"] = InvFolder.name; TempHash["parent_id"] = InvFolder.parentID.ToStringHyphenated(); - TempHash["version"] = (Int32)InvFolder.version; - TempHash["type_default"] = (Int32)InvFolder.type; + TempHash["version"] = (Int32) InvFolder.version; + TempHash["type_default"] = (Int32) InvFolder.type; TempHash["folder_id"] = InvFolder.folderID.ToStringHyphenated(); AgentInventoryArray.Add(TempHash); } @@ -182,13 +185,13 @@ namespace OpenSim.Region.Communications.Local ArrayList AgentInventoryArray = new ArrayList(); Hashtable TempHash; - foreach (OpenSim.Framework.InventoryFolder InvFolder in userInventory.InventoryFolders.Values) + foreach (InventoryFolder InvFolder in userInventory.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["version"] = (Int32) InvFolder.Version; + TempHash["type_default"] = (Int32) InvFolder.DefaultType; TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); AgentInventoryArray.Add(TempHash); } @@ -197,4 +200,4 @@ namespace OpenSim.Region.Communications.Local } } } -} +} \ No newline at end of file -- cgit v1.1