PGMDev / PGM

The original PvP Game Manager for Minecraft
https://pgm.dev
GNU Affero General Public License v3.0
181 stars 89 forks source link

Standalone XML parser #476

Open Electroid opened 4 years ago

Electroid commented 4 years ago

Users should be able to test and validate their XMLs without running a Bukkit server. At first, this could be a command line tool, potentially even a simple HTTP server.

KingOfSquares commented 4 years ago

Working on this...

KingOfSquares commented 4 years ago

Thoughts on abstracting out the parser into its own Maven module? And making it only depend on itself(and jdom)

KingOfSquares commented 4 years ago

It would mean the module would have its own checks for bukkit and pgm types (Materials, Mobs, etc..), so you would have to convert it into Bukkit stuff when it arrives to the main package again.

PGM sends map.xml file to the parser -> The parser uses the jdom stuff to parse the XML and sends MapModules back out -> PGM reacts to the sent modules accordingly.

This also means you can use the parser for other stuff. Some examples: what this issue describes, in-game XML editors, online graphical representation from xml...

Electroid commented 4 years ago

I'd rather we use Bukkit types, and for now not a seperate module. One step at a time.

KingOfSquares commented 4 years ago

Then i'm not entirely sure what to do. MapFactoryImpl already seems like the result to me.

harvanchik commented 3 years ago

Not sure if answers your request or even half-answers it, but I found a PGM XML schema awhile back. I forked it and make a few corrections to it. It's still not perfect, but it is really helpful for real-time xml validation. It does not validate it like pgm does when loading the map, but at least you can validate the elements, attributes, etc. Plus it speeds up the xml writing process a ton! https://github.com/harvanchik/PGMSchema

Electroid commented 3 years ago

Very cool! We should definitely have an "official" version provided by PGM.

harvanchik commented 3 years ago

Very cool! We should definitely have an "official" version provided by PGM.

Totally agree! I am constantly trying to fix errors in the one I linked.