When Lens is queuing commands for Dossier, and Dossier is reporting the results of these commands, neither of the programs use janus.load() and janus.save() to load and save data. This results in extremely excessive code duplication. One wonders how this happened when one explicitly talked about this on Discord the night before this code was written:
you can literally just construct a lua table any way you want in your program, and use janus.save() to save it and janus.load() to load it, and you don't have to parse anything or do any manual data conversion.
Instances which should use janus.load() and janus.save():
A dubious one, because it needs to append (it should probably handle this by constructing a table from the current command queue file, appending the new command to this table, then saving the resulting table):
A dubious one, because it needs to append (it should probably handle this by constructing a table from the current command queue file, appending the new command to this table, then saving the resulting table):
All opening/saving of commandQueue.tmp and commandResponses.tmp is now handled using janus.load() and janus.save(). Not closing this issue yet, awaiting your review.
When Lens is queuing commands for Dossier, and Dossier is reporting the results of these commands, neither of the programs use
janus.load()
andjanus.save()
to load and save data. This results in extremely excessive code duplication. One wonders how this happened when one explicitly talked about this on Discord the night before this code was written:Instances which should use
janus.load()
andjanus.save()
:Janus-Lens
https://github.com/Koulis2000/MCScripts/blob/922ebb0bc358e513cec3a0154ca0b357a3f3a8a8/CCTweaked/janus-lens.lua#L195 https://github.com/Koulis2000/MCScripts/blob/922ebb0bc358e513cec3a0154ca0b357a3f3a8a8/CCTweaked/janus-lens.lua#L226 https://github.com/Koulis2000/MCScripts/blob/922ebb0bc358e513cec3a0154ca0b357a3f3a8a8/CCTweaked/janus-lens.lua#L240 https://github.com/Koulis2000/MCScripts/blob/922ebb0bc358e513cec3a0154ca0b357a3f3a8a8/CCTweaked/janus-lens.lua#L247 https://github.com/Koulis2000/MCScripts/blob/922ebb0bc358e513cec3a0154ca0b357a3f3a8a8/CCTweaked/janus-lens.lua#L261
A dubious one, because it needs to append (it should probably handle this by constructing a table from the current command queue file, appending the new command to this table, then saving the resulting table):
https://github.com/Koulis2000/MCScripts/blob/922ebb0bc358e513cec3a0154ca0b357a3f3a8a8/CCTweaked/janus-lens.lua#L178
Janus-Dossier
https://github.com/Koulis2000/MCScripts/blob/922ebb0bc358e513cec3a0154ca0b357a3f3a8a8/CCTweaked/janus-dossier.lua#L290 https://github.com/Koulis2000/MCScripts/blob/922ebb0bc358e513cec3a0154ca0b357a3f3a8a8/CCTweaked/janus-dossier.lua#L333
A dubious one, because it needs to append (it should probably handle this by constructing a table from the current command queue file, appending the new command to this table, then saving the resulting table):
https://github.com/Koulis2000/MCScripts/blob/922ebb0bc358e513cec3a0154ca0b357a3f3a8a8/CCTweaked/janus-dossier.lua#L349