aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Servers
diff options
context:
space:
mode:
authorMW2007-05-16 17:35:27 +0000
committerMW2007-05-16 17:35:27 +0000
commit1e9a0220e69a62dd45b53753537fb4563e50412c (patch)
treebfe79152761b164dbd437b60dc025aa1f0c8c3fc /OpenSim.Servers
parent* removed unused new-login.dat (diff)
downloadopensim-SC-1e9a0220e69a62dd45b53753537fb4563e50412c.zip
opensim-SC-1e9a0220e69a62dd45b53753537fb4563e50412c.tar.gz
opensim-SC-1e9a0220e69a62dd45b53753537fb4563e50412c.tar.bz2
opensim-SC-1e9a0220e69a62dd45b53753537fb4563e50412c.tar.xz
Quite big change to how Sessions/circuits are Authenticated. Seems to work okay but needs a lot more testing.
Diffstat (limited to '')
-rw-r--r--OpenSim.Servers/LocalUserProfileManager.cs13
-rw-r--r--OpenSim.Servers/LoginServer.cs18
2 files changed, 24 insertions, 7 deletions
diff --git a/OpenSim.Servers/LocalUserProfileManager.cs b/OpenSim.Servers/LocalUserProfileManager.cs
index 2a119c5..a8b5f1f 100644
--- a/OpenSim.Servers/LocalUserProfileManager.cs
+++ b/OpenSim.Servers/LocalUserProfileManager.cs
@@ -45,6 +45,7 @@ namespace OpenSim.UserServer
45 private string m_ipAddr; 45 private string m_ipAddr;
46 private uint regionX; 46 private uint regionX;
47 private uint regionY; 47 private uint regionY;
48 private AddNewSessionHandler AddSession;
48 49
49 public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr , uint regX, uint regY) 50 public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr , uint regX, uint regY)
50 { 51 {
@@ -55,6 +56,11 @@ namespace OpenSim.UserServer
55 regionY = regY; 56 regionY = regY;
56 } 57 }
57 58
59 public void SetSessionHandler(AddNewSessionHandler sessionHandler)
60 {
61 this.AddSession = sessionHandler;
62 }
63
58 public override void InitUserProfiles() 64 public override void InitUserProfiles()
59 { 65 {
60 // TODO: need to load from database 66 // TODO: need to load from database
@@ -100,15 +106,18 @@ namespace OpenSim.UserServer
100 _login.Agent = new LLUUID((string)response["agent_id"]) ; 106 _login.Agent = new LLUUID((string)response["agent_id"]) ;
101 _login.Session = new LLUUID((string)response["session_id"]); 107 _login.Session = new LLUUID((string)response["session_id"]);
102 _login.SecureSession = new LLUUID((string)response["secure_session_id"]); 108 _login.SecureSession = new LLUUID((string)response["secure_session_id"]);
109 _login.CircuitCode =(uint) circode;
103 _login.BaseFolder = null; 110 _login.BaseFolder = null;
104 _login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]); 111 _login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]);
105 112
106 //working on local computer if so lets add to the gridserver's list of sessions? 113 //working on local computer if so lets add to the gridserver's list of sessions?
107 if (m_gridServer.GetName() == "Local") 114 /*if (m_gridServer.GetName() == "Local")
108 { 115 {
109 Console.WriteLine("adding login data to gridserver"); 116 Console.WriteLine("adding login data to gridserver");
110 ((LocalGridBase)this.m_gridServer).AddNewSession(_login); 117 ((LocalGridBase)this.m_gridServer).AddNewSession(_login);
111 } 118 }*/
119
120 this.AddSession(_login);
112 } 121 }
113 } 122 }
114} 123}
diff --git a/OpenSim.Servers/LoginServer.cs b/OpenSim.Servers/LoginServer.cs
index 393237b..6fd174b 100644
--- a/OpenSim.Servers/LoginServer.cs
+++ b/OpenSim.Servers/LoginServer.cs
@@ -47,6 +47,7 @@ using OpenSim.Framework.Types;
47 47
48namespace OpenSim.UserServer 48namespace OpenSim.UserServer
49{ 49{
50 public delegate void AddNewSessionHandler(Login loginData);
50 /// <summary> 51 /// <summary>
51 /// When running in local (default) mode , handles client logins. 52 /// When running in local (default) mode , handles client logins.
52 /// </summary> 53 /// </summary>
@@ -64,6 +65,7 @@ namespace OpenSim.UserServer
64 private string m_simAddr; 65 private string m_simAddr;
65 private uint regionX; 66 private uint regionX;
66 private uint regionY; 67 private uint regionY;
68 private AddNewSessionHandler AddSession;
67 69
68 public LocalUserProfileManager LocalUserManager 70 public LocalUserProfileManager LocalUserManager
69 { 71 {
@@ -73,9 +75,8 @@ namespace OpenSim.UserServer
73 } 75 }
74 } 76 }
75 77
76 public LoginServer(IGridServer gridServer, string simAddr, int simPort, uint regX, uint regY, bool useAccounts) 78 public LoginServer( string simAddr, int simPort, uint regX, uint regY, bool useAccounts)
77 { 79 {
78 m_gridServer = gridServer;
79 m_simPort = simPort; 80 m_simPort = simPort;
80 m_simAddr = simAddr; 81 m_simAddr = simAddr;
81 regionX = regX; 82 regionX = regX;
@@ -83,6 +84,12 @@ namespace OpenSim.UserServer
83 this.userAccounts = useAccounts; 84 this.userAccounts = useAccounts;
84 } 85 }
85 86
87 public void SetSessionHandler(AddNewSessionHandler sessionHandler)
88 {
89 this.AddSession = sessionHandler;
90 this.userManager.SetSessionHandler(sessionHandler);
91 }
92
86 public void Startup() 93 public void Startup()
87 { 94 {
88 this._needPasswd = false; 95 this._needPasswd = false;
@@ -180,15 +187,16 @@ namespace OpenSim.UserServer
180 _login.Agent = loginResponse.AgentID; 187 _login.Agent = loginResponse.AgentID;
181 _login.Session = loginResponse.SessionID; 188 _login.Session = loginResponse.SessionID;
182 _login.SecureSession = loginResponse.SecureSessionID; 189 _login.SecureSession = loginResponse.SecureSessionID;
183 190 _login.CircuitCode = (uint) loginResponse.CircuitCode;
184 _login.BaseFolder = loginResponse.BaseFolderID; 191 _login.BaseFolder = loginResponse.BaseFolderID;
185 _login.InventoryFolder = loginResponse.InventoryFolderID; 192 _login.InventoryFolder = loginResponse.InventoryFolderID;
186 193
187 //working on local computer if so lets add to the gridserver's list of sessions? 194 //working on local computer if so lets add to the gridserver's list of sessions?
188 if (m_gridServer.GetName() == "Local") 195 /* if (m_gridServer.GetName() == "Local")
189 { 196 {
190 ((LocalGridBase)m_gridServer).AddNewSession(_login); 197 ((LocalGridBase)m_gridServer).AddNewSession(_login);
191 } 198 }*/
199 AddSession(_login);
192 200
193 return response; 201 return response;
194 } 202 }