Skip to content

Instantly share code, notes, and snippets.

View gpluscb's full-sized avatar
🙃
I worked for copilot, unpaid and unattributed

Quiet gpluscb

🙃
I worked for copilot, unpaid and unattributed
View GitHub Profile
@gpluscb
gpluscb / instant-glicko-2.md
Last active April 29, 2023 02:20
So You Want to Use Glicko-2 for Your Game's Ratings

I wrote this article right after I published the first version of instant-glicko-2. It is meant to document how to implement a Glicko-2 algorithm that allows for instant feedback after games.

So You Want To Use Glicko-2 For Your Game's Ratings

Great! Glicko-2 is a very cool rating system. And a popular choice too! Lichess, CS:GO, and

@gpluscb
gpluscb / tos.md
Last active March 7, 2022 14:03
Toni ToS

ToniSSB Terms of Service

Usage Agreement

By inviting and using the bot, you agree to these terms and the privacy policy. You have the privilege to add the bot to servers you manage and use the bot freely, as long as you follow these terms. If you break these terms, this privilege may be temporarily or permanently revoked for you at any point after the violation.

Similarly, that privilege may also be revoked if you violate Discords ToS, Privacy Policy, or Community Guidelines.

The year is 20XX. Everyone plays Fox at TAS levels of perfection. Because of this, the winner of a match depends solely on port priority. The Rock Paper Scissors metagame has evolved to ridiculous levels due to it being the only remaining factor to decide matches. Humanity has reached its pinnacle. The low tier peasants are living in poverty. It seems nothing can stop the great leader of 20XX, Aziz “Hax” Al-Yami, and his army, the Fox monks who live in great monasteries where they levitate while TASing Fox with one hand, and winning tournaments with the other. The tournament metagame has gotten to this point where everything is played out to theoretical perfection, so tournament goers play Rock Paper Scissors for port priority, and that’s the game.

The leaders of the anti-20XX movement aim to keep 20XX from coming. These warriors include Juan “Hungrybox” DeBiedma, Kevin “PewPewU” Toy, Kevin “PPMD” Nanney, and Jeffery “Axe” Williamson. They are all fighting to keep the apocalypse at bay, the Fox apocalypse. B

@gpluscb
gpluscb / privacy.md
Last active June 14, 2021 16:27
Toni privacy

ToniSSB privacy policy

1) What data do I collect, including but not limited to personal identifying information?

I do not collect any personal identifying information (pii). However, I do keep logs of how people use the bot. This includes the content of all messages that start with a correct prefix ("toni", "noti", "!t", or a mention of the bot). I also store the server id, matchmaking role id, and optionally the matchmaking channel id for any server that has unranked matchmaking set up.

2) Why do I need the data?

In case an error occurrs, I need to know what exactly triggered the error for debugging. The matchmaking configuration data is needed to provide the unranked functionality.

@gpluscb
gpluscb / doubleblindpick.md
Created September 14, 2020 14:22
What is a Double Blind Pick in fighting games?

The (double) blind pick is a way of choosing fairly what characters two (or more) opponents are going to play in a game.

For a double blind pick, both players have to pick their character without knowing what character the other player will choose. Usually this is achieved with each player telling an unbiased third party what character they will play so that the other player can't hear them. The third party then reveals what character each player picked.

Other ways of achieving the same result are also possible. For example, both players could write down their characters and reveal what they wrote down only after both finished.

The same system can also apply for teams, or when more than two parties are involved.

@gpluscb
gpluscb / Intents.md
Last active April 23, 2020 10:57
GatewayIntents, JDAs cache, and chunking

What are intents?

Since the start of this year, there is a new concept in the Discord API: Intents. These intents tell Discord which events your bot receives. Without intents, just presence updates might take up the vast majority of events you receive, and they aren't even useful to most bots! As a fix for that, you could disable guild subscriptions for a while now, but that solution has been superceded by the new intents system.
But with the new intent system, you can just tell Discord that you don't care about such events when your bot connects, and Discord won't send them to you.

What does that have to do with JDAs cache?

Before intents, JDA would chunk guilds before any other events on that guild are executed by default. That just means that JDA sends a request via the gateway to retrieve all members in a guild when loading, and store them in its cache.
After that JDA would just keep the cache updated by looking at what events it receives. If there's an event indicating that a member up

@gpluscb
gpluscb / smash_gg_games
Created March 15, 2020 23:58
Sorry to the servers for having to handle those requests.
This file has been truncated, but you can view the full file.
Ids 0..9999
{
"data": {
"videogames": {
"pageInfo": {
"total": 5819,
"totalPages": 1,
"page": 0,