Author Topic: A way to query Laanx or it's Database?  (Read 3022 times)

peeg

  • Testers
  • Hydlaa Notable
  • *
  • Posts: 560
    • View Profile
A way to query Laanx or it's Database?
« 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
[ PSde ] - Join the german community!
Peeg Chaoswind - Mentor in The Rangers Of Yliakum

Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
(No subject)
« Reply #1 on: February 15, 2006, 01:14:56 pm »
Search says: Character Database. Can we access it?

If You would like to access database directly, become PS dev :)
"Close the world, txEn eht nepO."

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
(No subject)
« Reply #2 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.

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

peeg

  • Testers
  • Hydlaa Notable
  • *
  • Posts: 560
    • View Profile
(No subject)
« Reply #3 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
[ PSde ] - Join the german community!
Peeg Chaoswind - Mentor in The Rangers Of Yliakum

acraig

  • Administrator
  • Veteran
  • *
  • Posts: 1562
    • View Profile
(No subject)
« Reply #4 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.
----------
Andrew
"For all I know, she's lying, everyone's lying; welcome to the Internet"

peeg

  • Testers
  • Hydlaa Notable
  • *
  • Posts: 560
    • View Profile
(No subject)
« Reply #5 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
« Last Edit: February 15, 2006, 05:00:54 pm by peeg »
[ PSde ] - Join the german community!
Peeg Chaoswind - Mentor in The Rangers Of Yliakum

acraig

  • Administrator
  • Veteran
  • *
  • Posts: 1562
    • View Profile
(No subject)
« Reply #6 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:

\" now=\"1140020488\" number=\"5212\" client_count=\"72\" mob_births=\"13625\" mob_deaths=\"13628\" player_deaths=\"521\">

...

Which is then used to display the information on the laanx website.
----------
Andrew
"For all I know, she's lying, everyone's lying; welcome to the Internet"

peeg

  • Testers
  • Hydlaa Notable
  • *
  • Posts: 560
    • View Profile
(No subject)
« Reply #7 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!
« Last Edit: February 16, 2006, 06:46:08 pm by peeg »
[ PSde ] - Join the german community!
Peeg Chaoswind - Mentor in The Rangers Of Yliakum

Ethan

  • Hydlaa Resident
  • *
  • Posts: 64
    • View Profile
(No subject)
« Reply #8 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...
« Last Edit: February 22, 2006, 06:50:21 am by Ethan »
Wish list summary (under construction)
Your help is welcome!!!
Done : Weapons, Other items, Magic
TODO : a lot ...

Baston

  • Hydlaa Resident
  • *
  • Posts: 54
    • View Profile
(No subject)
« Reply #9 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 ;

my $ps = Game::Planeshift::Info->new(
     players => [\'Baston\', \'Ehasara\', \'Narita\', \'Setill\', \'Soshise\', \'Mardun\', \'Caules\']
) ;
print $ps->data2xml( $ps->retrieve_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 ;-)

In the Darkness I rest
In the Shadow I act
In the Light I kill
In the Blood I bathe

Baston Xantror
Dark Crusader in Infidel Slayers

Ethan

  • Hydlaa Resident
  • *
  • Posts: 64
    • View Profile
(No subject)
« Reply #10 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).
Wish list summary (under construction)
Your help is welcome!!!
Done : Weapons, Other items, Magic
TODO : a lot ...

Baston

  • Hydlaa Resident
  • *
  • Posts: 54
    • View Profile
(No subject)
« Reply #11 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 :

http://www.infinityperl.org/game_planeshift_info.pl

But direct XML from the server can be really nice.

In the Darkness I rest
In the Shadow I act
In the Light I kill
In the Blood I bathe

Baston Xantror
Dark Crusader in Infidel Slayers

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
(No subject)
« Reply #12 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.

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

acraig

  • Administrator
  • Veteran
  • *
  • Posts: 1562
    • View Profile
(No subject)
« Reply #13 on: March 17, 2006, 07:21:16 pm »
Example:


 
  Sat Mar 18 02:09:59 2006

  110
  205661
 
   
   

----------
Andrew
"For all I know, she's lying, everyone's lying; welcome to the Internet"