Fix inconsistencies with handling errors in early network startup

In most cases, when socket creation, bind, listen, or similar fails,
it's best to gracefully shutdown. We do that now.
This commit is contained in:
Lion Kortlepel
2022-03-24 14:05:40 +01:00
parent 4cb299061e
commit dbfe4a4d11
3 changed files with 40 additions and 26 deletions

View File

@@ -43,6 +43,7 @@ void Application::GracefullyShutdown() {
beammp_info("Subsystem " + std::to_string(i + 1) + "/" + std::to_string(mShutdownHandlers.size()) + " shutting down");
mShutdownHandlers[i]();
}
// std::exit(-1);
}
std::string Application::ServerVersionString() {
@@ -105,7 +106,7 @@ void Application::CheckForUpdates() {
if (Matches) {
auto MyVersion = ServerVersion();
auto RemoteVersion = Version(VersionStrToInts(Response));
if (!IsOutdated(MyVersion, RemoteVersion)) {
if (IsOutdated(MyVersion, RemoteVersion)) {
std::string RealVersionString = RemoteVersion.AsString();
beammp_warn(std::string(ANSI_YELLOW_BOLD) + "NEW VERSION OUT! There's a new version (v" + RealVersionString + ") of the BeamMP-Server available! For more info visit https://wiki.beammp.com/en/home/server-maintenance#updating-the-server." + std::string(ANSI_RESET));
} else {