Ir a la guía

Documentación 9.6.24

Integración del servidor

Llama a exports solo desde código fiable del servidor. El cliente no debe elegir excepciones, privilegios ni recompensas.

Ejemplo de lectura#

El ejemplo consulta el estado de administrador; no concede permisos. Verifica export e identificadores en el paquete instalado.

local playerId = 12
local isAdmin = exports['tosun-ac']:isAdmin(playerId)

Validar antes de exceptuar#

Comprueba sesión, jugador, posición, permisos y duración en el servidor. No expongas exports de excepción mediante RegisterNetEvent sin validación. Consulta la guía de seguridad de Cfx.

Leer la guía oficial de Cfx

Aviso de teletransporte#

Todo script de servidor que mueva a un jugador (casa, garaje, cárcel, hospital, trabajo) debe llamar a MarkTeleport justo antes del teletransporte. No requiere lista de confianza y solo relaja brevemente los controles de movimiento y visibilidad; la protección de armas, dinero e inyección sigue activa. Cuando todos los scripts que teletransportan envíen el aviso, puedes subir la sanción de teletransporte v16 a kick en los ajustes del anticheat.

exports['tosun-ac']:MarkTeleport(source, 8000)
SetEntityCoords(GetPlayerPed(source), x, y, z)

Recursos de confianza#

Los exports que eximen a jugadores, otorgan permisos o ejecutan acciones masivas (SetExempt, addAdmin, whitelistPlayer y otros) solo aceptan recursos de confianza. Una llamada rechazada se muestra una vez en la consola junto con la línea que hay que añadir. Mantén la lista en server.cfg para que las actualizaciones del anticheat no la sobrescriban. El comando de consola tosunac_integration muestra la lista de confianza y las últimas llamadas rechazadas.

set tosun_ac_trusted_resources "my-housing,my-clothing"

Armas entregadas fuera del inventario#

Los scripts que dan armas sin añadirlas al inventario, como arenas, paintball o menús, deben llamar a AllowWeapon al entregar el arma. De lo contrario, el control de armas e inventario de 9.4.0 la registra como un arma generada. Indica un nombre de arma o un asterisco para todas; la duración máxima es de 1 hora. Añade a extraWeapons en la configuración las armas addon que el anticheat no conoce.

exports['tosun-ac']:AllowWeapon(source, "WEAPON_PISTOL", 600000)

Mantener autoridad en servidor#

Usa TOSUN-AC-EXPORTS.md del paquete. Los nombres distinguen mayúsculas. Las exenciones usan milisegundos; AddWhitelist y WhitelistArea usan segundos. Inicia tosun-ac antes de sus dependientes y gestiona un recurso detenido sin omitir protección. Un retorno correcto no valida tus reglas de trabajo.

SetExempt y AllowWeapon requieren recurso servidor autorizado. Añade solo revisados, conservando entradas existentes. tosunac_integration muestra rechazos. Desactivar enforcement permite llamadas con avisos en modo auditoría; no lo dejes como arreglo permanente.

set tosun_ac_trusted_resources "my-clothing,my-arena"

# Consola del servidor:
tosunac_integration

Avisar justo antes del teletransporte#

Valida jugador, destino servidor, permiso y actividad. Llama MarkTeleport inmediatamente antes del movimiento. src y destination deben venir del flujo servidor validado, no de parámetros libres del cliente. El fragmento no es un evento de red completo.

No necesita lista de confianza. Relaja movimiento y controles relacionados de visibilidad/godmode/cámara; armas, dinero, abuso e injection siguen activos. Con los ajustes predeterminados, para recursos fuera de la lista de confianza: hasta 15 segundos por llamada y 180 por jugador en diez minutos. Extensiones gastan presupuesto; no lo repitas cada tick.

-- Dentro de un flujo servidor ya validado:
local ok = exports["tosun-ac"]:MarkTeleport(src, 8000, "house_enter")
if ok then
    SetEntityCoords(GetPlayerPed(src), destination.x, destination.y, destination.z)
end

Permitir un arma concreta#

En arenas sin objeto de inventario, valida partida servidor y llama AllowWeapon desde recurso autorizado. Prefiere un arma y duración necesaria. Solo afecta propiedad y su ruta de daño, no todo el AC.

Máximo una hora; evita asterisco sin necesitar todas. SetExempt es exención completa autorizada de hasta cinco minutos. BypassDetection ignora detectionKey: es completa hasta un minuto, no específica.

No reutilices source de un jugador desconectado para recompensa o exención posterior. Comprueba sesión servidor al actuar. Un recurso autorizado sigue siendo responsable de validar permisos y objetivo.

  • Acción autorizada funciona y permiso termina.
  • Cliente no elige otro jugador, tiempo, arma o destino.
  • Llamada no autorizada devuelve false y aviso.
  • Tras reinicio revisa estado y juego normal.
-- my-arena: recurso autorizado, sesión validada
local allowed = exports["tosun-ac"]:AllowWeapon(src, "WEAPON_PISTOL", 60000)
-- Da el arma solo dentro de la arena validada.

Finalizar exenciones con la API de servidor correcta#

SetExempt del servidor recibe src, milisegundos y motivo; el del cliente recibe state, milisegundos y motivo. Las firmas no son intercambiables. Una exención cliente no otorga autoridad de servidor. En un flujo de servidor confiable, SetPlayerExempt con state false elimina la exención temporal del jugador. Coordine actividades solapadas: el estado afecta al jugador y no es un token independiente de cada recurso. Eliminarlo puede finalizar la exención de otra actividad. En cambio, una whitelist de personal o panel puede mantener IsExemptFromPunish verdadero. Prefiera MarkTeleport o AllowWeapon cuando su alcance menor sea suficiente.

  1. Complete o cancele la actividad autorizada con un jugador actual validado y retire la exención cuando ya no haga falta.
  2. Pruebe cancelación, desconexión y finalización; no prolongue exenciones completas continuamente en un bucle.
  3. Compruebe con un jugador normal si la protección restante procede de personal, whitelist del panel u otra actividad.
