Development => Development Deliberation => Topic started by: peeg on February 15, 2006, 12:51:13 pm
Title: A way to query Laanx or it's Database?
Post by: peeg on February 15, 2006, 12:51:13 pm
Heya! My question is quite simple: Is there a possibillity to get some Informations from Laanx or it\'s database from somewhere but localhost? I mean Informations like the online status or the content of a characters inventory, total players online ...
greetings
Title:
Post by: Wired_Crawler on February 15, 2006, 01:14:56 pm
Search (http://www.planeshift3d.com/wbboard/search.php?boardid=23) says: Character Database. Can we access it? (http://www.planeshift3d.com/wbboard/thread.php?threadid=19307&boardid=33)
If You would like to access database directly, become PS dev :)
Title:
Post by: LigH on February 15, 2006, 02:01:11 pm
Yes - there is a way to at least access the list of currently online members. I have seen that on websites of guilds.
Title:
Post by: peeg on February 15, 2006, 02:35:25 pm
Well, if there is no way to query the server\'s database i\'m going to try to rip out some usefull informations out of the public resources :)
/me starts to do some coding secretly
Title:
Post by: acraig on February 15, 2006, 03:53:21 pm
For obvious reasons we cannot let people access the laanx database. However, we can provide some xml information files about things like players online/total players and data like that. These would be files that are built at regular intervals and would be able to be parsed by other people to collect the data they want. If you have a list of data that you would like then we can work from there.
Title:
Post by: peeg on February 15, 2006, 05:00:38 pm
Thanks for your offer Acraig. I\'ve just done a wrapper/parser for Laanx\'s statuspage that extracts some usefull informations like \"charakters online\" and \"total players online\" I\'m currently fighting some heavy bugs, but if they are terminated i\'ll share the code.
greetings
Title:
Post by: acraig on February 15, 2006, 05:22:59 pm
Yes, that is why I was suggesting to to use the XML data since it would be much easier to parse. In fact this is what the laanx server page is doing anyways.
For example the server generates an xml file like:
Which is then used to display the information on the laanx website.
Title:
Post by: peeg on February 15, 2006, 08:40:50 pm
I\'ve finished bug fixing for the moment! Here is an example for what can be done with my code: http://laanxwrapper.chaoslab.de/sample.php
//EDIT: Sourcecode, samples and some (quite bad) documentation can now be found here: http://laanxwrapper.chaoslab.de
Let me know if you like it :)
greetings!
Title:
Post by: Ethan on February 21, 2006, 09:28:54 pm
I am waiting for a *.xml files with a least the server\'s status. I know this is quite easy to know its status but I would like to check it with a software so... *.xml would be great indeed.
Edit : and the time between each report in the repost itself so we now when we should reload the file else we will need to chech every 1 second let say...
Title:
Post by: Baston on February 26, 2006, 01:36:39 am
After PHP (beurk...), I made a Perl module to retrieve and parse Planeshift server informations. This module is available on CPAN and features : - informations parsing - easily usable data structure - not that bad documentation - and the support for XML translation of the stucture.
The module is named Game::Planeshift::Info, and is available on CPAN : http://search.cpan.org/search?mode=dist&query=Planeshift
At this time I just upload 0.2 version wich correct a little bug in players list for online players. So this version is not yet indexed by PAUSE (the Perl Authors Upload Server) on CPAN.
here is a little code example who retrieve all informations and translates it in XML :
#!/usr/bin/perl
use strict; use warnings ; use Game::Planeshift::Info ;
my $ps = Game::Planeshift::Info->new() ; print $ps->data2xml( $ps->retrieve_info() ) ;
Easy isn\'t it ?
If you want to know if a friend is online, just use :
print \"Ehasara is online\" if( $ps->is_online(\'Ehasara\') ) ;
And the same code but to watch only a couple of buddies :
#!/usr/bin/perl
use strict; use warnings ; use Game::Planeshift::Info ;
I will put online a page which give the entire Laanx info page in XML for those off you who are to lazy to copy/paste this code in a Perl file ;-)
Title:
Post by: Ethan on February 26, 2006, 01:15:55 pm
If I understood correctly, you are using the *.html to generate a *.xml.. To have a *.xml is good but this one should be created by the game-server it-self... It would be easier, more acurate, and more stable. The aim of an *.xml is to be independent of the interface, so building a *.xml from an interface is a strange strategie. If some changes are done to this interfaces, you script to create the xml will not work anymore (best case) or create a buggy *.xml (worst case).
Title:
Post by: Baston on February 26, 2006, 03:06:31 pm
Indeed, moreover you forget that the WML produced by my module is certainly considerably different that the one generated by the server.
I also think that it would be really nice to let accessible the server-generated XML... Something like that :
But direct XML from the server can be really nice.
Title:
Post by: LigH on March 17, 2006, 06:40:02 pm
Quote
Originally posted by acraig Yes, that is why I was suggesting to to use the XML data since it would be much easier to parse. In fact this is what the laanx server page is doing anyways.
For example the server generates an xml file like:
...
Which is then used to display the information on the laanx website.
I would like to be able to receive such an XML report to analyse it. But I could not yet find the place where it was documented. I remember slightly to have it seen once, though. And other members remember as well.
Title:
Post by: acraig on March 17, 2006, 07:21:16 pm