Straftat LobbyRank
A mod that displays people's ranks under their names
| Last updated | 2 hours ago |
| Total downloads | 4 |
| Total rating | 0 |
| Categories | Mods Tools Misc Vanilla compatible |
| Dependency string | IWasForcedToPutATeamHere-Straftat_LobbyRank-2.5.1 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2305README
yet another straftistics clone
WHERE IS THE DOWNLOAD BUTTON
the latest build will always be found at https://github.com/forrest57/straftat-lobbyRank/releases/latest
Overview
This mod for STRAFTAT displays player's ranks under their name in lobbies and in game
How It Works
the mod listens to setPlayerValues and UpdatePLayerList.
- SetPlayerValues:
- on call, the mod will either replace the current displayed name with a cached string in the format
name \n rank(score), or fetch the single player's rank and cache it if it is not available - also, a safeguard is in place to avoid having multiple simultaneous fetches for the same user
- on call, the mod will either replace the current displayed name with a cached string in the format
- UpdatePlayerList:
- this is used to avoid caching too many users. the game calls this func when you leave the game (and other instances i guess) when called, the mod will clear unnecessary cached players if the cache has more than 5 players.
"Cheater handling"
This mod utilizes C0mputery's whitelist to have a "cheater offset" for ranks.
It is semi-widely known that some people have cheated their ranks, so this whitelist has been put in place so that those people are filtered out (or at least we try to)
What happens is:
- it fetches the full list of people allowed to be in the top 10 (~140 community-known players)
- it fetches all of their steam leaderboard data
- orders the full list by rank
- takes the fist 10 players
at this point we have a list of what the top 10 should be. What the mod does now is
- define and save a cheater offset such that
offset = top10Players[last].rank - 10
this means that in case the last player's steam rank is 10, the offset will be 0, in case it's 12, it'll be 2 and so on.
- normalize the top 10 so that it goes from rank 1 to 10
no amount of cheaters will ever make a legit player be ranked higher than another legit player, so we don't really need to know where the cheaters are in the top 10
- use the saved offset when displaying any non-top10 rank, and the normalized list to display the top 10s
e.g. if steam says my rank is 125 and there are 6 cheaters in the top 10, the mod will display my rank as 119.
Ball Knowledge
there are three possible states for a rank element:
~125the tilde (~) signals that the mod is not done fetching the whitelist's ranks, so what is being shown is the raw, non-offset, steamLB rank#125the hashtag signals that the whitelist has been correctly fetched and the shown rank is offset!9the exclamation mark is accompanied by the rank being bright red. the number shown is the raw steamLB rank, non-offset
this is reserved for the players who would be in the top 10, but are not in the whitelist.
does this mean they are a cheater?
not for sure, they could be, or they could only have to ask nicely in the tournament discord to be added to the whitelist
also, top 10 players will have a golden rank color
Data Source
The mod retrieves rank and score from the game's leaderboard system via Steamworks API
Usage
Install the mod using a compatible mod loader (e.g., BepInEx).
Contributing
PRs and issues are always welcome! I try to maintain this project in weekends or after work hours when I can, so sorry in advance if a PR hangs for a couple of days