Skip to content

cc_lib changelog

Versions before 1.2.0 are recorded in the git history only.

Versions before 1.2.0 are recorded in the git history only.

1.13.0 — 2026-12-01 (first product release)

The first release built for sale on The Code Cartel store (free asset). Starts from the Legacy city build 1.12.1; nothing a consumer calls changed shape.

Added

  • config.lua (public) and server/config.lua (secret): every setting that was a convar is now also a config value. Order: convar > config file > default, so servers configured with convars keep working unchanged. Read by init.lua into a sandbox (CC.cfg, CC.serverCfg), so a consumer's own Config global is never touched. server/config.lua is not in files and is never read on a client.
  • CC.setting(convar, path, default): the one resolver every module uses (type-coerced, a junk convar falls through to the config, a config value of the wrong type is ignored).
  • Boot validation (modules/settings.lua, server/validate.lua, console cc_validate): types, enums, ranges, unknown keys, forced adapters that are not started, a webhook URL in the public config, malformed webhook URLs, a boost window that ends before it starts.
  • Locales (locales/en.lua, CC.locale(key, ...), Config.Locale / cc:locale): the strings cc_lib shows itself (fallback menu, default titles, "Unemployed").
  • CC.billing (server): send(target, { amount, reason, society?, sender? }) and provider() for okokBilling and esx_billing, with an opt-in bank-charge fallback (Config.Billing.fallback).
  • Export surface for non-Lua code: exports.cc_lib:call(module, fn, ...), getVersion(), getConfig(), modules() on both sides (server/exports.lua, client/exports.lua).
  • Webhooks per channel from ServerConfig.Webhooks or set cc:webhook_<channel>.
  • Config.Bridge.society and cc:billing in the start-up override report, which now says whether an override came from a convar or config.lua.
  • tests/product.lua (83 checks) for all of the above.

Changed

  • CC.boost is off by default. The Legacy launch-week window is no longer built in; set Config.Boost (or the old convars, which still enable it on their own).
  • cc:gms "" no longer turns the homebar portrait off (an empty convar now means "unset"); use 'none'.
  • escrow_ignore lists every file: cc_lib ships open because other resources load it across resources (see INSTALL.md).
  • cc_lib's own instance registers its scoped client routes, so exports.cc_lib:call can notify, give keys etc.
  • Doc examples no longer use Legacy ids.

Fixed

  • tests/smoketest.lua loaded ../cc_lib (a sibling folder) instead of the checkout under test.

1.12.0 — 2026-11-25 (LEGACY)

  • CC.boost (modules/boost.lua): a timed pay and XP boost, pay(n), xp(n), active(), payRate(), xpRate(), state(). Defaults are the Legacy launch week (11 Dec 2026 18:30 to 18 Dec 23:59:59 AEDT, pay x1.3, XP x2); convars cc:boost_start, cc:boost_end, cc:boost_pay, cc:boost_xp, cc:boost_off. Server exports boostPay, boostXp, boostState (server/boost.lua) for resources without cc_lib's init. Test: tests/boost.lua.

1.11.0 — 2026-11-23

  • preLogin option on CC.security.event / CC.callback.register / gate (cc_lib #2): character select/create/delete run before a character exists; a loaded player is refused (loaded) and flagged. Needed by cc_multicharacter.

1.10.1 — 2026-11-16 (audit-1116)

Fixed

  • CC.inventory.isOpen() on ox_inventory called exports.ox_inventory:IsInventoryOpen(), which ox_inventory does not export, so it always answered false. It reads LocalPlayer.state.invOpen now, the state bag ox_inventory sets on open and close (client side only).

1.10.0 — 2026-11-12

Added

  • Shared page motion for every Cartel page (ui/motion.js + ui/motion.css, loaded by ui/homebar.js; owner, 12 Nov: "across all the cc UIs", from cc_paperroute 2.9.0). No page change needed:
    • Page to page: a [data-view], [data-pane] or [role=tabpanel] that is shown drifts 24 px in from the side of the tab you came from and fades up (260 ms); its first blocks settle 40 ms apart. Not on the open itself.
    • Gliding tab fill: a filled selected tab's background slides from the old tab to the new one (300 ms). A tab row that draws its own indicator keeps it.
    • Theme switch: every colour blends over 360 ms; the homebar's sun and moon turn past each other (320 ms). Dark stays the default and the choice still saves per player.
    • More: dialogs inside a panel pop in (scale .96, 180 ms); CCMotion.count(el, n, fmt) rolls a figure to a new value (600 ms); CCMotion.bump(el) pulses a changed badge.
  • Never fights a page: skips elements the page already transforms or animates (paperroute's own slide), stays off under prefers-reduced-motion, and data-cc-motion="off" opts a page or part out. Transform and opacity only; nothing loops; no fetch.

1.9.2 — 2026-11-12

Fixed

  • Homebar card blank on some pages (cc_detecting showed "?" and no name). A page that asks for the card twice as it opens (detecting asks on open and again in its own boot) hit the profile callback's 1 s cooldown; the second answer was nil and the page drew an empty card over the good one. client/homebar.lua now answers every ask within 1.5 s from one server read, makes an ask wait for one already out, and falls back to the last good card (up to a minute) on a failed read. ui/homebar.js never wipes a drawn card with an empty answer.
  • Portrait key names the character. The once-per-photo key was the photo's length and tail; it now starts with the citizenid, so two characters' photos can never share a key on one client, and a key the client does not hold shows initials, never an older picture.

1.9.1 — 2026-11-12

Changed

  • Every Cartel page is dark by default (owner, 12 Nov). A player who has never pressed the theme button now gets dark on every page, not light. client/homebar.lua treats "nothing saved" as dark, and ui/homebar.js puts data-cc-theme="dark" on the page before the saved choice comes back, so the first frame is dark too. A player who saved light keeps light. A page that must start light can still say data-default="light" on its homebar mount. Still no color-scheme: dark on the root.

1.9.0 — 2026-11-11

Changed

  • Homebar: the line under the name is the job. It was "GMS: ", which only repeated the character name (owner, 11 Nov). Now it is "Job · Grade" from CC.framework.getJob, and it is hidden when the character is unemployed. The page's gms label is no longer used.
  • Homebar: the portrait is the wallet photo. The server takes the GMS primary photo, the same one the government wallet shows, and it may be a base64 jpeg/png/webp data URL (up to 700 KB, strictly checked). Before, a primary photo kept in the database was skipped and an older approved https photo showed instead. This needs tcc_gms GetCharacterPortrait to return the primary photo (LIVE CODE CHANGES/tcc_gms.md).
  • A portrait is sent to each client once per photo: the server remembers the key it sent, and client/homebar.lua fills it back in for every page. Re-opening a page no longer blinks the portrait to initials.

1.8.0 — 2026-11-09

Added

  • Purchase receipts inside the open page. FiveM draws the focused NUI frame at z-index 99999 over every other frame, so ox_inventory's item box, ox_lib toasts and the HUD money flash were hidden under an open Cartel shop: a player bought a metal detector, saw nothing change, and kept buying. Now CC.inventory.addItem / removeItem and CC.money.add / remove send CC.notify.receipt on success, every client CC.notify.send is mirrored to the resource's own page, and the new ui/receipt.js draws them as toasts inside the page - only while that page has focus, so a closed page stays silent. Display only.
  • ui/receipt.js loads itself on every page that loads ui/homebar.js. Other pages add <script src="nui://cc_lib/ui/receipt.js"></script>. A page with its own notify toasts sets <html data-cc-receipt="no-notify">. Labels/locale: CCReceipt.configure({ labels, locale }).

1.7.6 — 2026-11-06

Added

  • Every CC.money.addSociety / removeSociety (and so paySalary) writes one log line, refused moves included: console always, Discord channel society = convar cc:log_society_webhook (server-only, set), else the consumer's own economy channel, else none. okokBanking society UPDATEs log nothing, so a treasury or society move used to leave no trail unless the caller logged it (Legacy core audit 6 Nov, H5).
  • CC.logger.ensureChannel(name, convar?, fallback?): give a channel a webhook only if the consumer set none.

1.7.5 — 2026-11-03

Fixed

  • CC.security distance gates (Security.near, Security.nearAny, and every distance = {...} option on events and callbacks) accept a vector4 or a plain {x, y, z} table; the heading is ignored. They did #(pedCoords - coords), and CfxLua errors on vector3 - vector4, so a config point written as vec4 refused every gate: players beside the ped were told "too far" (cc_scrapyard, legacy-live#426). The sim's vector mock allowed the mixed subtraction, which is why no suite caught it.

1.7.4 — 2026-11-02

Fixed

  • Qbox core object: real qbx_core registers GetCoreObject only as a qb-core export, so getCore() now falls back to exports['qb-core']:GetCoreObject() (review A). Recorded here on 3 Nov; the code shipped with the 2 Nov autosave.

1.7.3 — 2026-11-02

Fixed

  • CC.vehicle get/setProperties without the consumer's lib global now call ox_lib's export (exports.ox_lib:getVehicleProperties / setVehicleProperties; every lib.x in @ox_lib/resource is exported). 1.7.2 fell back to the framework path, which on Qbox has no core object (qbx_core registers GetCoreObject only as a qb-core export), so every CC.vehicle.spawn({ props }) lost its props in consumers without @ox_lib/init.lua (cc_business garage liveries, extras, max mods). The qb path now guards a non-table core.

1.7.2 — 2026-11-02

Fixed

  • CC.menu (open, close, input, confirm) no longer needs the consumer to load @ox_lib/init.lua: without the lib global it calls ox_lib's client exports. cc_tow's truck loan threw menu.lua:133: attempt to index a nil value (global 'lib'); 25 cc_* resources load cc_lib without ox_lib's init.
  • CC.vehicle properties use ox_lib only when lib exists in the consumer, else the framework path.

1.7.1 — 2026-11-01

Fixed

  • Homebar: a page that is dark by design marks its mount data-default="dark"; until the player saves a choice the bar then starts dark, so the theme button no longer claims the wrong mode on first open.

1.7.0 — 2026-11-01

Added

  • The universal homebar. ui/homebar.js + ui/homebar.css (served as nui://cc_lib/ui/...): theme button, GMS portrait, character name and GMS line, ported from cc-shops 2.0.0. A page adds <div data-cc-homebar></div> to its top bar. Profile from the server (server/homebar.lua: tcc_gms GetPersonByCitizenId / GetCharacterPortrait, portrait host-allowlisted, initials fallback, GMS optional); also exports.cc_lib:GetProfile(src). Theme saved per player (one KVP, shared by every panel), written to <html data-cc-theme> and the cc-theme window event. ui/theme-dark.css is the dark token map for pages on the standard tokens. Convars: cc:gms, cc:avatarhosts, cc:gmscache. No config key changed.

1.6.0 — 2026-10-27

Mostly additions. Products may require cc_lib >= 1.6.0 for the functions marked new.

Changed (behaviour — read before upgrading)

  • distance.coords returning nil now refuses the event. 1.5 skipped the check on nil, and some products used that as "no fixed point". Return false to skip the check explicitly; nil (a lookup that found nothing) refuses and logs an error. Reported by cc_jobcentre, whose keybind boards lost every question until it changed.
  • Arg specs: unbounded numbers capped at ±2^31-1, tables depth/size-limited, unknown types refuse (details under Fixed).
  • CC.api.registry: unregister<X> only works for the entry's owner (or the hosting resource); the owner may re-register its own key (replaces it); get<X>s returns a copy, not the live definitions.
  • CC.dispatch.send returns false when the built-in fallback delivered the alert.

Fixed

  • cc_lib's own net events were global. cc_lib:notify, cc_lib:keys:*, cc_lib:fuel:set, cc_lib:vehicle:applyProps and cc_lib:dispatch:* were handled by every resource that had loaded the module: a server running five products showed one CC.notify.send as five toasts, five blips, five key grants. A product whose client had never touched the module dropped its own events. They are now cc_lib:<resource>:<name> (CC.eventName), with one handler each in init.lua that loads the module on first use.
  • Client-raised dispatch alerts could reach any job with any blip. The fallback event now keeps only jobs in cc:dispatch_jobs (default police,sheriff,ambulance,fire, max 4, no duplicates, police if none survive) and clamps sprite / colour / scale / time. Ported from the Legacy city's 21 Oct audit fix.
  • onReady fired with no character. The client gave up after 60 s and ran every onReady handler from the character-select screen. It now waits for as long as it takes (Legacy city fix, 24 Oct).
  • ND_Core was detected but not bridged. CC.framework.name said 'nd' while getPlayer, jobs and money silently used the standalone path. ND_Core 2.x now has a real adapter (player, job/rank, loaded and job-change events, cash/bank).
  • Dispatch: rcore_dispatch, core_dispatch, origen_police and emergencydispatch were detected and then sent to the fallback with send reporting success. rcore_dispatch and core_dispatch now have adapters; the other two say so in the cc report and the README.
  • Fuel: on the server, a legacy-shaped provider with no server SetFuel (LegacyFuel and most forks) made set return true having done nothing. It returns false now; use setFor.
  • SCRIPT-STANDARDS calls CC.logger.info(...), which did not exist. It does now.

Fixed from the checker's review (REVIEW.md, 27 Oct):

  • exchange could consume without producing. Reward addItem results were ignored, so a reward that did not land still returned true with the inputs gone. Now checked, with rollback of rewards and inputs; capacity is checked after the inputs are removed; inputs may carry metadata for the rollback; a failed rollback is logged item by item.
  • paySalary destroyed society money when the player credit failed. The society is now refunded, and a failed refund is logged as an error.
  • A distance gate with nil coords passed. It now refuses (and a check that errors refuses too).
  • Society writes trust the provider: Renewed-Banking and qb-banking booleans are honoured; qb-management, qs-banking and okokBanking are read back after the write. A refused debit no longer reads as paid. getSociety(nil) and friends return 0/false instead of raising.
  • ESX add/remove are pcall-guarded and add reads the balance back; ox_core add returns the call's own result, not "did not throw".
  • Inventory exports are pcall-guarded at the public entry points.
  • CC.hasExport caches per resource (dropped on that resource's start/stop): money.get, getItemCount, getSociety no longer probe on every call.
  • validate: unbounded numbers capped at ±2^31-1, tables walked for depth/size, unknown spec types refuse.
  • Logger: a 429 re-schedules its own flush; captureSecurityFlags posts at most 10 flags per player per minute and reports the rest as a count, so a flood cannot evict the first real flag.

Added

  • CC.phone — sendMail, notify, getNumber for lb-phone, yseries, gksphone, qs-smartphone(-pro), npwd and qb-phone, with a CC.notify fallback. setr cc:phone.
  • Dispatch adapters for rcore_dispatch, core_dispatch and lb-tablet (server AddDispatch). Server-capable providers are called from the server directly. A provider call that throws falls back to the built-in alert.
  • Money: fd_banking society accounts; ND_Core cash/bank; standalone cash and black money as inventory items (cc:cash_item, cc:black_item); CC.money.addByIdentifier(identifier, account, amount, reason) pays an online or (qb / Qbox) offline character.
  • Framework: getPlayerByIdentifier(identifier), getMetadata(src, key), setMetadata(src, key, value) (session-only fallback with no framework).
  • Target: darktrace interact, falling back to the native prompt per call.
  • Fuel: qb-fuel. Legacy-shaped providers are picked on the client only when they publish GetFuel.
  • Vehicle: CC.vehicle.getLabel(model), never nil.
  • Logger: every log() now also writes a console line, fires the server-local cc_lib:log event, and mirrors to Fivemanage (fmsdk) and the ox_lib logger when detected (set cc:log_mirror, cc:log_console). An empty webhook no longer means no log. CC.logger.channel(name), CC.logger.info/warn/error(msg, ...). Webhook name, avatar and footer icon from set cc:log_username, cc:log_avatar, cc:log_footer_icon (the Legacy copy hard-coded its brand here).
  • Utilities: CC.hasExport(res, fn), CC.pickExport(list, fn), CC.eventName(suffix).
  • The cc report lists phones, logging sinks, fd_banking, qs-banking, interact, qb-fuel, okokGasStation and lb-tablet, and the new convars.
  • Absorbed from tcc_bridge (retired): identifier lookup, metadata get/set, offline money, vehicle labels, qb-fuel. Everything else it bridged cc_lib already had.

Tests

  • tests/mutate.lua: M15 and M119 re-anchored to the new distance gate and society pre-check; 128/128 caught (run against a copy with the sim version line bumped).
  • tests/smoketest.lua runs with no argument (fverify -Suite smoketest), models per-resource exports and captures events; 65 new checks cover every addition above.
  • tests/verify.lua: guide-12 provider coverage per module, no global cc_lib: event literals, every init route has its receiver, the dispatch allowlist, the onReady give-up gone, and the README documents every 1.6.0 function.

1.5.0 — 2026-10-17

Fixed

  • CC.garage on jg-advancedgarages v4 (checked against v4.1.1's docs and its unescrowed files):
    • register keeps the id registerGarage returns. v4 prefixes it with the calling resource's name and stores cars under it, so unregister sent v4 an id it had never registered, and the client opened the wrong garage.
    • The vehicle type goes to jg as vehicleType. It was sent as type, which v4 ignores, so every garage was a car garage. coords now goes as a vector3, as the API says.
    • A refusal (false, err) is now false and logged. It used to count as registered.
    • On the client, jgV4() asked for registerGarage, which is a server-only export, so the client always took the v3 event path. It now asks for the client export openGarage, and open/store call v4's openGarage/storeVehicle.

Added

  • CC.garage.garageId(id): the id the garage resource knows the garage by. That is jg v4's prefixed id once registered, and the raw id everywhere else. Send this to the client for open/store. register returns it as a second value.
  • CC.garage.refreshAccess(id) calls v4's refreshGarageAccess after keys or ownership change. Access is still asked live on every use, so this only refreshes jg's prompts.
  • def.interactions (default false) maps to v4's manageInteractions. By default the product draws its own prompts and calls open/store, as it does with every other garage.
  • Sim: the v4 scenario now uses a fake that returns a prefixed id and has separate server and client exports. New scenarios cover a v4 refusal and the v3 event path. Mutations M125-M128 cover the client export check, the returned id in unregister and in garageId, and vehicleType.
  • tests/verify.lua, the static suite fverify requires and cc_lib never had. It checks the version in the manifest, changelog and sim, the module shipping, webhook URLs, and the jg v4 contract.

1.4.0 — 2026-10-17

Added

  • acc_business society provider for CC.money.getSociety / addSociety / removeSociety. Resolved ahead of okokBanking, because acc_business re-exports okok's names and is the real society store on a city running both; cc:society still overrides. Calls GetAccount(job), AddMoney(job, amount, meta) and RemoveMoney(job, amount, meta) with bare job names and meta = { description = reason, txType = 'sale' | 'withdrawal' }; acc_business's booleans are returned as-is (its RemoveMoney is an atomic conditional debit), and an export that errors is a false, not a crash. Each export is probed per call; a started acc_business missing one warns once and reads 0 / refuses.
  • Landmines documented in modules/money.lua: AddMoney to an unknown job auto-creates an active account when acc_business's autoCreateJobAccounts is on, and GetAccount is 0 for missing and suspended accounts alike, so societyExists returns true.
  • The cc report lists acc_business under Banking.
  • Tests: 11 sim scenarios against a stub of acc_business 2.0.0's banking exports (with okokBanking running alongside); mutations M115-M124.

1.3.0 — 2026-10-15

Security

  • CC.logger is safe with player-authored text. Through 1.2.0 a character named @everyone, or one carrying <@&roleid>, pinged the owner's staff from a log line, an item label could bold, spoiler or hyperlink itself, and one over-long description or invalid UTF-8 from a bad cut made Discord answer 400 — losing every log in that batch. Backward compatible: the API is unchanged and callers need do nothing.
    • allowed_mentions = { parse = {} } on every request — batches, retries and the onResourceStop flush alike. Discord's own guarantee that a log pings nobody.
    • Every string log() puts in an embed is sanitised: title, description, field names and values, footer, and the player name in the identity field (which also makes captureSecurityFlags safe). Zero-width, bidi, separator, joiner/isolate and BOM characters are stripped (lead bytes pinned, so José stays José), control characters removed, @everyone / @here / <@ broken with a zero-width space, and markdown escaped (* _ ` ~ | \ [ ] ( ) > #). Escaping is idempotent, so text a caller already escaped — cc_marketplace's Log.safe — does not show its backslashes.
    • Line breaks: titles, field names and footers are one line; the description and field values keep their lines, with at most one blank line in a row.
    • Discord's limits are enforced on UTF-8 boundaries, with an ellipsis: title 256, description 4096, field name 256 / value 1024, footer 2048, 25 fields (the Player field included and reserved first), 6000 per embed — and 6000 across the embeds of one message, so a batch of ten legal embeds is split rather than refused. Sizes are counted in bytes, which never undercounts what Discord counts. Bytes that are not valid UTF-8 are replaced with U+FFFD. An empty field name or value becomes -.
    • Batching (10 per message), the 429 backoff and re-queue, and the 500-entry queue cap are unchanged.

Test notes

  • tests/sim.lua: the PerformHttpRequest stub now records the callback, method and body, and the logger scenarios read the payload table handed to json.encode. New section "logger: Discord safety and limits": allowed_mentions on every post (batches, a retried 500, the stop flush), mentions in every embed string and the player name, markdown, idempotent escaping, nine invisible/control character classes, eleven non-ASCII names untouched, newline handling, eight oversize / invalid-UTF-8 / empty inputs against every limit, the per-message 6000 budget, the 429 path, and sanitised security flags. 650 checks.
  • tests/mutate.lua: M86–M114 remove each defence in turn — allowed_mentions, each mention break, escaping, idempotence, #, each strip, lead-byte pinning, UTF-8 repair, the cut boundary and ellipsis room, every limit, the empty-value placeholder, the player name, both newline rules, and the 429 re-queue. All 114 mutations RED.

1.2.0 — 2026-10-15

Added

  • CC.inventory.getSlot(src, slot) (server) — what is in one slot of a player's inventory, as { name, label, count, metadata, slot }, or nil when the slot is empty or the inventory cannot answer. Lets a product take a slot number from the client and read the item — and its metadata — itself, so an item escrowed from a slot comes back with the same serial and durability instead of as a fresh copy.
    InventoryHow the slot is read
    ox_inventoryGetSlot(src, slot)
    qb-inventory 1.x / 2.x, ps, lj, tgiann, ak47, codem, other forksGetItemBySlot(src, slot), probed
    qs-inventoryGetInventory(src), the entry for that slot (keyed or listed)
    qb-core player, no inventory exportFunctions.GetItemBySlot, else PlayerData.items[slot] (qb-core 1.3.0)
    ESX, core_inventoryno numbered slots: nil, logged once
    any other detected inventory without GetItemBySlotnil, logged once — the framework's copy is not read

    Metadata is passed through untouched (ox metadata, qb info); empty metadata is nil, as everywhere in the module. An entry that reports a different slot than the one asked for is refused, and a fractional slot is a bad request, not floored to a real one.

Test notes

  • tests/sim.lua: getSlot scenarios for ox, qb-inventory 2.x, ps-inventory, qs-inventory (keyed and listed), the qb-core player (with and without GetItemBySlot), ESX, core_inventory and an export-less fork. 446 checks.
  • tests/mutate.lua: M77–M85 break the slot lookup (fixed slot on ox and on GetItemBySlot), the wrong-slot refusal, the qs list match, qb info as metadata, the no-guessing rule for forks, the qb-core 1.3.0 fallback, log-once, and integer slots. All 85 mutations RED.