-- Trusted server resource; src belongs to an authorised workflow.
-- Clear the temporary exemption when that workflow finishes or is cancelled.
local cleared = exports["tosun-ac"]:SetPlayerExempt(src, false, 0, "menu_finished")

Usar auxiliares con una política de resultado explícita#

Los auxiliares del puente se añaden al manifiesto de su recurso y no sustituyen permisos. TosunAC.IsAvailable comprueba si AC está iniciado; TosunAC.IsTrusted comprueba confianza del llamante. PlayerExempt devuelve ok y mode: full es exención completa confiable; soft solo alivio limitado de movimiento y visibilidad. Un resultado verdadero no significa inmunidad completa. Si una actividad necesita realmente full, defina cómo detenerla o rechazarla cuando solo obtiene soft, sin continuar silenciosamente con otro alcance. PlayerExemptOff retira la exención completa temporal mediante la API del servidor.

  1. Cargue el auxiliar servidor antes del script que usa TosunAC y conserve las demás dependencias del manifiesto.
  2. Examine ok y mode al iniciar; registre solo recurso, motivo y resultado no secreto.
  3. Gestione explícitamente AC detenido o rechazo; diagnostique orden de inicio o confianza antes de repetir.
-- Add these lines to your own resource manifest:
client_script "@tosun-ac/bridge/tosun_ac_client.lua"
server_script "@tosun-ac/bridge/tosun_ac_server.lua"

Usar exports de lectura como diagnóstico#

GetStatus ofrece un resumen pequeño, incluido framework configurado y jugadores online, no una auditoría completa. GetIntegrationStatus describe la confianza del recurso llamante, no todos los scripts. IsMovementExempt e IsExemptFromPunish responden preguntas diferentes. GetDetections conserva un nombre histórico: lee bans del jugador en ts_anticheat, no todos los registros recientes de detección. Un resultado vacío no certifica que esté limpio. Use consultas de base o jugadores amplias bajo demanda, no cada tick. Utilice objetos devueltos para su propósito documentado y no adjunte credenciales o datos personales innecesarios a depuración pública.

  1. Registre recurso llamante y comprobación exacta de estado o exención utilizada en el diagnóstico.
  2. Compare el alcance esperado de un flujo conocido con su resultado antes de modificar sanciones.
  3. Revise TOSUN-AC-EXPORTS.md instalado tras actualizar, especialmente alias antiguos y orden de argumentos cliente/servidor.

Vincular el movimiento diferido a la conexión y al resource#

Si entrar en una casa requiere una breve espera, guardar el número source del jugador no basta. Otra conexión puede reutilizarlo después de que el jugador se desconecte. El fragmento de server.lua es una función local para un flujo del servidor ya autorizado, no un evento de red accesible desde el cliente. El destino debe ser una ubicación validada por el servidor. Un objeto Lua único en pending vincula el movimiento diferido al flujo. Al desconectarse, se elimina la entrada; el temporizador no actúa si no encuentra el mismo objeto. Un nuevo jugador con el antiguo source no recibe aquel movimiento.

El ejemplo limpia los registros pendientes al detenerse tosun-ac o tu propio resource. Al terminar la espera vuelve a comprobar el estado del resource, la presencia del jugador y su ped. pcall captura los errores del export y solo hay movimiento si MarkTeleport devuelve true. Estas comprobaciones no conceden propiedad de la casa, roles ni permiso de destino: debes validarlos antes de llamar. El código solo solicita tolerancia de movimiento; no retira exenciones completas ni modifica permisos de otros scripts. Prueba por separado la desconexión durante la espera, la parada de AC y la entrada normal. No necesitas un bucle permanente ni recorrer todos los jugadores; hay una espera por flujo iniciado.

-- server.lua: call only from an already authorised server workflow.
-- destination is a server-validated location, never raw client input.
local pending = {}

local function scheduleValidatedMove(src, destination)
    src = tonumber(src)
    if not src or not GetPlayerName(src) then return false end
    if GetResourceState("tosun-ac") ~= "started" then return false end
    local ticket = {}
    local target = {x = destination.x, y = destination.y, z = destination.z}
    pending[src] = ticket
    SetTimeout(1500, function()
        if pending[src] ~= ticket then return end
        pending[src] = nil
        if not GetPlayerName(src) then return end
        if GetResourceState("tosun-ac") ~= "started" then return end
        local ped = GetPlayerPed(src)
        if not ped or ped == 0 then return end
        local called, allowed = pcall(function()
            return exports["tosun-ac"]:MarkTeleport(src, 8000, "house_delayed_entry")
        end)
        if called and allowed == true then
            SetEntityCoords(ped, target.x, target.y, target.z)
        end
    end)
    return true -- Scheduled, not yet moved.
end

AddEventHandler("playerDropped", function() pending[source] = nil end)
AddEventHandler("onResourceStop", function(name)
    if name == GetCurrentResourceName() or name == "tosun-ac" then
        pending = {}
    end
end)

Medir la confianza desde el resource que integra el export#

Después de editar la lista de confianza, coloca este diagnóstico dentro del resource que hará la llamada real. El comando solo funciona desde la consola del servidor; las llamadas de jugadores se ignoran porque src no es cero. Ejecuta my-resource-ac-check una vez. GetIntegrationStatus devuelve el nombre del resource que llama y los valores trusted y enforcing. Por eso, un true obtenido desde otro resource no prueba que tu script de ropa o arena sea de confianza. GetStatus ofrece un pequeño resumen de ejecución con versión y framework configurado, no una auditoría de todas las integraciones.

