various question about ws API

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

Moderator: NADEO

Post Reply
schtroumf
Posts: 22
Joined: 10 Jan 2011, 18:31
Location: Région bordelaise
Contact:

various question about ws API

Post by schtroumf »

Hi @ all,

After months of inactivity, I will have time to develop the tm2 version of tm-ladder.com. In parallel, I will migrate the tmf section from the old depreciated API to trackmania web service.
Before coding the website, I have some questions about the web servicies:

- what is the update frequency of data for tmf and for tm2 (I could find several rate on the forum). In the old API we had in all responses, the timestamp of the last update on Nadeo's servers thus, I could synchronise my cache with nadeo's one. How to know when Nadeo's cache is updated without this timestamp ? If both cache are not synchronised, some players may appears twice in the global ladder and others can not appear.

- Is there an equivalent of pubGetPlayerAllInfosById of the old API in the trackmania ws ? To display the complete account of a player (nick, ladder on all environments, tags, ...), only 1 request was needed. With the ws 9 requests are needed at least for the same result (8 requests are necessary for ladder information and 1 for tags).

- Is in the ws (trackmania and maniaplanet) an equivalent of prv* functions ? For example, getBudies method doesn't give as many information than prvGetPlayerBuddiesLadderMultiPlayers.

with no doubt, I will have others questions,
Thanks for your answer,
Fabien (smurf), tm-ladder.com
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: various question about ws API

Post by gouxim »

First of all, a quick note for people migrating from the old API to the TMF/MP Web Services. It may seem poorer at first sight, but the philosophy has changed ; the old API was accessed by only a few people, so the services were very specific and the information one could access was sometimes quite sensitive. All in all, it was lot of work for us and only a few selected people could use it. The goal of the TMF/MP Web Services was to provide a higlhy accessible API, with simple services, easy-to-use SDK, simple procedure to get credentials, etc. Hence some of the limitations that were introduced with the API. In any case, don't hesitate to make suggestions on what you'd like to see!

Also bear in mind the TMF WS api is not updated that much ; we obviously focus a lot on ManiaPlanet right now.
schtroumf wrote:what is the update frequency of data for tmf and for tm2 (I could find several rate on the forum). In the old API we had in all responses, the timestamp of the last update on Nadeo's servers thus, I could synchronise my cache with nadeo's one. How to know when Nadeo's cache is updated without this timestamp ?
It depends on the data. For players, it is 1 hour. For rankings, it is 24 hours (actually we cache the data for 1 hour on our side, but the rankings DB is updated once a day). FYI we don't even know internally when the data is cleared from cache ; your system should actually be designed to handle this.
schtroumf wrote:If both cache are not synchronised, some players may appears twice in the global ladder and others can not appear.
Why do you say that? Do you have an example?
schtroumf wrote:Is there an equivalent of pubGetPlayerAllInfosById of the old API in the trackmania ws ?
You need to use ManiaConnect (called OAuth2 in TMF WS) to retrieve personal information, but you'll need the user's permission to do that (see http://code.google.com/p/maniaplanet-ws ... niaConnect).
schtroumf wrote:Is there an equivalent of pubGetPlayerAllInfosById of the old API in the trackmania ws ?
There is not. You need to either do all the requests at once, or split the information on several pages.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
Xymph
Posts: 1399
Joined: 15 Jun 2010, 20:35
Contact:

Re: various question about ws API

Post by Xymph »

schtroumf wrote:After months of inactivity, I will have time to develop the tm2 version of tm-ladder.com. In parallel, I will migrate the tmf section from the old depreciated API to trackmania web service.
Great. When you do, please address two shortcomings:
Thanks, and have fun building the new sites. :thumbsup:
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub
schtroumf
Posts: 22
Joined: 10 Jan 2011, 18:31
Location: Région bordelaise
Contact:

Re: various question about ws API

Post by schtroumf »

I made a simple example of mis-synchronisation with the server where a player appears twice and one disappears.
At T0 : cache of the website is empty.
At T1 : user ask ladder 1 to 3 on the website -> ask on nadeo's server, update cache, display ladder
At T2 : user ask ladder 4 to 6 on the website -> ask on nadeo's server, update cache, display ladder
At T3 : User ask ladder 1 to 6 -> doesn't ask on nadeo's server and take data in cache, display ladder

Without server update :
Image
All is OK

With a server update between T1 and T2 (player3 loose 1 position, player4 win 1 position)
Image
At T3, player4 doesn't appear anymore in the result and player3 is duplicated with his old and new position.
Post Reply

Return to “Maniaplanet Web Services”

Who is online

Users browsing this forum: No registered users and 1 guest