From 4e947b8733980f9d40f781f883b85e6f65bd953f Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 22 Jul 2024 16:23:41 +0100 Subject: Allow contrib modules to specify their own module version. --- src/modules.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index a69b65418..b7cd29c84 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -46,8 +46,14 @@ void dynamic_reference_base::reset_all() } Module::Module(int mprops, const std::string& mdesc) + : Module(mprops, "", mdesc) +{ +} + +Module::Module(int mprops, const std::string& mversion, const std::string& mdesc) : description(mdesc) , properties(mprops) + , version(mversion) { } @@ -83,6 +89,15 @@ std::string Module::GetPropertyString() const return propstr; } +std::string Module::GetVersion() const +{ + if (!version.empty()) + return version; + + const auto* dll_version = ModuleDLL->GetVersion(); + return dll_version ? dll_version : "unknown"; +} + void Module::DetachEvent(Implementation i) { ServerInstance->Modules.Detach(i, this); -- cgit v1.3.1-10-gc9f91 From 3814a952a344382798883870107f5469a0e197d7 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 22 Jul 2024 16:39:28 +0100 Subject: Revert module flags to the way they worked in v3. --- src/modules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index b7cd29c84..1ec07f9ba 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -85,7 +85,7 @@ std::string Module::GetPropertyString() const size_t pos = 0; for (int mult = VF_CORE; mult <= VF_OPTCOMMON; mult *= 2, ++pos) if (!(this->properties & mult)) - propstr[pos] = tolower(propstr[pos]); + propstr[pos] = '-'; return propstr; } -- cgit v1.3.1-10-gc9f91