diff --git a/Ragon.Relay/Sources/Relay.cs b/Ragon.Relay/Sources/Relay.cs index ae8eef4..e63c630 100644 --- a/Ragon.Relay/Sources/Relay.cs +++ b/Ragon.Relay/Sources/Relay.cs @@ -63,6 +63,7 @@ namespace Ragon.Relay Protocol = configuration.Protocol, ServerKey = configuration.ServerKey, ServerTickRate = configuration.ServerTickRate, + ServerAddress = configuration.ServerAddress, }; var relay = new RagonServer(networkServer, plugin, serverConfiguration); diff --git a/Ragon.Relay/Sources/RelayConfiguration.cs b/Ragon.Relay/Sources/RelayConfiguration.cs index ac2510a..da583a3 100644 --- a/Ragon.Relay/Sources/RelayConfiguration.cs +++ b/Ragon.Relay/Sources/RelayConfiguration.cs @@ -7,6 +7,7 @@ namespace Ragon.Relay { public string ServerKey; public string ServerType; + public string ServerAddress; public ushort ServerTickRate; public string Protocol; public ushort Port; diff --git a/Ragon.Relay/relay.config.json b/Ragon.Relay/relay.config.json index bef71d0..811e709 100644 --- a/Ragon.Relay/relay.config.json +++ b/Ragon.Relay/relay.config.json @@ -1,6 +1,7 @@ { "serverKey": "defaultkey", "serverType": "enet", + "serverAddress": "*", "serverTickRate": 30, "protocol": "1.0.0", "port": 5000, diff --git a/Ragon.Server.ENetServer/Sources/ENetServer.cs b/Ragon.Server.ENetServer/Sources/ENetServer.cs index 8b22ae5..456e2e8 100644 --- a/Ragon.Server.ENetServer/Sources/ENetServer.cs +++ b/Ragon.Server.ENetServer/Sources/ENetServer.cs @@ -49,7 +49,7 @@ namespace Ragon.Server.ENetServer _host.Create(address, _connections.Length, 2, 0, 0, 1024 * 1024); var protocolDecoded = RagonVersion.Parse(_protocol); - _logger.Info($"Listen at 127.0.0.1:{configuration.Port}"); + _logger.Info($"Listen at {configuration.Address}:{configuration.Port}"); _logger.Info($"Protocol: {protocolDecoded}"); } diff --git a/Ragon.Server.WebSocketServer/Sources/WebSocketServer.cs b/Ragon.Server.WebSocketServer/Sources/WebSocketServer.cs index 540b6eb..e8a0f19 100644 --- a/Ragon.Server.WebSocketServer/Sources/WebSocketServer.cs +++ b/Ragon.Server.WebSocketServer/Sources/WebSocketServer.cs @@ -146,13 +146,13 @@ public class WebSocketServer : INetworkServer _connections = new WebSocketConnection[configuration.LimitConnections]; _httpListener = new HttpListener(); - _httpListener.Prefixes.Add($"http://+:{configuration.Port}/"); + _httpListener.Prefixes.Add($"http://{configuration.Address}:{configuration.Port}/"); _httpListener.Start(); _executor.Run(() => StartAccept(_cancellationTokenSource.Token)); var protocolDecoded = RagonVersion.Parse(configuration.Protocol); - _logger.Info($"Listen at http://0.0.0.0:{configuration.Port}/"); + _logger.Info($"Listen at http://{configuration.Address}:{configuration.Port}/"); _logger.Info($"Protocol: {protocolDecoded}"); } diff --git a/Ragon.Server/Sources/RagonServer.cs b/Ragon.Server/Sources/RagonServer.cs index 743321c..ab49342 100644 --- a/Ragon.Server/Sources/RagonServer.cs +++ b/Ragon.Server/Sources/RagonServer.cs @@ -118,7 +118,7 @@ public class RagonServer : IRagonServer, INetworkListener { LimitConnections = _configuration.LimitConnections, Protocol = RagonVersion.Parse(_configuration.Protocol), - Address = "0.0.0.0", + Address = _configuration.ServerAddress, Port = _configuration.Port, }; @@ -290,7 +290,7 @@ public class RagonServer : IRagonServer, INetworkListener private void CopyrightInfo() { - _logger.Info($"Ragon Server Version: {ServerVersion}"); + _logger.Info($"Server Version: {ServerVersion}"); _logger.Info($"Machine Name: {Environment.MachineName}"); _logger.Info($"OS: {Environment.OSVersion}"); _logger.Info($"Processors: {Environment.ProcessorCount}"); diff --git a/Ragon.Server/Sources/RagonServerConfiguration.cs b/Ragon.Server/Sources/RagonServerConfiguration.cs index 7ee9277..00ba57a 100644 --- a/Ragon.Server/Sources/RagonServerConfiguration.cs +++ b/Ragon.Server/Sources/RagonServerConfiguration.cs @@ -26,6 +26,7 @@ public enum ServerType public struct RagonServerConfiguration { public string ServerKey; + public string ServerAddress; public ushort ServerTickRate; public string Protocol; public ushort Port;