core icon indicating copy to clipboard operation
core copied to clipboard

SystemService and Commands Overhaul

Open 1ForeverHD opened this issue 4 years ago • 0 comments

Update: scrap most of these, but do introduce a role setting priceInRobux

  • [ ] IMPORTANT: Make sure to introduce size limits for text arguments or arguments that can take unlimited characters. See isCreator for repo
  • [ ] Create a 'Record' object which takes settings then creates a janitor, changed, _created, _destroying signal and a settings state property
  • [ ] Convert all system templates to objects (Roles, Bans, Settings, Longterm, Job, etc) which inherit this Record object and are parented under it
  • [ ] Cleanup services so that they listen for the creation of objects via the record, and remove all 'remove record' functions. Also keep createName, just have it abstract .new()
  • [ ] Ensure the cooldown behaviour of jobs still work, otherwise redo
  • [ ] Remove Command as a System object
  • [ ] remove all 'revoke' methods/checks - this method is no longer necessarily as cleanup should be handled on execution via janitors
  • [ ] replace all references of 'invoke' with 'execute' or 'onExeuction' (maybe unless when invoking the client)
  • [ ] Consider renaming :invoke[]Client to something like fire or execute (because it doesn't yield)
  • [ ] For Command object, remove defaultTemplate from CommandService and update to something like followed:
local main = require(game.Nanoblox)
local command =	main.modules.Command.new()



command.name = script.Name
command.description = ""
command.aliases	= {}
command.opposites = {}
command.tags = {}
command.prefixes = {}
command.contributors = {}
command.blockPeers = false
command.blockJuniors = false
command.autoPreview = false
command.requiresRig = main.enum.HumanoidRigType.None
command.revokeRepeats = false
command.preventRepeats = main.enum.TriStateSetting.Default
command.cooldown = 0
command.persistence = main.enum.Persistence.None
command.args = {"Username"}

command:setHook("onExecute", function(job, args)

end)



return command
  • [ ] if command property changes (metaindex), make sure to update all relevant tables/commands/displays
  • [ ] have following hooks
    • [ ] onRegister - called when the command has been registered and sorted within CommandService
    • [ ] onExecute - the main function to call
    • [ ] preReplicate - used to block/verify replication signals
    • [ ] onReplicate - CLIENT
  • [ ] :getHook
  • [ ] improve CommandService/State tables so that they are easier to understand
  • [ ] when a new command is added/destroyed/updated, make sure to perform an update but delay by 1 frame (as 1000 commands could be registered all in 1 go)
  • [ ] create ClientCommand object and repeat something similar
  • [ ] update all Commands and ClientCommands with these changes

1ForeverHD avatar Feb 10 '22 18:02 1ForeverHD