world.id() for server
This commit is contained in:
parent
9b10964a3e
commit
ec4787d78e
@ -375,6 +375,7 @@ namespace LuaBindings {
|
||||
callbacks.registerCallback("isClient", []() { return false; });
|
||||
callbacks.registerCallback("isServer", []() { return true; });
|
||||
|
||||
callbacks.registerCallbackWithSignature<String>("id", bind(ServerWorldCallbacks::id, serverWorld));
|
||||
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>("loadRegion", bind(ServerWorldCallbacks::loadRegion, serverWorld, _1));
|
||||
@ -1086,6 +1087,10 @@ namespace LuaBindings {
|
||||
return world->clientWindow();
|
||||
}
|
||||
|
||||
String ServerWorldCallbacks::id(WorldServer* world) {
|
||||
return world->worldId();
|
||||
}
|
||||
|
||||
bool ServerWorldCallbacks::breakObject(WorldServer* world, EntityId arg1, bool arg2) {
|
||||
if (auto entity = world->get<Object>(arg1)) {
|
||||
bool smash = arg2;
|
||||
|
@ -73,6 +73,7 @@ namespace LuaBindings {
|
||||
}
|
||||
|
||||
namespace ServerWorldCallbacks {
|
||||
String id(WorldServer* world);
|
||||
bool breakObject(WorldServer* world, EntityId arg1, bool arg2);
|
||||
bool isVisibleToPlayer(WorldServer* world, RectF const& arg1);
|
||||
bool loadRegion(WorldServer* world, RectF const& arg1);
|
||||
|
Loading…
Reference in New Issue
Block a user