fix IClientIPEndpoint broken by justin long ago.. but stop using it

except on SceneBanner, later it my be also removed from there and
 everywhere
0.9.0-post-fixes
UbitUmarov 2017-05-22 19:14:19 +01:00
parent 8f9256ea1c
commit 73222e4dd4
4 changed files with 15 additions and 20 deletions

View File

@ -34,6 +34,6 @@ namespace OpenSim.Framework.Client
{
public interface IClientIPEndpoint
{
IPAddress EndPoint { get; }
IPEndPoint RemoteEndPoint { get; }
}
}

View File

@ -62,7 +62,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Handles new client connections
/// Constructor takes a single Packet and authenticates everything
/// </summary>
public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientInventory, IStatsCollector
public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientInventory, IStatsCollector, IClientIPEndpoint
{
/// <value>
/// Debug packet level. See OpenSim.RegisterConsoleCommands() for more details.

View File

@ -53,9 +53,9 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan
if (bans.Count > 0)
{
IClientIPEndpoint ipEndpoint;
if (client.TryGet(out ipEndpoint))
if (client.TryGet(out ipEndpoint) && ipEndpoint.RemoteEndPoint != null)
{
IPAddress end = ipEndpoint.EndPoint;
IPAddress end = ipEndpoint.RemoteEndPoint.Address;
try
{

View File

@ -813,8 +813,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agentCircuit.Id0 = currentAgentCircuit.Id0;
}
IClientIPEndpoint ipepClient;
uint newRegionX, newRegionY, oldRegionX, oldRegionY;
Util.RegionHandleToRegionLoc(destinationHandle, out newRegionX, out newRegionY);
Util.RegionHandleToRegionLoc(sourceRegion.RegionHandle, out oldRegionX, out oldRegionY);
@ -834,11 +832,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
//sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
#region IP Translation for NAT
// Uses ipepClient above
if (sp.ClientView.TryGet(out ipepClient))
{
endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
}
IPEndPoint clientEP = sp.ControllingClient.RemoteEndPoint;
if (clientEP != null && clientEP.Address != null)
endPoint.Address = NetworkUtil.GetIPFor(clientEP.Address, endPoint.Address);
#endregion
agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
}
@ -1746,10 +1743,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (m_eqModule != null)
{
#region IP Translation for NAT
IClientIPEndpoint ipepClient;
if (agent.ClientView.TryGet(out ipepClient))
endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
IPEndPoint clientEP = agent.ControllingClient.RemoteEndPoint;
if (clientEP != null && clientEP.Address != null)
endPoint.Address = NetworkUtil.GetIPFor(clientEP.Address, endPoint.Address);
m_log.DebugFormat("{0} {1} is sending {2} EnableSimulator for neighbour region {3}(loc=<{4},{5}>,siz=<{6},{7}>) " +
"and EstablishAgentCommunication with seed cap {8}", LogHeader,
source.RegionName, agent.Name,
@ -2402,11 +2399,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened
return;
IClientIPEndpoint ipepClient;
if (sp.ClientView.TryGet(out ipepClient))
{
endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
}
IPEndPoint clientEP = sp.ControllingClient.RemoteEndPoint;
if (clientEP != null && clientEP.Address != null)
endPoint.Address = NetworkUtil.GetIPFor(clientEP.Address, endPoint.Address);
#endregion
m_log.DebugFormat("{0} {1} is sending {2} EnableSimulator for neighbour region {3}(loc=<{4},{5}>,siz=<{6},{7}>) " +