Aunque pcall tenga éxito, el valor devuelto debe ser una tabla. Un error de llamada y un resultado false son observaciones diferentes; no declares verificada la configuración si no se pudo llamar al export. Con trusted=false y enforcing=true, compara el nombre del llamador con la lista revisada. enforcing=false puede ser una configuración de auditoría; no demuestra que todas las operaciones sensibles estén restringidas de forma segura. La salida solo contiene resource, versión, framework y dos booleanos, no identificadores de jugadores ni claves. No la ejecutes en cada tick. Tras una actualización prueba las rutas normales y los rechazos esperados por separado; el diagnóstico de lectura no garantiza autorización para exports de sanción.

-- Place in the integrating resource's server.lua.
RegisterCommand("my-resource-ac-check", function(src)
    if src ~= 0 then return end -- Server console only.
    if GetResourceState("tosun-ac") ~= "started" then
        print("[integration] tosun-ac is not started")
        return
    end
    local okTrust, trust = pcall(function()
        return exports["tosun-ac"]:GetIntegrationStatus()
    end)
    local okStatus, status = pcall(function()
        return exports["tosun-ac"]:GetStatus()
    end)
    if not okTrust or type(trust) ~= "table"
        or not okStatus or type(status) ~= "table" then
        print("[integration] status query failed")
        return
    end
    print(("[integration] resource=%s version=%s framework=%s trusted=%s enforcing=%s")
        :format(GetCurrentResourceName(), tostring(status.version),
            tostring(status.framework), tostring(trust.trusted), tostring(trust.enforcing)))
end, false)

Registrar eventos con validación del servidor#

Usa RegisterSafeEvent en el script del servidor. El nombre del evento debe empezar por el recurso que lo registra. El validador debe devolver exactamente true tras comprobar jugador, tarea, posición, objetos y permisos del servidor. La clave del cliente no concede permisos. Consume la tarea completada una sola vez para evitar premios duplicados.

Usa el export de cliente TriggerSafeServerEvent. sent solo confirma el envío, no un pago o premio. queued_until_key espera un máximo de 30 segundos; una cola llena rechaza nuevas llamadas. No repitas operaciones económicas automáticamente. Registra de nuevo al reiniciar AC.

Migra y elimina los antiguos handlers directos RegisterNetEvent. Tosun AC no puede cancelar handlers de otros recursos; mantener la acción antigua deja una vía de acceso. Los handlers :safe de ProtectedEvents deben usar AddEventHandler solo en el servidor.

-- my-job/server.lua: own server-owned job state and framework adapter.
local activeJobs = {}
local function registerActions()
    if GetResourceState("tosun-ac") ~= "started" then return end
    local ok, reason = exports["tosun-ac"]:RegisterSafeEvent("my-job:finish",
        function(src)
            local job = activeJobs[src]
            return job ~= nil and job.completed == true
            -- Also verify server-owned position, role and inventory as required.
        end,
        function(src)
            local job = activeJobs[src]
            if not job then return end
            activeJobs[src] = nil -- consume before any yielding reward operation
            -- Give the server-owned reward through your validated framework adapter.
        end, {rateLimit=5, windowMs=10000, maxArgs=0})
    if not ok then print("[my-job] SafeEvent: " .. tostring(reason)) end
end
AddEventHandler("onResourceStart", function(name)
    if name == GetCurrentResourceName() or name == "tosun-ac" then registerActions() end
end)
AddEventHandler("playerDropped", function() activeJobs[source] = nil end)

-- my-job/client.lua:
local sent, state = exports["tosun-ac"]:TriggerSafeServerEvent("my-job:finish")
-- Read state; implement a separate application acknowledgement if needed.

Configura el nombre exacto del recurso que llama#

Añade set tosun_ac_trusted_resources "my-housing,my-clothing" a server.cfg conservando otros nombres revisados. Usa el nombre del recurso/carpeta, no un nombre visible, jugador o rol de Discord. Usa set, no setr, y mantén ts.EnforceExportCallerWhitelist = true. La confianza permite exports sensibles; no valida propiedad, inventario, empleo ni jugador objetivo. Ejecuta el diagnóstico dentro del recurso que realiza la acción y comprueba trusted=true y enforcing=true.

set tosun_ac_trusted_resources "my-housing,my-clothing"

# txAdmin server console:
tosunac_integration

-- In the invoking integration resource server script:
local status = exports["tosun-ac"]:GetIntegrationStatus()
print(status.resource, status.trusted, status.enforcing)

Cinco listas con funciones distintas#

La lista de recursos de confianza permite exports sensibles del servidor. La whitelist de jugadores protege a un jugador. La whitelist de triggers falsos desactiva una trampa, no autoriza el evento real. ts.ProtectedEvents es el transporte antiguo con clave; el valor predeterminado incluye test:event. La baseline de recursos guarda archivos revisados para integridad. Una entrada no se copia a otras listas. No añadas todos los eventos del framework a ProtectedEvents ni los conviertas en trampas.

Catálogo completo de exports del servidor#

Los nombres y declaraciones de argumentos provienen del inventario real del código de este paquete. Es una referencia, no un script que ejecutar en orden. Respeta mayúsculas y lado servidor/cliente. Incluye diagnósticos, escáneres y transporte internos para no confundir un nombre parecido con una API de negocio segura. Antes de modificar datos, comprueba su contrato y resultados. Conocer un nombre no otorga permisos.

