I am making
Quote: a leaderboard system
When public, you can view the ladder here: https://ladder.galaxyverge.com/
. You currently will get a "Verboten" response, but in English.
I've also done several SAPP scripts. I've been doing several databases for various purposes.
Upcoming are a functional membership and login system connected to a leaderboard that works with anything that can run SAPP and PHP. I was asked to provide an API for getting the information of the leaderboard, so I intend to do that also so that you can register for an API key to send with an HTTPS GET request in a PHP script that will echo a JSON file of the interesting information stored in the leaderboard database.
Another script I designed is simple: it bans players who spam join/leave connections to a Halo game server. I don't know where I'll put these scripts eventually (perhaps in a database?) but in the mean time, here is a link to that anti-joinspam-ban SAPP Lua script: https://cdn.discordapp.com/attachments/216982842230439936/347532320011452418/joinspamprevention.lua
Here are some of my notes about how the leaderboard system functions:
Quote: Players are asked to use their e-mail address as their password. This is to give them a memorable password in case their IP address, CD Key Hash, and Profile Name are changed.
When a player joins, look at their current information and check it against their playerindex stored slot information. If it matches, persist their login state. If it does not match, look for their CDKeyHash in the database. If it is found, use that information and check it against their current information. If it matches, persist their login state. If it does not match, have them log in specifying their e-mail address.
When a player leaves a slot, do not alter that slot's information. Instead, when a player connects in that same slot, check their information against that slot's information. This will prevent spam-joins from affecting database queries.
When a new user has registered using their e-mail address, record their current information in the database. While a user is logged in, they are idle in the second thread and their information is updated via events. Every 60 seconds, update their information in the database. When they log out, change their status but do not clear their information; instead, check it for alterations. If their connection duration was over 10 seconds, update their information in the database. Otherwise, there should be no database queries.
A player joins. If they are rejoining using the same IP (any port), CD Key Hash, and Profile Name, they are automatically logged in and can continue playing with their stats being updated to the database every 60 seconds and when they leave.
A player joins. If they are a new member, they provide their e-mail address (it's stored encrypted, as a memorable password) and they can play and have their stats recorded.
A player joins. If they are rejoining using the same CD Key Hash but with a different IP or Profile Name than they had previously in tuple, then they need to specify their e-mail address to log in again, and their new IP and Profile Name are recorded to keep them logged in until such change again.
CD Key Hashes can be stolen or misappropriated by game hosts. Therefore, something unique, such as a password, needs to be provided to indicate to the server that the player is likely the person who registered their CD Key Hash. The current test version of the leaderboard requires players who join to provide a password of at least 13 characters including 2 letters, 2 numbers and 2 symbols. Most simply leave without doing that, because it is easier to type something you already know than to make something up to fit requirements. I'm going to tell the new members to enter their e-mail address or a password they can remember.
When the whole thing is chugging along like Mickey Mouse behind the wheel of his steamboat, I'll post a video of the interface as a ... well, who doesn't like watching my YouTube videos?Edited by sparky on Aug 17, 2017 at 06:44 PM