You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when GameActions are exported, we have to also attach a bunch of metadata attributes to them to make them usable. e.g.
[ExportGameAction]
[ActionPrimaryAlias("clone", CommandCategory.Admin)]
[ActionDescription("Clones an object.")]
[ActionSecurity(SecurityRole.fullAdmin)]
public class Clone : GameAction
It is too easy to forget to add some of the metadata that is required for an action to function properly. Every action needs careful consideration of supported aliases and such to even be usable.
The action creator should also be required to provide a helpful starting description and security level, and so on. These things could be required as members when defining a class that derives from GameAction, making the only part we have to remember to add for metadata be the ExportGameAction attribute.
IIRC one of the reasons we used metadata to start with was brevity, but latest C# syntax makes it easy to one-line properties with hard-coded values now anyway. Also, an individual game admin will eventually still be able to customize commands without touching the Core code, by inheriting from the base command and overriding the values they want to override (while exporting their own version with a higher priority, once we respect a priority level on the ExportGameAction attribute via #62).
I would like to see attributes removed from the system so that we can do more dependency injection anyway.
I think Attributes are great for some things but not for full export-import of game world data.
The text was updated successfully, but these errors were encountered:
Currently when GameActions are exported, we have to also attach a bunch of metadata attributes to them to make them usable. e.g.
It is too easy to forget to add some of the metadata that is required for an action to function properly. Every action needs careful consideration of supported aliases and such to even be usable.
The action creator should also be required to provide a helpful starting description and security level, and so on. These things could be required as members when defining a class that derives from GameAction, making the only part we have to remember to add for metadata be the
ExportGameAction
attribute.IIRC one of the reasons we used metadata to start with was brevity, but latest C# syntax makes it easy to one-line properties with hard-coded values now anyway. Also, an individual game admin will eventually still be able to customize commands without touching the Core code, by inheriting from the base command and overriding the values they want to override (while exporting their own version with a higher priority, once we respect a priority level on the
ExportGameAction
attribute via #62).@duaneking adds:
The text was updated successfully, but these errors were encountered: