mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-07-01 09:10:01 +00:00
Make the server not crash in the case we are using only env-vars
make the dockerfile have configs in the expected location incase of bypassing entrypoint.sh
This commit is contained in:
parent
79f347bedf
commit
d27a3b5680
@ -32,7 +32,9 @@ COPY --from=build /app/build/*Server /app/
|
|||||||
|
|
||||||
# Necessary suplimentary files
|
# Necessary suplimentary files
|
||||||
COPY --from=build /app/build/*.ini /app/default-configs/
|
COPY --from=build /app/build/*.ini /app/default-configs/
|
||||||
COPY --from=build /app/build/vanity /app/default-vanity
|
COPY --from=build /app/build/*.ini /app/configs/
|
||||||
|
COPY --from=build /app/build/vanity/*.* /app/default-vanity/*
|
||||||
|
COPY --from=build /app/build/vanity/*.* /app/vanity/*
|
||||||
COPY --from=build /app/build/navmeshes /app/navmeshes
|
COPY --from=build /app/build/navmeshes /app/navmeshes
|
||||||
COPY --from=build /app/build/migrations /app/migrations
|
COPY --from=build /app/build/migrations /app/migrations
|
||||||
COPY --from=build /app/build/*.dcf /app/
|
COPY --from=build /app/build/*.dcf /app/
|
||||||
@ -40,6 +42,7 @@ COPY --from=build /app/build/*.dcf /app/
|
|||||||
# needed as the container runs with the root user
|
# needed as the container runs with the root user
|
||||||
# and therefore sudo doesn't exist
|
# and therefore sudo doesn't exist
|
||||||
ENV USE_SUDO_AUTH=0
|
ENV USE_SUDO_AUTH=0
|
||||||
|
ENV DLU_CONFIG_DIR=/app/configs/
|
||||||
|
|
||||||
COPY --chmod=0500 ./entrypoint.sh /app/
|
COPY --chmod=0500 ./entrypoint.sh /app/
|
||||||
ENTRYPOINT [ "/app/entrypoint.sh" ]
|
ENTRYPOINT [ "/app/entrypoint.sh" ]
|
||||||
|
@ -81,43 +81,18 @@ int main(int argc, char** argv) {
|
|||||||
Game::logger = SetupLogger();
|
Game::logger = SetupLogger();
|
||||||
if (!Game::logger) return EXIT_FAILURE;
|
if (!Game::logger) return EXIT_FAILURE;
|
||||||
|
|
||||||
if (!dConfig::Exists("authconfig.ini")) {
|
if (!dConfig::Exists("authconfig.ini")) LOG("Couldnt find authconfig.ini.");
|
||||||
LOG("Couldnt find authconfig.ini");
|
if (!dConfig::Exists("chatconfig.ini")) LOG("Couldnt find chatconfig.ini");
|
||||||
return EXIT_FAILURE;
|
if (!dConfig::Exists("masterconfig.ini")) LOG("Couldnt find masterconfig.ini");
|
||||||
}
|
if (!dConfig::Exists("sharedconfig.ini")) LOG("Couldnt find sharedconfig.ini");
|
||||||
|
if (!dConfig::Exists("worldconfig.ini")) LOG("Couldnt find worldconfig.ini");
|
||||||
if (!dConfig::Exists("chatconfig.ini")) {
|
|
||||||
LOG("Couldnt find chatconfig.ini");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dConfig::Exists("masterconfig.ini")) {
|
|
||||||
LOG("Couldnt find masterconfig.ini");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dConfig::Exists("sharedconfig.ini")) {
|
|
||||||
LOG("Couldnt find sharedconfig.ini");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dConfig::Exists("worldconfig.ini")) {
|
|
||||||
LOG("Couldnt find worldconfig.ini");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
Game::config = new dConfig("masterconfig.ini");
|
Game::config = new dConfig("masterconfig.ini");
|
||||||
Game::logger->SetLogToConsole(Game::config->GetValue("log_to_console") != "0");
|
Game::logger->SetLogToConsole(Game::config->GetValue("log_to_console") != "0");
|
||||||
Game::logger->SetLogDebugStatements(Game::config->GetValue("log_debug_statements") == "1");
|
Game::logger->SetLogDebugStatements(Game::config->GetValue("log_debug_statements") == "1");
|
||||||
|
|
||||||
uint32_t clientNetVersion = 0;
|
uint32_t clientNetVersion = 171022;
|
||||||
if (!GeneralUtils::TryParse(Game::config->GetValue("client_net_version"), clientNetVersion)) {
|
GeneralUtils::TryParse(Game::config->GetValue("client_net_version"), clientNetVersion);
|
||||||
LOG("Failed to parse (%s) as net version. Cannot start server as no clients could connect.",Game::config->GetValue("client_net_version").c_str());
|
|
||||||
LOG("As of version 1.1.1, client_net_version is required to be defined in sharedconfig.ini as opposed to in CMakeVariables.txt as NET_VERSION.");
|
|
||||||
LOG("Rerun cmake to ensure all config values exist. If client_net_version already exists in sharedconfig.ini, please ensure it is a valid number.");
|
|
||||||
LOG("like 171022");
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG("Using net version %s", Game::config->GetValue("client_net_version").c_str());
|
LOG("Using net version %s", Game::config->GetValue("client_net_version").c_str());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user