From 1521410e79bcef9605a51c41ab007bfe43f48466 Mon Sep 17 00:00:00 2001 From: miniduikboot Date: Mon, 30 Jan 2023 00:10:55 +0100 Subject: [PATCH] Add a warning for using the default PublicIp 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Impostor.Server/Net/MatchmakerService.cs b/src/Impostor.Server/Net/MatchmakerService.cs index 6973ba3..f76663c 100644 --- a/src/Impostor.Server/Net/MatchmakerService.cs +++ b/src/Impostor.Server/Net/MatchmakerService.cs @@ -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) -- 2.39.5