Development of Manasource and anything else related to the Mana Project.
#135508 by Ablu
Thu Jun 06, 2013 7:03 am
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
#135509 by Bjørn
Thu Jun 06, 2013 7:07 am
Looks fine to me, though note that JSON doesn't officially allow comments (but some parsers will deal with them). :-)
#135510 by Ablu
Thu Jun 06, 2013 7:08 am
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 ;)
#135514 by Crush
Thu Jun 06, 2013 9:44 am
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?
#135515 by Ablu
Thu Jun 06, 2013 9:47 am
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

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest