]> git.deb.at Git - rhonda/impostor.git/commitdiff
Add a warning for using the default PublicIp
authorminiduikboot <mini@duikbo.at>
Sun, 29 Jan 2023 23:10:55 +0000 (00:10 +0100)
committerminiduikboot <mini@duikbo.at>
Tue, 14 Feb 2023 22:26:32 +0000 (23:26 +0100)
This is a misconfiguration in most cases and it breaks Impostor.Http.
Throw a warning so that people know that they should return to the
install instructions.

src/Impostor.Server/Net/MatchmakerService.cs

index 6973ba3295afb7203db7b6f5baccac9964e4ece8..f76663c7ade4cf27e9f4618765e32f2452e53268 100644 (file)
@@ -36,6 +36,14 @@ namespace Impostor.Server.Net
                 endpoint.Port,
                 _serverConfig.ResolvePublicIp(),
                 _serverConfig.PublicPort);
+
+            // NOTE: If this warning annoys you, set your PublicIp to "localhost"
+            if (_serverConfig.PublicIp == "127.0.0.1")
+            {
+                _logger.LogWarning("Your PublicIp is set to the default value of 127.0.0.1.");
+                _logger.LogWarning("To allow people on other devices to connect to your server, change this value to your Public IP address");
+                _logger.LogWarning("For more info on how to do this see https://github.com/Impostor/Impostor/blob/master/docs/Server-configuration.md");
+            }
         }
 
         public async Task StopAsync(CancellationToken cancellationToken)