/* DynBlock object accessors */
luaCtx.registerMember("reason", &DynBlock::reason);
luaCtx.registerMember("domain", &DynBlock::domain);
- luaCtx.registerMember("until", &DynBlock::until);
+ luaCtx.registerMember<DynBlock, timespec>(
+ "until", [](const DynBlock& block) {
+ timespec nowMonotonic{};
+ gettime(&nowMonotonic);
+ timespec nowRealTime{};
+ gettime(&nowRealTime, true);
+ nowRealTime.tv_sec += (block.until.tv_sec - nowMonotonic.tv_sec);
+ return nowRealTime; }, [](DynBlock& block, [[maybe_unused]] timespec until) {});
luaCtx.registerMember<DynBlock, unsigned int>(
"blocks", [](const DynBlock& block) { return block.blocks.load(); }, [](DynBlock& block, [[maybe_unused]] unsigned int blocks) {});
luaCtx.registerMember("action", &DynBlock::action);