From d84051bdd30937b638cb389bda81935ab873b6b6 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Mon, 20 Sep 2021 16:59:42 +0200 Subject: [PATCH] possible fix for windows path issue --- src/TConfig.cpp | 1 + src/TLuaPlugin.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/TConfig.cpp b/src/TConfig.cpp index b5313a9..8e014f5 100644 --- a/src/TConfig.cpp +++ b/src/TConfig.cpp @@ -107,6 +107,7 @@ void TConfig::CreateConfigFile(std::string_view name) { beammp_error("There was no \"" + std::string(ConfigFileName) + "\" file (this is normal for the first time running the server), so one was generated for you. It was automatically filled with the settings from your Server.cfg, if you have one. Please open ServerConfig.toml and ensure your AuthKey and other settings are filled in and correct, then restart the server. The old Server.cfg file will no longer be used and causes a warning if it exists from now on."); mFailed = true; ofs.close(); + // FIXME WriteSendErrors(std::string(name)); } else { beammp_error("Couldn't create " + std::string(name) + ". Check permissions, try again, and contact support if it continues not to work."); diff --git a/src/TLuaPlugin.cpp b/src/TLuaPlugin.cpp index ec5e176..f8826de 100644 --- a/src/TLuaPlugin.cpp +++ b/src/TLuaPlugin.cpp @@ -28,8 +28,12 @@ TLuaPlugin::TLuaPlugin(TLuaEngine& Engine, const TLuaPluginConfig& Config, const }); std::vector>> ResultsToCheck; for (const auto& Entry : Entries) { - // read in entire file +// read in entire file +#if defined(WIN32) + std::FILE* File = _wfopen(reinterpret_cast(Entry.c_str()), "r"); +#else std::FILE* File = std::fopen(reinterpret_cast(Entry.c_str()), "r"); +#endif if (File) { auto Size = std::filesystem::file_size(Entry); auto Contents = std::make_shared();