Skip to main content

Enums

Named constant tables for Motix.

Access enums via Motix.Enums for controller enums and via Motix.MotixNet.Enums for network enums.

Using named constants instead of raw strings makes mistyped values fail immediately at the point of use (a nil-index) rather than silently at runtime.

-- Good: typos fail immediately
Motix.MotixNet.Enums.NetworkMode.ServerAuthority

-- Risky: typos pass silently
"serverAuthority"

Properties

Action

Enums.Action: ActionEnum

Animation directive action types. Used internally by the state machine entry/exit system. Not typically needed in user code.

Motix.Enums.Action.Play      -- "PLAY"
Motix.Enums.Action.Stop      -- "STOP"
Motix.Enums.Action.StopGroup -- "STOP_GROUP"
Key Value
Play "PLAY"
Stop "STOP"
StopGroup "STOP_GROUP"

ConflictVerdict

Enums.ConflictVerdict: ConflictVerdictEnum

Verdicts produced by layer and group conflict resolution. Used internally by the controller. Not typically needed in user code.

Motix.Enums.ConflictVerdict.Allow  -- "ALLOW"
Motix.Enums.ConflictVerdict.Defer  -- "DEFER"
Motix.Enums.ConflictVerdict.Reject -- "REJECT"
Key Value Meaning
Allow "ALLOW" The incoming animation may play.
Defer "DEFER" The incoming animation is queued pending the current animation finishing.
Reject "REJECT" The incoming animation is discarded.

NetworkMode

Enums.NetworkMode: NetworkModeEnum

Authority modes for MotixNet. Pass to NetworkConfig.Mode when creating a MotixNet instance.

local Net = Motix.MotixNet.new(Controller, HashReg, {
	Mode = Motix.MotixNet.Enums.NetworkMode.ServerAuthority,
})
Key Value Description
ClientAuthoritative "ClientAuthoritative" Clients send intents. Server validates and relays. Default.
ServerAuthority "ServerAuthority" Only server code may trigger animations. All client intents are dropped.
SharedAuthority "SharedAuthority" Both client and server may emit intents. Client intents are validated. Server calls bypass validation.

ValidationReason

Enums.ValidationReason: ValidationReasonEnum

Rejection reasons fired on MotixNetServer.OnIntentRejected.

Net.OnIntentRejected:Connect(function(player, reason)
	if reason == Motix.MotixNet.Enums.ValidationReason.RateLimited then
		-- handle rate limiting
	end
end)
Key Value Meaning
Passed "Passed" Validation succeeded. Not fired on rejection; used internally.
PlayerNotFound "PlayerNotFound" Sending player could not be identified.
SessionInactive "SessionInactive" Player does not have an active session.
UnknownAnimHash "UnknownAnimHash" Hash not found in the server's HashRegistry.
InvalidAction "InvalidAction" Action byte is not 0 (PLAY) or 1 (STOP).
StaleIntent "StaleIntent" Intent timestamp older than MaxIntentStaleness.
RateLimited "RateLimited" Token bucket exhausted.
Show raw api
{
    "functions": [],
    "properties": [
        {
            "name": "Action",
            "desc": "Animation directive action types. Used internally by the state machine entry/exit system.\nNot typically needed in user code.\n\n```lua\nMotix.Enums.Action.Play      -- \"PLAY\"\nMotix.Enums.Action.Stop      -- \"STOP\"\nMotix.Enums.Action.StopGroup -- \"STOP_GROUP\"\n```\n\n| Key | Value |\n|---|---|\n| `Play` | `\"PLAY\"` |\n| `Stop` | `\"STOP\"` |\n| `StopGroup` | `\"STOP_GROUP\"` |",
            "lua_type": "ActionEnum",
            "source": {
                "line": 43,
                "path": "docs/Enums.lua"
            }
        },
        {
            "name": "ConflictVerdict",
            "desc": "Verdicts produced by layer and group conflict resolution. Used internally by the\ncontroller. Not typically needed in user code.\n\n```lua\nMotix.Enums.ConflictVerdict.Allow  -- \"ALLOW\"\nMotix.Enums.ConflictVerdict.Defer  -- \"DEFER\"\nMotix.Enums.ConflictVerdict.Reject -- \"REJECT\"\n```\n\n| Key | Value | Meaning |\n|---|---|---|\n| `Allow` | `\"ALLOW\"` | The incoming animation may play. |\n| `Defer` | `\"DEFER\"` | The incoming animation is queued pending the current animation finishing. |\n| `Reject` | `\"REJECT\"` | The incoming animation is discarded. |",
            "lua_type": "ConflictVerdictEnum",
            "source": {
                "line": 63,
                "path": "docs/Enums.lua"
            }
        },
        {
            "name": "NetworkMode",
            "desc": "Authority modes for MotixNet. Pass to `NetworkConfig.Mode` when creating a `MotixNet`\ninstance.\n\n```lua\nlocal Net = Motix.MotixNet.new(Controller, HashReg, {\n\tMode = Motix.MotixNet.Enums.NetworkMode.ServerAuthority,\n})\n```\n\n| Key | Value | Description |\n|---|---|---|\n| `ClientAuthoritative` | `\"ClientAuthoritative\"` | Clients send intents. Server validates and relays. Default. |\n| `ServerAuthority` | `\"ServerAuthority\"` | Only server code may trigger animations. All client intents are dropped. |\n| `SharedAuthority` | `\"SharedAuthority\"` | Both client and server may emit intents. Client intents are validated. Server calls bypass validation. |",
            "lua_type": "NetworkModeEnum",
            "source": {
                "line": 85,
                "path": "docs/Enums.lua"
            }
        },
        {
            "name": "ValidationReason",
            "desc": "Rejection reasons fired on `MotixNetServer.OnIntentRejected`.\n\n```lua\nNet.OnIntentRejected:Connect(function(player, reason)\n\tif reason == Motix.MotixNet.Enums.ValidationReason.RateLimited then\n\t\t-- handle rate limiting\n\tend\nend)\n```\n\n| Key | Value | Meaning |\n|---|---|---|\n| `Passed` | `\"Passed\"` | Validation succeeded. Not fired on rejection; used internally. |\n| `PlayerNotFound` | `\"PlayerNotFound\"` | Sending player could not be identified. |\n| `SessionInactive` | `\"SessionInactive\"` | Player does not have an active session. |\n| `UnknownAnimHash` | `\"UnknownAnimHash\"` | Hash not found in the server's `HashRegistry`. |\n| `InvalidAction` | `\"InvalidAction\"` | Action byte is not `0` (PLAY) or `1` (STOP). |\n| `StaleIntent` | `\"StaleIntent\"` | Intent timestamp older than `MaxIntentStaleness`. |\n| `RateLimited` | `\"RateLimited\"` | Token bucket exhausted. |",
            "lua_type": "ValidationReasonEnum",
            "source": {
                "line": 110,
                "path": "docs/Enums.lua"
            }
        }
    ],
    "types": [],
    "name": "Enums",
    "desc": "Named constant tables for Motix.\n\nAccess enums via `Motix.Enums` for controller enums and via `Motix.MotixNet.Enums` for\nnetwork enums.\n\nUsing named constants instead of raw strings makes mistyped values fail immediately at\nthe point of use (a nil-index) rather than silently at runtime.\n\n```lua\n-- Good: typos fail immediately\nMotix.MotixNet.Enums.NetworkMode.ServerAuthority\n\n-- Risky: typos pass silently\n\"serverAuthority\"\n```",
    "source": {
        "line": 20,
        "path": "docs/Enums.lua"
    }
}