Revert "fix: fix crash"

This commit is contained in:
Tsubasa6848
2024-02-15 17:00:01 +08:00
Unverified
parent 928c470150
commit 543c042789
6 changed files with 32 additions and 106 deletions
-19
View File
@@ -2,34 +2,15 @@
void Export_Compatibility_API() {
RemoteCall::exportAs("GMLIB_API", "getServerMspt", []() -> float {
if (!isServerStarted) {
return 0;
}
return GMLIB_Level::getLevel()->getServerMspt();
});
RemoteCall::exportAs("GMLIB_API", "getServerCurrentTps", []() -> float {
if (!isServerStarted) {
return 0;
}
return GMLIB_Level::getLevel()->getServerCurrentTps();
});
RemoteCall::exportAs("GMLIB_API", "getServerAverageTps", []() -> float {
if (!isServerStarted) {
return 0;
}
return GMLIB_Level::getLevel()->getServerAverageTps();
});
RemoteCall::exportAs("GMLIB_API", "getAllPlayerUuids", []() -> std::vector<std::string> {
return GMLIB_Player::getAllUuids();
});
RemoteCall::exportAs("GMLIB_API", "getAllExperiments", []() -> std::vector<int> {
return {6, 7, 8, 9, 10, 13, 16, 17, 18};
});
RemoteCall::exportAs("GMLIB_API", "getExperimentTranslatedName", [](int id) -> std::string {
auto map = GMLIB_Level::getAllExperimentsTranslateKeys();
if (map.count(id)) {
return map[id];
}
return "";
});
}