[Fixed] Valley rankings not working

Maniaplanet public API, ManiaConnect system and the open source PHP SDK.

Moderator: NADEO

Post Reply
User avatar
weerwolf
Posts: 630
Joined: 15 Jun 2010, 21:21
Location: Wijchen, Netherlands
Contact:

[Fixed] Valley rankings not working

Post by weerwolf » 04 Aug 2013, 22:38

My code for getting the rankings for stadium,canyon and storm are working, but valley not?

User avatar
magnetik
Nadeo
Nadeo
Posts: 1670
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: Valley rankings not working

Post by magnetik » 05 Aug 2013, 07:32

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
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!

User avatar
weerwolf
Posts: 630
Joined: 15 Jun 2010, 21:21
Location: Wijchen, Netherlands
Contact:

Re: Valley rankings not working

Post by weerwolf » 05 Aug 2013, 11:13

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

User avatar
magnetik
Nadeo
Nadeo
Posts: 1670
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: Valley rankings not working

Post by magnetik » 05 Aug 2013, 11:21

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).
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!

User avatar
weerwolf
Posts: 630
Joined: 15 Jun 2010, 21:21
Location: Wijchen, Netherlands
Contact:

Re: Valley rankings not working

Post by weerwolf » 05 Aug 2013, 11:38

I am using 4.2 ?

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

User avatar
magnetik
Nadeo
Nadeo
Posts: 1670
Joined: 01 Feb 2012, 19:13
Location: Bordeaux
Contact:

Re: Valley rankings not working

Post by magnetik » 05 Aug 2013, 11:42

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
ManiaPlanet technical documentation portal (Dedicated, ManiaLink, ManiaScript, Titles...) -- contribute!

User avatar
weerwolf
Posts: 630
Joined: 15 Jun 2010, 21:21
Location: Wijchen, Netherlands
Contact:

Re: Valley rankings not working

Post by weerwolf » 05 Aug 2013, 11:49

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

User avatar
w1lla
Posts: 2373
Joined: 15 Jun 2010, 11:09
Location: Netherlands
Contact:

Re: Valley rankings not working

Post by w1lla » 05 Aug 2013, 11:57

(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';
TM² Info
SM Info
QM Info

OS: Windows 10 x64 Professional
MB: MSI 970A-G46
Processor: AMD FX-6300 3500 mHz
RAM Memory: 16 GB DDR3
Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
KB: Logitech G510s
Mouse: Logitech G300s
Mode Creation
ManiaScript Docs

User avatar
Rots
Translator
Translator
Posts: 1164
Joined: 01 Sep 2010, 14:39
Location: España, Barcelona

Re: Valley rankings not working

Post by Rots » 08 Aug 2013, 23:15

That's it. This is the way it is working for me.

getMultiplayerWorld('title',offset,length) gives the global rankings for the specified attributes
Image
Image
Image
TrackMania Original brought me here... Here I am since 2006

Post Reply

Return to “Maniaplanet Web Services”

Who is online

Users browsing this forum: No registered users and 2 guests