444 Commits

Author SHA1 Message Date
Kakarot 4bdff4d3b3 Merge branch 'main' into main 2026-06-17 13:02:53 -05:00
Mehdi 1b126f1bd0 🐛 Fix async race condition causing ghost characters on deletion 2026-05-29 12:17:00 +01:00
Mehdi 02ce867a37 the damn bug 2026-05-29 12:00:30 +01:00
aysihuniks ae51ed75aa fix: move PreCommandExecution event after argument validation 2026-05-27 15:39:19 +03:00
aysihuniks 9ff384b9fc feat(commands): add pre-execution middleware event 2026-05-27 15:28:01 +03:00
Kakarot 7104e8c81f fixes for AddPlayerMethod 2026-05-19 22:59:06 -05:00
Kakarot 74ac036d4a Refactor core structure and notification UI
Major refactor to centralize QBCore and replace the web UI stack:

- Move QBConfig into a unified QBCore.Config and initialize QBCore.PlayerData; add shared/functions.lua.
- Remove legacy client/main.lua and server/main.lua exports and update fxmanifest to include shared/functions and drop those main scripts.
- Update client event handling: adapt player data events to QBCore:Client:OnPlayerUpdated and trigger job/gang update events; remove deprecated exploitable handlers.
- Web UI rewrite: remove Vue/Quasar dependency and config module; implement a lightweight vanilla JS notification system (html/js/app.js) with updated html and css assets, plus drawtext tweaks.
- CSS overhaul for notification styling and animations; HTML head/meta/font cleanup.
- Server fixes: use QBCore.Shared.Locations in teleport command and strengthen numeric parsing/validation for coords.
- Add .gitattributes for consistent text/eol handling and small code cleanups (thread/comment removal).

These changes consolidate config/shared logic under QBCore, simplify the frontend dependencies, and fix a few parsing/event issues.
2026-05-19 18:13:35 -05:00
Kakarot 1cee09a394 Support partial player data updates
Add support for sending single-field player data updates to clients to reduce bandwidth. Added a new client event QBCore:Player:UpdatePlayerDataField that updates a single key on QBCore.PlayerData. Modified server QBCore.Player.CreatePlayer UpdatePlayerData to accept an optional key and value; when provided it triggers the new per-field client event, otherwise it falls back to sending the full player data. Updated various player functions to call UpdatePlayerData with specific keys (job, gang, metadata, money, etc.) instead of always triggering a full sync. Files changed: client/events.lua, server/player.lua.
2026-04-20 19:18:48 -05:00
Kakarot 17da7688f0 Run paychecks in async thread and fix society check
Move the paycheck loop into a CreateThread to avoid blocking the main thread and prevent paychecks from stopping. Add a nil guard for Player and keep existing payment lookup logic. Tighten society payroll logic: check the society account balance before removing funds and still pay employees if the account is zero, avoiding duplicate AddMoney/Notify branches. Add a short Wait(50) between player iterations to yield. Preserve the existing SetTimeout scheduling for the next paycheck run.
2026-04-20 18:58:05 -05:00
Kakarot 6dbbfed6c7 Reduce client loop CPU usage; tweak Kick timing
Increase client loop default sleep from 0 to 1000 to avoid a tight busy-wait when the player is not logged in, reducing CPU usage. In server/functions.lua move the Wait(100) out of the inner Kick loop so the DropPlayer thread is spawned immediately and the short delay happens after the loop, improving timing and avoiding blocking behavior.
2026-04-20 18:51:33 -05:00
Kakarot 83152ac815 dom asked for optimization lol 2026-04-20 18:34:22 -05:00
GR-Scripts 9d6143c7a9 Set job duty status at player login 2025-12-15 05:13:21 +01:00
Joel 63d6cc9681 fix(client-callbacks): check source before attempting concatenation 2025-10-06 14:48:21 -04:00
Joel 3c9ce7cc4c fix: append source id when registering client callback in table to prevent collisions 2025-10-06 13:41:12 -04:00
Joel aaa681fdd4 fix: append source id to prevent client callback collisions 2025-10-06 13:39:11 -04:00
MrNewb d19f34ba09 update 2025-06-22 15:45:03 -04:00
Kakarot 2827a6350b Merge branch 'main' into main 2025-06-22 14:38:43 -05:00
MrNewb 7a0567efac feat(core): add functions to retrieve online players by job name or type with optional on-duty check
Adds two utility functions to retrieve online players by either job name or job type, with optional filtering for on-duty status. While the logic is a bit nested, this approach avoids unnecessary function splitting and keeps related behavior in a single place. Although I'm not entirely satisfied with the nesting, this structure felt like a reasonable trade-off between readability and reusability.

