T1 // Core & Engine

coe_core

HAL & Central State Management

Hardware Abstraction Layer & Player Session State Manager

HEADLESS SERVICE (NO UI)
DEPENDS ON coe_supervisorcoe_databasecoe_logging
coe_core 9 exports · 3 commands

Runs without a NUI: nothing is rendered on the client and the resource stays idle until events arrive.

01 // OVERVIEW

The architectural heart of the framework. Implements the Hardware Abstraction Layer (HAL) in `@coe_core/lib/platform.lua` shielding server logic from GTA engine alterations. Responsible for player authentication, session handling, StateID synchronization, and internal reactive event routing.

On FiveM Enhanced

Architected specifically for FiveM Enhanced native APIs, completely isolating business rules from low-level graphics engine natives.

02 // FEATURES

What the module delivers

01

Hardware Abstraction Layer

No gameplay script invokes GTA natives directly; all interactions route through the HAL.

02

Unified StateID

Persistent unique citizen identifier preserved across disconnections and reconnects.

03

Typed Event Bus

Strict runtime type verification on client-server events protecting against malicious payloads.

04

Secure Cryptographic Handshake

Enforces cryptographically signed login handshakes to prevent session impersonation.

ARCHITECTURAL LAYERS // CLEAN ARCHITECTURE

4-Layer Isolation with 0.00 ms Idle

Every COE Framework script strictly follows the principle of separation of concerns. Interact with the 3D stack below:

L4
Headless Operation (No UI)
Zero DOM · CoE UI Delegation
Headless
L3
Application & Server
Atomic locks · Rate limiting
Auth Server
L2
Platform & HAL
Core.Platform · Mock natives
Gen9 HAL
L1
Domain & ACID Database
Prepared SQL · MariaDB pool
ACID Pool
LAYER 04 // HEADLESS SERVICE

Headless Service (No Dedicated NUI)

Operates strictly within layers L1–L3 (domain, HAL, and server-authoritative application logic). Visual interactions and management flows are delegated to centralized ecosystem apps (coe_ui / coe_tablet), guaranteeing 0.00 ms idle client overhead in FiveM DX12.

Zero CEF graphic overhead: no background web pages or NUI bridges loaded
Typed public contracts (types.lua) consumed directly by external resources and UIs
Strict adherence to the Server-Authoritative model with zero direct DOM manipulation
ADMIN POWERS // OPERATION & MANAGEMENT

What this script delivers to Server Owners

Manage your city without relying on developers. Runtime parameters, auditing, and ACE-protected commands:

🛡️
Routing Buckets
Isolates players into parallel dimensions for instances and private interiors without collision.
SetPlayerRoutingBucket(src, bucket)
👥
Groups by command
List, inspect, set and remove a character's groups and grades by StateID (ACE-restricted command).
/grupo definir <stateId> <grupo> [grau]
🧩
Groups via export
Other resources assign groups with a confirmation callback.
exports.coe_core:SetPlayerGroup(source, name, grade, callback)
03 // EXPORTS

Public API 9

Typed contracts to call from other resources. Full types live in types.lua and in the docs reference.

exports['coe_core']:GetCoreObject() → table

Returns the central Core framework object (events, players, permissions, HAL, and state bags). Available on both server and client.

No parameters.

LUA
local result = exports['coe_core']:GetCoreObject()
exports['coe_core']:GetCharacterByStateId(stateId) → table|nil, string|nil

Retrieves an active online character by their unique stateId. Server-side.

ParameterType
stateIdstring
LUA
local ok, detail = exports['coe_core']:GetCharacterByStateId(stateId)
exports['coe_core']:GetActiveCharacter(source) → table|nil

Retrieves the currently selected active character for an online player. Server-side.

ParameterType
sourceinteger
LUA
local result = exports['coe_core']:GetActiveCharacter(source)
exports['coe_core']:GetPlayerByStateId(stateId) → table|nil, string|nil

Retrieves online player data by character stateId. Server-side.

ParameterType
stateIdstring
LUA
local ok, detail = exports['coe_core']:GetPlayerByStateId(stateId)
exports['coe_core']:ValidateSession(source, expectedCharacterId, expectedGeneration) → boolean, table|string

Valida se a sessão do jogador ainda corresponde ao personagem e à geração esperados (proteção contra reciclagem de source no FiveM Enhanced). Server.

ParameterType
sourceinteger
expectedCharacterIdstring|nil
expectedGenerationinteger|nil
LUA
local ok, detail = exports['coe_core']:ValidateSession(source, expectedCharacterId, expectedGeneration)
exports['coe_core']:GetGroupDefinitions() → CoeGroupDefinition[]

Returns all permission and organizational group definitions configured on the server. Server-side.

No parameters.

LUA
local result = exports['coe_core']:GetGroupDefinitions()
exports['coe_core']:GetPlayerGroups(source) → table[]|nil

Retrieves all group memberships and grades for a player's active character. Server-side.

ParameterType
sourceinteger
LUA
local result = exports['coe_core']:GetPlayerGroups(source)
exports['coe_core']:SetPlayerGroup(source, name, grade, callback) → true|string

Assigns a group and grade to a player. Requires ACE `coe.groups.admin` on caller principal. Server-side.

ParameterType
sourceinteger
namestring
gradeinteger
callbackfun(success:
LUA
local result = exports['coe_core']:SetPlayerGroup(source, name, grade, callback)
exports['coe_core']:RemovePlayerGroup(source, name, callback) → true|string

Revokes a group membership from a player. Requires ACE `coe.groups.admin` on caller principal. Server-side.

ParameterType
sourceinteger
namestring
callbackfun(success:
LUA
local result = exports['coe_core']:RemovePlayerGroup(source, name, callback)
04 // COMMANDS

In-game commands 3

[E]

Interact · +coe_interact · rebindable in FiveM key bindings

/grupo lista | ver <stateId> | definir <stateId> <grupo> [grau] | remover <stateId> <grupo>

Lists groups, shows a character groups and sets or removes a group (ACE-restricted command).

/id

Shows the active character StateID.