moo.sdk.ratelimit
Per-account broadcast flood limiting.
RestrictedPython here uses a plain iterator and the only runaway backstop is the
Celery wall-clock kill — neither bounds a verb that spams everyone present
within the time budget (the $spew problem). This module is that limiter: a
fixed-window counter, keyed to the initiating account, that bounds outbound
broadcast lines (messages an account causes to be sent to other players). A
player’s own output is never counted, so a long room description or a verbose
NPC is never clipped — the target is flooding, not verbosity.
The limit and window default to settings.MOO_BROADCAST_RATE_LIMIT /
MOO_BROADCAST_RATE_WINDOW and may be overridden at runtime by the System
Object properties broadcast_rate_limit / broadcast_rate_window (the
“sys knob”).
Functions
|
Charge one broadcast line to |
The effective per-window broadcast line budget (0 disables). |
|
The effective fixed-window length in seconds. |