Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow more short code lobbies #208

Merged
merged 2 commits into from
Mar 17, 2025
Merged

Allow more short code lobbies #208

merged 2 commits into from
Mar 17, 2025

Conversation

erikdubbelboer
Copy link
Member

After trying to generate 4 short lobby codes of only 4 characters, try 5 characters, then 6 then 7 and as a final attempt use a full lobby code.

Also make lobby codes only unique per game instead of for all games combined.

After trying to generate 4 short lobby codes of only 4 characters, try 5
characters, then 6 then 7 and as a final attempt use a full lobby code.

Also make lobby codes only unique per game instead of for all games
combined.

ss := make([]string, chars)
for i := range chars {
if i/2%2 == 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i/2%2 is very obscure. 😅 I ran it in a Python interpreter to see what it is, which made me more confused. Turns out, it's different in Go and Python. I think a quick comment will fix this. 😇 (And maybe a unittest?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I removed this now. We now just use the whole alphabet for all 4 characters. Otherwise the amount of possible lobbies was too low.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have had multiple games now with the issue if running out of possible lobbies.

Before this only ~24k lobbies were possible with a 4 character code.
After this much more.
@erikdubbelboer erikdubbelboer merged commit d431b01 into main Mar 17, 2025
6 checks passed
@erikdubbelboer erikdubbelboer deleted the more-lobbies branch March 17, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants