mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
refactor(streaming): bump default timeout
There's no point trying to argue with people who rely on faulty behaviour and race conditions.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---Load an animation dictionary. When called from a thread, it will yield until it has loaded.
|
||||
---@param animDict string
|
||||
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 1000.
|
||||
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 10000.
|
||||
---@return string animDict
|
||||
function lib.requestAnimDict(animDict, timeout)
|
||||
if HasAnimDictLoaded(animDict) then return animDict end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---Load an animation clipset. When called from a thread, it will yield until it has loaded.
|
||||
---@param animSet string
|
||||
---@param timeout number? Approximate milliseconds to wait for the clipset to load. Default is 1000.
|
||||
---@param timeout number? Approximate milliseconds to wait for the clipset to load. Default is 10000.
|
||||
---@return string animSet
|
||||
function lib.requestAnimSet(animSet, timeout)
|
||||
if HasAnimSetLoaded(animSet) then return animSet end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---Load a model. When called from a thread, it will yield until it has loaded.
|
||||
---@param model number | string
|
||||
---@param timeout number? Approximate milliseconds to wait for the model to load. Default is 1000.
|
||||
---@param timeout number? Approximate milliseconds to wait for the model to load. Default is 10000.
|
||||
---@return number model
|
||||
function lib.requestModel(model, timeout)
|
||||
if type(model) ~= 'number' then model = joaat(model) end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---Load a named particle effect. When called from a thread, it will yield until it has loaded.
|
||||
---@param ptFxName string
|
||||
---@param timeout number? Approximate milliseconds to wait for the particle effect to load. Default is 1000.
|
||||
---@param timeout number? Approximate milliseconds to wait for the particle effect to load. Default is 10000.
|
||||
---@return string ptFxName
|
||||
function lib.requestNamedPtfxAsset(ptFxName, timeout)
|
||||
if HasNamedPtfxAssetLoaded(ptFxName) then return ptFxName end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---Load a texture dictionary. When called from a thread, it will yield until it has loaded.
|
||||
---@param textureDict string
|
||||
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 1000.
|
||||
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 10000.
|
||||
---@return string textureDict
|
||||
function lib.requestStreamedTextureDict(textureDict, timeout)
|
||||
if HasStreamedTextureDictLoaded(textureDict) then return textureDict end
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
---Load a weapon asset. When called from a thread, it will yield until it has loaded.
|
||||
---@param weaponType string | number
|
||||
---@param timeout number? Approximate milliseconds to wait for the asset to load. Default is 1000.
|
||||
---@param timeout number? Approximate milliseconds to wait for the asset to load. Default is 10000.
|
||||
---@param weaponResourceFlags WeaponResourceFlags? Default is 31.
|
||||
---@param extraWeaponComponentFlags ExtraWeaponComponentFlags? Default is 0.
|
||||
---@return string | number weaponType
|
||||
|
||||
@@ -18,7 +18,7 @@ function lib.streamingRequest(request, hasLoaded, assetType, asset, timeout, ...
|
||||
|
||||
return lib.waitFor(function()
|
||||
if hasLoaded(asset) then return asset end
|
||||
end, ("failed to load %s '%s' - this is likely caused by unreleased assets"):format(assetType, asset), timeout)
|
||||
end, ("failed to load %s '%s' - this is likely caused by unreleased assets"):format(assetType, asset), timeout or 10000)
|
||||
end
|
||||
|
||||
return lib.streamingRequest
|
||||
|
||||
Reference in New Issue
Block a user