Page 1 of 1

JSON serverlist

Posted: 06 Jun 2013, 08:03
by Ablu
Hello,

How do we want to structure a JSON serverlist?

I thought about something like this:

Code: Select all

{
    // Place for stuff like latest client version / future expansion
    "servers": [
        {
            "name": "Source of Tales",
            "hostname": "testing.manasource.org",
            "port": 9601,
            "description": "The LPC 2012 entry by the Mana team.",
            "website": "http://manasource.org/",
            "state": "TEST",
        },
    ]
}
Also saving this link (i fear to loose it otherwise :P). It shows a possible implementation: https://bugreports.qt-project.org/browse/QTBUG-12117

Regards,
Ablu

Re: JSON serverlist

Posted: 06 Jun 2013, 08:07
by Bjørn
Looks fine to me, though note that JSON doesn't officially allow comments (but some parsers will deal with them). :-)

Re: JSON serverlist

Posted: 06 Jun 2013, 08:08
by Ablu
Bjørn wrote:Looks fine to me, though note that JSON doesn't officially allow comments (but some parsers will deal with them). :-)
Yeah, I did not plan to include that comment there ;)

Re: JSON serverlist

Posted: 06 Jun 2013, 10:44
by Crush
Don't you already have a serverlist in XML? Is there really a benefit in reimplementing all this in JSON? Personally I prefer JSON over XML for most situations because the complexity of XML is overkill for most use-cases, but why add yet another dependency?

Re: JSON serverlist

Posted: 06 Jun 2013, 10:47
by Ablu
We want to use the JSON one in the qt client only. So it basically is one dependency less since we do not depend on the xmlpatterns (we need the patterns since we filter for type in the QML XmlListModel module and JSON is supported by qt directly anyway.

Regards,
Ablu