timeEvents Reference
Module defined in `lua/common/timeEvents.lua`. A lightweight timer/scheduler that lets you schedule function callbacks to fire after a specified delay. Similar to the global `schedule()` function.
Module defined in lua/common/timeEvents.lua. A lightweight timer/scheduler that lets you schedule function callbacks to fire after a specified delay. Similar to the global schedule() function.
Exports
Functions
M.create()
Creates a new time events scheduler instance.
- Returns: table - A scheduler object with
:addEvent(),:clear(), and:process()methods
Instance Methods
scheduler:addEvent(time, fn)
Schedules a function to be called after the specified time.
- Parameters:
time- number - Delay in seconds before firingfn- function - Callback to invoke when time expires
scheduler:clear()
Removes all pending scheduled events.
scheduler:process(dt)
Advances all timers by dt and fires any that have expired. Must be called each frame.
- Parameters:
dt- number - Delta time in seconds since last call
Internal Notes
- Events are stored as
{fn, time}entries in an array - Processes in reverse order to safely remove expired events via
table.remove - Fired events are removed; there is no repeat/interval mechanism
tcpServer Reference
Module defined in `lua/common/tcpServer.lua`. Non-blocking TCP server with a binary-framed JSON message protocol. Supports both LuaSocket and ASIO (C++ engine) backends.
utils Reference
Module defined in `lua/common/utils.lua`. Massive utility library providing color functions, JSON encoding/decoding, table manipulation, string utilities, file I/O, serialization, debugging tools, and