Commit Graph

2931 Commits

Author SHA1 Message Date
Evan 73016bb56b Add bottom left ad in crazygames (#3526)
## Description:

If on crazy games, shows an in-game ad on the bottom left corner

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-03-27 11:57:42 -07:00
Ryan 7d1ff91078 playerstats to go with infra (#3520)
## Description:

https://github.com/openfrontio/infra/pull/279 to go with this, splits
out 1v1

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

w.o.n
2026-03-26 19:05:37 -07:00
Evan 1c2bd5df31 add not logged in warning to flags modal, refactored to its own lit component (#3521)
## Description:

So players know they are logged out and don't think their purchased
flags dissappeared.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-03-26 16:45:13 -07:00
evanpelle d99359c456 Add a store button to the patterns modal and flag modal 2026-03-25 15:24:43 -07:00
evanpelle 9d51846932 bugfix: Call modal close() on nav clicks so onClose callback fires 2026-03-25 15:17:12 -07:00
evanpelle d809c25d1c bugfix: Make territory patterns modal inline page like flag input modal 2026-03-24 16:15:35 -07:00
Evan dbba1dccb5 Display the name of the creator for flags & skins (#3510)
## Description:

So artists get credit for the work they do.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-03-24 15:17:25 -07:00
FloPinguin 4bf18dfafe Maybe for v30: Add leave confirmation dialog to JoinLobbyModal 🚪 (#3507)
## Description:

Adds a `confirmBeforeClose()` override to `JoinLobbyModal`, matching the
existing behavior in `HostLobbyModal`.

Because the german streamers had a lot of problems with accidentally
leaving today.

When a user is in a lobby and tries to close the modal (Escape key or
clicking outside), they now get a confirmation dialog asking if they
really want to leave. If the user hasn't joined a lobby yet (still on
the join form), the modal closes without prompting.

Reuses the existing `host_modal.leave_confirmation` translation key.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
2026-03-24 13:28:30 -07:00
FloPinguin d83a4d2dc6 For v30: Fix base language preferred over regional variant in auto-detection 🌐 (#3506)
## Description:

When the browser reports a locale like `de-DE`, the language selector
didn't find an exact match and fell through to candidate matching, where
it picked `de-CH` (Swiss German) over `de` (German) because longer codes
were sorted first.

This adds an early check: if the base language code (e.g. `de`) is
directly supported, return it immediately before scanning regional
candidates.

FYI @Aotumuri 

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
2026-03-24 12:21:50 -07:00
Evan 39ad547c04 support for unlockable flags (#3479)
## Description:

Add support for purchasable/gated flags.

* Create a new "Store" modal that renders both skins & flags
* move all store related logic out of TerritoryPatternsModal
* use nation:code for existing nation flags & flag:key for gated flags
* check if user has the appropriate flags before purchasing

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-03-23 17:09:18 -07:00
evanpelle 426806299f bugfix: map was not compact size in compact gamemode 2026-03-23 14:01:10 -07:00
FloPinguin 8f4e6c2e2a Remove modifiers from normal FFA/Team games (And increase chance of gold multiplier for special games, decrease random spawn) 🎲 (#3471)
Normal (FFA and Team) public games no longer roll random modifiers.
Special games remain fully unaffected and continue to use random
modifiers as before.

I also increased the gold multiplier ticket count in the special
modifier pool from 1 to 4 because of player feedback.

Edit: And because I saw complaints of too much random spawn I decreased
the chance of it.

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

regression is found:

FloPinguin
2026-03-23 13:54:29 -07:00
VariableVince 481d0fa3a1 Fix(HelpModal): small updates and fixes (#3473)
## Description:

- fix info icon spacing
- update multiple texts to reflect current state, rewrote
"ui_playeroverlay_desc" further for better readability
- add text for the options menu, and change their order to reflect
current button order
- add missing "Stop trading" icon, is PNG so lazy load
- remove uneccesary lazy loading for an SVG icon (rest of the SVGs
aren't lazy loaded either)

Didn't touch the rest although more incremental updates are needed
following UI and other changes.

Before:
<img width="242" height="82" alt="image"
src="https://github.com/user-attachments/assets/8f38eef6-21e7-4b18-84ef-adc4161a317f"
/>

<img width="357" height="167" alt="image"
src="https://github.com/user-attachments/assets/c6937b5c-c1b2-4560-b40b-94b24a4906cc"
/>

After:
<img width="262" height="95" alt="image"
src="https://github.com/user-attachments/assets/15c1e9f5-3e27-4f4b-8472-5bb70234ab42"
/>

<img width="345" height="203" alt="image"
src="https://github.com/user-attachments/assets/3d3fe3c5-98b2-41fb-8f79-48d02d7ecf9b"
/>

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

tryout33

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-03-21 12:03:11 -07:00
evanpelle e14f1e8cea max of 3 modifiers for special (4 was confusing to me) 2026-03-19 21:16:38 -07:00
evanpelle c5706613e4 make 1 in every 3 games compact 2026-03-19 21:07:34 -07:00
evanpelle 76c0f766af make ffa the large game card 2026-03-19 20:00:33 -07:00
FloPinguin 1220a331ba Remove modifiers from normal FFA/Team games (And increase chance of gold multiplier for special games, decrease random spawn) 🎲 (#3471)
## Description:

Normal (FFA and Team) public games no longer roll random modifiers.
Special games remain fully unaffected and continue to use random
modifiers as before.

I also increased the gold multiplier ticket count in the special
modifier pool from 1 to 4 because of player feedback.

Edit: And because I saw complaints of too much random spawn I decreased
the chance of it.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
2026-03-19 14:50:07 -07:00
evanpelle c5dad1f850 on purchase redirect, check cosmetic param instead of pattern param 2026-03-18 19:27:33 -07:00
Evan 3e7088cb2a Close join error (#3454)
## Description:

When joining a game after it fills up, the server rejects the player
join and the player leaves the lobby, but the join modal stays up.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-03-17 19:20:13 -07:00
Evan cb7164a52f Place footer ad during spawn phase (#3458)
## Description:

Show the "footer_ad" ad type during the spawn phase.

<img width="1855" height="914" alt="Screenshot 2026-03-17 at 7 01 37 PM"
src="https://github.com/user-attachments/assets/9c4c1730-95a0-4fc7-a983-4fe625d38c80"
/>

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-03-17 19:02:55 -07:00
FloPinguin 5b0b9dfd31 Increase spawn immunity from 30s to 45s for 5M starting gold maps 🛡️ (#3457)
## Description:

Increases the spawn immunity duration from 30s to 45s for maps with 5M
starting gold.

The previous 30s was too short - 45s gives players 15s longer than it
takes to build a SAM, allowing them to establish basic defenses before
becoming vulnerable.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
2026-03-17 15:57:15 -07:00
FloPinguin a30859d132 Fix labels in public lobby modifier display 🏷️ (#3456)
## Description:

Fixes two issues in the join lobby modal's modifier display:

1. **Starting Gold**: Label showed "Starting Gold (Millions)" with value
"5M", duplicating "millions". Now shows "Starting Gold" as the label,
keeping "5M" as the value.
2. **Disable Alliances**: Label showed "Disable Alliances" with value
"Enabled", which is confusing. Now shows "Alliances" as the label with
"Disabled" as the value.

Join Lobby Modal needs a general rework, I will probably make an PR

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
2026-03-17 15:31:11 -07:00
VariableVince 9f8a2d2d84 Fix "you didn't enter the lobby in time" when device clock isn't synced (#3451)
## Description:

If the time on the local device differs from the server time, users may
see the message “You did not join the lobby on time.”

Resolve this by accounting for the time difference, reusing the logic in
`JoinLobbyModal` that was previously in `GameModeSelector`, and
centralizing it into `ServerTime.ts`.

Bug reports:
https://github.com/openfrontio/OpenFrontIO/issues/3428

https://discord.com/channels/1284581928254701718/1482511096597315815

https://discord.com/channels/1284581928254701718/1482382264011591781

Resolves #3428 

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

tryout33
2026-03-17 15:21:38 -07:00
VariableVince 5c01e7a0c9 Fix: player name and location on wrong spot on the map (#3455)
## Description:

Fixes https://github.com/openfrontio/OpenFrontIO/issues/1021

Fixes issue that has been there since the beginning. Player name and
location and conquest FX (swords) not being in the right place. It can
happen at any time during a game and can be game-breaking in that
regard.

This makes it hard to find players, especially when trying to eliminate
their last few tiles on some island. So when clicking name in
leaderboard > wrong tiles. And when seeing name > above wrong tiles. Bug
report:
https://discord.com/channels/1284581928254701718/1444669324571967680

Also, when removing those last tiles, the wait time between updates of
player location can make it frustrating to find and eliminate them fast.
You need 2-3 clicks on their name in leaderboard, before finally being
moved to their current location.


**Cause:**
largestClusterBoundingBox not being changed when last attack happened in
same tick removeClusters last ran.

**Fix:** 
Also call removeClusters, and therefore update largestClusterBoundingBox
, when LastTileChange was AT lastCalc tick.

**Also:** 
Run removeClusters if player owns less than 100 tiles, don't wait for
ticksPerClusterCalc in that case. This way, sniping off the last couple
of island tiles of the player is easier. So it doesn't take 2-3 clicks
bbut just 1 click on the player name in the Leaderboard before the
camera moves to the next little island they are on. Also their last
clusters are annexed faster, only helping with the faster cleanup.
I think this is an optional to the fix in this PR, but still an
important QoL fix for sniping those last tiles quickly.

**BEFORE:**

https://github.com/user-attachments/assets/0960a4d3-7f8b-4368-9531-8244356bff17

**AFTER:** (also notice how it now just takes 1 click in the leaderboard
to immediately go to their next location, not 2-3 clicks)
https://youtu.be/qXJPekjsrP4

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

tryout33
2026-03-17 14:10:11 -07:00
evanpelle 79c3deabd8 remove spawn video ad 2026-03-17 11:40:42 -07:00
VariableVince 11e183366f Fix inverse annexation (#3448)
## Description:

An inverse annexation could happen where the small player (even with
0,01% tiles owned) could fully annex the large player.

**TL;DR:** basically wrong use of calculateBoundingBox in
surroundedBySamePlayer, feeding it all bordertiles, making enemyBox far
bigger than it actually was in some cases. Which resulted in enemyBox of
small player with two small clusters at some distance from each other,
being seen as inscribing the largest cluster of the bigger player. While
that largest cluster is actually the border tiles of the bigger player
surrounding the main cluster of the small player. Instead of an
annexation of small by bigger, small would incorrectly annex bigger
completely.

**Situation:** bigger player fully surrounds main cluster of smaller
player. Those border tiles are also the largest cluster of the bigger
player, for which surroundedBySamePlayer is called.
SurroundedBySamePlayer finds the small player as the only bordering
enemy of this cluster. Then it needs to check which of the two players
is surrounded by the other one. EnemyBox uses calculateBoundingBox with
all border tiles of the small player as argument. The small player also
has at least one seperate cluster elsewhere, could be on another island,
which count as border tiles too. The enemyBox from the main cluster of
the small player to the seperate cluster elsewhere, can be huge. Now
inscribed() is called and it determines that largest cluster box of the
bigger player (which was in fact calculated correctly, also making use
of calculateBoundingBox) is surrounded by the bigger enemyBox. And so
the small surrounded player fully annexes the bigger player.

**Fix:** instead of a global enemyBox, we only need the localEnemyBox
that touches the largest cluster of the bigger player. With that,
inscribed() can correctly conclude that largest cluster box surrounds
the localEnemyBox. As a matter of fact isSurrounded() already used the
same method to calculate its enemyBox as introduced by @scamiv for v30:
https://github.com/openfrontio/OpenFrontIO/pull/3127/changes#diff-fb1101a2b50dd7c353d082ff7a3351cff5469b8249b3ebca91c10573a3dfaaf1

- Change in PlayerExecution
- Added test NoInverseAnnexation.test.ts, which fails before and passes
after the fix

The bug was introduced in this commit 10 months ago:
https://github.com/openfrontio/OpenFrontIO/commit/c4381a9ad3828b06764ab1a21fc1514e37aacfd7

It has probably led to some weird annexations happening since then. The
bug could seemingly happen on any map. But was noted recently a few
times on square islands (Sierpinski) or maps (The Box/The Alps), where
the circumstances probably highten the chances of the bug occuring.

**Bug reports:**

https://discord.com/channels/1359946986937258015/1481916231689703477/1481916231689703477

https://discord.com/channels/1359946986937258015/1481916231689703477/1481963273367851030

https://discord.com/channels/1284581928254701718/1479993924432171008/1479995658302652496

https://discord.com/channels/1284581928254701718/1479993924432171008/1481865495492956182
https://discord.com/channels/1284581928254701718/1483047153571201034

**BEFORE:**

https://github.com/user-attachments/assets/4440182b-f696-45cf-bb01-b10159df8763

**AFTER**, on the same replay but with the bugfix:

https://github.com/user-attachments/assets/5f461ab2-eb62-4cc3-ae07-e2224adbbc6a

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

tryout33
2026-03-17 11:15:36 -07:00
Evan cce46ef126 Refactor: use promises instead of callbacks for joining a game (#3452)
## Description:

Simplifies the interface a bit.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-03-17 10:08:30 -07:00
Evan dd2c239aa1 Have Worker rate limit ws messages (#3449)
## Description:

Prevent client from spamming ws messages before joining a game server.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-03-16 20:45:05 -07:00
Evan 5e7317a818 Update socket rate limiting (#3447)
## Description:

On replays, there can be a burst of traffic from hashes, so instead just
have a 2MB limit per client for the entire game. Also the winner message
can be 100s of kb on a large game with many players, so now we don't
need to put a special case for that.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-03-16 20:26:56 -07:00
evanpelle 194a288ce1 reduce ws max size to 1 mb 2026-03-16 20:13:14 -07:00
Evan 51db6a2772 Add in game add to bottom left corner (#3446)
## Description:

Remove the header ad because that's where the player info overlay is,
and instead put it on the bottom left

Ad is not displayed on small screens.

<img width="1916" height="924" alt="Screenshot 2026-03-16 at 7 27 58 PM"
src="https://github.com/user-attachments/assets/e39c4be6-5270-4a77-bfbd-9521d15b9211"
/>

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-03-16 19:36:02 -07:00
FloPinguin f7e50826de Reduce spawn phase duration when random spawn is enabled ⏱️ (#3437)
## Description:

Reduces `numSpawnPhaseTurns` from 300 to 100 (matching singleplayer
duration) when random spawn is active. Since players can't choose their
spawn location in random spawn mode, there's no need for the full
300-tick spawn phase.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
2026-03-16 15:58:54 -07:00
FloPinguin 71e5faf4ec Rebalance HvN (#3433)
## Description:

For the next v30 fix version

<img width="868" height="364" alt="imaege"
src="https://github.com/user-attachments/assets/520a999c-67e7-4c57-8651-895ad9eeb73a"
/>

HvN balancing for the revamped difficulty steps of v30 sadly doesn't
really work out...
In medium difficulty games humans nearly always win (boring)
In hard difficulty games humans usually lose
It was intended differently...

So lets get rid of medium difficulty HvN, always use hard difficulty and
disable the donation-capability for public game nations.
That will tune the human winrate towards a middle ground at about 65% I
think. Which should be nice.
Easier than in v29 (was frustrating sometimes) but not as easy as it's
now.

We can only test this in prod lol

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
2026-03-16 12:25:43 -07:00
HulKiora b045608c89 ui: reduce HUD transparency for control, attacks, events, and hover panel (#3429)
## Description:

Reduce HUD transparency for better readability by making the Control
Panel, Attacks panel, Events/Chat panel, and Hover panel more opaque
while keeping a subtle blur effect.

## Please complete the following:

- [ x] I have added screenshots for all UI updates
- [ ] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [ ] I have added relevant tests to the test directory
- [x ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

HulKiora
Before :
<img width="518" height="134" alt="image"
src="https://github.com/user-attachments/assets/dd714a8e-5b8c-4754-b68d-a86a0f82afcf"
/>

After :
<img width="519" height="138" alt="image"
src="https://github.com/user-attachments/assets/828b88be-a071-474c-a4a2-80d1c679b3df"
/>
2026-03-15 14:59:34 -07:00
evanpelle f6167d2d94 allow 3 send winner msgs, in case a client reconnects 2026-03-14 11:30:12 -07:00
Josh Harris 3273931950 Fix public lobby timer stuck due to IPC race condition 2026-03-14 06:02:57 +00:00
Evan 5fb7f75f3d Server-side WebSocket message rate limiting & size enforcement (#3424)
## Description:

* Adds ClientMsgRateLimiter — a per-client token-bucket rate limiter
that gates all incoming WebSocket messages. Returns "ok", "limit"
(drop), or "kick" based on the violation type.

* Intent messages are capped at 500 bytes each (they are stored in turn
history for the game duration, so oversized intents
accumulate in server RAM). Violations kick the client.

* Winner messages bypass the byte rate limit (they include stats for all
players and can be 100s of KB) but are strictly capped at one per client
— a second winner message kicks the client.

* All other messages go through the standard per-second (10/s) and
per-minute (150/min) rate limits. Violations drop the message; byte
budget exhaustion kicks the client.

* WebSocket maxPayload set to 2 MB on game workers.
Invalid (unparseable) messages now immediately kick the client rather
than being silently dropped.
Unit tests added for all rate limiting behaviors.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2026-03-13 21:15:10 -07:00
Josh Harris 4b33f3749d Fix duplicate game creation when opening private lobby (#3423)
## Description:

- Prevent `BaseModal.open()` from firing `onOpen()` twice when
Navigation.showPage() re-calls `open()` on inline modals
- Adds an `isModalOpen` early-return guard, matching existing behavior
in `OModal.open()`

## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [ ] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [ ] I have added relevant tests to the test directory
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Jish
2026-03-13 19:34:59 -07:00
evanpelle 9721aae9ab Kill and restart workers when IPC send fails
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 19:10:27 -07:00
evanpelle e596b998f8 terminate lobby ws on request 2026-03-13 18:55:59 -07:00
evanpelle 2741e315e0 kick players when intents too large 2026-03-13 18:44:18 -07:00
evanpelle d4321ba81f add intent based rate limits 2026-03-13 18:32:29 -07:00
evanpelle f2a7493bbf Revert "temporarily disable homepage footer ad"
This reverts commit 3ab778ace4.
2026-03-13 12:31:33 -07:00
evanpelle add21ace42 Revert "Rearrange homepage game boxes & tune special modifier probabilities 🎲 (#3420)"
This reverts commit ea4355f03a.
2026-03-13 12:14:36 -07:00
evanpelle 536d3e63ae don't render ranked button on crazy games 2026-03-13 12:01:11 -07:00
FloPinguin ea4355f03a Rearrange homepage game boxes & tune special modifier probabilities 🎲 (#3420)
## Description:

**Homepage layout:** Reorder the game mode cards so FFA is the left
(large) box, Teams is the upper-right box, and Special Games is the
lower-right box. Mobile order updated to match (FFA → Teams → Special).

**Special game modifiers:**
- Adjusted modifier count roll to 40%/40%/15%/5% for 1/2/3/4 modifiers
(was 30%/40%/20%/10%) because having so many special games with 3/4
modifiers while we only have 8 modifiers in the pool is a bit dumb (from
the 8 modifiers two are mutually exclusive and 4 should be quite rare).
- Changed ticket counts in `SPECIAL_MODIFIER_POOL` so
isAlliancesDisabled and isHardNations are more rare.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
2026-03-13 11:55:03 -07:00
evanpelle 681aa98fb1 bugfix: don't remove player name renderer if name location is not set 2026-03-13 11:53:38 -07:00
evanpelle 3ab778ace4 temporarily disable homepage footer ad 2026-03-13 11:45:12 -07:00
evanpelle 28b2372ef5 shorten the control panel vertically a bit to increase center space for gameplay 2026-03-13 09:46:47 -07:00
evanpelle ced65b7382 increase train spawn rate by 20% 2026-03-12 21:11:18 -07:00