1488 Commits

Author SHA1 Message Date
Scott Anderson 17d9521493 Merge main into settings 2025-05-04 14:54:55 -04:00
evan 1f474a368c add footer link to privacy policy and terms of service 2025-05-02 19:43:49 -07:00
Loymdayddaud f700c53154 change team order to Red, Blue, Yellow, Green, Teal, Orange, Purple (#615)
## Description:
Changes the team order to Red, Blue, Yellow, Green, Orange, Purple, Teal
instead of what it originally was (Red, Blue, Teal, Purple, Yellow,
Orange, Green)
Teal and Blue look similar, so I think it's better to move them further
apart. Instead, the primary colors are chosen first.
Fixes #614

In the long run, I think it would be nice to have the teams randomly
chosen from available colors and not always in the same order - e.g. a
three-team game isn't always Red, Blue, and Yellow, it could be any mix
of the colors. However, my programming skills aren't great enough to do
that.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:
Spartan Oligarchy/Loymdayddaud
2025-05-02 14:01:10 -07:00
Scott Anderson 0ec2f053d0 Precompute tile coordinate LUT (#639)
## Description:

Precompute div/mod operations and store them in a lookup table.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-02 13:19:42 -07:00
evan 8bdda67b2a disable remote logging and metrics on dev & staging to reduce load on monitoring stack 2025-05-02 12:53:48 -07:00
evan 8c20e1f690 remove master metrics, we'll be using node exporter instead for system info 2025-05-02 12:25:55 -07:00
Scott Anderson d6b100108a JWT refresh (#636)
## Description:

Implement refresh for JWTs.

Related to https://github.com/openfrontio/infra/pull/26

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-02 12:02:53 -07:00
evan 0dd762e3a8 change worker metrics to guage 2025-05-02 08:45:52 -07:00
evan d24a3ddcec don't allow building units during spawn phase 2025-05-02 08:01:15 -07:00
PilkeySEK ebc9e4877d Fix emoji exploit (#640)
## Description:
This should fix the exploit that allows players to send custom text as
an "emoji". It does this by introducing a emoji ID (index into the emoji
table) instead of sending the raw emoji as a string.

## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:
PilkeySEK
2025-05-02 07:37:29 -07:00
Scott Anderson b56764ce57 Update JWT schema (#632)
## Description:

- Handle the new `sub` encoding
- Decode the new `rol` claim
- Related to https://github.com/openfrontio/infra/pull/25

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-01 12:22:20 -07:00
evanpelle ffc2fadc20 use otel for observability (#635)
## Description:

## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

<DISCORD USERNAME>

Co-authored-by: evan <openfrontio@gmail.com>
2025-05-01 11:22:56 -07:00
evan 4852ada7f3 show team in player overlay panel 2025-04-30 14:39:06 -07:00
evan 491ad109da in spawn phase highligh player as green if on the same team 2025-04-30 14:09:51 -07:00
evanpelle d6a412aa50 implement duos (#630)
## Description:
Implement Duos team mode.
Also assign teams to nations at the start instead of assigning them
randomly on spawn. This gives more consistent team sizes

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

<DISCORD USERNAME>

Co-authored-by: evan <openfrontio@gmail.com>
2025-04-30 13:47:35 -07:00
evanpelle 1bdcc618b7 update countries.json (#624)
## Description:

Update countries.json

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

<DISCORD USERNAME>

Co-authored-by: evan <openfrontio@gmail.com>
2025-04-30 10:41:17 -07:00
Scott Anderson 1070a7cb0f JWT decoding with jose (#617)
## Description:

- Decode JWT with jose, and manually verify claims.
- Unfortunately, chrome isn't able to verify EdDSA signatures, so we
can't use the simpler `jwtVerify` jose function, which would verify
claims for us.
- Use the persistent_id from the JWT.


![image](https://github.com/user-attachments/assets/f3561311-0264-48f7-8173-e7f98c3b581e)

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

fake.neo

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-04-30 10:17:44 -07:00
evan 41f5faf34c re-enable donation in ffa 2025-04-29 19:28:21 -07:00
Samuel Safahi e0cbbf0173 Add Duration to Defense Debuff Messages (#603)
## Description:

This PR updates the in-game defense debuff message to include the
**duration** of the effect, improving clarity and usability during
gameplay.

### Change Summary:
- Updated static text to:  
`You broke your alliance with United States, making you a TRAITOR (50%
defense debuff for 30 secs)`
- Improves player understanding of how long penalties last.
- Aligns with other UI efforts focused on real-time feedback and clearer
mechanics.
- Sets a standard for future status/debuff messages to include duration
info where relevant.

This small but high-impact change enhances the player experience,
especially in intense or competitive matches where timing matters.

---

## Please complete the following:

- [] I have added screenshots for all UI updates  
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---

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

**@walker9607**


Resolves issue
https://github.com/openfrontio/OpenFrontIO/issues/602#issue-3018752308
2025-04-29 17:21:18 -07:00
evanpelle cc9b1a305b add link to tournament (#621)
## Description:

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

<DISCORD USERNAME>

Co-authored-by: evan <openfrontio@gmail.com>
2025-04-29 13:22:29 -07:00
evan 84b5545c5b remove DiscordBot.ts, since this will be handled in a seperate service 2025-04-29 09:58:59 -07:00
Scott Anderson cb9a97083a Discord login (#611)
## Description:

## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

<DISCORD USERNAME>

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-04-28 18:31:42 -07:00
evan a36fdcaaed re-enable stacking 2025-04-28 15:18:50 -07:00
Duwibi ccba7a5617 Add Antarctica Map (#544)
## Description:
This PR adds the new Deglaciated Antarctica map(suggested by Backn). It
has 9 nations - most of the country territorial claims on the continent
and the "Penguin Empire".

fixes #545 

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

Nikola123

---------

Co-authored-by: Loymdayddaud <145969603+TheGiraffe3@users.noreply.github.com>
2025-04-28 12:58:10 -07:00
evan 94e828e408 use environment variable to store R2_BUCKET 2025-04-28 09:54:04 -07:00
evan 8e8df5c308 bugfix: make sure not to add TerraNullius as enemy in BotBehavior as the causes a crash when checking isFriendly 2025-04-28 09:53:07 -07:00
Scott Anderson 96c8429a16 Shuffle playlist order (#612)
## Description:

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

fake.neo

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-04-28 09:17:13 -07:00
evan eed489a551 bugfix: make sure to add teams before assigning players, this caused all team games to have only two teams 2025-04-27 20:39:24 -07:00
Tom 42b6a649ce Use monospace font for private lobby code input (#566)
## Description:
Changes private lobby code input font to be monospace. Parity with lobby
creation screen (#438).

**Before:**

![image](https://github.com/user-attachments/assets/da25cf2c-a8df-4d62-86ae-1eb575ad7bac)

**After:**

![image](https://github.com/user-attachments/assets/a65a0ff8-d48e-4c38-a949-8cc0fc82d383)


## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

imdarktom
2025-04-27 17:10:56 -07:00
Mittanicz 2684d17fc6 Merge 3be053bb7c into d9e8984df5 2025-04-28 08:22:21 +09:00
Scott Anderson d9e8984df5 Refactor Nations AI (#427)
## Description:

Refactor AI troop management and strategic behavior based around two key
values: a trigger ratio and a reserve ratio.
- Reserve ratio: This determines the portion of the population the AI
will keep in reserve and will not send on attacks.
- Trigger ratio: This is the threshold at which the bot will initiate an
attack.

Additionally, when an incoming attack is detected, bots will now
prioritize retaliating by switching targets to the largest incoming
attacker.

Fixes #470 

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

fake.neo

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-04-27 14:15:45 -07:00
evanpelle f12690808f Tile expansion (#606)
## Description:
Modify tile expansion logic, creates more consistent expansion.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

<DISCORD USERNAME>
evan

---------

Co-authored-by: evan <openfrontio@gmail.com>
2025-04-27 14:12:13 -07:00
evan 8e30227204 disable defense post shooting ships for now 2025-04-26 09:49:30 -07:00
evan a509bc3b82 reduce structureMinDist to 12, allow for some overlap 2025-04-26 09:43:42 -07:00
evan de70321c4b bugfix: remove unit before updating tile in UnitImpl.move(). This is because if a unit moves too fast or on border, UnitGrid will not find the existing unit, causing duplicate units 2025-04-26 09:35:47 -07:00
evan 8b37cccbc3 cleanup SAMLauncher execution, warheadTargers & target local variable instead of field 2025-04-26 09:31:17 -07:00
evan 386e1916a3 update discord link 2025-04-24 14:18:47 -07:00
evan bbe8ec4cde bfs bugfix: add the original tile to seen. this was causing single surrounded tiles to not get conquered 2025-04-24 13:47:51 -07:00
evan 3c586455a8 disable defense under name until new meta is live 2025-04-24 13:14:30 -07:00
evan 84b58b9929 revert meta back to v21 2025-04-24 13:11:33 -07:00
evan ea323f919e increase traitor duration 15s => 30s 2025-04-24 12:58:57 -07:00
evan 4899c3383f remove transport ship embark delay 2025-04-24 12:45:47 -07:00
evan ff535820c5 bugfix: don't show build icon in radial during spawn phase, bugfix: log warning and hide playerpanel if tile not owned by player 2025-04-24 12:40:51 -07:00
evan 7a944e670a disable multitab detector on DEV environment 2025-04-24 12:15:47 -07:00
icslucas 13abdc30ef Update MultiTabDetector.ts (#588)
## Description:
Replaced the original focus/visibility-based MultiTabDetector
implementation with a lock-based system using localStorage to reliably
prevent multitabbing in OpenFront. The new system enforces a single
active tab per browser instance by using a unique tabId and a shared
lock key with periodic heartbeats. This eliminates race conditions,
prevents event-hook tampering, and avoids fingerprinting while
maintaining compatibility with existing punishment callbacks and UI
warnings.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

Lucas

---------

Co-authored-by: evan <openfrontio@gmail.com>
2025-04-24 11:51:17 -07:00
evan 9428ac1a28 add back old europe map as Europe Classic 2025-04-24 08:56:36 -07:00
evan 34333e306f bugfix: add null check on trade ship target in alternate view 2025-04-24 08:14:06 -07:00
evan e86e4d581c alternate view: make trade ships yellow when destined for ally port 2025-04-24 08:09:28 -07:00
evan 35805b2e4e remove random-name element from front page 2025-04-24 07:59:29 -07:00
evan 94c499a5e5 fix teams mode on private multiplayer games 2025-04-24 07:47:08 -07:00