* Pipes IPEndPoint through all Login methods, including LLSD/OSD login paths.

0.6.6-post-fixes
Adam Frisby 2009-05-23 06:14:02 +00:00
parent 31baeef469
commit e9ea959263
6 changed files with 15 additions and 14 deletions

View File

@ -144,7 +144,7 @@ namespace OpenSim.Client.Linden
/// <param name="user"></param>
/// <param name="response"></param>
/// <returns>true if the region was successfully contacted, false otherwise</returns>
protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response)
protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)
{
IPEndPoint endPoint = regionInfo.ExternalEndPoint;
response.SimAddress = endPoint.Address.ToString();

View File

@ -259,7 +259,7 @@ namespace OpenSim.Framework.Communications.Services
/// <param name="user"></param>
/// <param name="response"></param>
/// <returns>true if the region was successfully contacted, false otherwise</returns>
protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response)
protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)
{
IPEndPoint endPoint = regionInfo.ExternalEndPoint;
response.SimAddress = endPoint.Address.ToString();

View File

@ -256,7 +256,7 @@ namespace OpenSim.Framework.Communications.Services
logResponse.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(agentID));
logResponse.StartLocation = startLocationRequest;
if (CustomiseResponse(logResponse, userProfile, startLocationRequest))
if (CustomiseResponse(logResponse, userProfile, startLocationRequest, remoteClient))
{
userProfile.LastLogin = userProfile.CurrentAgent.LoginTime;
CommitAgent(ref userProfile);
@ -351,7 +351,7 @@ namespace OpenSim.Framework.Communications.Services
/// </summary>
/// <param name="request">The LLSD request</param>
/// <returns>The response to send</returns>
public OSD LLSDLoginMethod(OSD request)
public OSD LLSDLoginMethod(OSD request, IPEndPoint remoteClient)
{
// Temporary fix
m_loginMutex.WaitOne();
@ -486,7 +486,7 @@ namespace OpenSim.Framework.Communications.Services
try
{
CustomiseResponse(logResponse, userProfile, startLocationRequest);
CustomiseResponse(logResponse, userProfile, startLocationRequest, remoteClient);
}
catch (Exception ex)
{
@ -891,7 +891,7 @@ namespace OpenSim.Framework.Communications.Services
/// <param name="theUser">The user profile</param>
/// <param name="startLocationRequest">The requested start location</param>
/// <returns>true on success, false if the region was not successfully told to expect a user connection</returns>
public bool CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest)
public bool CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest, IPEndPoint client)
{
// add active gestures to login-response
AddActiveGestures(response, theUser);
@ -984,7 +984,7 @@ namespace OpenSim.Framework.Communications.Services
response.StartLocation = "url";
}
if ((regionInfo != null) && (PrepareLoginToRegion(regionInfo, theUser, response)))
if ((regionInfo != null) && (PrepareLoginToRegion(regionInfo, theUser, response, client)))
{
return true;
}
@ -1015,13 +1015,13 @@ namespace OpenSim.Framework.Communications.Services
theUser.CurrentAgent.Position = new Vector3(128, 128, 0);
response.StartLocation = "safe";
return PrepareLoginToRegion(regionInfo, theUser, response);
return PrepareLoginToRegion(regionInfo, theUser, response, client);
}
protected abstract RegionInfo RequestClosestRegion(string region);
protected abstract RegionInfo GetRegionInfo(ulong homeRegionHandle);
protected abstract RegionInfo GetRegionInfo(UUID homeRegionId);
protected abstract bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response);
protected abstract bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint client);
/// <summary>
/// Add active gestures of the user to the login response.

View File

@ -755,7 +755,7 @@ namespace OpenSim.Framework.Servers.HttpServer
if (m_defaultLlsdHandler != null)
{
// LibOMV path
llsdResponse = m_defaultLlsdHandler(llsdRequest);
llsdResponse = m_defaultLlsdHandler(llsdRequest, request.RemoteIPEndPoint);
}
else
{

View File

@ -25,10 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Net;
using OpenMetaverse.StructuredData;
namespace OpenSim.Framework.Servers.HttpServer
{
public delegate OSD LLSDMethod( string path, OSD request, string endpoint );
public delegate OSD DefaultLLSDMethod(OSD request);
public delegate OSD DefaultLLSDMethod(OSD request, IPEndPoint client);
}

View File

@ -246,9 +246,9 @@ namespace OpenSim.Grid.UserServer.Modules
}
}
protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response)
protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)
{
return PrepareLoginToRegion(RegionProfileData.FromRegionInfo(regionInfo), user, response);
return PrepareLoginToRegion(RegionProfileData.FromRegionInfo(regionInfo), user, response, remoteClient);
}
/// <summary>
@ -259,7 +259,7 @@ namespace OpenSim.Grid.UserServer.Modules
/// <param name="user"></param>
/// <param name="response"></param>
/// <returns>true if the region was successfully contacted, false otherwise</returns>
private bool PrepareLoginToRegion(RegionProfileData regionInfo, UserProfileData user, LoginResponse response)
private bool PrepareLoginToRegion(RegionProfileData regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)
{
try
{