-- tosun-ac / server
-- AddWhitelist(target, durationSec)
-- AllowWeapon(src, weapon, ms)
-- BanPlayerExt(playerId, reason)
-- BypassDetection(playerId, detectionKey, durationMs)
-- ClearArea(playerId, areaName)
-- ForensicLinksOf(license)
-- GetCloudThreatScore(src)
-- GetDetections(playerId, limit)
-- GetIntegrationStatus()
-- GetNearbyPlayers(playerId, radius)
-- GetPlayerInfo(playerId)
-- GetPlayerShieldData(src)
-- GetServerAuthorityStatus()
-- GetStatus()
-- IsExemptFromPunish(src)
-- IsInArea(playerId, areaName)
-- IsMovementExempt(src)
-- IsPlayerProtected(playerId)
-- IsWhitelisted(playerId)
-- KickPlayer(playerId, reason)
-- MarkTeleport(src, ms, reason)
-- NoteCloudViolation(src, reason, punishment)
-- OpenScanCache(sealed)
-- PauseAllDetections(durationMs)
-- PausePlayerDetections(playerId, durationMs)
-- RateLimit(src, key, max, windowMs)
-- RegisterSafeEvent(eventName, validator, handler, options)
-- RemoveWhitelist(target)
-- RequestShieldScreenshot(src)
-- ScanPolicyFingerprint(moduleFile, policy)
-- ScanResourceSnapshot(name, expected, callback)
-- SealScanCache(raw)
-- SetExempt(playerId, durationMs, reason)
-- SetPlayerExempt(playerId, state, durationMs, reason)
-- WhitelistArea(playerId, areaName, durationSec)
-- acV2Challenge(build, license, fp, version)
-- acV2Fingerprint()
-- acV2Integrity(raw)
-- acV2VerifyResponse(raw, build, license, fp, version, nonce, httpCode)
-- addAdmin(playerId)
-- addCheatSignature(pattern, signatureName, severity)
-- addSignatureEscrowSkip(resourceName, note)
-- addSignatureException(resourceName, filePath, signatureName, note)
-- applyTimeWithFramework(h, m)
-- applyWeatherWithFramework(weather)
-- approveResource(resourceName, approvedBy)
-- ban(playerId, reason)
-- batchDetection(playerName, license, steam, discord, ip, dtype, reason, punishment, banID, screenshot, configKey)
-- batchLog(message, playerId, playerName)
-- batchWebhook(url, payload)
-- blockResource(resourceName, reason)
-- centralHandshake()
-- centralPoll()
-- centralStatus()
-- checkIpReputation(ip)
-- cipherHasSession(src)
-- cipherIssueKey(src)
-- cipherVerify(src, payload, signature)
-- clearInventory(src)
-- crashGuardInspect(v)
-- crashGuardReject(src, p)
-- emergencyLockdown(reason)
-- fakeTriggerTrap(eventName, typ)
-- fakeTriggerWhitelist(eventName)
-- freezePlayer(src, freeze)
-- getAdminType(playerId)
-- getBanInfo(banID)
-- getBans(limit, offset)
-- getBaseline()
-- getBatchStats()
-- getCleanupStats()
-- getConfig(configType)
-- getInfectedFiles()
-- getOnlinePlayers()
-- getPlayerLocale(src)
-- getResources()
-- getRuntimeStats()
-- getSourceKey()
-- getStats()
-- getSuspicious()
-- giveWeapon(src, weapon, ammo)
-- healAll()
-- invalidateSignatureCache()
-- isAdmin(playerId)
-- isAdminMenuAllowed(playerId)
-- isPlayerFrozen(src)
-- isPlayerMuted(src)
-- isQuarantined(src)
-- isStaffPlayer(playerId)
-- issueEventKey(src)
-- licenseStatus()
-- lockdownStatus()
-- massFreeze(state)
-- mutePlayer(src, durationSec, reason, actor)
-- offlineBan(data, reason)
-- offlineBanByLicense(...)
-- phoneNotify(targetSrc, title, body, opts)
-- phoneNotifyAdmins(title, body, opts)
-- punish(playerId, reason, image, config, punish)
-- quarantine(src, reason, sec)
-- quarantineList()
-- refreshPanelPermissions()
-- refreshPanelWhitelist()
-- releaseQuarantine(src)
-- reloadSignatureExceptions()
-- reloadSignatureScanCaches()
-- removeAdmin(playerId)
-- removeSignatureEscrowSkip(idOrName)
-- removeSignatureException(id)
-- removeWhitelist(playerId)
-- reportInfection(resource, file, sigs, severity, callback)
-- rescanResources()
-- runCleanup()
-- scanAllResources()
-- scanSingleResource(name)
-- screenCapture(src, requestedBy)
-- setLockdown(state, reason)
-- setPlayerArmor(src, armor)
-- setPlayerHealth(src, hp)
-- setPlayerLocale(src, lang)
-- setSpeedLimit(kmh)
-- slayPlayer(src)
-- spectatePlayer(adminSrc, targetSrc)
-- stripWeapons(src)
-- translate(key, ...)
-- translateForPlayer(src, key, ...)
-- tsAutoSetup()
-- tsBackdoorScanStatus()
-- tsLicenseRecheck()
-- tsScanBackdoors(callback)
-- tsScanEvents()
-- tsSignatureScanStatus()
-- unban(banID)
-- unmutePlayer(src)
-- v6ScreenWatchLatest(serverId)
-- v6ScreenWatchPoll(rid)
-- v6ScreenWatchRequest(serverId, mode, requestedBy, panelUrl, forceBase64)
-- v9StreamHasSession(serverId)
-- warnPlayer(src, reason, actor)
-- webBridgeApplyInventory(src, action, itemName, count, slot)
-- webBridgeApplyMoney(src, moneyType, amount, action)
-- webBridgeFindByCitizen(cid)
-- webBridgeFindByLicense(license)
-- webBridgeGrantAdmin(src)
-- webBridgeRevokeAdmin(src)
-- whitelistPlayer(playerId, duration)

-- tosun-ac-guardian / server
-- guardianAlive()
-- guardianHold(reason,seconds)

-- tosun_render / server
-- GetStatus()

Exports del cliente y margen local limitado#

SetExempt del cliente recibe estado, milisegundos y motivo; el del servidor recibe source del jugador, milisegundos y motivo. PauseDetections del cliente concede margen limitado para apariencia, movimiento y cámara, no pausa universal. Las llamadas locales comparten 240 segundos de ampliación por diez minutos y hasta 32 motivos. IsExempt(config) necesita la clave exacta; IsExempt() solo representa personal verificado o exención/pausa completa confiable. Armas, eventos, injection y detecciones desconocidas siguen activas. Gestiona false sin repetir cada frame.

