aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/Local/LocalLoginService.cs
diff options
context:
space:
mode:
authorlbsa712007-10-30 09:05:31 +0000
committerlbsa712007-10-30 09:05:31 +0000
commit67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch)
tree20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Region/Communications/Local/LocalLoginService.cs
parent* Deleted .user file (diff)
downloadopensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz
* Optimized usings
* Shortened type references * Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Region/Communications/Local/LocalLoginService.cs')
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs49
1 files changed, 26 insertions, 23 deletions
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;
30using System.Collections; 30using System.Collections;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using libsecondlife; 32using libsecondlife;
33using OpenSim.Framework.Communications;
34using OpenSim.Framework; 33using OpenSim.Framework;
35using OpenSim.Framework.UserManagement; 34using OpenSim.Framework.UserManagement;
35using InventoryFolder=OpenSim.Framework.InventoryFolder;
36 36
37namespace OpenSim.Region.Communications.Local 37namespace OpenSim.Region.Communications.Local
38{ 38{
@@ -49,23 +49,23 @@ namespace OpenSim.Region.Communications.Local
49 49
50 public event LoginToRegionEvent OnLoginToRegion; 50 public event LoginToRegionEvent OnLoginToRegion;
51 51
52 public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate) 52 public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent,
53 NetworkServersInfo serversInfo, bool authenticate)
53 : base(userManager, welcomeMess) 54 : base(userManager, welcomeMess)
54 { 55 {
55 m_Parent = parent; 56 m_Parent = parent;
56 this.serversInfo = serversInfo; 57 this.serversInfo = serversInfo;
57 defaultHomeX = this.serversInfo.DefaultHomeLocX; 58 defaultHomeX = this.serversInfo.DefaultHomeLocX;
58 defaultHomeY = this.serversInfo.DefaultHomeLocY; 59 defaultHomeY = this.serversInfo.DefaultHomeLocY;
59 this.authUsers = authenticate; 60 authUsers = authenticate;
60 } 61 }
61 62
62 63
63 public override UserProfileData GetTheUser(string firstname, string lastname) 64 public override UserProfileData GetTheUser(string firstname, string lastname)
64 { 65 {
65 UserProfileData profile = this.m_userManager.GetUserProfile(firstname, lastname); 66 UserProfileData profile = m_userManager.GetUserProfile(firstname, lastname);
66 if (profile != null) 67 if (profile != null)
67 { 68 {
68
69 return profile; 69 return profile;
70 } 70 }
71 71
@@ -73,9 +73,9 @@ namespace OpenSim.Region.Communications.Local
73 { 73 {
74 //no current user account so make one 74 //no current user account so make one
75 Console.WriteLine("No User account found so creating a new one "); 75 Console.WriteLine("No User account found so creating a new one ");
76 this.m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY); 76 m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY);
77 77
78 profile = this.m_userManager.GetUserProfile(firstname, lastname); 78 profile = m_userManager.GetUserProfile(firstname, lastname);
79 if (profile != null) 79 if (profile != null)
80 { 80 {
81 m_Parent.InventoryService.CreateNewUserInventory(profile.UUID); 81 m_Parent.InventoryService.CreateNewUserInventory(profile.UUID);
@@ -113,18 +113,22 @@ namespace OpenSim.Region.Communications.Local
113 113
114 if (reg != null) 114 if (reg != null)
115 { 115 {
116 response.Home = "{'region_handle':[r" + (reg.RegionLocX * 256).ToString() + ",r" + (reg.RegionLocY * 256).ToString() + "], " + 116 response.Home = "{'region_handle':[r" + (reg.RegionLocX*256).ToString() + ",r" +
117 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + 117 (reg.RegionLocY*256).ToString() + "], " +
118 "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; 118 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" +
119 theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
120 "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" +
121 theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
119 string capsPath = Util.GetRandomCapsPath(); 122 string capsPath = Util.GetRandomCapsPath();
120 response.SimAddress = reg.ExternalEndPoint.Address.ToString(); 123 response.SimAddress = reg.ExternalEndPoint.Address.ToString();
121 response.SimPort = (Int32)reg.ExternalEndPoint.Port; 124 response.SimPort = (Int32) reg.ExternalEndPoint.Port;
122 response.RegionX = reg.RegionLocX; 125 response.RegionX = reg.RegionLocX;
123 response.RegionY = reg.RegionLocY; 126 response.RegionY = reg.RegionLocY;
124
125 127
126 response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; 128
127 // response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/"; 129 response.SeedCapability = "http://" + reg.ExternalHostName + ":" +
130 serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/";
131 // response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/";
128 theUser.currentAgent.currentRegion = reg.RegionID; 132 theUser.currentAgent.currentRegion = reg.RegionID;
129 theUser.currentAgent.currentHandle = reg.RegionHandle; 133 theUser.currentAgent.currentHandle = reg.RegionHandle;
130 134
@@ -135,11 +139,11 @@ namespace OpenSim.Region.Communications.Local
135 _login.Agent = response.AgentID; 139 _login.Agent = response.AgentID;
136 _login.Session = response.SessionID; 140 _login.Session = response.SessionID;
137 _login.SecureSession = response.SecureSessionID; 141 _login.SecureSession = response.SecureSessionID;
138 _login.CircuitCode = (uint)response.CircuitCode; 142 _login.CircuitCode = (uint) response.CircuitCode;
139 _login.StartPos = new LLVector3(128, 128, 70); 143 _login.StartPos = new LLVector3(128, 128, 70);
140 _login.CapsPath = capsPath; 144 _login.CapsPath = capsPath;
141 145
142 if( OnLoginToRegion != null ) 146 if (OnLoginToRegion != null)
143 { 147 {
144 OnLoginToRegion(currentRegion, _login); 148 OnLoginToRegion(currentRegion, _login);
145 } 149 }
@@ -148,7 +152,6 @@ namespace OpenSim.Region.Communications.Local
148 { 152 {
149 Console.WriteLine("not found region " + currentRegion); 153 Console.WriteLine("not found region " + currentRegion);
150 } 154 }
151
152 } 155 }
153 156
154 protected override InventoryData CreateInventoryData(LLUUID userID) 157 protected override InventoryData CreateInventoryData(LLUUID userID)
@@ -168,8 +171,8 @@ namespace OpenSim.Region.Communications.Local
168 TempHash = new Hashtable(); 171 TempHash = new Hashtable();
169 TempHash["name"] = InvFolder.name; 172 TempHash["name"] = InvFolder.name;
170 TempHash["parent_id"] = InvFolder.parentID.ToStringHyphenated(); 173 TempHash["parent_id"] = InvFolder.parentID.ToStringHyphenated();
171 TempHash["version"] = (Int32)InvFolder.version; 174 TempHash["version"] = (Int32) InvFolder.version;
172 TempHash["type_default"] = (Int32)InvFolder.type; 175 TempHash["type_default"] = (Int32) InvFolder.type;
173 TempHash["folder_id"] = InvFolder.folderID.ToStringHyphenated(); 176 TempHash["folder_id"] = InvFolder.folderID.ToStringHyphenated();
174 AgentInventoryArray.Add(TempHash); 177 AgentInventoryArray.Add(TempHash);
175 } 178 }
@@ -182,13 +185,13 @@ namespace OpenSim.Region.Communications.Local
182 185
183 ArrayList AgentInventoryArray = new ArrayList(); 186 ArrayList AgentInventoryArray = new ArrayList();
184 Hashtable TempHash; 187 Hashtable TempHash;
185 foreach (OpenSim.Framework.InventoryFolder InvFolder in userInventory.InventoryFolders.Values) 188 foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
186 { 189 {
187 TempHash = new Hashtable(); 190 TempHash = new Hashtable();
188 TempHash["name"] = InvFolder.FolderName; 191 TempHash["name"] = InvFolder.FolderName;
189 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); 192 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
190 TempHash["version"] = (Int32)InvFolder.Version; 193 TempHash["version"] = (Int32) InvFolder.Version;
191 TempHash["type_default"] = (Int32)InvFolder.DefaultType; 194 TempHash["type_default"] = (Int32) InvFolder.DefaultType;
192 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); 195 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
193 AgentInventoryArray.Add(TempHash); 196 AgentInventoryArray.Add(TempHash);
194 } 197 }
@@ -197,4 +200,4 @@ namespace OpenSim.Region.Communications.Local
197 } 200 }
198 } 201 }
199 } 202 }
200} 203} \ No newline at end of file