diff --git a/zone/main.cpp b/zone/main.cpp index a05af774a4..2e089394ec 100644 --- a/zone/main.cpp +++ b/zone/main.cpp @@ -122,6 +122,7 @@ void CatchSignal(int sig_num); extern void MapOpcodes(); +bool CheckForCompatibleQuestPlugins(); int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformZone); @@ -367,6 +368,11 @@ int main(int argc, char **argv) return 1; } + if (!CheckForCompatibleQuestPlugins()) { + LogError("Incompatible quest plugins detected, please update your plugins to the latest version"); + return 1; + } + // load these here for now until spells and items can be truly repointed to "content_db" database.SetSharedItemsCount(content_db.GetItemsCount()); database.SetSharedSpellsCount(content_db.GetSpellsCount()); @@ -705,3 +711,25 @@ void UpdateWindowTitle(char *iNewTitle) SetConsoleTitle(tmp); #endif } + +bool CheckForCompatibleQuestPlugins() +{ + std::vector files = { + "quests/plugins/check_handin.pl", + "lua_modules/items.lua", + }; + + bool found = true; + for (const auto &file : files) { + auto f = path.GetServerPath() + "/" + file; + if (File::Exists(f)) { + auto r = File::GetContents(std::filesystem::path{f}.string()); + if (!Strings::Contains(r.contents, "CheckHandin")) { + found = false; + break; + } + } + } + + return found; +}