From 2046c0e06da9927ea8e964e02d48c0805dc0212b Mon Sep 17 00:00:00 2001 From: Tsubasa6848 <116721335+Tsubasa6848@users.noreply.github.com> Date: Sat, 24 Feb 2024 11:07:21 +0800 Subject: [PATCH] feat: add version info --- src/CompatibilityApi.cpp | 8 ++++++++ src/Global.h | 1 + src/MemoryOperators.cc | 7 +++++++ tooth.json | 8 ++++---- 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 src/MemoryOperators.cc diff --git a/src/CompatibilityApi.cpp b/src/CompatibilityApi.cpp index 806b9e3..30d0d4e 100644 --- a/src/CompatibilityApi.cpp +++ b/src/CompatibilityApi.cpp @@ -91,4 +91,12 @@ void Export_Compatibility_API() { } return false; }); + RemoteCall::exportAs("GMLIB_API", "isVersionMatched", [](int a, int b, int c) -> bool { + auto version = SemVersion(a, b, c, "", ""); + return version.satisfies(LIB_VERSION); + }); + RemoteCall::exportAs("GMLIB_API", "getVersion_LRCA", []() -> std::string { return LIB_VERSION.asString(); }); + RemoteCall::exportAs("GMLIB_API", "getVersion_GMLIB", []() -> std::string { + return GMLIB::Version::getLibVersionString(); + }); } \ No newline at end of file diff --git a/src/Global.h b/src/Global.h index 2dd567b..b902602 100644 --- a/src/Global.h +++ b/src/Global.h @@ -3,6 +3,7 @@ #include #define PLUGIN_NAME "GMLIB-LRCA" +#define LIB_VERSION SemVersion(0, 8, 4, "", "") extern ll::Logger logger; diff --git a/src/MemoryOperators.cc b/src/MemoryOperators.cc new file mode 100644 index 0000000..f7c918a --- /dev/null +++ b/src/MemoryOperators.cc @@ -0,0 +1,7 @@ +// This file will make your plugin use LeviLamina's memory operators by default. +// This improves the memory management of your plugin and is recommended to use. +// You should not modify anything in this file. + +#define LL_MEMORY_OPERATORS + +#include diff --git a/tooth.json b/tooth.json index 84ff446..eb92da5 100644 --- a/tooth.json +++ b/tooth.json @@ -1,7 +1,7 @@ { "format_version": 2, "tooth": "github.com/GroupMountain/GMLIB-LegacyRemoteCallApi", - "version": "0.8.3", + "version": "0.8.4", "info": { "name": "GMLIB-LegacyRemoteCallApi", "description": "Legacy RemoteCall API for GMLIB", @@ -14,9 +14,9 @@ "library" ] }, - "asset_url": "https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi/releases/download/v0.8.3/GMLIB-LegacyRemoteCallApi-windows-x64.zip", + "asset_url": "https://github.com/GroupMountain/GMLIB-LegacyRemoteCallApi/releases/download/v0.8.4/GMLIB-LegacyRemoteCallApi-windows-x64.zip", "dependencies": { - "github.com/GroupMountain/GMLIB": ">=0.8.1" + "github.com/GroupMountain/GMLIB": ">=0.8.5" }, "files": { "place": [ @@ -26,4 +26,4 @@ } ] } -} +} \ No newline at end of file