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.
0.6.0-stable
Teravus Ovares 2008-03-18 03:09:38 +00:00
parent 040a887b9c
commit 4e30f862af
3 changed files with 60 additions and 10 deletions

View File

@ -93,6 +93,14 @@ namespace OpenSim.Framework.UserManagement
(requestData.Contains("passwd") || requestData.Contains("web_login_key")));
bool GoodLogin = false;
string startLocationRequest = "last";
if (requestData.Contains("start"))
{
startLocationRequest = (string)requestData["start"];
m_log.Info("[LOGIN]: Client Requested Start: " + (string)requestData["start"]);
}
UserProfileData userProfile;
LoginResponse logResponse = new LoginResponse();
@ -213,7 +221,7 @@ namespace OpenSim.Framework.UserManagement
try
{
CustomiseResponse(logResponse, userProfile);
CustomiseResponse(logResponse, userProfile, startLocationRequest);
}
catch (Exception e)
{
@ -252,6 +260,8 @@ namespace OpenSim.Framework.UserManagement
{
bool GoodLogin = false;
string startLocationRequest = "last";
UserProfileData userProfile = null;
LoginResponse logResponse = new LoginResponse();
@ -265,6 +275,12 @@ namespace OpenSim.Framework.UserManagement
string lastname = map["last"].AsString();
string passwd = map["passwd"].AsString();
if (map.ContainsKey("start"))
{
m_log.Info("[LOGIN]: StartLocation Requested: " + map["start"].AsString());
startLocationRequest = map["start"].AsString();
}
userProfile = GetTheUser(firstname, lastname);
if (userProfile == null)
{
@ -342,7 +358,7 @@ namespace OpenSim.Framework.UserManagement
try
{
CustomiseResponse(logResponse, userProfile);
CustomiseResponse(logResponse, userProfile, startLocationRequest);
}
catch (Exception ex)
{
@ -376,7 +392,7 @@ namespace OpenSim.Framework.UserManagement
/// </summary>
/// <param name="response">The existing response</param>
/// <param name="theUser">The user profile</param>
public virtual void CustomiseResponse(LoginResponse response, UserProfileData theUser)
public virtual void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest)
{
}

View File

@ -71,7 +71,7 @@ namespace OpenSim.Grid.UserServer
/// </summary>
/// <param name="response">The existing response</param>
/// <param name="theUser">The user profile</param>
public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)
public override void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest)
{
bool tryDefault = false;
//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
try
{
RegionProfileData SimInfo =
RegionProfileData.RequestSimProfileData(
theUser.currentAgent.currentHandle, m_config.GridServerURL,
m_config.GridSendKey, m_config.GridRecvKey);
RegionProfileData SimInfo = null;
if (startLocationRequest == "last")
{
SimInfo =
RegionProfileData.RequestSimProfileData(
theUser.currentAgent.currentHandle, m_config.GridServerURL,
m_config.GridSendKey, m_config.GridRecvKey);
}
else if (startLocationRequest == "home")
{
SimInfo =
RegionProfileData.RequestSimProfileData(
theUser.homeRegion, m_config.GridServerURL,
m_config.GridSendKey, m_config.GridRecvKey);
}
else
{
// TODO: Parse out startlocationrequest string in the format; 'uri:RegionName&X&Y&Z'
SimInfo =
RegionProfileData.RequestSimProfileData(
theUser.currentAgent.currentHandle, m_config.GridServerURL,
m_config.GridSendKey, m_config.GridRecvKey);
}
// Customise the response
//CFK: This is redundant and the next message should always appear.

View File

@ -123,9 +123,23 @@ namespace OpenSim.Region.Communications.Local
}
}
public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)
public override void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest)
{
ulong currentRegion = theUser.currentAgent.currentHandle;
ulong currentRegion = 0;
if (startLocationRequest == "last")
{
currentRegion = theUser.currentAgent.currentHandle;
}
else if (startLocationRequest == "home")
{
currentRegion = theUser.homeRegion;
}
else
{
// TODO: Parse string in the following format: 'uri:RegionName&X&Y&Z'
currentRegion = theUser.currentAgent.currentHandle;
}
RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion);
if (reg != null)