From af09e256ae95b2bf039b3c4459749668055b7e48 Mon Sep 17 00:00:00 2001 From: EpsilonZunsat <2748716171@qq.com> Date: Sat, 18 May 2024 15:48:50 +0800 Subject: [PATCH 1/2] feat: add FakeList remotecall --- .gitignore | 3 ++- src/LegacyServerApi.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9bfef8b..3a8687a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ CMakeSettings.json build/ /.xmake /CMakeLists.txt -/bin \ No newline at end of file +/bin +.cache/clangd/index diff --git a/src/LegacyServerApi.cpp b/src/LegacyServerApi.cpp index 7fc0f8e..0ab65ce 100644 --- a/src/LegacyServerApi.cpp +++ b/src/LegacyServerApi.cpp @@ -1,4 +1,6 @@ +#include "GMLIB/Server/FakeListAPI.h" #include "Global.h" +#include "mc/world/ActorUniqueID.h" void Export_Legacy_GMLib_ServerAPI() { RemoteCall::exportAs("GMLib_ServerAPI", "setEducationFeatureEnabled", []() -> void { @@ -51,4 +53,7 @@ void Export_Legacy_GMLib_ServerAPI() { } ); RemoteCall::exportAs("GMLib_ServerAPI", "PlayerToEntity", [](Player* player) -> Actor* { return (Actor*)player; }); + RemoteCall::exportAs("GMLib_ServerAPI", "addFakeList", [](const std::string& name,const std::string& xuid) -> bool { return GMLIB::Server::FakeList::addFakeList(name,xuid,ActorUniqueID(-1)); }); + RemoteCall::exportAs("GMLib_ServerAPI", "removeFakeList", [](const std::string& nameOrXuid) -> bool { return GMLIB::Server::FakeList::removeFakeList(nameOrXuid); }); + RemoteCall::exportAs("GMLib_ServerAPI", "removeAllFakeList", []() -> void { return GMLIB::Server::FakeList::removeAllFakeLists(); }); } \ No newline at end of file From f254b5f5f2ed3a0451924b298fb68c2904db424f Mon Sep 17 00:00:00 2001 From: EpsilonZunsat <2748716171@qq.com> Date: Sat, 18 May 2024 16:43:09 +0800 Subject: [PATCH 2/2] fix: fix order --- src/LegacyServerApi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LegacyServerApi.cpp b/src/LegacyServerApi.cpp index 0ab65ce..8a4c57b 100644 --- a/src/LegacyServerApi.cpp +++ b/src/LegacyServerApi.cpp @@ -53,7 +53,7 @@ void Export_Legacy_GMLib_ServerAPI() { } ); RemoteCall::exportAs("GMLib_ServerAPI", "PlayerToEntity", [](Player* player) -> Actor* { return (Actor*)player; }); - RemoteCall::exportAs("GMLib_ServerAPI", "addFakeList", [](const std::string& name,const std::string& xuid) -> bool { return GMLIB::Server::FakeList::addFakeList(name,xuid,ActorUniqueID(-1)); }); + RemoteCall::exportAs("GMLib_ServerAPI", "addFakeList", [](const std::string& xuid,const std::string& name) -> bool { return GMLIB::Server::FakeList::addFakeList(name,xuid,ActorUniqueID(-1)); }); RemoteCall::exportAs("GMLib_ServerAPI", "removeFakeList", [](const std::string& nameOrXuid) -> bool { return GMLIB::Server::FakeList::removeFakeList(nameOrXuid); }); RemoteCall::exportAs("GMLib_ServerAPI", "removeAllFakeList", []() -> void { return GMLIB::Server::FakeList::removeAllFakeLists(); }); } \ No newline at end of file