-- tosun-ac / client
-- GetExemptions()
-- IsExempt(config)
-- IsPlayerAdmin()
-- NativeGuardThreat()
-- NativeGuardToken()
-- PauseDetections(durationMs)
-- SetExempt(state, durationMs, reason)
-- SetSpawned(state)
-- ShieldCaptureForBan(callback)
-- ShieldFlushBanVideo(callback)
-- TriggerSafeServerEvent(eventName, ...)
-- getConfig()
-- getV12Tolerance(key, default)
-- incNetRequest()
-- incScreenshotEvent()
-- shieldHook(hookType, detailJson)

Estado privado y significado de los resultados#

TosunAcState es interno al recurso AC; otros recursos deben usar exports documentados. setExempt, setPause y setMovement del servidor devuelven booleanos y limitan permisos a cinco minutos. Un fallo de notificación no confirma un aumento nuevo; revocaciones y reducciones se conservan aunque devuelva false. Exención, pausa y movimiento son independientes. setStaff solo escribe una copia de compatibilidad, no concede autoridad admin. isExemptFromBag/isPausedFromBag leen permisos privados verificados, no bags editables. Un éxito no prueba entrega a todos los clientes ni pausa de todos los detectores del servidor.

-- Internal AC server API; external resources use guarded exports.
-- TosunAcState.setExempt(id, active, ms) -> boolean
-- TosunAcState.setPause(id, ms) -> boolean
-- TosunAcState.setMovement(id, ms) -> boolean
-- TosunAcState.remaining(id, kind) -> remaining milliseconds
-- TosunAcState.setStaff(id, staff) -> compatibility mirror only
-- AddWhitelist(target, durationSec): seconds
-- WhitelistArea(playerId, areaName, durationSec): seconds
-- IsInArea: named record lookup, not a coordinate/permission check
-- WhitelistArea grants broad client relief, not one chosen detector.
-- BypassDetection: detectionKey is ignored; full exemption, <=60000ms
-- Client: IsExempt("ts.antiFreeCam") -> scoped camera grace
-- Client: IsExempt() -> verified staff/full/pause only

Los nombres de eventos no son autorizaciones#

El catálogo generado lista eventos literales del protocolo AC por lado de registro. No incluye todos los nombres calculados ni eventos propios. No reproduzcas manualmente eventos internos de clave, castigo, configuración o menú. Descubrir nombres y dirección no verifica propiedad ni recompensas. Usa RegisterSafeEvent con validación para acciones sensibles. La protección del panel y ac_protected_events alimentan trampas/honeypots, no validadores. Deja EventScanner.autoProtect=false durante la instalación.

-- tosun-ac/client/AddEventHandler
-- CEventShockingGunshotFired
-- baseevents:onPlayerDied
-- baseevents:onPlayerKilled
-- esx:onPlayerDeath
-- esx_ambulancejob:revive
-- esx_basicneeds:onRevive
-- gameEventTriggered
-- hospital:client:Revive
-- hospital:client:SetDeathState
-- hospital:client:SetLaststand
-- hospital:client:isDead
-- onClientResourceStart
-- onClientResourceStop
-- playerSpawned
-- qb-ambulancejob:client:RevivePlayer
-- qb-medical:client:OnDeath
-- qb-medical:client:OnRevive
-- tosun-ac:nui:pushToolState
-- tosun-ac:uploadTokenUpdated
-- ts_anticheat:adminStateChanged
-- ts_anticheat:adminStatus
-- ts_anticheat:bridge:capture
-- ts_anticheat:bridge:clearInventory
-- ts_anticheat:bridge:freeze
-- ts_anticheat:bridge:giveWeapon
-- ts_anticheat:bridge:heal
-- ts_anticheat:bridge:mute
-- ts_anticheat:bridge:revive
-- ts_anticheat:bridge:setArmor
-- ts_anticheat:bridge:setHealth
-- ts_anticheat:bridge:slay
-- ts_anticheat:bridge:speedLimit
-- ts_anticheat:bridge:stripWeapons
-- ts_anticheat:bridge:teleport
-- ts_anticheat:bridge:time
-- ts_anticheat:bridge:warning
-- ts_anticheat:bridge:weather
-- ts_anticheat:checkTaze
-- ts_anticheat:cipher:assigned
-- ts_anticheat:cipher:request_refresh
-- ts_anticheat:clearDone
-- ts_anticheat:configUpdated
-- ts_anticheat:detectclient
-- ts_anticheat:internal:receiveKey
-- ts_anticheat:internal:trapsChanged
-- ts_anticheat:isAdmin
-- ts_anticheat:joinBundle
-- ts_anticheat:liveSSRequest
-- ts_anticheat:newDetection
-- ts_anticheat:openAdminMenu
-- ts_anticheat:openAdminMenuAuthorized
-- ts_anticheat:panelBroadcast
-- ts_anticheat:panelHeal
-- ts_anticheat:panelRevive
-- ts_anticheat:panelTime
-- ts_anticheat:panelWeather
-- ts_anticheat:promptOpenMenu
-- ts_anticheat:receiveKey
-- ts_anticheat:receiveLiveSS
-- ts_anticheat:receiveLiveVideo
-- ts_anticheat:receivePlayerCount
-- ts_anticheat:receiveScreenshot
-- ts_anticheat:requestCoords
-- ts_anticheat:resourceGuardSync
-- ts_anticheat:shield:requestScreenshot
-- ts_anticheat:shield:uploadConfig
-- ts_anticheat:startVideoLiveStream
-- ts_anticheat:startVideoLiveWeb
-- ts_anticheat:startVideoRecording
-- ts_anticheat:stopVideoLiveStream
-- ts_anticheat:stopVideoLiveWeb
-- ts_anticheat:stopVideoRecording
-- ts_anticheat:syncBanList
-- ts_anticheat:syncConfig
-- ts_anticheat:syncIdentifiers
-- ts_anticheat:syncLogs
-- ts_anticheat:syncPlayers
-- ts_anticheat:takeScreenshot
-- ts_anticheat:unbanDone
-- ts_anticheat:webPanelScreenshot

