That file is quite short (192 lines), while the other files using these functions in session/ have 500 to 1500 lines of code.
The functions are also not logically related, so the code would benefit from moving them to a place where they are used and expected.
This is the only file to which these remarks apply.
While at it, the affected code was cleaned a bit:
- remove duplication and translation comments in the trading gain tooltip
- let instead of var
- remove else following returns and weird inverted and unneeded checks in getRankIconSprite
- remove unneeded variable in resourcesToAlphaMask
- remove checks in hasClass that are always satisfied
- rename getPlayerData to updatePlayerData, since the function is only useful to change g_Players. Eventually that variable should be nuked entirely ("single source of truth" pattern).
- Remove if (g_PlayerAssignments) condition which is always true.
- sendLobbyPlayerlistUpdate moved to the other function sending data to the lobby