Commit Graph

2832 Commits

Author SHA1 Message Date
Evan 0d37db8a3f Update docker build to be smaller & faster (#2693)
## Description:

1. eliminate redundant curls/downloads
2. better stage organization
3. only copy required dirs & files, (removed the COPY . .) 

## 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
2025-12-25 12:49:00 -08:00
Evan a810e0ad34 crazy games integrations (#2675)
## Description:

Integrate with crazy games SDK

## 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:

evan
v0.28.1
2025-12-23 09:11:00 -08:00
FloPinguin 29d6cee4e1 Change public game difficulty to Easy 📊 (#2662)
## Description:

Multiple people in the game-feedback dc channel are complaining that
nations are too strong. To make the FFAs feel more like `PvP` instead of
`PvPvE`, switch to the easy difficulty.

Unlike humans, the easy nations cannot execute parallel bot attacks at
all, making them expand much slower.
Also their `maxTroops`, `troopIncreaseRate` and `startManpower` configs
are lower than the human ones.
They are easier to ally, etc...
And I have some dumbing-down ideas ready.

**Proposal:** We could introduce "modifiers" to public games in the
future: Higher difficulty nations (for people who like PvPvE), random
spawn, compact map, MIRVs disabled, ...

## 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
2025-12-23 08:08:21 -08:00
Danny 88c6e40399 Remove RNG from SAM launchers (#2665)
## Description:
SAMs will now always hit their target instead of missing sometimes.

Describe the 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:

Lavodan
2025-12-23 08:08:02 -08:00
Duwibi 2973b83a02 Map fixes for Britannia and Pangaea (#2641)
## Description:
This PR fixes some small pixel errors on Pangaea and Britannia

## 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:

DISCORD_USERNAME
Nikola123
2025-12-22 11:55:06 -08:00
evanpelle f4ed2a932f remove ofm advert in winmodal v0.28.0 2025-12-18 11:06:28 -08:00
evanpelle 85bfdbc066 reduce in-game ad frequency 2025-12-18 08:12:35 -08:00
evanpelle bec9af6d1e custom color bugfixes: don't add hash because it is already present in flare, clear current color on logout 2025-12-17 15:05:02 -08:00
DevelopingTom 507f391aa1 Add Christmas emojis (#2634)
## Description:

Add some christmas spirit in the emoji list
🎁🌟🎅🎄

## 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:

IngloriousTom
2025-12-17 14:18:39 -08:00
DevelopingTom 7255b5282f Change Christmas-atom and Christmas-hydro colors (#2635)
## Description:
Change atom and hydro color to be less confusing:

<img width="704" height="441" alt="image"
src="https://github.com/user-attachments/assets/17e762d5-50b5-47a9-9a9e-c66e5c4beebb"
/>

## 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:

IngloriousTom
2025-12-17 14:18:04 -08:00
VariableVince 9fa5e9daef Fix: show 0 Nations in Lobby Team Preview when disableNPCs is true (#2633)
## Description:

Fix for v28: show 0 Nations in Lobby Team Preview when disableNPCs is
true. Lobby Team Preview displays the number of Nations on a map, but
should diplay "0 Nations" in this case.

After fix:
<img width="1067" height="737" alt="image"
src="https://github.com/user-attachments/assets/d89ede3f-e1ca-4614-bf8a-36ad564bf3d2"
/>

<img width="1072" height="737" alt="image"
src="https://github.com/user-attachments/assets/b2b068fd-b0d1-49a8-b284-e64e479f4bab"
/>


## 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
2025-12-17 21:09:07 +00:00
VariableVince a26d704a2e Help prevent supply chain attack: add safer install script (#2627)
## Description:

For safer installations, clean install (ci) should be used, preferably
with added --ignore-scripts. To make it easier for devs, add a npm
script which can be ran by using "npm run inst". Update readme.

Evan agreed here
https://discord.com/channels/1359946986937258015/1360078040222142564/1432085555126206576

"npm run inst" runs `npm ci --ignore-scripts` which installs
dependencies exactly according to the versions in `package-lock.json`
and doesn't run scripts. This can prevent being hit by a supply chain
attack.

Did not re-use the "install" or "ci" npm lifecycle hook, instead used a
similar but still short script name "inst". We can change this to
something like "safe-install" if needed but i assume "inst" will 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:

tryout33
2025-12-17 12:38:47 -08:00
evanpelle 2a294d93df have events display retaliate button send counter troops based on the attack ratio 2025-12-17 12:35:58 -08:00
evanpelle 5f5176bd39 meta: reduce train gold from allies from 50k => 35k 2025-12-17 12:28:37 -08:00
VariableVince 765cd1b495 Fix: incorrect Duos Trios Quads texts + display teams in one box (#2632)
## Description:

- **Fix wrong Duos Trios Quads text in SP and Private Lobby modals:** PR
#2591 overwrote translations for public_lobby.teams_Duos , teams_Trios
and teams_Quads. But those translation keys are not only used in Public
Lobby, they are also used for the Single player and Private Lobby
modals. Where they are displayed in a slightly different context, making
the new translations appear off. Fix: add seperate translation keys and
restore old strings.

- **One box for team text in Public Lobby:** display number of teams and
team size in one block instead of two seperate blocks. It is agreed upon
also by evan that one block would look better:
https://discord.com/channels/1359946986937258015/1360078040222142564/1449498245817569502

--BEFORE:--
<img width="816" height="272" alt="Before in public lobby seperated
boxes"
src="https://github.com/user-attachments/assets/ddf7b425-4664-4f23-9d8c-7a859d6aea36"
/>

<img width="797" height="256" alt="Before in public lobby seperated
boxes and with change in translation of PR 2591 visible"
src="https://github.com/user-attachments/assets/f49c8fec-5de5-42d9-88fb-ed0ccb3951ea"
/>

<img width="1091" height="282" alt="Before naming of Duos Trios Quads
incorrect in SP and private lobby modal after changes in PR 2591"
src="https://github.com/user-attachments/assets/9c4d45b5-8db6-44b9-b2db-379a2c97e4d5"
/>

--AFTER:--
<img width="911" height="297" alt="After in public lobby now one box for
Team games"
src="https://github.com/user-attachments/assets/28a1c30b-3f0d-4484-bf12-4281435072c1"
/>

<img width="807" height="248" alt="After in public lobby now one box for
Team games Quads example"
src="https://github.com/user-attachments/assets/7cb54246-8d0a-410a-9e44-1f8cc15a2978"
/>

<img width="912" height="297" alt="After in public lobby still same for
other game modes"
src="https://github.com/user-attachments/assets/4dab6234-81fe-426d-82d1-c478d672673e"
/>

<img width="1115" height="622" alt="After naming of num teams for Duos
Trios Quads corrected Private lobby modal"
src="https://github.com/user-attachments/assets/c2622c4e-1cfd-40f9-b0ed-8ff1d437d72d"
/>

<img width="1163" height="582" alt="After naming of num teams for Duos
Trios Quads corrected"
src="https://github.com/user-attachments/assets/98fdfa22-70a8-4820-96fa-7b1df991e3ff"
/>


## 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
2025-12-17 11:30:12 -08:00
VariableVince 6d58abfdbb Christmas Themed Homepage 2 (#2628)
## Description:

A small fix for https://github.com/openfrontio/OpenFrontIO/pull/2608.
Give the map buttons in the private lobby and single player modal the
same red border and background as the buttons below them.

Before:
<img width="551" height="592" alt="image"
src="https://github.com/user-attachments/assets/cd6087ab-d74d-48d7-8093-d4a39fb2e30f"
/>

After:
<img width="263" height="192" alt="image"
src="https://github.com/user-attachments/assets/f47da143-6efd-43f5-b586-d46e6b6df96a"
/>

## 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
2025-12-16 19:22:41 -08:00
FloPinguin 8b9bed0e0b Hotfix: Max troops instead of troops for team stats 📊 (#2631)
## Description:

Missing i18n key because I forgot to add maxTroops to the team
leaderboard...
I completely forgot that troops are also shown on the team leaderboard

Before:

<img width="905" height="309" alt="Screenshot 2025-12-17 022043"
src="https://github.com/user-attachments/assets/c2f95c0b-86a5-4447-bbfc-1925d70005f6"
/>

After:

<img width="778" height="309" alt="Screenshot 2025-12-17 025028"
src="https://github.com/user-attachments/assets/fe6c968a-7867-4be9-8ee1-65f2baa26190"
/>

## 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
2025-12-16 19:16:03 -08:00
evanpelle f3b4c7c27f Refine AGPL Section 7 attribution terms 2025-12-16 16:33:51 -08:00
evanpelle 9edf0349cb bugfix: bomb launch was recorded before the MIRV was constructed, causing it to increase in price before it could be built v0.28.0-beta-v1 2025-12-16 12:31:00 -08:00
FloPinguin 058bb44273 Fix nation relation exploit 🔧 (#2523)
## Description:

Saw this in an Enzo video about beating impossible nations:

You can just donate 1% gold / 1% troops to a nation to get a friendly
relation with them.

This PR adds randomized minimum donation requirements based on the
difficulty.
Randomized in a way that there is a minimum someone has to donate to
surely get the relation improvement, but you can also gamble and send
less.

For troop donations, the minimum is calculated based on what percentage
of their troops the sender donated.

For gold donations, it's fixed values. We cannot use percentages here
because “having nearly no gold” is a usual case. Donating 100% of your
gold wouldn’t hurt if you just spent all your gold on buildings.

I tried to add tests for this but it's really horrible. Because the test
would have to wait until the relation update from the alliance accepting
is gone (we need to have an alliance to send stuff), has returned to
Neutral, and then changes back to Friendly after the donation.

## 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

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-12-16 09:01:18 -08:00
Restart2008 f256f497ce Christmas Themed Homepage (#2608)
## Description:
Adds the following:
- Snowflake animation with snowflakes falling from the top to the bottom
of the screen
- Changed homepage color theme from blue and white to Green and Red.
Also changed the openfront logo to a red, green, and white gradient.
- Added a santa hat on the announcements button

## 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
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

<img width="1616" height="836" alt="Screenshot 2025-12-12 at 3 01 17 PM"
src="https://github.com/user-attachments/assets/82e29db3-3bc0-4392-b5bf-dd57c15784a3"
/>

<img width="1616" height="836" alt="Screenshot 2025-12-12 at 2 58 54 PM"
src="https://github.com/user-attachments/assets/232da646-6923-4966-acba-5240074e7e3f"
/>


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

Restart

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-12-15 20:26:42 -08:00
DevelopingTom 648ae1943f Christmas Themed FX (#2624)
## Description:

### Santa:
- spawn randomly on the map every minute:


![santa_is_coming](https://github.com/user-attachments/assets/0c40f983-7c5e-4fd9-93cd-5601008cb2ef)

### Nuke changes:
- Atom: small gift
- Hydro: big gift
- MIRV: shooting star


![all_christmas_nukes](https://github.com/user-attachments/assets/db80d765-6292-44e0-a5a3-fe08c0516993)

### Nuke fallout FX:
- melting snowman
- happy elves
- elves needing assistance


![christmastroph](https://github.com/user-attachments/assets/92270357-a0f6-43bf-9b95-cc5b2427a542)

## 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:

IngloriousTom
2025-12-15 20:24:23 -08:00
FloPinguin f96fd6dc12 Show max troops in PlayerInfoOverlay and leaderboard 🖌️ (#2625)
## Description:

In the main discord, people seem to be divided in their opinions about
this.
But lets see what the playtest-people are saying, we can easily roll
this back.

<img width="197" height="312" alt="Screenshot 2025-12-15 220648"
src="https://github.com/user-attachments/assets/c6acd1f8-03b1-4949-b15e-6a32f8460e18"
/>
<img width="405" height="323" alt="Screenshot 2025-12-15 220623"
src="https://github.com/user-attachments/assets/21190a6f-1a0b-4db3-b6d0-c0722e98902a"
/>

## 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
2025-12-15 20:22:59 -08:00
Danny 58c7cdd46f Task: Unify username validation and remove username sanitation (#2622)
## Description:

This PR centralizes all username validation using UsernameSchema with a
set maximum, minimum, and a regex pattern,

It also removes sanitization, as all places where the username would be
sanitized on the server have been gatekept, so no unvalidated usernames
can get onto the server past the ClientMessageSchema safeParse in
GameServer's on message func.

Here is how the errors look if that happens, Note that if the client is
funtioning correctly and the user doesn't manually send a WS message,
they should never see this. The screenshots are from a debug build where
client uname validation was disabled.
<img height="300" alt="error message too short"
src="https://github.com/user-attachments/assets/1b7ac32c-2f03-40fb-8ce9-1f4ab66100bd"
/>
<img height="300" alt="error message bad regex"
src="https://github.com/user-attachments/assets/c78b4114-7e4b-4d39-a135-4cab3ad52c0b"
/>

Profanity sanitization was not changed.

Additionally, the censor tests were updated to reflect the new
expectations.
Jose was added to the jest config as an allowed transform pattern, as it
didn't make sense to me to mock a zod schema.

The UsernameSchema pattern was set to `^[a-zA-Z0-9_ \[\]üÜ]+$`, I
personally think either we should allow all latin characters (regex has
a pattern for this, `\p{L}` or `\p{sc=Latin}`) and then we'd use some
kind of library to normalize all latin characters into regular ascii for
name filtering, or we should only keep ascii letters.

## 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:

Lavodan


(I just realized sanitization isn't a word, it's supposed to be
sanitation, sorry.)
2025-12-15 10:07:15 -08:00
jachisc 690b7e1155 Add Manicouagan Map and Credit OpenTopography (#2620)
## Description:

Adds a map based on the Manicouagan Reservoir in Quebec and credits
OpenTopography

## Checklist:

- [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
<img width="1017" height="1017" alt="Screenshot 2025-12-14 214706"
src="https://github.com/user-attachments/assets/030c4bbd-0325-4da4-bef5-71053dc8f183"
/>

## Discord username:

sehentsin
2025-12-15 09:44:15 -08:00
scamiv aae9c43fa4 perf Optimize removeClusters by replacing sort with linear scan (#2614)
## Description:

PlayerExecution.ts removeClusters:
Replace O(k log k) sorting with O(k) linear scan to find the largest
cluster
2025-12-15 09:43:10 -08:00
Evan 92d9f7a93c Create a docs folder, add auth & architecture docs (#2623)
## Description:
Create docs folder
## 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
2025-12-15 09:07:31 -08:00
Evan 71cf309252 increase mirv price with total number of merged launched (#2621)
## Description:

To prevent MAD stalemates, have the price of MIRVs increase after each
launch. This will encourage players to launch a MIRV once they have
enough money for it. Also reduce the price of the first MIRV to 25
million to reduce snowballing, each subsequent MIRV cost an extra 15
million:

1. 25 million
2. 40 million
3. 60 million
4. etc



## 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
2025-12-14 19:52:54 -08:00
VariableVince 4f6a433dc8 Fixes & cleans up Username input (#2619)
## Description:

**Fix:**
Error box like "Username must be at least 3 characters long" sometimes
still remains after the game starts. See bug report with screenshot:
https://discord.com/channels/1284581928254701718/1449169462426079343/1449169462426079343

This is while in main.ts, element username-validation-error is already
set to hidden. Most of the time this works but apparently sometimes
there's a re-render which removes the 'hidden' tag again. Most probable
solution for this edge case: clear validationError first. Then to make
sure, still hide element username-validation-error.

**Cleanup username.ts:**
- Remove cat and clover emojis from validPattern. For single player
games, the only other validity checks are done from GameRunner calling
sanitize() from Util.ts. And from GameImpl where from addPlayer the
PlayerImpl are created, which uses sanitizeUserName also from
username.ts, which uses validPattern again. Both GameRunner and
PlayerImpl therefor allow emoji. But for muliplayer there's an extra
step where ClientJoinMessageSchema enforces UserNameSchema = SafeString.
Which does NOT allow cat or clover emoji. So for multiplayer you get an
error and can't join a game with cat or clover emoji. To align their
behavior more, just disallow the emojis from validPattern from the
start. Almost no-one ever used them anyway, they were once put in
because a developer liked to use them before the existance of
ClientJoinMessageSchema. There's more consolidation/refactoring possible
but this is an important first step.
- Remove sending arg max: MAX_USERNAME_LENGTH for translation key
invalid_chars, since the translation string doesn't contain params

**Cleanup UserNameInput.ts:**
- Remove userSettings: isn't used anywhere in the code
- Remove dispatchUsernameEvent: nowhere in the repo is event
'username-change' listened to. Also, dispatchUsernameEvent is only
called from connectedCallBack but not anywhere else. It seems like
handleChange was made for this. Also main.ts calls
usernameInput.getCurrentUsername() and doesn't listen for the event
either.

## 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
2025-12-14 18:38:25 -08:00
FloPinguin 7eef3d4688 Rebalance nation configs, they are getting too strong to beat 📊 (#2618)
Resolves #2599

## Description:

For example in #2599 we can see people already struggling with the
higher difficulties.

With my PR #2606 (nation alliance request logic), an alliance request
towards an impossible difficulty nation will probably always get
rejected. They have `maxTroops * 2`, and because humans have much less
troops, the nation of course won't want to ally with them (unless the
human somehow manages to get a similar troop count).

This makes them even harder to beat.

So I tuned the `maxTroops`, `troopIncreaseRate` and `startManpower`
configs towards the setting for humans, following the goal to make
difficulties impact the **SMARTNESS** of nations, instead of just their
troop count configs (more varied gameplay 😊).

The biggest change is in `startManpower`. I thought it was weird that
easy nations started with much less troops than a bot (2_500 vs 10_000).

Look at this screenshot, a couple of seconds into the game. Bots were
bigger than nations. 💀 Turkey in the bottom right corner...

<img width="1536" height="1045" alt="Screenshot 2025-12-14 180823"
src="https://github.com/user-attachments/assets/d219e6ce-b579-4b7e-a8bb-effa339507bf"
/>

## 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
2025-12-14 15:20:13 -08:00
FloPinguin dfe33a05e9 Improved the nation alliance request logic 🤝 Massive upgrade to singleplayer fun (#2606)
## Response to alliance requests

Previously the way nations responded to alliance requests was quite
simple / boring / exploitable. Basically you couldn't ally them if you
had a bad relation with them, or if you had too many alliances.
Otherwise they would just take it.

Now there is a **complete decision tree which is based on the
difficulty**. The nations should also feel more human now.

For example, just like humans, nations will now consider to take an
alliance even if you have a bad relation with them (If you are a
threat).

Also, nations no longer check if YOU have too many alliances. Now they
do what humans do: Check if THEY have too many alliances (they want to
be able to attack somebody).

Another big change is the default case: Previously it was just `return
true`. Now it's `return isAlliancePartnerSimilarlyStrong`. So they do
what humans do: Take a quick look at their troop count before allying
them.

## Sending alliance requests

Previously alliance requests were sent randomly. Quite boring.

Now we use the same decision tree as for responding.

## Alliance extension requests

They also use the same decision tree.

## Tests

Tested it a lot in singleplayer.
I have planned to add unit tests for all the nation/bot stuff in the
upcoming cleanup 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
2025-12-14 15:18:07 -08:00
Aotumuri 66ae8cd9bb Remove troop ratio slider and description (#2617)
## Description:

Removed unused translation strings and code.

## 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:

aotumuri
2025-12-14 15:13:40 -08:00
Aotumuri 9d10ca71a5 Fix: GulfOfStLawrence map name not being translated (#2616)
## Description:
The map name was not translated because it contained a . character,
which caused the translation key to break.

To prevent this issue, the map name handling now strips . characters
when generating translation keys.
With this change, maps that include . in their names will no longer
cause translation issues in the future.

Before fix:
<img width="538" height="284" alt="スクリーンショット 2025-12-14 14 26 02"
src="https://github.com/user-attachments/assets/a683e3de-09df-4b43-8077-4a00bd5f1272"
/>

After fix:
<img width="494" height="176" alt="スクリーンショット 2025-12-14 14 27 19"
src="https://github.com/user-attachments/assets/f9d27e16-de70-4c43-af31-aaa30287e5cd"
/>


## 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:
aotumuri
2025-12-13 21:51:31 -08:00
VariableVince 099337d83e Special bot names 2 (#2609)
## Description:

Second and last changes to special bot names. Sorry to anyone who might
feel left out, the list is non-exhaustive.

## 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
2025-12-13 19:36:37 -08:00
FloPinguin b4ec54113d Fixed events panel scroll position not staying at the bottom 🛠️ (#2613)
## Description:

Common issue reported by several people (many times by Enzo) now finally
fixed.
If you scroll to the bottom of the events panel the scroll position now
always stays there.
This behavior was previously implemented with CSS only, which apparently
did not work properly. Now we use javascript.

## 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
2025-12-13 19:35:55 -08:00
evanpelle ddeebefebe Merge branch 'v27' 2025-12-13 14:43:45 -08:00
Aotumuri 5392e0b9e3 Prevent keyboard shortcuts from firing while typing in quick chat search (#2528)
## Description:

Guard global keydown/keyup handlers to ignore events from
text/textarea/contenteditable targets (except Escape/active keys) so
gameplay shortcuts don’t trigger while typing in the quick chat player
search.

## 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:

aotumuri
2025-12-13 22:15:00 +00:00
dependabot[bot] 3e8ad650e0 Bump node-forge from 1.3.1 to 1.3.2 in the npm_and_yarn group across 1 directory (#2530)
Bumps the npm_and_yarn group with 1 update in the / directory:
[node-forge](https://github.com/digitalbazaar/forge).

Updates `node-forge` from 1.3.1 to 1.3.2
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md">node-forge's
changelog</a>.</em></p>
<blockquote>
<h2>1.3.2 - 2025-11-25</h2>
<h3>Security</h3>
<ul>
<li><strong>HIGH</strong>: ASN.1 Validator Desynchronization
<ul>
<li>An Interpretation Conflict (CWE-436) vulnerability in node-forge
versions
1.3.1 and below enables remote, unauthenticated attackers to craft ASN.1
structures to desynchronize schema validations, yielding a semantic
divergence that may bypass downstream cryptographic verifications and
security decisions.</li>
<li>Reported by Hunter Wodzenski.</li>
<li>CVE ID: <a
href="https://www.cve.org/CVERecord?id=CVE-2025-12816">CVE-2025-12816</a></li>
<li>GHSA ID: <a
href="https://github.com/digitalbazaar/forge/security/advisories/GHSA-5gfm-wpxj-wjgq">GHSA-5gfm-wpxj-wjgq</a></li>
</ul>
</li>
<li><strong>HIGH</strong>: ASN.1 Unbounded Recursion
<ul>
<li>An Uncontrolled Recursion (CWE-674) vulnerability in node-forge
versions
1.3.1 and below enables remote, unauthenticated attackers to craft deep
ASN.1 structures that trigger unbounded recursive parsing. This leads to
a
Denial-of-Service (DoS) via stack exhaustion when parsing untrusted DER
inputs.</li>
<li>Reported by Hunter Wodzenski.</li>
<li>CVE ID: <a
href="https://www.cve.org/CVERecord?id=CVE-2025-66031">CVE-2025-66031</a></li>
<li>GHSA ID: <a
href="https://github.com/digitalbazaar/forge/security/advisories/GHSA-554w-wpv2-vw27">GHSA-554w-wpv2-vw27</a></li>
</ul>
</li>
<li><strong>MODERATE</strong>: ASN.1 OID Integer Truncation
<ul>
<li>An Integer Overflow (CWE-190) vulnerability in node-forge versions
1.3.1
and below enables remote, unauthenticated attackers to craft ASN.1
structures containing OIDs with oversized arcs. These arcs may be
decoded
as smaller, trusted OIDs due to 32-bit bitwise truncation, enabling the
bypass of downstream OID-based security decisions.</li>
<li>Reported by Hunter Wodzenski.</li>
<li>CVE ID: <a
href="https://www.cve.org/CVERecord?id=CVE-2025-66030">CVE-2025-66030</a></li>
<li>GHSA ID: <a
href="https://github.com/digitalbazaar/forge/security/advisories/GHSA-65ch-62r8-g69g">GHSA-65ch-62r8-g69g</a></li>
</ul>
</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>[asn1] Fix for vulnerability identified by CVE-2025-12816 PKCS#12
MAC
verification bypass due to missing macData enforcement and improper
asn1.validate routine.</li>
<li>[asn1] Add <code>fromDer()</code> max recursion depth check.
<ul>
<li>Add a <code>asn1.maxDepth</code> global configurable maximum depth
of 256.</li>
<li>Add a <code>asn1.fromDer()</code> per-call <code>maxDepth</code>
option.</li>
<li><strong>NOTE</strong>: The default maximum is assumed to be higher
than needed for valid
data. If this assumption is false then this could be a breaking change.
Please file an issue if there are use cases that need a higher
maximum.</li>
<li><strong>NOTE</strong>: The per-call <code>maxDepth</code> parameter
has not been exposed up through
all of the API stack due to the complexities involved. Please file an
issue
if there are use cases that require this instead of changing the default
maximum.</li>
</ul>
</li>
<li>[asn1] Improve OID handling.
<ul>
<li>Error on parsed OID values larger than <code>2**32 - 1</code>.</li>
<li>Error on DER OID values larger than <code>2**53 - 1 </code>.</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/digitalbazaar/forge/commit/235ad3e70e4fdfdca4fdeb662dfba6588e2c38bd"><code>235ad3e</code></a>
Release 1.3.2.</li>
<li><a
href="https://github.com/digitalbazaar/forge/commit/25982441171dc9815c87d3d886c5c8a1d092b334"><code>2598244</code></a>
Update changelog.</li>
<li><a
href="https://github.com/digitalbazaar/forge/commit/0032dd0be8b6fb1b1092ef754d1dde91c10a95ad"><code>0032dd0</code></a>
Fix typos.</li>
<li><a
href="https://github.com/digitalbazaar/forge/commit/d75e08d255559ae401d9368346cacefde306e6df"><code>d75e08d</code></a>
Run new security test.</li>
<li><a
href="https://github.com/digitalbazaar/forge/commit/a5ce91d03df4dcfc025b74a5b7f50389942d49c9"><code>a5ce91d</code></a>
Update changelog formatting.</li>
<li><a
href="https://github.com/digitalbazaar/forge/commit/4652de6ddd833392e52d99b37abbbda76817c0b7"><code>4652de6</code></a>
Cleanups.</li>
<li><a
href="https://github.com/digitalbazaar/forge/commit/eb932d94fbd88655f46ac7a94a8e13e7ed8597f7"><code>eb932d9</code></a>
Fix typo.</li>
<li><a
href="https://github.com/digitalbazaar/forge/commit/db6954ba4b4440831a5112dea5d37ef68a28b878"><code>db6954b</code></a>
Fix style.</li>
<li><a
href="https://github.com/digitalbazaar/forge/commit/afbf7d8e0812014da134caa5a064cf55d1f61847"><code>afbf7d8</code></a>
Align error message style.</li>
<li><a
href="https://github.com/digitalbazaar/forge/commit/6607445859637442cf586eaa7fa06e99a2a8ae0b"><code>6607445</code></a>
Revert minor changes.</li>
<li>Additional commits viewable in <a
href="https://github.com/digitalbazaar/forge/compare/v1.3.1...v1.3.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=node-forge&package-manager=npm_and_yarn&previous-version=1.3.1&new-version=1.3.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/openfrontio/OpenFrontIO/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Evan <evanpelle@gmail.com>
2025-12-13 12:27:08 -08:00
evanpelle 1b79d531d0 require jwts for production 2025-12-12 16:49:22 -08:00
evanpelle 04370eda17 Merge branch 'v27' 2025-12-12 16:20:43 -08:00
scamiv e290e587ea perf: Optimize cluster calculation with DFS and zero-allocation patterns (#2539)
## Description:

Replace BFS with DFS and eliminate GC pressure in calculateClusters():

- Switch from O(N) queue.shift() to O(1) stack.pop() operations
- Replace Set.has()/Set.add() with Uint8Array bitfield
- Add reusable buffer management to avoid repeated allocations
- Implement callback-based neighbor iteration to eliminate array
allocations
- Add forEachNeighborWithDiag() method to Game interface and GameImpl
- Remove now unused GameImpl import from PlayerExecution

Describe the 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:

DISCORD_USERNAME
2025-12-12 14:19:37 -08:00
evanpelle 2e52c0aa41 better logging for auth/account fetch failures v0.27.10 2025-12-12 10:25:26 -08:00
evanpelle b832da308a reduce gold from trains by ~10% v0.27.9 2025-12-11 20:37:06 -08:00
Evan dab04eddb4 bugfix: user receives unauthorized on reconnection (#2601)
## Description:
When rejoining, the client did not refresh the play token, so the jwt
could be expired, causing the server to reject it.

Also improved the error log when token fails

## 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
v0.27.8
2025-12-11 20:00:53 -08:00
evanpelle ef0aff12e2 update tranlation key in account_modal v0.27.7 2025-12-11 16:23:59 -08:00
FloPinguin 427e462fe5 Revamp nation/bot enemy selection 🗡️ (#2550)
## Description:

I closed my previous PR #2533 which was already reviewed by evan (but
not yet merged) because I noticed some issues.
Which led me to changing the enemy selection entirely. 

Nations / Bots previously had a fixed enemy which they kept for 100
ticks (10 seconds). This could make them react too late and feel slow.
Now they are a bit more responsive.

But the main benefit: Without a fixed enemy we can do multiple
sendAttack() on the same tick, which allowed me to give impossible
nations extremely efficient parallel bot attacks:


https://github.com/user-attachments/assets/38f65623-fbf0-4e98-a833-5fcba2ee6eee

Previously nations were so slow in taking out bots that you could even
encircle them on the Archiran map...
Now they are like 200% faster (but only on the impossible difficulty)

## Nuke enemy selection

Previously, the enemy for troop attacks and nukes was identical. Now, as
we no longer have a fixed enemy in BotBehaviour, I added
findBestNukeTarget() to select better nuke-targets. I will probably open
a PR soon which makes nations nuke the crown :)

## Betrayal logic

While revamping the attack logic I had to work on the betrayal logic,
which was quite confusing, with many negations. And the betrayals were
just random.
So I made it easier to understand with maybeBetrayAndAttack().
Now it does betray friends if we have 10 times more troops than them. I
will improve that method in a future PR, but already now it should be
better than just betraying randomly.

## Attack order

Previously, nations attacked in this order:

- TerraNullius (Untaken land and nuked territory)
- Bots
- Retaliate against incoming attacks

Now its in this order:

- TerraNullius (Untaken land)
- Retaliate against incoming attacks
- Bots
- TerraNullius (Nuked territory)

So the changes are these:

- After throwing a nuke onto a nation, they will no longer ignore
incoming attacks. Previously they attacked the nuked territory first.
Very common singleplayer problem.
- Nations now retaliate against incoming attacks before attacking bots.
Previously you could attack a nation but they did not care because there
were still bots left.

I also changed the attack order of bots a bit (retaliate before
attacking randoms), but that isn't even noticeable.

## Big bug fixed

Additionally, I fixed a big bug: selectEnemy() oftentimes returned null
(because of enemySanityCheck) and therefore no attack happened.
This was especially visible in games where nations are surrounded by
friends (Team games and nations vs humans).
This was also the reason why Enzo could play nations vs humans in
singleplayer and NO NATION of the much bigger nation team would try to
attack him.

## 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
2025-12-11 13:57:15 -08:00
Duwibi 1f8adb4849 Add Svalmel (#2600)
## Description:
This PR adds the Christmas map Svalmel with 5 nations.

Describe the 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:

DISCORD_USERNAME
Nikola123
2025-12-11 21:53:05 +00:00
evanpelle af17fb85dd update ratio of ffa:team games to 2:1 2025-12-11 13:52:04 -08:00
evanpelle 01e5aaa832 If user has no linked account, ensure that their skin is set to default 2025-12-11 12:18:06 -08:00
Evan a09f0c67f1 Update auth & login to follow best practices (#2559)
## Description:

The previous login system used long lived jwts which could be stolen by
XSS. The current system uses long lived refresh tokens that are stored
as http-only cookies. Then the client calls /refresh to get a short
lived jwt using the refresh token. The jwt is stored in memory only so
it's discarded on page close. This way a XSS can only steal the
short-lived jwt.

It also updates how accounts work: players get an account automatically
when they join the webpage. They can see their stats even if not logged
in. If a player wants to keep their account, they can tie it to their
Discord or email, allowing them to log in if cookies are lost.

## 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
2025-12-11 11:25:27 -08:00