RVT Chat

Configuración

Las opciones más usadas de shared.lua y el archivo completo comentado.

Edita shared.lua y reinicia el recurso (restart rvt_chat) para aplicar. Estas son las opciones que más se ajustan.

OpciónPor defectoQué hace
Config.Framework.name"standalone"Framework usado para identidad y moderación: standalone, creative, qb, esx o custom. No hay detección automática.
Config.Resource"rvt_chat"Prefijo de los eventos de red y de los logs. Debe ser igual al nombre de la carpeta.
Config.App.identifier"rvt_chat"ID de la app en LB Phone. Cambiarlo crea otra app en el teléfono; el historial no cambia.
Config.App.defaultApptrueInstala la app en todos los teléfonos.
Config.App.registertrueRegistra la app en LB Phone. Déjalo en true.
Config.Identity.requirePhoneItemtrueExige el ítem del teléfono para usar la app. El número equipado siempre es obligatorio.
Config.Messages.editWindowS900Tiempo (en segundos) para editar un mensaje después de enviarlo.
Config.Messages.deleteForEveryoneWindowS172800Tiempo (en segundos) para borrar un mensaje para todos (48 h).
Config.Groups.maxMembers256Máximo de miembros por grupo.
Config.Groups.maxCreatedPerAccount50Grupos activos que una misma cuenta puede crear.
Config.Communities.maxGroups50Máximo de grupos vinculados a una comunidad.
Config.Channels.maxCreatedPerAccount5Canales que una misma cuenta puede crear.
Config.Status.ttlS86400Duración de un estado, en segundos (24 h).
Config.LiveLocation.durations{ 900, 3600, 28800 }Duraciones permitidas de la ubicación en tiempo real, en segundos: 15 min, 1 h y 8 h.
Config.Calls.maxGroupParticipants8Participantes por llamada de voz grupal.
Config.Calls.groupVideotrueActiva el video grupal. Con false, las llamadas grupales son solo de voz.
Config.Calls.maxGroupVideoParticipants4Participantes por videollamada grupal. Por encima de 4 baja la calidad.
Config.Media.domains{}Hosts HTTPS aceptados para archivos, por tipo (image, video, audio, sticker, gif). Empiezan vacíos: añade el host de subida configurado en LB Phone.
Config.Media.maxBytes10 MB / 50 MB / 10 MBTamaño máximo de imagen, video y audio.
Config.Limits.textLength4096Longitud máxima de un mensaje de texto, en caracteres.
Config.Retention.messagesDays0Días que se guardan los mensajes. 0 los mantiene para siempre.
Config.Admin.ace"rvt_chat.admin"ACE que habilita la moderación de la app (todos los modos, salvo creative).
Config.Admin.group""Solo en modo creative: grupo que puede moderar (el nivel mínimo está en Config.Admin.level, por defecto 1). Vacío = nadie.
Config.DebugfalseMuestra líneas de depuración en la consola del servidor.
Ver el shared.lua completo
shared.lua
Config = {}

-- Standalone is generic. Select an installed framework explicitly before production.
Config.Framework = {
    name = "standalone",       -- string. standalone | creative | qbox | qb | esx | custom (no auto-detection)
    qbResource = "qb-core",    -- string. QB resource name
    qboxResource = "qbx_core", -- string. Qbox resource name
    esxResource = "es_extended" -- string. ESX resource name
}

-- Prefix of net events ("<Resource>:rpc", "<Resource>:event"), log lines and the pma-voice admission name.
-- Must equal the resource folder name. string, default "rvt_chat".
Config.Resource = "rvt_chat"

Config.App = {
    identifier = "rvt_chat",   -- string. LB custom app id
    name = "RVT Chat",         -- string. Name shown on the phone
    description = "Conversas, grupos, comunidades, canais e status.", -- string. App description
    developer = "RVT Scripts", -- string. Developer shown by LB
    defaultApp = true,         -- bool. Installed on every phone
    size = 4096,               -- number. App size shown by LB (KB)
    register = true,           -- bool. false = never calls AddCustomApp
    ui = "web/dist/index.html",-- string. Path inside the resource
    icon = "web/dist/icon.svg" -- string. Path inside the resource
}

-- Every timestamp exchanged with the frontend is Unix epoch in milliseconds (UTC).

Config.Identity = {
    requirePhoneItem = true,   -- bool. Every op needs the phone item (LB HasPhoneItem)
    revalidateMs = 30000       -- number (ms). Re-check identity, equipped number and item
}

Config.Limits = {
    payloadBytes = 16384,      -- bytes. JSON payload per RPC (PAYLOAD_TOO_LARGE above)
    pageSize = 30,             -- default page size
    maxPageSize = 100,         -- hard cap for "limit"
    textLength = 4096,         -- chars. Message body
    captionLength = 1024,      -- chars. Media caption
    displayName = 40,          -- chars. Profile name
    about = 140,               -- chars. Profile "about"
    searchMin = 2, searchMax = 64, -- chars. Search term bounds
    pinnedChats = 3,           -- max pinned chats per account
    pinnedMessages = 3,        -- max pinned messages per chat (oldest drops out)
    forwardTargets = 5,        -- max destination chats per forward
    frequentlyForwardedScore = 5, -- forwards before the "frequently forwarded" flag
    batchIds = 100,            -- max ids in *.batch ops
    reactionBytes = 32         -- max bytes of one reaction emoji
}

