Skip to content

Add timeouts and validation to asset loaders#1219

Merged
GhzGarage merged 1 commit into
qbcore-framework:mainfrom
MrNewb:main
May 13, 2026
Merged

Add timeouts and validation to asset loaders#1219
GhzGarage merged 1 commit into
qbcore-framework:mainfrom
MrNewb:main

Conversation

@MrNewb
Copy link
Copy Markdown
Contributor

@MrNewb MrNewb commented May 10, 2026

Enhance several asset-loading helpers in client/functions.lua to avoid indefinite blocking and provide explicit status. LoadModel, RequestAnimDict, LoadAnimSet, and LoadParticleDictionary now accept an optional timeout (default 5000ms), return a boolean load result and the resolved name/hash, and perform existence/validity checks before requesting. LoadModel also accepts string model names (converted via joaat) and logs a warning if the model doesn't exist. These changes make asset loading safer and easier to debug when assets fail to load.

Description

Adds timeout as optional param.
Adds a Boolean + request return.
Adds failure print where applicable.
Stops infinite loops on model/animset/anim dict/particle requests.
No breaking changes and backwards compatible.

Checklist

  • [X ] I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • [X ] My code fits the style guidelines.
  • [X ] My PR fits the contribution guidelines.

this is kinda fun sometimes

Enhance several asset-loading helpers in client/functions.lua to avoid indefinite blocking and provide explicit status. LoadModel, RequestAnimDict, LoadAnimSet, and LoadParticleDictionary now accept an optional timeout (default 5000ms), return a boolean load result and the resolved name/hash, and perform existence/validity checks before requesting. LoadModel also accepts string model names (converted via joaat) and logs a warning if the model doesn't exist. These changes make asset loading safer and easier to debug when assets fail to load.

Adds timeout as optional param, stops infinite loops on model/animset/anim dict/particle requests
No breaking changes and backwards compatable
@MrNewb
Copy link
Copy Markdown
Contributor Author

MrNewb commented May 10, 2026

Originally wanted to increment in a count, Stevie suggested game time so went with that.

@QBStevie
Copy link
Copy Markdown
Contributor

QBStevie commented May 10, 2026

lol thats bec i like game time

@GhzGarage GhzGarage merged commit 891b039 into qbcore-framework:main May 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants