ElRubioLoco / HowManyContenders

A Trackmania Next plugin, allowing to see the total number of players who played a map.So you can more precisely see where you are in terms of performance.
https://openplanet.dev/plugin/howmanycontenders
GNU General Public License v3.0
1 stars 0 forks source link

Plugin shows Player position if he already has a PB on the current map #6

Open ElRubioLoco opened 1 year ago

ElRubioLoco commented 1 year ago

If the player comes on a map he already played, he will see his position in the list.

Capture d'écran 2023-06-20 133231

@Banalian told me that he actually has an account that never played Trackmania on his server and he gets the count of player in a map by asking to Trackmania API from this account, maybe it'll fix this.

Banalian commented 1 year ago

Exactly, you could use this endpoint : https://github.com/Banalian/ExtraLeaderboardAPI#get-apileaderboardmapmapidplayercount

if you want to spin up your own instance of this API, either build it, or ask me for the .ear files to drop in wildfly ! I could also give you the url to mine, potentially

ElRubioLoco commented 11 months ago

hey I was searching for this plugin for long time I really appreciate your work but seems broken now pls can u update it Capture

Hey @Wh1Te-AnGeL , thanks for your report! I am aware of this bug, I must get back to work on this. It's been a long time I didn't touch anything because I'm struggling to find time for this 😅 I'll let you know as soon as I fix everything!

Wh1Te-AnGeL commented 11 months ago

@ElRubioLoco thank you take ur time

the-ether-bunny commented 5 months ago

Hello I know it's been a while but I was wondering if you think this problem of wrongly showing basically your own rank on maps you've already played is solvable? I was looking into making a plugin that shows your regional rank vs total players (for that map) and then your % ranking in each region as well (basically your plugin combined with Mwalrus's MapRank. I thought it might be pretty easy if you were able to get the regional player numbers but now I'm thinking maybe not lol.

Btw i could have really used your plugin when I was setting 10+ minute times on several tracks each campaign to manually note player numbers in my region, so obviously it could still be very useful to certain people despite the current limitations. Thanks!

Banalian commented 5 months ago

Hi ! In any case, you won't be able to get a player count with the player's account sadly, since it's not a feature of the API. My plugin cheats and asks for the position of the time that's the maximum integer (you can check my API code for the in depth code)

To get some regional player count, you'll need to test a lot some endpoints while removing the onlyWorld parameter, maybe you'll need an acc that keeps changing its account country and region, or have one account per in-game region 🤔, I don't know how these endpoints would work with regions sadly

If you have any other questions, I might be able to help, but in any case, good luck with your endeavors!

the-ether-bunny commented 5 months ago

Thank you so much for the timely reply! I have to say I was afraid of that though. Honestly if one blank account (with club access and no races run) would be enough to pull the numbers somehow for all regions (without switching the region manually, obviously) I would gladly pay for it but it sounds like it would only work for the 1 region it was in.

As an aside. Do you have any idea if it's possible to pull the surrounding rank racers for that region for an arbitrary account (like not the players)? In game it will obviously tell you your regional rank and the player ahead and behind you. My lowest level region (as in US state), for example, only has several hundred contenders for each track at the most. Could it be possible to pull the racers 1 by 1 down the list until you reach the end? Reading through all your and others plugin code has me paranoid about not spamming the servers (i swear half the code by volume is anti-spamming measures lol) but even if you just did one racer per second you could reach the bottom of a thousand player region in like 15 minutes. (And for campaigns, on the second track you could search for the lowest ranked players from the first track and probably be able to start much closer to the bottom of the ladder).

In any case hope I'm not wasting too much of your time but I thought you have some experience with this so you might know. 😄 Thanks!

Banalian commented 5 months ago

Hi again! No trouble, I'm happy to help!

About having an account, there's no need for club, any ubi accounts can request the leaderboards!

For this specific request, you'll need to do some testing, some of the endpoint i use allow for more parameters to request more records in one go, you could check OP's Web API doc about Nadeo for these parameters, you might be able to cut down on these.times by requesting 100s of record at once!

the-ether-bunny commented 5 months ago

Thanks again I'll be looking into it. I've been reading up about the API on OP so perhaps there is a way. I'll make sure to tell you if anything comes of it. Cheers!

Banalian commented 5 months ago

Happy to help! Feel free to DM me on discord or here if you need anymore help!