Page 1 of 2

New plugin: Json Parser

Posted: Sat Nov 10, 2018 10:20 pm
by midwan
I was thinking about developing a new Plugin for Hollywood, to handle Json strings/files.
I haven't done that before for Hollywood, but I do have experience with C/C++ and other languages.

I've got the SDK, and I saw that there's already an XMLParser plugin, but unfortunately the sources for that are not available.

Would it be possible to share those, as I think it might be quite similar in concept to what I have in mind?

Re: New plugin: Json Parser

Posted: Sun Nov 11, 2018 10:14 pm
by airsoftsoftwair
I can send you the XML parser plugin source code if you want. Please send me an email.

Re: New plugin: Json Parser

Posted: Mon Nov 12, 2018 10:47 am
by SamuraiCrow
I'm pretty sure that Allanon has written a JSON parser for the patrons of his Patreon account and it's pure Hollywood so no need for plugins.

Re: New plugin: Json Parser

Posted: Mon Nov 12, 2018 1:30 pm
by midwan
Thanks for both the replies!

My e-mail is midwan at gmail dot com, if you could send me the sources for the XML Parser. Even if there's already something out there, it would help me understand how one would go about writing something similar anyway.

@SamuraiCrow: Is there a link to Allanon's work somewhere? Is it available for all, or only for the patrons?

Re: New plugin: Json Parser

Posted: Mon Nov 12, 2018 2:40 pm
by Clyde
@midwan: Thumbs up for learning and understanding! Here are Allanon's libaries: http://www.a-mc.biz/_software/hollywood-libraries/ But it seems no JSON lib here. If yo go to his documentation site (http://a-mc.biz/docsite/doku.php) at least "JSON" is listed.

I can't find something JSON releated on his Patreon site (I am a Patreon and so should you :-D ), though.

Re: New plugin: Json Parser

Posted: Thu Nov 15, 2018 4:40 pm
by SamuraiCrow
I appear to have opened a can of worms. I am a translator for Allanon's documentation. As such, I seem to have access to some unreleased software libraries. It's up to Allanon to release and write the original Italian documentation for me to translate and tidy up in English.

Re: New plugin: Json Parser

Posted: Fri Nov 16, 2018 9:10 pm
by airsoftsoftwair
@midwan: I have just sent the xmlparser sources to you. It is based on LuaExpat. The easiest way to create a JSON plugin for Hollywood is probably to take an existing Lua JSON plugin and adapt it to Hollywood's plugin interface. You have to be careful with some Lua internals, though, because Hollywood still uses Lua 5.0 and most Lua plugins target later versions like 5.2 or 5.3.

Re: New plugin: Json Parser

Posted: Fri Nov 16, 2018 9:12 pm
by midwan
Understood, thanks for sending me the sources and the useful input :)
I'll post any news here when I have them!

Re: New plugin: Json Parser

Posted: Fri Nov 16, 2018 9:22 pm
by airsoftsoftwair
Would be nice if you could finish that job. A JSON plugin is on my agenda as well but if you do it, then that's even better, because it leaves more resources for me for the really important stuff :)

Re: New plugin: Json Parser

Posted: Wed Dec 19, 2018 7:34 pm
by Allanon
Hi guys,
I've noticed only now this thread! Sorry! :D

Yes, I've a written JSON parser to decode server answers for a project but I've not published it yet because the code is dirty, no comments at all, but it works fine.
If someone is interested I can publish it as is, it returns an Hollywood table but there is no encoding methods, just decode.