Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

[FEATURE]-Add methods for reading and writing files.

Open jtalborough opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. I would like helper methods to read and write files other than the essentials config. Plugins should have a decent reference for this functionality without having to recreate the logic each time.

Describe the solution you'd like A method to search for files by path/name A method that will return the data from a text file A method that will write a text file when passed data and a path.

jtalborough avatar Mar 18 '22 16:03 jtalborough

If something to implement as part of the core I would vote for decent config sharing, lookup, merging and deserialization functionality is needed. While running multiple S#Pro programs I found need for:

  1. Automatic config resolution per slot - when same plugin loaded into two or more program slots, right config should be picked.
  2. Global and per-slot settings - ability to read global config and merge it with per slot config.
  3. Automatic traversal - check program running folder, switch to other common areas where config can be located, i.e. check program0x first, check nvram, check user, etc...
  4. Return as c# objects? I.e. read, merge, parse and instantiate config objects hiding file lookup, parsing from json, merge, de-serialize final config object....

Basically my two cents... I did something like that in https://github.com/uoftdaniels/ConfigManagementLibrary

I really hope something like that can be implemented at core level for Essentials as well - so we can have global config and per room customizations... Right now I believe it is possible only at portal level where merge is happening....

batourin avatar Mar 18 '22 21:03 batourin

@batourin that all sounds and looks great. I think maybe its a couple of iterations past this initial request. I encourage you to keep evolving this initial feature, or submitting your libraries as a separate feature request.

jtalborough avatar Mar 21 '22 20:03 jtalborough