fix localhost not working for direct connection
This commit is contained in:
+4
-1
@@ -31,6 +31,9 @@ namespace Barotrauma.Networking
|
|||||||
{
|
{
|
||||||
if (netServer != null) { return; }
|
if (netServer != null) { return; }
|
||||||
|
|
||||||
|
var address = serverSettings.ListenIPAddress;
|
||||||
|
if (address == IPAddress.Any) address = IPAddress.IPv6Any;
|
||||||
|
|
||||||
netPeerConfiguration = new NetPeerConfiguration("barotrauma")
|
netPeerConfiguration = new NetPeerConfiguration("barotrauma")
|
||||||
{
|
{
|
||||||
AcceptIncomingConnections = true,
|
AcceptIncomingConnections = true,
|
||||||
@@ -38,7 +41,7 @@ namespace Barotrauma.Networking
|
|||||||
MaximumConnections = NetConfig.MaxPlayers * 2,
|
MaximumConnections = NetConfig.MaxPlayers * 2,
|
||||||
EnableUPnP = serverSettings.EnableUPnP,
|
EnableUPnP = serverSettings.EnableUPnP,
|
||||||
Port = serverSettings.Port,
|
Port = serverSettings.Port,
|
||||||
LocalAddress = serverSettings.ListenIPAddress
|
LocalAddress = address
|
||||||
};
|
};
|
||||||
|
|
||||||
netPeerConfiguration.DisableMessageType(NetIncomingMessageType.DebugMessage |
|
netPeerConfiguration.DisableMessageType(NetIncomingMessageType.DebugMessage |
|
||||||
|
|||||||
Reference in New Issue
Block a user