feat: add setMaxPlayers api

This commit is contained in:
zimuya4153
2025-08-17 17:08:43 +08:00
Unverified
parent 2b18aeb245
commit 446cc68f32
3 changed files with 25 additions and 1 deletions
+5
View File
@@ -79,4 +79,9 @@ void Export_Legacy_GMLib_ServerAPI() {
[](GMLevel& level) -> int { return level.getMaxPlayerCount(); }
).value_or(0);
});
RemoteCall::exportAs("GMLib_ServerAPI", "setMaxPlayers", [&](int count, bool ignoreVanillaLimit) {
if (auto level = GMLevel::getInstance(); level) {
level->setMaxPlayerCount(count, ignoreVanillaLimit);
}
});
}