删除和修改

删除新增的handleRequestTryAction事件和handleRequestAction事件
有关附魔接口均改采用命名空间
新增id转命名空间接口
修正获取最大玩家数代码
This commit is contained in:
子沐呀
2024-06-27 04:13:17 +08:00
Unverified
parent a7f5ad26ac
commit d78a63044b
8 changed files with 87 additions and 190 deletions
+4 -5
View File
@@ -1,8 +1,4 @@
#include "GMLIB/Server/FakeListAPI.h"
#include "GMLIB/Server/LevelAPI.h"
#include "Global.h"
#include "mc/world/ActorUniqueID.h"
#include <variant>
void Export_Legacy_GMLib_ServerAPI() {
RemoteCall::exportAs("GMLib_ServerAPI", "setEducationFeatureEnabled", []() -> void {
@@ -76,6 +72,9 @@ void Export_Legacy_GMLib_ServerAPI() {
return FakeList::removeAllFakeLists();
});
RemoteCall::exportAs("GMLib_ServerAPI", "getMaxPlayers", []() -> int {
return ll::memory::dAccess<int>(ll::service::getServerNetworkHandler().as_ptr(), 200);
if (auto level = GMLIB_Level::getInstance()) {
return level->getMaxPlayerCount();
}
return {};
});
}