-- tosun-ac/client/RegisterNUICallback
-- Armour
-- DeleteAll
-- DeleteObjects
-- DeletePeds
-- DeleteVehicles
-- GetPlayerIdentifiers
-- Health
-- addLog
-- armourPlayer
-- banPlayer
-- bringAll
-- bringPlayer
-- cancelAnimation
-- clearNearbyObjects
-- clearNearbyPeds
-- clearNearbyVehicles
-- devtoolsdetected
-- exit
-- freezeAll
-- freezePlayerToggle
-- getBans
-- getLogs
-- getPlayerCount
-- getPlayers
-- giveWeaponPlayer
-- healAll
-- healPlayer
-- isInVehicle
-- kickPlayer
-- liveWatchStart
-- liveWatchStop
-- nuiDependencyMissing
-- nuiWatermark
-- repair
-- returnOCRResult
-- reviveAll
-- revivePlayer
-- screenshotPlayer
-- selfRevive
-- setHealthPlayer
-- setTime
-- setWeather
-- shield_devtools
-- shield_heartbeat
-- shield_heartbeat_fail
-- shield_screenshot
-- shield_tokens
-- shield_video_final
-- shield_video_segment
-- slayPlayer
-- spawnVehicle
-- spectatePlayer
-- stopSpectate
-- stripWeaponsPlayer
-- toggleESP
-- toggleFreecam
-- toggleGodmode
-- toggleInvisible
-- toggleNoclip
-- tosunRenderResult
-- tpToPlayer
-- unbanPlayer
-- verifyModel
-- videoLiveSegmentResult
-- videoRecordingResult
-- videoRecordingStartResult
-- warnPlayerNUI

-- tosun-ac/client/RegisterNetEvent
-- QBCore:Client:OnPlayerLoaded
-- QBCore:Client:OnPlayerUnload
-- esx:onPlayerDeath
-- esx:onPlayerLogout
-- esx:playerLoaded
-- esx_ambulancejob:revive
-- esx_basicneeds:onRevive
-- hospital:client:Revive
-- hospital:client:SetDeathState
-- hospital:client:SetLaststand
-- hospital:client:isDead
-- qb-ambulancejob:client:RevivePlayer
-- qb-medical:client:OnDeath
-- qb-medical:client:OnRevive
-- qbx_core:client:playerLoggedIn
-- qbx_multicharacter:client:chooseChar
-- ts_anticheat:adminStateChanged
-- ts_anticheat:adminStatus
-- ts_anticheat:bridge:capture
-- ts_anticheat:bridge:clearInventory
-- ts_anticheat:bridge:freeze
-- ts_anticheat:bridge:giveWeapon
-- ts_anticheat:bridge:heal
-- ts_anticheat:bridge:mute
-- ts_anticheat:bridge:revive
-- ts_anticheat:bridge:setArmor
-- ts_anticheat:bridge:setHealth
-- ts_anticheat:bridge:slay
-- ts_anticheat:bridge:speedLimit
-- ts_anticheat:bridge:stripWeapons
-- ts_anticheat:bridge:teleport
-- ts_anticheat:bridge:time
-- ts_anticheat:bridge:warning
-- ts_anticheat:bridge:weather
-- ts_anticheat:checkTaze
-- ts_anticheat:cipher:assigned
-- ts_anticheat:cipher:request_refresh
-- ts_anticheat:clearDone
-- ts_anticheat:detectclient
-- ts_anticheat:isAdmin
-- ts_anticheat:joinBundle
-- ts_anticheat:liveSSRequest
-- ts_anticheat:newDetection
-- ts_anticheat:openAdminMenu
-- ts_anticheat:openAdminMenuAuthorized
-- ts_anticheat:panelBroadcast
-- ts_anticheat:panelHeal
-- ts_anticheat:panelRevive
-- ts_anticheat:panelTime
-- ts_anticheat:panelWeather
-- ts_anticheat:promptOpenMenu
-- ts_anticheat:receiveEventKey
-- ts_anticheat:receiveKey
-- ts_anticheat:receiveLiveSS
-- ts_anticheat:receiveLiveVideo
-- ts_anticheat:receivePlayerCount
-- ts_anticheat:receiveScreenshot
-- ts_anticheat:requestCoords
-- ts_anticheat:resourceGuardSync
-- ts_anticheat:shield:requestScreenshot
-- ts_anticheat:shield:uploadConfig
-- ts_anticheat:startVideoLiveStream
-- ts_anticheat:startVideoLiveWeb
-- ts_anticheat:startVideoRecording
-- ts_anticheat:stopVideoLiveStream
-- ts_anticheat:stopVideoLiveWeb
-- ts_anticheat:stopVideoRecording
-- ts_anticheat:syncBanList
-- ts_anticheat:syncConfig
-- ts_anticheat:syncIdentifiers
-- ts_anticheat:syncLogs
-- ts_anticheat:syncPlayers
-- ts_anticheat:takeScreenshot
-- ts_anticheat:unbanDone
-- ts_anticheat:uploadToken
-- ts_anticheat:webPanelScreenshot

