feat: add FakeList remotecall

This commit is contained in:
EpsilonZunsat
2024-05-18 15:48:50 +08:00
Unverified
parent 27d969d7f1
commit af09e256ae
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -15,3 +15,4 @@ build/
/.xmake /.xmake
/CMakeLists.txt /CMakeLists.txt
/bin /bin
.cache/clangd/index
+5
View File
@@ -1,4 +1,6 @@
#include "GMLIB/Server/FakeListAPI.h"
#include "Global.h" #include "Global.h"
#include "mc/world/ActorUniqueID.h"
void Export_Legacy_GMLib_ServerAPI() { void Export_Legacy_GMLib_ServerAPI() {
RemoteCall::exportAs("GMLib_ServerAPI", "setEducationFeatureEnabled", []() -> void { 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", "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(); });
} }