Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/scripting/StarWorldLuaBindings.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-10-17 19:02:24 +1100
committerKae <80987908+Novaenia@users.noreply.github.com>2024-10-17 19:02:24 +1100
commit0a5e92ef389a67956b1075cf7e4f0c3b2461c190 (patch)
treeaf463a81a8c67650a33d150bd50b87f01e0f2d2f /source/game/scripting/StarWorldLuaBindings.cpp
parent9ba9eb2ac33a53a8fd50ce14d40be00d42a9f7af (diff)
unify UniverseClient & WorldClient LuaRoots & let universeClient scripts intercept packets
can be used for intercepting chat packets, for example!
Diffstat (limited to 'source/game/scripting/StarWorldLuaBindings.cpp')
-rw-r--r--source/game/scripting/StarWorldLuaBindings.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/game/scripting/StarWorldLuaBindings.cpp b/source/game/scripting/StarWorldLuaBindings.cpp
index 08a7a43..624660f 100644
--- a/source/game/scripting/StarWorldLuaBindings.cpp
+++ b/source/game/scripting/StarWorldLuaBindings.cpp
@@ -356,6 +356,8 @@ namespace LuaBindings {
});
if (auto clientWorld = as<WorldClient>(world)) {
+ callbacks.registerCallback("inWorld", [clientWorld]() { return clientWorld->inWorld(); });
+ callbacks.registerCallback("mainPlayer", [clientWorld]() { return clientWorld->clientState().playerId(); });
callbacks.registerCallback("isClient", []() { return true; });
callbacks.registerCallback("isServer", []() { return false; });
callbacks.registerCallbackWithSignature<RectI>("clientWindow", bind(ClientWorldCallbacks::clientWindow, clientWorld));