TyphoonMC / TyphoonLimbo

Lightweight minecraft limbo server
GNU General Public License v2.0
91 stars 13 forks source link

Configuration improvement #1

Closed mikroskeem closed 6 years ago

mikroskeem commented 6 years ago

In my opinion, serializing json into json using base64 is weird and really inconvenient to use.

Maybe that can be improved?

Before you ask: No, I cannot PR this, as I am not good in Go.

Edit: added screenshot

skyforce77 commented 6 years ago

I could add color codes to create colored text but it would not be as customisable as it is actually. Using directly json into the actual json structure would require to parse the entire structure then reserialize the json message. Do you think that one of those ideas would be better or do you have another one ?

mikroskeem commented 6 years ago

Using directly json into the actual json structure would require to parse the entire structure then reserialize the json message.

Yeah I think that wouldn't be that good idea.

I think I see why you chose base64 - because putting json into string is even more painful, as user would have to escape quotation marks.

Either way base64 is inconvenient for manual editing. I think I'll proceed with a wrapper which re-writes configuration before starting TyphoonLimbo.

IDerr commented 6 years ago

any news on this ?

mikroskeem commented 6 years ago

If that helps, I cooked something like this (not meant for real use, just an example to give directions)

Text formatter (which is not bundled into given gist) pretty much follows the idea of this library, configuration file for TyphoonLimbo is generated using Gson, process is executed using zt-exec, and wrapper's configuration file is loaded/serialized using Configurate.