-- tosun-ac/server/AddEventHandler
-- QBCore:Server:OnPlayerLoaded
-- QBCore:Server:PlayerLoaded
-- chatMessage
-- clearPedTasksEvent
-- entityControlEvent
-- entityCreated
-- entityCreating
-- esx:playerLoaded
-- eventTriggered
-- explosionEvent
-- fireEvent
-- giveWeaponEvent
-- onResourceStart
-- onResourceStop
-- onServerResourceStart
-- playerConnecting
-- playerDropped
-- playerJoining
-- ptFxEvent
-- qbx_core:server:playerLoaded
-- rconCommand
-- removeAllWeaponsEvent
-- removeWeaponEvent
-- requestControlEvent
-- respawnPlayerPedEvent
-- startProjectileEvent
-- tosun-ac:nuiPermissionRefreshed
-- tosun-ac:panel:characterReady
-- tosun-ac:server:detection
-- tosun-ac:server:logResourceActivity
-- tosun-ac:server:nuiWatermark
-- tosun-ac:server:signedDetection
-- tosun-ac:settingsReloaded
-- ts_anticheat:GetPlayerIdentifiers
-- ts_anticheat:addAdmin_internal
-- ts_anticheat:addLog
-- ts_anticheat:adminDelEntity
-- ts_anticheat:banCommitted
-- ts_anticheat:banPlayer
-- ts_anticheat:banRelay
-- ts_anticheat:bridge:freeze
-- ts_anticheat:bringAllPlayers
-- ts_anticheat:bringPlayer
-- ts_anticheat:cipher:detection
-- ts_anticheat:cipher:request
-- ts_anticheat:clearTasks
-- ts_anticheat:client:scriptsReady
-- ts_anticheat:configUpdated
-- ts_anticheat:deleteObjects
-- ts_anticheat:deletePeds
-- ts_anticheat:deleteVehicles
-- ts_anticheat:freezeAllPlayers
-- ts_anticheat:getBanList
-- ts_anticheat:getLogs
-- ts_anticheat:getPlayerCount
-- ts_anticheat:getPlayers
-- ts_anticheat:healAllPlayers
-- ts_anticheat:internal:pushResourceGuard
-- ts_anticheat:internal:suspicious
-- ts_anticheat:kickPlayer
-- ts_anticheat:liveSSResult
-- ts_anticheat:liveWatchStart
-- ts_anticheat:liveWatchStop
-- ts_anticheat:logAdminMenu
-- ts_anticheat:newLog
-- ts_anticheat:playerBanned
-- ts_anticheat:requestAdminStatus
-- ts_anticheat:requestEventKey
-- ts_anticheat:requestKey
-- ts_anticheat:requestOpenAdminMenu
-- ts_anticheat:returnCoords
-- ts_anticheat:reviveAllPlayers
-- ts_anticheat:screenshotPlayer
-- ts_anticheat:screenshotResult
-- ts_anticheat:server:<computed suffix> [template only; not a runnable exact event]
-- ts_anticheat:server:checkIsAdmin
-- ts_anticheat:server:clientXkzuqBwmTjN7Gab4QzuN9QYZJ1WxxU
-- ts_anticheat:server:requestJoinHandshake
-- ts_anticheat:server:requestResourceGuard
-- ts_anticheat:server:requestSyncData
-- ts_anticheat:server:tazed
-- ts_anticheat:serverClear
-- ts_anticheat:setInvisible
-- ts_anticheat:setTime
-- ts_anticheat:setWeather
-- ts_anticheat:shield:ban_video_saved
-- ts_anticheat:spawnVehicle
-- ts_anticheat:targetArmour
-- ts_anticheat:targetFreeze
-- ts_anticheat:targetGiveWeapon
-- ts_anticheat:targetHeal
-- ts_anticheat:targetRevive
-- ts_anticheat:targetSetHealth
-- ts_anticheat:targetSlay
-- ts_anticheat:targetStripWeapons
-- ts_anticheat:targetWarn
-- ts_anticheat:tpToPlayer
-- ts_anticheat:unbanPlayer
-- ts_anticheat:v10:exec
-- ts_anticheat:v6:detection
-- ts_anticheat:v6:screenshotResult
-- ts_anticheat:verifyModel
-- ts_anticheat:videoResult
-- vehicleComponentControlEvent
-- weaponDamageEvent

-- tosun-ac/server/RegisterNetEvent
-- tosun-ac:panel:characterReady
-- tosun-ac:server:detection
-- tosun-ac:server:logResourceActivity
-- tosun-ac:server:nuiWatermark
-- tosun-guard:acMissing
-- tosun-guard:hello
-- tosun-guard:tick
-- tosun:nativeGuard:status
-- ts_anticheat:GetPlayerIdentifiers
-- ts_anticheat:addLog
-- ts_anticheat:adminDelEntity
-- ts_anticheat:banPlayer
-- ts_anticheat:banRelay
-- ts_anticheat:bridge:freeze
-- ts_anticheat:bringAllPlayers
-- ts_anticheat:bringPlayer
-- ts_anticheat:cipher:detection
-- ts_anticheat:cipher:request
-- ts_anticheat:client:scriptsReady
-- ts_anticheat:deleteObjects
-- ts_anticheat:deletePeds
-- ts_anticheat:deleteVehicles
-- ts_anticheat:freezeAllPlayers
-- ts_anticheat:getBanList
-- ts_anticheat:getLogs
-- ts_anticheat:getPlayerCount
-- ts_anticheat:getPlayers
-- ts_anticheat:healAllPlayers
-- ts_anticheat:kickPlayer
-- ts_anticheat:liveSSResult
-- ts_anticheat:liveWatchStart
-- ts_anticheat:liveWatchStop
-- ts_anticheat:logAdminMenu
-- ts_anticheat:requestAdminStatus
-- ts_anticheat:requestEventKey
-- ts_anticheat:requestKey
-- ts_anticheat:requestOpenAdminMenu
-- ts_anticheat:returnCoords
-- ts_anticheat:reviveAllPlayers
-- ts_anticheat:screenshotPlayer
-- ts_anticheat:screenshotResult
-- ts_anticheat:server:checkIsAdmin
-- ts_anticheat:server:clientXkzuqBwmTjN7Gab4QzuN9QYZJ1WxxU
-- ts_anticheat:server:requestJoinHandshake
-- ts_anticheat:server:requestResourceGuard
-- ts_anticheat:server:requestSyncData
-- ts_anticheat:server:tazed
-- ts_anticheat:serverClear
-- ts_anticheat:setInvisible
-- ts_anticheat:setTime
-- ts_anticheat:setWeather
-- ts_anticheat:shield:banVideo
-- ts_anticheat:shield:heartbeat_fail
-- ts_anticheat:shield:requestUploadConfig
-- ts_anticheat:shield:screenshot
-- ts_anticheat:shield:tokens
-- ts_anticheat:spawnVehicle
-- ts_anticheat:targetArmour
-- ts_anticheat:targetFreeze
-- ts_anticheat:targetGiveWeapon
-- ts_anticheat:targetHeal
-- ts_anticheat:targetRevive
-- ts_anticheat:targetSetHealth
-- ts_anticheat:targetSlay
-- ts_anticheat:targetStripWeapons
-- ts_anticheat:targetWarn
-- ts_anticheat:tpToPlayer
-- ts_anticheat:unbanPlayer
-- ts_anticheat:v10:exec
-- ts_anticheat:v6:detection
-- ts_anticheat:v6:screenshotResult
-- ts_anticheat:verifyModel
-- ts_anticheat:videoResult

