Merge branch 'main' of github.com:OpenStarbound/OpenStarbound

This commit is contained in:
Zithia Satazaki 2023-10-29 20:23:31 -04:00
commit 4da15c42e0

View File

@ -356,6 +356,8 @@ namespace LuaBindings {
}); });
if (auto clientWorld = as<WorldClient>(world)) { if (auto clientWorld = as<WorldClient>(world)) {
callbacks.registerCallback("isClient", []() { return true; });
callbacks.registerCallback("isServer", []() { return false; });
callbacks.registerCallbackWithSignature<RectI>("clientWindow", bind(ClientWorldCallbacks::clientWindow, clientWorld)); callbacks.registerCallbackWithSignature<RectI>("clientWindow", bind(ClientWorldCallbacks::clientWindow, clientWorld));
callbacks.registerCallback("players", [clientWorld]() { callbacks.registerCallback("players", [clientWorld]() {
List<EntityId> playerIds; List<EntityId> playerIds;
@ -370,6 +372,9 @@ namespace LuaBindings {
} }
if (auto serverWorld = as<WorldServer>(world)) { if (auto serverWorld = as<WorldServer>(world)) {
callbacks.registerCallback("isClient", []() { return false; });
callbacks.registerCallback("isServer", []() { return true; });
callbacks.registerCallbackWithSignature<bool, EntityId, bool>("breakObject", bind(ServerWorldCallbacks::breakObject, serverWorld, _1, _2)); callbacks.registerCallbackWithSignature<bool, EntityId, bool>("breakObject", bind(ServerWorldCallbacks::breakObject, serverWorld, _1, _2));
callbacks.registerCallbackWithSignature<bool, RectF>("isVisibleToPlayer", bind(ServerWorldCallbacks::isVisibleToPlayer, serverWorld, _1)); callbacks.registerCallbackWithSignature<bool, RectF>("isVisibleToPlayer", bind(ServerWorldCallbacks::isVisibleToPlayer, serverWorld, _1));
callbacks.registerCallbackWithSignature<bool, RectF>("loadRegion", bind(ServerWorldCallbacks::loadRegion, serverWorld, _1)); callbacks.registerCallbackWithSignature<bool, RectF>("loadRegion", bind(ServerWorldCallbacks::loadRegion, serverWorld, _1));