aboutsummaryrefslogtreecommitdiff
path: root/src/keeper.hpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-12-03 10:26:47 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2024-12-03 10:26:47 +0100
commit307fd830eb168005a3ba3d557343284814757eff (patch)
treeeb14512492d58e33585bc5df3f3d9b23d7308934 /src/keeper.hpp
parentca7657e24549acb8a2dd45fa81c309b5bf9f61ee (diff)
downloadlanes-307fd830eb168005a3ba3d557343284814757eff.tar.gz
lanes-307fd830eb168005a3ba3d557343284814757eff.tar.bz2
lanes-307fd830eb168005a3ba3d557343284814757eff.zip
New method linda:restrict()
Diffstat (limited to 'src/keeper.hpp')
-rw-r--r--src/keeper.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/keeper.hpp b/src/keeper.hpp
index b77f1a9..e2ad445 100644
--- a/src/keeper.hpp
+++ b/src/keeper.hpp
@@ -13,6 +13,15 @@ DECLARE_UNIQUE_TYPE(KeeperIndex, int);
13 13
14// ################################################################################################# 14// #################################################################################################
15 15
16enum class LindaRestrict
17{
18 None,
19 SetGet,
20 SendReceive
21};
22
23// #################################################################################################
24
16struct Keeper 25struct Keeper
17{ 26{
18 std::mutex mutex; 27 std::mutex mutex;
@@ -79,6 +88,9 @@ DECLARE_UNIQUE_TYPE(KeeperCallResult, std::optional<int>);
79// xxh64 of string "kNilSentinel" generated at https://www.pelock.com/products/hash-calculator 88// xxh64 of string "kNilSentinel" generated at https://www.pelock.com/products/hash-calculator
80static constexpr UniqueKey kNilSentinel{ 0xC457D4EDDB05B5E4ull, "lanes.null" }; 89static constexpr UniqueKey kNilSentinel{ 0xC457D4EDDB05B5E4ull, "lanes.null" };
81 90
91// xxh64 of string "kRestrictedChannel" generated at https://www.pelock.com/products/hash-calculator
92static constexpr UniqueKey kRestrictedChannel{ 0x4C8B879ECDE110F7ull };
93
82using keeper_api_t = lua_CFunction; 94using keeper_api_t = lua_CFunction;
83#define KEEPER_API(_op) keepercall_##_op 95#define KEEPER_API(_op) keepercall_##_op
84 96
@@ -96,6 +108,8 @@ int keepercall_receive(lua_State* L_);
96[[nodiscard]] 108[[nodiscard]]
97int keepercall_receive_batched(lua_State* L_); 109int keepercall_receive_batched(lua_State* L_);
98[[nodiscard]] 110[[nodiscard]]
111int keepercall_restrict(lua_State* L_);
112[[nodiscard]]
99int keepercall_send(lua_State* L_); 113int keepercall_send(lua_State* L_);
100[[nodiscard]] 114[[nodiscard]]
101int keepercall_set(lua_State* L_); 115int keepercall_set(lua_State* L_);