-- tosun-ac/server/RegisterServerEvent
-- ts_anticheat:clearTasks

-- tosun-ac/shared/AddEventHandler
-- onClientResourceStart
-- onResourceStop
-- playerDropped
-- ts_anticheat:locale:reload
-- ts_anticheat:locale:setSelf
-- ts_anticheat:locale:sync

-- tosun-ac/shared/RegisterNetEvent
-- ts_anticheat:locale:setSelf
-- ts_anticheat:locale:sync

-- tosun-ac-guardian/server/AddEventHandler
-- onResourceStart
-- onResourceStop

-- tosun_render/server/AddEventHandler
-- onResourceStart

-- tosun-ac/client / RegisterCommand
-- stopspectate
-- tsdelaimed
-- tsfreecam
-- tsmenu
-- unspectate

-- tosun-ac/server / RegisterCommand
-- ac_cleanup
-- acfreeze
-- acping
-- acstats
-- acunfreeze
-- acwarn
-- capture
-- clearinv
-- emergency
-- giveweapon
-- massfreeze
-- mute
-- setarmor
-- sethp
-- speedlimit
-- stripweapons
-- tosunac_backdoorscan
-- tosunac_db_check
-- tosunac_db_status
-- tosunac_doctor
-- tosunac_eventscan
-- tosunac_integration
-- tosunac_license_status
-- tosunac_setup
-- ts
-- ts_adminsync
-- ts_broadcast
-- ts_capture
-- ts_clearinv
-- ts_emergency
-- ts_freeze
-- ts_giveweapon
-- ts_healall
-- ts_kickall
-- ts_lockdown
-- ts_massfreeze
-- ts_modping
-- ts_mute
-- ts_players
-- ts_revive
-- ts_setarmor
-- ts_sethp
-- ts_settime
-- ts_setweather
-- ts_slay
-- ts_speedlimit
-- ts_stripweapons
-- ts_tphere
-- ts_tpto
-- ts_unfreeze
-- ts_unmute
-- ts_v9_help
-- ts_warn
-- ts_warnings
-- unmute

-- tosun-ac/shared / RegisterCommand
-- ts_setlang

-- tosun-ac-guardian/server / RegisterCommand
-- tosunac_guardian_pause
-- tosunac_guardian_resume
-- tosunac_guardian_status

-- tosun_render/server / RegisterCommand
-- tosun_render_status

SafeEvent: reinicio, cola y errores#

RegisterSafeEvent requiere nombre con prefijo del recurso, validator y handler. El validator debe devolver exactamente true después de revisar el estado actual del servidor. Elimina el antiguo handler de red; AC no cancela handlers independientes ajenos. Registra de nuevo al reiniciar tu recurso o tosun-ac. Estados del cliente: sent, queued_until_key, queue_full, invalid_event_or_arguments, resource_stopping. sent es envío, no recibo de recompensa. La cola admite 32 llamadas durante 30 segundos. Un error de handler no se repite ni confirma automáticamente. Usa recibo propio y operación idempotente; nunca repitas automáticamente dinero o artículos.

-- Client TriggerSafeServerEvent results:
-- true,  "sent"
-- false, "queued_until_key"
-- false, "queue_full"
-- false, "invalid_event_or_arguments"
-- false, "resource_stopping"

-- Server RegisterSafeEvent results:
-- true, "registered"
-- false + server_resource_required / use_own_resource_prefix
-- false + invalid_callbacks_or_options / already_registered / registration_capacity

-- Server log may say: application handler failed.
-- No automatic replay; implement an application receipt.

Un informe en cola aún no confirma escritura#

reportInfection(resource, file, sigs, severity[, callback]) devuelve true solo al encolar la operación DB. El callback opcional ocurre como máximo una vez con success y affectedRows; éxito exige entero positivo. Sin respuesta del driver no hay garantía de finalización. Resource 1–190 bytes de letras/dígitos/_.-, file 1–500 bytes, severity 1–50 letras/dígitos/_- (warning predeterminado). sigs es texto no vacío o lista densa 1–32 textos; unión hasta 255 bytes. Se rechazan NUL/CR/LF. Datos inválidos, driver ausente/rechazo o error síncrono devuelven false. No repitas automáticamente una finalización incierta.

-- A reviewed server reporting workflow; fictional non-secret labels.
-- resource: 1..190 bytes, letters/digits/underscore/dot/hyphen
-- file: 1..500 bytes; signatures joined: 1..255 bytes
-- severity: 1..50 bytes, letters/digits/underscore/hyphen (no dot)
local queued = exports["tosun-ac"]:reportInfection(
    "my-housing", "server.lua", {"reviewed_pattern"}, "warning",
    function(success, affectedRows)
        print(success and "[scan] report saved" or "[scan] report not confirmed")
    end)
-- queued=true is dispatch only; it is not the completion callback.
-- Do not automatically retry an operation with an uncertain outcome.