mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 12:25:42 +08:00
* Adds NAT routing support for MXP Asset Delivery. (This means MXP should be fully NAT compatible.)
This commit is contained in:
@@ -450,11 +450,18 @@ namespace OpenSim.Client.MXP.PacketHandler
|
||||
|
||||
joinResponseMessage.RequestMessageId = joinRequestMessage.MessageId;
|
||||
joinResponseMessage.FailureCode = MxpResponseCodes.SUCCESS;
|
||||
|
||||
|
||||
joinResponseMessage.BubbleId = joinRequestMessage.BubbleId;
|
||||
joinResponseMessage.ParticipantId = userId.Guid;
|
||||
joinResponseMessage.AvatarId = userId.Guid;
|
||||
joinResponseMessage.BubbleAssetCacheUrl = "http://"+m_scenes[new UUID(joinRequestMessage.BubbleId)].RegionInfo.ExternalHostName+":"+m_scenes[new UUID(joinRequestMessage.BubbleId)].RegionInfo.HttpPort+"/assets/";
|
||||
joinResponseMessage.BubbleAssetCacheUrl = "http://" +
|
||||
NetworkUtil.GetHostFor(session.RemoteEndPoint.Address,
|
||||
m_scenes[
|
||||
new UUID(joinRequestMessage.BubbleId)].
|
||||
RegionInfo.
|
||||
ExternalHostName) + ":" +
|
||||
m_scenes[new UUID(joinRequestMessage.BubbleId)].RegionInfo.
|
||||
HttpPort + "/assets/";
|
||||
|
||||
joinResponseMessage.BubbleName = m_scenes[new UUID(joinRequestMessage.BubbleId)].RegionInfo.RegionName;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenSim.Framework
|
||||
{
|
||||
if (host.Equals(user) && host.AddressFamily == AddressFamily.InterNetwork)
|
||||
{
|
||||
m_log.Info("[NATROUTING] Localhost user detected, sending them '" + host + "' instead of '" + simulator + "'");
|
||||
m_log.Info("[NetworkUtil] Localhost user detected, sending them '" + host + "' instead of '" + simulator + "'");
|
||||
return host;
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ namespace OpenSim.Framework
|
||||
|
||||
if (valid)
|
||||
{
|
||||
m_log.Info("[NATROUTING] Local LAN user detected, sending them '" + subnet.Key + "' instead of '" + simulator + "'");
|
||||
m_log.Info("[NetworkUtil] Local LAN user detected, sending them '" + subnet.Key + "' instead of '" + simulator + "'");
|
||||
return subnet.Key;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ namespace OpenSim.Framework
|
||||
{
|
||||
if (host.AddressFamily == AddressFamily.InterNetworkV6)
|
||||
{
|
||||
m_log.Info("[NATROUTING] Localhost user detected, sending them '" + host + "' instead of '" + defaultHostname + "'");
|
||||
m_log.Info("[NetworkUtil] Localhost user detected, sending them '" + host + "' instead of '" + defaultHostname + "'");
|
||||
return host;
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ namespace OpenSim.Framework
|
||||
|
||||
if (valid)
|
||||
{
|
||||
m_log.Info("[NATROUTING] Local LAN user detected, sending them '" + subnet.Key + "' instead of '" + defaultHostname + "'");
|
||||
m_log.Info("[NetworkUtil] Local LAN user detected, sending them '" + subnet.Key + "' instead of '" + defaultHostname + "'");
|
||||
return subnet.Key;
|
||||
}
|
||||
}
|
||||
@@ -154,10 +154,6 @@ namespace OpenSim.Framework
|
||||
{
|
||||
m_subnets.Add(address.Address, address.IPv4Mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[NetworkUtil] Found IPv4 Address without Subnet Mask!?");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user