aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares2008-03-18 03:09:38 +0000
committerTeravus Ovares2008-03-18 03:09:38 +0000
commit4e30f862af218de783552ffc2ca68ae8a11509c5 (patch)
tree7d8d07d08a16f6407646f6c66516e9df99b7ba84 /OpenSim
parentLast position will be stored in the DB on logout, and the avatar can continue... (diff)
downloadopensim-SC_OLD-4e30f862af218de783552ffc2ca68ae8a11509c5.zip
opensim-SC_OLD-4e30f862af218de783552ffc2ca68ae8a11509c5.tar.gz
opensim-SC_OLD-4e30f862af218de783552ffc2ca68ae8a11509c5.tar.bz2
opensim-SC_OLD-4e30f862af218de783552ffc2ca68ae8a11509c5.tar.xz
Building on Joha's update...
* Server now listens to the client's start location request for 'home' or 'last' and sends the user to the home location or the last location.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs22
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs30
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs18
3 files changed, 60 insertions, 10 deletions
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index fc02ff6..5547c24 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -93,6 +93,14 @@ namespace OpenSim.Framework.UserManagement
93 (requestData.Contains("passwd") || requestData.Contains("web_login_key"))); 93 (requestData.Contains("passwd") || requestData.Contains("web_login_key")));
94 bool GoodLogin = false; 94 bool GoodLogin = false;
95 95
96 string startLocationRequest = "last";
97
98 if (requestData.Contains("start"))
99 {
100 startLocationRequest = (string)requestData["start"];
101 m_log.Info("[LOGIN]: Client Requested Start: " + (string)requestData["start"]);
102 }
103
96 UserProfileData userProfile; 104 UserProfileData userProfile;
97 LoginResponse logResponse = new LoginResponse(); 105 LoginResponse logResponse = new LoginResponse();
98 106
@@ -213,7 +221,7 @@ namespace OpenSim.Framework.UserManagement
213 221
214 try 222 try
215 { 223 {
216 CustomiseResponse(logResponse, userProfile); 224 CustomiseResponse(logResponse, userProfile, startLocationRequest);
217 } 225 }
218 catch (Exception e) 226 catch (Exception e)
219 { 227 {
@@ -252,6 +260,8 @@ namespace OpenSim.Framework.UserManagement
252 { 260 {
253 bool GoodLogin = false; 261 bool GoodLogin = false;
254 262
263 string startLocationRequest = "last";
264
255 UserProfileData userProfile = null; 265 UserProfileData userProfile = null;
256 LoginResponse logResponse = new LoginResponse(); 266 LoginResponse logResponse = new LoginResponse();
257 267
@@ -265,6 +275,12 @@ namespace OpenSim.Framework.UserManagement
265 string lastname = map["last"].AsString(); 275 string lastname = map["last"].AsString();
266 string passwd = map["passwd"].AsString(); 276 string passwd = map["passwd"].AsString();
267 277
278 if (map.ContainsKey("start"))
279 {
280 m_log.Info("[LOGIN]: StartLocation Requested: " + map["start"].AsString());
281 startLocationRequest = map["start"].AsString();
282 }
283
268 userProfile = GetTheUser(firstname, lastname); 284 userProfile = GetTheUser(firstname, lastname);
269 if (userProfile == null) 285 if (userProfile == null)
270 { 286 {
@@ -342,7 +358,7 @@ namespace OpenSim.Framework.UserManagement
342 358
343 try 359 try
344 { 360 {
345 CustomiseResponse(logResponse, userProfile); 361 CustomiseResponse(logResponse, userProfile, startLocationRequest);
346 } 362 }
347 catch (Exception ex) 363 catch (Exception ex)
348 { 364 {
@@ -376,7 +392,7 @@ namespace OpenSim.Framework.UserManagement
376 /// </summary> 392 /// </summary>
377 /// <param name="response">The existing response</param> 393 /// <param name="response">The existing response</param>
378 /// <param name="theUser">The user profile</param> 394 /// <param name="theUser">The user profile</param>
379 public virtual void CustomiseResponse(LoginResponse response, UserProfileData theUser) 395 public virtual void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest)
380 { 396 {
381 } 397 }
382 398
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index e03ac3a..c8d0619 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -71,7 +71,7 @@ namespace OpenSim.Grid.UserServer
71 /// </summary> 71 /// </summary>
72 /// <param name="response">The existing response</param> 72 /// <param name="response">The existing response</param>
73 /// <param name="theUser">The user profile</param> 73 /// <param name="theUser">The user profile</param>
74 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) 74 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest)
75 { 75 {
76 bool tryDefault = false; 76 bool tryDefault = false;
77 //CFK: Since the try is always "tried", the "Home Location" message should always appear, so comment this one. 77 //CFK: Since the try is always "tried", the "Home Location" message should always appear, so comment this one.
@@ -79,10 +79,30 @@ namespace OpenSim.Grid.UserServer
79 79
80 try 80 try
81 { 81 {
82 RegionProfileData SimInfo = 82 RegionProfileData SimInfo = null;
83 RegionProfileData.RequestSimProfileData( 83 if (startLocationRequest == "last")
84 theUser.currentAgent.currentHandle, m_config.GridServerURL, 84 {
85 m_config.GridSendKey, m_config.GridRecvKey); 85 SimInfo =
86 RegionProfileData.RequestSimProfileData(
87 theUser.currentAgent.currentHandle, m_config.GridServerURL,
88 m_config.GridSendKey, m_config.GridRecvKey);
89 }
90 else if (startLocationRequest == "home")
91 {
92 SimInfo =
93 RegionProfileData.RequestSimProfileData(
94 theUser.homeRegion, m_config.GridServerURL,
95 m_config.GridSendKey, m_config.GridRecvKey);
96
97 }
98 else
99 {
100 // TODO: Parse out startlocationrequest string in the format; 'uri:RegionName&X&Y&Z'
101 SimInfo =
102 RegionProfileData.RequestSimProfileData(
103 theUser.currentAgent.currentHandle, m_config.GridServerURL,
104 m_config.GridSendKey, m_config.GridRecvKey);
105 }
86 106
87 // Customise the response 107 // Customise the response
88 //CFK: This is redundant and the next message should always appear. 108 //CFK: This is redundant and the next message should always appear.
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index d7b3a58..6088890 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -123,9 +123,23 @@ namespace OpenSim.Region.Communications.Local
123 } 123 }
124 } 124 }
125 125
126 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) 126 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest)
127 { 127 {
128 ulong currentRegion = theUser.currentAgent.currentHandle; 128 ulong currentRegion = 0;
129 if (startLocationRequest == "last")
130 {
131 currentRegion = theUser.currentAgent.currentHandle;
132 }
133 else if (startLocationRequest == "home")
134 {
135 currentRegion = theUser.homeRegion;
136 }
137 else
138 {
139 // TODO: Parse string in the following format: 'uri:RegionName&X&Y&Z'
140 currentRegion = theUser.currentAgent.currentHandle;
141 }
142
129 RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion); 143 RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion);
130 144
131 if (reg != null) 145 if (reg != null)