Config.Messages = {
    editWindowS = 15 * 60,              -- seconds. Edit window after sending
    deleteForEveryoneWindowS = 48 * 3600, -- seconds. "Delete for everyone" window
    adminDeleteAnyTime = false,         -- bool. Group admins delete outside the window
    disappearingOptions = { 0, 86400, 7 * 86400, 90 * 86400 }, -- allowed timers (0 = off)
    pinDurations = { 86400, 7 * 86400, 30 * 86400 },           -- allowed pin durations
    pollMaxOptions = 12, pollOptionLength = 100, pollQuestionLength = 255
}

Config.Groups = {
    maxMembers = 256,
    maxCreatedPerAccount = 50, -- active groups created by one account
    nameLength = 50,
    descriptionLength = 512,
    -- defaults for new groups; "admins" | "all"; communityJoin: "open" | "request" | "hidden"
    defaults = { editInfo = "admins", send = "all", addMembers = "admins", pin = "admins", approval = false, communityJoin = "request" }
}

Config.Communities = { maxGroups = 50, maxMembers = 2000, maxCreatedPerAccount = 10 }

Config.Channels = { nameLength = 60, descriptionLength = 512, maxAdmins = 16, maxCreatedPerAccount = 5 }

Config.Invites = {
    defaultTtlS = 7 * 86400,   -- seconds. Default link lifetime
    maxTtlS = 30 * 86400,      -- seconds. Upper bound for ttlS
    maxUses = 1000             -- upper bound for maxUses
}

Config.Broadcasts = {
    maxLists = 20,             -- lists per account
    maxRecipients = 256,       -- recipients per list
    requireRecipientContact = true -- bool. Recipient must have the sender in the LB agenda
}

Config.Status = {
    ttlS = 24 * 3600,          -- seconds. Status lifetime
    maxActivePerAccount = 30,
    textLength = 700, captionLength = 700,
    purgeAfterS = 24 * 3600    -- seconds. Physical removal after expiry
}

Config.LiveLocation = {
    durations = { 900, 3600, 28800 }, -- allowed durations (seconds)
    intervalMs = 5000,         -- number (ms). Server tick that reads the position
    labelLength = 120,
    bounds = { minX = -4500.0, maxX = 4500.0, minY = -4500.0, maxY = 8500.0 } -- picked points only
}

Config.Calls = {
    ringTimeoutS = 30,         -- seconds. Ringing before "missed"
    maxGroupParticipants = 8,  -- voice group call
    maxDurationS = 7200,       -- seconds. Hard limit, then reason "max_duration"
    channelBase = 800000, channelRange = 99999, -- reserved pma-voice namespace (see installation)
    groupVideo = true,         -- bool. Enables WebRTC mesh video in group calls
    maxGroupVideoParticipants = 4,
    signalBytes = 8192,        -- bytes. Max size of one call.signal data
    -- Cloudflare TURN credentials are read from server convars, never from the files:
    --   set rvt_chat_turn_token_id "<TURN key id>"
    --   set rvt_chat_turn_api_token "<TURN API token>"
    -- Without them the mesh uses STUN only (fails behind strict NAT).
    turnTtlS = 3600,           -- seconds. Lifetime of generated TURN credentials
    stunUrls = { "stun:stun.cloudflare.com:3478" }
}

Config.Media = {
    -- Set the HTTPS hostnames used by your LB upload provider before enabling media.
    -- A domain entry also accepts its subdomains. Every list starts empty.
    domains = {
        image = {},
        video = {},
        audio = {},
        sticker = {},
        gif = {}
    },
    maxBytes = { image = 10 * 1024 * 1024, video = 50 * 1024 * 1024, audio = 10 * 1024 * 1024, sticker = 1024 * 1024, gif = 15 * 1024 * 1024 },
    maxDurationS = { video = 180, audio = 600 },
    mimes = {
        image = { "image/jpeg", "image/png", "image/webp" }, video = { "video/webm", "video/mp4" },
        audio = { "audio/ogg", "audio/webm", "audio/mpeg", "audio/mp4" },
        sticker = { "image/webp", "image/png" }, gif = { "image/gif", "video/mp4", "image/webp" }
    },
    documents = false,         -- bool. Documents need private storage; none is installed
    maxPerMessage = 10
}

Config.RateLimits = {          -- bucket = { requests, windowMs } per account
    default = { 30, 10000 }, send = { 20, 10000 }, typing = { 6, 5000 }, lookup = { 20, 60000 },
    search = { 10, 10000 }, create = { 5, 60000 }, report = { 5, 60000 }, media = { 20, 60000 },
    call = { 6, 30000 }, signal = { 120, 10000 }, location = { 6, 30000 }
}

Config.Sync = { overlapMs = 5000, maxItems = 300 }

Config.Retention = {           -- days unless noted; 0 on messagesDays keeps forever
    messagesDays = 0, receiptsDays = 30, idempotencyHours = 24,
    callsDays = 60, auditDays = 180, cleanupIntervalS = 60
}

Config.Admin = {
    ace = "rvt_chat.admin",    -- string. ACE that unlocks admin.* ops (every mode except creative)
    group = "",                -- string. creative mode only: group allowed to moderate ("" = nobody)
    level = 1                  -- number. creative mode only: minimum level of that group
}

Config.Notifications = { previewLength = 120 } -- chars of notification body

Config.Debug = false           -- bool. Debug lines in the console