[x] Also consider asking tomarty about the relevance of caching modules
[x] Setup an AssetService for server
[x] Change the framework so that the server now has access to all the assets by default, but still keep an asset folder for the client
[x] Handle the organising and reference of command assets (remember we want them to remain on the server)
[x] Iterate over (shared + client) then (shared + server) and ensure both groups have completely unique assetNames. If duplicate found, display warning
[x] Setup the remote to listen for the asset request - only permit the grabbing of client or shared assets
[x] Setup an AssetUtil for client with methods:
[x] getAsset(assetName, optionalCommandName) -- if commandName specified, check that first, then check normally
[x] strongly consider caching items on the client
[x] getAssets(assetNamesArray, optionalCommandName) -- only permit the grabbing of serer or shared assets
[x] Setup an AssetUtil on server with same methods (but which don't return a promise)
[x] A task method task.getAsset(assetName) which abstracts main.modules.AssetUtil.get(assetName, task.commandName)
[x] Same task method for task.getAssets(assetNamesArray)
[x] IMPORTANT: for the two methods above, if the task.isDead, destroy the asset, otherwise give it to the task maid
[x] Amend...
[x] Clone.lua
[x] BodyUtil.lua
[x] Update these using remodel
[x] Can promises be tracked? (i.e. task:track()) - this is important as you don't want a task ending before a promise has finished. Maybe :finally() which registers as complete, or another thread which wait until promise.complete Conclusion: Not possible, a trackable thread (i.e. thread:spawn) has to be created right away within the promise andThen function instead
[x] Complete AssetService methods
[x] Make sure task.getAsset stuff can also be called on the server
Other
[x] Important: Okay so promises do need to be tracked to prevent the task closing mid-promise. In short, setup task:track() to work with promises (and also when track is called on a promise also do maid:give(promise))
[x] Create a 'Become' buff agent:buff("Become"):set(humanoidDesc)
[x] Create a PlayerUtil.getHumanoidDescription which accepts a character, userId, username or player, then returns a promise
[x] Allow 'Clone' to also accept HumanoidDescriptions
[x] Fix clone:watch head lowering glitch
[x] For melon command, put Melon's HumanoidDesc into the commands client asset storage
Test
[x] Setup a test which utilises the new method and promises (which are given to the task maid)
[x] Test what happens if a task is killed which contains a Promise that hasnt finished yet (which creates its own objects on completion)
Main
task.getAsset(assetName)
which abstractsmain.modules.AssetUtil.get(assetName, task.commandName)
task.getAssets(assetNamesArray)
thread:spawn
) has to be created right away within the promise andThen function insteadOther
task:track()
to work with promises (and also when track is called on a promise also do maid:give(promise))agent:buff("Become"):set(humanoidDesc)
PlayerUtil.getHumanoidDescription
which accepts a character, userId, username or player, then returns a promiseTest