Compare commits

...

2 Commits

3 changed files with 14 additions and 12 deletions
+7 -6
View File
@@ -1,4 +1,5 @@
#include "Global.h"
#include "gmlib/mc/world/actor/Player.h"
#include "mc/platform/UUID.h"
#include <regex>
@@ -503,7 +504,7 @@ void Export_Compatibility_API() {
return "";
});
RemoteCall::exportAs("GMLIB_API", "getXuidByName", [](std::string const& name) -> std::string {
if (auto uce = UserCache::getInstance()->from(name, UserCache::QueryType::Name)) {
if (auto uce = UserCache::getInstance()->from(name, UserCache::Name)) {
return uce->mXuid;
}
return "";
@@ -515,19 +516,19 @@ void Export_Compatibility_API() {
return "";
});
RemoteCall::exportAs("GMLIB_API", "getNameByXuid", [](std::string const& xuid) -> std::string {
if (auto uce = UserCache::getInstance()->from(xuid, UserCache::QueryType::Xuid)) {
if (auto uce = UserCache::getInstance()->from(xuid, UserCache::Xuid)) {
return uce->mName;
}
return "";
});
RemoteCall::exportAs("GMLIB_API", "getUuidByXuid", [](std::string const& xuid) -> std::string {
if (auto uce = UserCache::getInstance()->from(xuid, UserCache::QueryType::Xuid)) {
if (auto uce = UserCache::getInstance()->from(xuid, UserCache::Xuid)) {
return uce->mUuid.asString();
}
return "";
});
RemoteCall::exportAs("GMLIB_API", "getUuidByName", [](std::string const& name) -> std::string {
if (auto uce = UserCache::getInstance()->from(name, UserCache::QueryType::Name)) {
if (auto uce = UserCache::getInstance()->from(name, UserCache::Name)) {
return uce->mUuid.asString();
}
return "";
@@ -552,7 +553,7 @@ void Export_Compatibility_API() {
return result;
}
}
if (auto uce = UserCache::getInstance()->from(info, UserCache::QueryType::Default)) {
if (auto uce = UserCache::getInstance()->from(info, UserCache::Default)) {
ll::reflection::forEachMember(*uce, [&](std::string_view name, auto&& member) {
result[std::string{name.substr(1)}] = fmt::to_string(member);
});
@@ -823,7 +824,7 @@ void Export_Compatibility_API() {
}
);
RemoteCall::exportAs("GMLIB_API", "getPlayerHungry", [](Player* player) -> float {
return player->getMutableAttribute(Player::HUNGER()).mInstance->mCurrentValue;
return player->getAttribute(Player::HUNGER()).mPtr->mCurrentValue;
});
RemoteCall::exportAs("GMLIB_API", "getPlayerArmorCoverPercentage", [](Player* player) -> float {
return player->getArmorCoverPercentage();
+1 -1
View File
@@ -2,7 +2,7 @@
"format_version": 3,
"format_uuid": "289f771f-2c9a-4d73-9f3f-8492495a924d",
"tooth": "github.com/GroupMountain/GMLIB-LegacyRemoteCallApi",
"version": "1.7.1",
"version": "1.9.0",
"info": {
"name": "GMLIB-LegacyRemoteCallApi",
"description": "Legacy RemoteCall API for GMLIB",
+6 -5
View File
@@ -8,12 +8,12 @@ if not has_config("vs_runtime") then
set_runtimes("MD")
end
add_requires("levilamina 1.7.3", {configs = {target_type = "server"}})
add_requires("levilamina 050b392575227db10340075328e833c1a0f41e27", {configs = {target_type = "server"}})
add_requires("legacyremotecall")
add_requires("levibuildscript 0.5.2")
add_requires("ilistenattentively 0.10.0")
add_requires("gmlib 1.7.0")
add_requires("modapi 0.3.0")
add_requires("levibuildscript 0.6.0")
add_requires("ilistenattentively 0.11.0")
add_requires("gmlib 1.9.0")
add_requires("modapi 0.4.0")
target("GMLIB-LegacyRemoteCallApi")
add_cxflags(
@@ -26,6 +26,7 @@ target("GMLIB-LegacyRemoteCallApi")
"UNICODE",
"_HAS_CXX23=1"
)
add_defines("LL_PLAT_S") --TODO: check client compatibility
add_files(
"src/**.cpp"
)