diff --git a/Server/main.cpp b/Server/main.cpp index ef9a1b7b..e4125140 100644 --- a/Server/main.cpp +++ b/Server/main.cpp @@ -8,6 +8,7 @@ #include "server_update.h" #include "steam_server.h" #include "Extension/Multiplayer/Session/monotonic_clock.h" +#include "Engine/Core/Platform/path_text.h" #include "Engine/Core/Text/word_filter.h" #include "Engine/Game/World/world_layer_catalog.h" #include "Engine/Game/World/world_names.h" @@ -301,14 +302,14 @@ int run(int argc, char **argv, bool skip_update) { const bool fresh = !std::filesystem::exists(config_file); std::vector added; config = load_config(config_file, &added); - if (fresh) write_log("Wrote a default " + config_file.filename().string() + ". Edit it to name the server and add admins."); + if (fresh) write_log("Wrote a default " + path_utf8(config_file.filename()) + ". Edit it to name the server and add admins."); if (!added.empty()) { std::string names; for (const auto &name : added) names += (names.empty() ? "" : ", ") + name; - write_log("Added new settings to " + config_file.filename().string() + " with their defaults: " + names + "."); + write_log("Added new settings to " + path_utf8(config_file.filename()) + " with their defaults: " + names + "."); } } catch (const std::exception &e) { - write_log("Cannot read " + config_file.string() + ": " + e.what()); + write_log("Cannot read " + path_utf8(config_file) + ": " + e.what()); return 1; } // Maps: the retail ones and custom maps from Mods\\reskate-levels.json. diff --git a/Server/server_config.cpp b/Server/server_config.cpp index ab2f1840..82b44654 100644 --- a/Server/server_config.cpp +++ b/Server/server_config.cpp @@ -1,5 +1,6 @@ #include "server_config.h" #include "Engine/Core/Json/json.h" +#include "Engine/Core/Platform/path_text.h" #include "Extension/Multiplayer/Net/protocol.h" #include "Engine/Game/World/world_names.h" #include @@ -207,7 +208,7 @@ void save_config(const ServerConfig &c) { { std::ofstream out(temporary, std::ios::binary | std::ios::trunc); out << to_json(c).dump(2) << '\n'; - if (!out) throw std::runtime_error("Cannot write " + temporary.string()); + if (!out) throw std::runtime_error("Cannot write " + path_utf8(temporary)); } std::filesystem::rename(temporary, c.file); }