This method could also serve as a foundation for deprecating older job-check functions, should the maintainer choose to consolidate similar logic in the future.
2025-05-23 04:13:17 -04:00
Stevie 76dcd087df Update functions.lua 2025-04-11 04:26:31 +01:00
Stevie eabfb14086 Update functions.lua 2025-04-11 04:24:56 +01:00
Stevie d293239c71 Update functions.lua 2025-04-11 04:23:35 +01:00
Stevie 85bc71416a Update functions.lua 2025-04-11 03:44:55 +01:00
Kakarot 73e80fbc7c Merge branch 'main' into main 2025-03-09 14:23:30 -05:00
Miguel Oppermann 62e6a6f949 Update functions.lua
Fixed a bug that prevented paychecks from working forever once 0 players was hit which typically directly happens on server start.
2025-03-02 00:42:27 +01:00
Pickle 1ce2d445ee Merge branch 'main' into main 2025-02-02 21:28:02 -05:00
Kakarot 9adb33b970 Core object filtering + exported functions/data
Maintains backwards compatibility and allows users to only get what they need from the core instead of importing it all
2025-01-25 00:36:31 -06:00
Borre e90fa91102 TP with heading support
Added support for the heading argument when using the /tp command.
2025-01-24 19:27:01 +01:00
Pickle ebae2c35f7 Update functions.lua 2025-01-12 14:13:07 -05:00
Cocodrulo 6f6bcf0321 Merge branch 'main' into feature/getname 2025-01-08 21:09:08 +01:00
Cocodrulo e288b742c8 Add function to retrieve player's full name from character data 2025-01-08 13:25:07 +01:00
Zerio d08d7bbeba chore: remove accidental automatic format changes 2025-01-07 07:21:50 +01:00
Zerio 8ab5f76bdf feat: simply funcref check 2025-01-07 07:20:53 +01:00
Zerio 8660c98d49 fix: wrong args passed 2025-01-06 21:41:53 +01:00
Zerio dc8fbf04e9 feat: use promises in callbacks + cleanup 2025-01-06 21:31:23 +01:00
Zerio bbf23491dc Merge branch 'main' into main 2024-11-11 20:52:33 +01:00
Mustache Dom 304a6f42a0 Update player.lua 2024-11-07 20:47:22 -08:00
Mustache Dom 1ce5dd831b Update player.lua 2024-11-07 20:22:12 -08:00
Mustache Dom 080556c425 checks to see if RemoveMoney has enough
removes exploit to allow bank to be -99999999999
2024-10-22 15:07:23 -07:00
Kakarot c15169296c Merge branch 'main' into main 2024-07-25 22:04:57 +02:00
Zerio 4344c3a592 Merge branch 'main' into fix-isboss-sync 2024-07-15 04:59:18 +02:00
Zerio c4bbff6b56 Merge branch 'main' into main 2024-07-15 04:55:14 +02:00
Kasey FItton 78bcabcbfc fix(server/events): fix the typo in the typo
kill me plz
2024-07-12 01:31:33 +01:00
Kasey FItton 7e580eef1d fix(server/events): fix typo 2024-07-12 01:26:37 +01:00
Kasey FItton e1aa208b61 fix(server/functions): return database details correctly 2024-07-12 01:06:48 +01:00
Kasey FItton be3bbb8abf fix(server/events): error handle MySQL.ready 2024-07-12 00:24:17 +01:00
Kasey FItton e39fe89140 feat(server): SQL error handling 2024-07-11 18:53:27 +01:00
Zerio 5d2ee040b3 feat: add same validation for gangs as for job 2024-05-26 07:55:38 +02:00
Zerio 3d6760b402 fix: what should happen for non existant jobs? 2024-05-26 07:55:11 +02:00
Zerio ffc67e0347 fix: validate job info upon player login 2024-05-26 00:21:29 +02:00
Zerio 9fbab7a4e6 fix: remove usable item after resource stop 2024-05-25 21:04:30 +00:00