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
parent
040a887b9c
commit
4e30f862af
|
@ -93,6 +93,14 @@ namespace OpenSim.Framework.UserManagement
|
||||||
(requestData.Contains("passwd") || requestData.Contains("web_login_key")));
|
(requestData.Contains("passwd") || requestData.Contains("web_login_key")));
|
||||||
bool GoodLogin = false;
|
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;
|
UserProfileData userProfile;
|
||||||
LoginResponse logResponse = new LoginResponse();
|
LoginResponse logResponse = new LoginResponse();
|
||||||
|
|
||||||
|
@ -213,7 +221,7 @@ namespace OpenSim.Framework.UserManagement
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CustomiseResponse(logResponse, userProfile);
|
CustomiseResponse(logResponse, userProfile, startLocationRequest);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -252,6 +260,8 @@ namespace OpenSim.Framework.UserManagement
|
||||||
{
|
{
|
||||||
bool GoodLogin = false;
|
bool GoodLogin = false;
|
||||||
|
|
||||||
|
string startLocationRequest = "last";
|
||||||
|
|
||||||
UserProfileData userProfile = null;
|
UserProfileData userProfile = null;
|
||||||
LoginResponse logResponse = new LoginResponse();
|
LoginResponse logResponse = new LoginResponse();
|
||||||
|
|
||||||
|
@ -265,6 +275,12 @@ namespace OpenSim.Framework.UserManagement
|
||||||
string lastname = map["last"].AsString();
|
string lastname = map["last"].AsString();
|
||||||
string passwd = map["passwd"].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);
|
userProfile = GetTheUser(firstname, lastname);
|
||||||
if (userProfile == null)
|
if (userProfile == null)
|
||||||
{
|
{
|
||||||
|
@ -342,7 +358,7 @@ namespace OpenSim.Framework.UserManagement
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CustomiseResponse(logResponse, userProfile);
|
CustomiseResponse(logResponse, userProfile, startLocationRequest);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -376,7 +392,7 @@ namespace OpenSim.Framework.UserManagement
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="response">The existing response</param>
|
/// <param name="response">The existing response</param>
|
||||||
/// <param name="theUser">The user profile</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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace OpenSim.Grid.UserServer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="response">The existing response</param>
|
/// <param name="response">The existing response</param>
|
||||||
/// <param name="theUser">The user profile</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;
|
bool tryDefault = false;
|
||||||
//CFK: Since the try is always "tried", the "Home Location" message should always appear, so comment this one.
|
//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
|
try
|
||||||
{
|
{
|
||||||
RegionProfileData SimInfo =
|
RegionProfileData SimInfo = null;
|
||||||
RegionProfileData.RequestSimProfileData(
|
if (startLocationRequest == "last")
|
||||||
theUser.currentAgent.currentHandle, m_config.GridServerURL,
|
{
|
||||||
m_config.GridSendKey, m_config.GridRecvKey);
|
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
|
// Customise the response
|
||||||
//CFK: This is redundant and the next message should always appear.
|
//CFK: This is redundant and the next message should always appear.
|
||||||
|
|
|
@ -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);
|
RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion);
|
||||||
|
|
||||||
if (reg != null)
|
if (reg != null)
|
||||||
|
|
Loading…
Reference in New Issue