Page 1 of 1

[Fixed] Valley rankings not working

Posted: 04 Aug 2013, 22:38
by weerwolf
My code for getting the rankings for stadium,canyon and storm are working, but valley not?

Re: Valley rankings not working

Posted: 05 Aug 2013, 07:32
by magnetik
What's wrong with it?

What error do you have?

On my side it's working fine:

Code: Select all

http://ws.maniaplanet.com/valley/rankings/multiplayer/player/magnetik.org/

Code: Select all

    Object
        environment = Valley
        unit = Ladder Points
        points = 82.47
        ranks = Array
            [] => Object
                idZone = 1
                path = World
                rank = 8245
            [] => Object
                idZone = 118644
                path = World|Europe
                rank = 6199
            [] => Object
                idZone = 2
                path = World|Europe|France
                rank = 1652
            [] => Object
                idZone = 49
                path = World|Europe|France|Aquitaine
                rank = 64
            [] => Object
                idZone = 211
                path = World|Europe|France|Aquitaine|Gironde
                rank = 35

Re: Valley rankings not working

Posted: 05 Aug 2013, 11:13
by weerwolf

Code: Select all

$MultiplayerCanyon = new \Maniaplanet\WebServices\Rankings\Canyon('*****', '*****');
           $player = $MultiplayerCanyon->getMultiplayerPlayer($login);

$MultiplayerStorm = new \Maniaplanet\WebServices\Rankings\Storm('*****', '*****');
           $player = $MultiplayerStorm->getMultiplayerPlayer($login);

$MultiplayerStadium = new \Maniaplanet\WebServices\Rankings\Stadium('*****', '*****');
           $player = $MultiplayerStadium->getMultiplayerPlayer($login);

$MultiplayerValley = new \Maniaplanet\WebServices\Rankings\Valley('*****', '*****');
           $player = $MultiplayerValley->getMultiplayerPlayer($login);

Code: Select all

Class 'Maniaplanet\WebServices\Rankings\Valley' not found

Re: Valley rankings not working

Posted: 05 Aug 2013, 11:21
by magnetik
It looks like that you are using an old version of the SDK.

I suggest you to use latest version wich is way easier to use (only one class for all rankings).

Re: Valley rankings not working

Posted: 05 Aug 2013, 11:38
by weerwolf
I am using 4.2 ?

Then either i am blind or the documentation is again not clear ...

Re: Valley rankings not working

Posted: 05 Aug 2013, 11:42
by magnetik
You are using 4.2 but it looks like you kept old classes.

Current usage of rankings is :

Code: Select all

 $rankings = new \Maniaplanet\WebServices\Rankings($username, $password);
        print_r($rankings->getMultiplayerWorld('SMStorm',0,2));

 $rankings = new \Maniaplanet\WebServices\Rankings($username, $password);
        print_r($rankings->getMultiplayerWorld('SMStormElite@nadeolabs',0,2));
Examples are up to date: https://code.google.com/p/maniaplanet-w ... nkings.php

Re: Valley rankings not working

Posted: 05 Aug 2013, 11:49
by weerwolf
ok, 2 questions:

old:

Code: Select all

$MultiplayerValley = new \Maniaplanet\WebServices\Rankings\Valley('*****', '*****');
           $player = $MultiplayerValley->getMultiplayerPlayer($login);
new:

Code: Select all

$rankings = new \Maniaplanet\WebServices\Rankings($username, $password);
        print_r($rankings->getMultiplayerWorld('SMStorm',0,2));
Where is the $login ??

Code: Select all

('SMStorm',0,2))
what does the 0,2 do/mean?

WW

Re: Valley rankings not working

Posted: 05 Aug 2013, 11:57
by w1lla
(0,2);

Offset, Length.

What you might need is getMultiplayerPlayer('titleID', 'Login');

where titleID =

Code: Select all

      case 'SMStorm':
                                return '/storm';

                        case 'TMCanyon':
                                return '/canyon';

                        case 'SMStormRoyal@nadeolabs':
                                return '/royal';

                        case 'TMStadium':
                                return '/stadium';

                        case 'SMStormElite@nadeolabs':
                                return '/elite';
                                
                        case 'TMValley':
                                return '/valley';

                        default:
                                return '/titles';

Re: Valley rankings not working

Posted: 08 Aug 2013, 23:15
by Rots
That's it. This is the way it is working for me.

getMultiplayerWorld('title',offset,length) gives the global rankings for the specified attributes