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 public interface IClientIPEndpoint
{ {
IPAddress EndPoint { get; } IPEndPoint RemoteEndPoint { get; }
} }
} }

View File

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

View File

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