Appearance
sdk.hunt_analytics
@type library Authoritative hunt/session analytics. The service consumes typed protocol events and (optionally) terminal action-broker snapshots. It never parses chat text and never sends telemetry over the network.
lua
local M = require("sdk.hunt_analytics")Constants
Lua 5.4 has no enums — these are integer (or string) fields on the module.
| Name | Value | Summary |
|---|---|---|
Service | Service | Hunt analytics class. |
new
function · new(opts)
Construct a hunt analytics service with optional engine/broker/clock. item_value_resolver defaults to catalog; false disables lookup. Common: inject clock and broker in tests; live code uses the defaults.
start
function · start(...) return default_service():start(...)
Start the shared singleton hunt session. Scripts should not construct a second analytics lifecycle. Common: thin module facade over Service:start.
rebind_runtime
function · rebind_runtime(...) return default_service():rebind_runtime(...)
Re-register singleton hooks after a ScriptHost reload. Does not reset counters; start() would skip subscribe when listening. Common: facade over Service:rebind_runtime.
stop
function · stop(...) return default_service():stop(...)
Stop the shared singleton and drop its subscriptions. Other modules sharing this instance lose the hunt feed too. Common: facade over Service:stop.
finish
function · finish(...) return default_service():finish(...)
Freeze the shared session without unsubscribing. Planner keeps a final snapshot and can start a fresh hunt later. Common: facade over Service:finish.
reset
function · reset(...) return default_service():reset(...)
Open a new shared session while keeping subscriptions. WorldEntered also takes this path inside handle(). Common: facade over Service:reset.
handle
function · handle(...) return default_service():handle(...)
Dispatch one event onto the shared singleton. Used by tests and by hosts that push events without Engine.on. Common: facade over Service:handle.
record
function · record(...) return default_service():record(...)
Record a semantic action that has no dedicated inbound packet. Only scalar fields survive; see Service:record. Common: facade over Service:record.
poll
function · poll(...) return default_service():poll(...)
Force a broker scan on the shared singleton. Same throttle bypass as Service:poll. Common: facade over Service:poll.
snapshot
function · snapshot(...) return default_service():snapshot(...)
Return the shared singleton dashboard payload. Familiar alias getMetrics points here. Common: facade over Service:snapshot.
summary
function · summary(...) return default_service():summary(...)
Return the shared singleton text summary. Familiar alias buildSummary points here. Common: facade over Service:summary.
is_active
function · is_active() return default_service():is_active()
Whether the shared singleton session is recording. Familiar alias isSessionActive points here. Common: facade over Service:is_active.
is_started
function · is_started() return default_service():is_started()
Whether the shared singleton still holds Engine.on hooks. A finished session can remain started. Common: facade over Service:is_started.
isSessionActive
alias · isSessionActive = is_active
Familiar analyzer aliases for scripts migrating from older bot APIs.
Alias
Same as is_active.
getMetrics
alias · getMetrics = snapshot
Same as snapshot.
Alias
Same as snapshot.
buildSummary
alias · buildSummary = summary
Same as summary.
Alias
Same as summary.