Commit Graph

2327 Commits

Author SHA1 Message Date
Scott Anderson 42dcaa5413 Merge group (#1689)
## Description:

Add support for merge groups

## 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
- [ ] I have read and accepted the CLA agreement (only required once).
2025-08-02 18:29:57 -04:00
Kipstz Avenger 0943b1544c Fix Race conditions on alliances (#1605)
## Description:

Players received "traitor" debuff when alliances were formed after
attacks started, creating an unfair race condition.

the problem was mentioned here
https://discord.com/channels/1284581928254701718/1399115120486912100

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

Kipstzz

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-08-02 22:12:23 +00:00
Kipstz Avenger 86a329f7cb Add random shell damage (#1665)
Closes #555 

## Description:

Added random damage for warship shells and defence posts.
Damage mapping: roll 1-5 → 200, 225, 250, 275, 300 damage respectively.

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

kipstzz
2025-08-02 22:08:17 +00:00
DevelopingTom eeeb7e4b4e SAM smart targeting (#1618)
## Description:

Current SAM behavior is to shoot a missile as soon as a nuke is in
range.
Players can exploit it by overshooting behind the SAM, so the SAM
missile will take way longer to reach the nuke, usually too late to
prevent its explosion.

This PR introduces a "smart" targeting system that allows SAM to
calculate an optimal interception tile along the nuke's trajectory. They
can also preshot before the nuke becomes vulnerable, as long as the
interception tile will be within the vulnerable window.

This change makes SAM range enforcement much more strict.

Changes:
- Nukes now precompute their full trajectory on creation and update
their current position index every tick.
- SAMs use this trajectory data and their own missile speed to calculate
the ideal interception tile.
- SAM missiles now aim directly at that interception point rather than
chasing the nuke.

Small changes on the fly:
- `BezierCurve` now uses a provided increment so the curve LUT is the
optimal size
- Increased nuke opacity when untargetable: 0.4 → 0.5
- Slightly extended nuke vulnerability range to SAMs: 120 → 150


===

Preshot an incoming nuke still in the unfocusable state. Notice how the
nuke is destroyed as soon as becomes focusable:



https://github.com/user-attachments/assets/9fbf1ae4-33b4-4fa0-9b53-cb53f3adc17b


Shooting right at the range limit:


https://github.com/user-attachments/assets/d68793ac-b249-45fe-88bf-e20f70758449


Shooting behind the SAM:


https://github.com/user-attachments/assets/800cd7ff-d9d9-40f3-aba8-fa3ab526b3b2




## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

IngloriousTom
2025-08-02 22:03:29 +00:00
Scott Anderson 3a703b0b4b Fix broken test (#1688)
## Description:

Due to a bad merge resolution, a test is failing.

## 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
- [ ] I have read and accepted the CLA agreement (only required once).
2025-08-02 14:58:35 -04:00
Scott Anderson 487401bc55 Merge tag 'v0.24.13' into main 2025-08-02 14:50:42 -04:00
Tyler Hanavan 15d0fd5b64 Allow main menu modals to be closed by clicking escape (#1617)
## Description:



Allow the main menu modals to be closed by clicking the Escape key. The
manner by which this change achieves this is by adding a
connectedCallback to add a keydown EventListener, which closes the modal
on clicking Escape.

Relevant issue: #1586 

My earlier PR was only for the in-game modals, as they can access the
Event Bus and receive the CloseViewEvent.
https://github.com/openfrontio/OpenFrontIO/pull/1604

As mentioned, this PR differs in that it does not use the Event Bus
because these are not in-game modals. The main menu modals do not have
access to the event bus.

Affected modals for this PR.
- UserSettingModal.ts
- TerritoryPatternsModal.ts
- SingePlayerModal.ts
- NewsModal.ts
- LanguageModal.ts
- JoinPrivateLobbyModal.ts
- HostLobbyModal.ts
- HelpModal.ts
- FlatInput.ts








## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

slyty

---------

Co-authored-by: Antoine <antoine.gannat@gmail.com>
2025-08-02 04:36:03 -04:00
Scott Anderson bcab4e600e Lower lines coverage 2025-08-02 04:30:22 -04:00
Aleksey Orekhovsky aa6bc42854 Remove unused processName util and twemoji dependency (#1683)
## Description:
This PR removes the unused `processName` utility function from `Util.ts`
and its dependency, the `twemoji` package.

The `processName` function has been commented out and non-operational
for approximately 9 months. This cleanup removes the dead code. As a
result, the `twemoji` npm package is no longer needed and has been
removed from the project's dependencies, which slightly reduces the
overall dependency footprint.

## 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
- [X] I have read and accepted the CLA agreement (only required once).

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

aaa4xu
2025-08-02 01:53:36 -04:00
Manan Lalwani 999fd9157c Enhance dark mode support (#1682)
## Description:

Improved dark mode styling for #1681 

Old:

<img width="536" height="565" alt="image"
src="https://github.com/user-attachments/assets/8b7b5cc5-aa74-4e9b-a814-635c4373d5ab"
/>

New Look:
<img width="766" height="925" alt="image"
src="https://github.com/user-attachments/assets/acd00f2b-7248-4b63-b5c4-a345195d4414"
/>

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

DISCORD_USERNAME
totalfailure
2025-08-02 01:50:10 -04:00
Scott Anderson 7eb39a21e7 Lower function coverage 2025-08-02 01:45:45 -04:00
falc ac8a841e40 feature/prevent-from-accident-reloading (#1411)
## Description:

Added prevention from accident reload of page

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

@qqkedsi
<img width="526" height="896" alt="image"
src="https://github.com/user-attachments/assets/22b273a5-de50-4567-93f0-353cea36ea29"
/>
2025-08-02 01:36:22 -04:00
djmrFunnyMan 4626f4dc4a Remove gold from dead players (#1450)
Fixes #1519 

## Description:
Currently if a player is killed via a nuke, they keep their gold despite
being eliminated and other players have no way to access that gold as
there is no territory to conquer. This PR fixes this by removing gold
from dead players.

This doesn't affect gameplay itself, because that gold was already
inaccessible. It'll just be clearer to the remaining players now.

<img width="1566" height="827" alt="Zrzut ekranu 2025-07-16 210908"
src="https://github.com/user-attachments/assets/438081e5-c145-4691-a36c-92ceb1049469"
/>
^ This is what this PR fixes

## 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
- [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:
aceralex
2025-08-02 01:22:12 -04:00
floriankilian 850b0f3d16 Convert GameServer's message handler from if to switch #1639 Open (#1649)
## Description:
Converted the WebSocket message handler from if-statement chain to
switch statements. The outer switch handles message types (`intent`,
`ping`, `hash`, `winner`) and the inner switch handles intent types
(`mark_disconnected`, `kick_player`).

## 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
- [ ] I have read and accepted the CLA agreement (only required once).

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

---

*Fixes #1639*
2025-08-02 01:14:10 -04:00
Scott Anderson 34648b61a2 contributor (#1647)
## Description:

Add contributor pattern.

<img width="285" height="324" alt="image"
src="https://github.com/user-attachments/assets/db7d1f81-cff9-4c82-ac62-bec097011f84"
/>

## 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
- [ ] I have read and accepted the CLA agreement (only required once).
2025-08-02 00:45:24 -04:00
evanpelle 3b8a36166a Remove workers & troop ratio bar, only have troops (#1676)
## Description:

The troop/worker ratio bar is almost never changed. so remove it and the
entire concept of workers. Now there is just troops.

Now players get a consistent 1k/s gold.

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

evan
2025-08-01 16:06:59 -07:00
Kipstz Avenger cf662bc1bc Add Split radial menu into separate attack and build buttons (#1598)
## Description:

This PR implements a new radial menu system that separates attack and
construction functionalities into distinct buttons. Previously, all
units (both attack and construction) were grouped together in a single
orange button, making the interface confusing and inefficient.

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

Kipstzz

<img width="420" height="345" alt="image"
src="https://github.com/user-attachments/assets/73d67fe1-d5d2-4c7e-8894-360877fa7004"
/>
<img width="422" height="345" alt="image"
src="https://github.com/user-attachments/assets/e576d543-4156-48f4-81ac-e7a06d26b25b"
/>
v0.24.12
2025-08-01 18:38:16 -04:00
Scott Anderson cba4baccbd Add support for merge groups (#1674)
## Description:

Add support for merge groups

## 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
- [ ] I have read and accepted the CLA agreement (only required once).
2025-08-01 18:27:22 -04:00
evanpelle e7b23e6c85 don't kick client for invalid message (#1673)
## Description:

There is a race condition causing clients to send intents before
joining:

1. User requests to join a Game
2. The Worker does authentication & authorization
3. User requests to send an intent before joining the game, so the
request is sent to the worker

So instead of kicking the client, just log a warning and drop the
message.

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

evan
2025-08-01 12:51:35 -07:00
floriankilian 9797746c0d Further Darken Background Image for Dark Mode - Issue #1238 (#1653)
## Description:
Adjusted the CSS filter properties for the background image in dark mode
by reducing brightness, adding saturation control, and increasing
contrast.

Fixes #1238 

Screenshots:
From:
<img width="3360" height="2100" alt="CleanShot Google Chrome 2025-07-31
at 11 00 58@2x"
src="https://github.com/user-attachments/assets/93472d02-3a3d-4431-bf43-9abc2d7ac873"
/>

To:
<img width="3360" height="2100" alt="CleanShot Google Chrome 2025-07-31
at 11 01 03@2x"
src="https://github.com/user-attachments/assets/eac464e1-d66f-4b74-a5f6-94441ff20b73"
/>


## 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
- [x] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:
[UN] nvm
2025-08-01 06:47:30 +00:00
floriankilian bd59cd61cb Private Lobbies: Add kick player functionality (#1436)
## Description:
Added player management features so lobby hosts can kick players from
private games. This includes both UI changes and backend work.

### What's new:
- Hosts can now kick players from private lobbies with a simple button
- Added host badges and remove buttons to the UI
- Made sure only hosts can kick people, and hosts can't kick themselves

### How it works:
- When someone creates a private game, they automatically become the
host
- Kicking happens through WebSocket "kick-player" events
- Server checks that you're actually the host before letting you kick
anyone

<img width="1291" height="871" alt="Screenshot 2025-07-15 002114"
src="https://github.com/user-attachments/assets/ea575f83-a0f4-45d1-9cfe-7521d373f3d5"
/>



### Known Issues:
- Kicked player gets general message (same when kicked for multi tab)

### Other Issues:
- Host abandoment still existent (host clicks on x; or is closing tab)

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

[UN]nvm

---------

Co-authored-by: floriankilian <floriankilian@users.noreply.github.com>
2025-08-01 05:01:10 +00:00
Aleksey Orekhovsky ee459b7410 Reduce Docker image size by refactoring map loading (#1621)
## Description:

This PR implements a major refactoring of how map data is stored and
loaded, as described in #1242. Previously, map data (`.bin` files) was
bundled directly into the client-side JavaScript by Webpack using
`binary-loader`. This approach led to data duplication and increased
bundle/image sizes.

This refactoring changes the strategy entirely:
- `GameMapLoader` interface has been introduced to decouple the map
loading mechanism from the components that use it.
- New `FetchGameMapLoader` implementation loads map data by fetching it
from static server endpoint.
- Webpack configuration and `Dockerfile` have been updated to serve the
map files as static assets and to remove the source `resources/maps`
directory from the final image, thus eliminating data duplication.

This leads to several key improvements:
- Docker image size is reduced from ~750 MB to ~600 MB.
- Build time is decreased. On my local machine, the docker image build
time went from 48s to 43s.
Most of this speed-up comes from faster Webpack builds (reduced from 16s
to 11s), as it no longer needs to process large binary files. This
performance gain will be noticeable for all developers during local
development, not just in the CI workflow.

## 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
- [X] I have read and accepted the CLA agreement (only required once).

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

aaa4xu
2025-08-01 04:49:07 +00:00
Aleksey Orekhovsky 69d5f33665 Handle canvas context loss and restoration by redrawing (#1667)
## Description:
This PR introduces handling for the canvas `contextlost` and
`contextrestored` events to make the game's rendering more robust.

Previously, if the graphics context was lost (which can happen due to
browser memory management, GPU driver resets, etc.), the render loop
would continue to run, but most drawing operations would silently fail.
This resulted in a broken visual state where terrain, structures, and
other graphics would disappear, leading to what players have referred to
as the "black screen bug".

These changes implement the following:
1.  In `GameRenderer`, event listeners are added to the main canvas.
2. On `contextlost`, the `requestAnimationFrame` loop is cancelled,
pausing rendering.
3. On `contextrestored`, a full redraw of all layers is triggered, and
the render loop is restarted, allowing the game to gracefully recover.

Additionally, a related bug in the `StructureLayer` is fixed. During a
redraw/restoration, the layer could attempt to render unit icons to its
canvas before the images were fully (re)decoded. The `init` method now
explicitly waits for all icon images to be decoded before drawing them,
ensuring the layer is restored correctly.

**Important Note:** This PR represents a partial fix for the context
loss issue. Specifically, the `StructureIconsLayer` remains in a broken
state after context restoration. This layer is rendered using Pixi.js,
which has its own specific process for handling renderer recovery. Due
to my lack of experience with the Pixi.js API, I was unable to implement
the fix for this layer. This would be an excellent follow-up
contribution for someone familiar with Pixi.

## 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
- [X] I have read and accepted the CLA agreement (only required once).

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

aaa4xu
2025-08-01 04:47:07 +00:00
Scott Anderson 3cf761e9c0 Loosen coverage requirements slightly (#1669)
## Description:

Tight code coverage requirements and low coverage are making it
difficult to merge code, because a small increase in lines of code can
decrease coverage enough to trigger a test failure.

## 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
- [ ] I have read and accepted the CLA agreement (only required once).
2025-08-01 00:43:07 -04:00
Scott Anderson 00dac0e22b Merge tag 'v0.24.11' into main 2025-08-01 00:27:29 -04:00
richardroy e5f47e34d7 Shift scroll only increase (#1625)
## Description:

Determine which scroll event delta, x or y, has the non zero value.
Use it to determine troop ratio increase or decrease.
Shift + Scroll can change scroll diretion from Y to X axis. If that is
enabled this change will still allow troop ratio increase / decrease

## 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
- [ ] 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
- [ ] I have read and accepted the CLA agreement (only required once).

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

richard012659

---------

Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com>
2025-08-01 04:26:12 +00:00
Tyler Hanavan 488188ff86 Fix the stale disconnected (Zzz) icon persisting when a client reconnects (#1631)
Fix the stale disconnected (Zzz) icon persisting when a client
reconnects

## Description:

Refer to issue #1630 

This change modifies the GameServer.addClient function to send the
mark_disconnected = false intent when a client that was previously
disconnected gets replaced by a newly joined client with the same
clientID. Under the old logic, this mark_disconnected = false intent is
not sent if the client was disconnected for longer than 60 seconds
before reconnecting.



https://github.com/user-attachments/assets/5e0ce1c3-9519-4f39-aa80-e46f1275649c

Left side browser (player with red tiles) is the disconnected client
that was disconnected at 00:14 game clock time. It reconnected around
03:56 game clock time.
Right side browser (player with green tiles) is the other client. Use
the game clock time from the right side for the live game clock time.

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

slyty

---------

Co-authored-by: Drills Kibo <59177241+drillskibo@users.noreply.github.com>
2025-08-01 04:24:15 +00:00
Scott Anderson c1f99c6bac Betray on MIRV launch (#1668)
## Description:

Betray on MIRV launch, instead of on separate.

## 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
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA agreement (only required once).
v0.24.11
2025-07-31 19:29:07 -07:00
Kipstz Avenger 38eb48cd2e Fix for two formatPercentage functions (#1659)
Closes #1656

## Description:

Change: Simplification of the function to display percentages with one
decimal place without limitation.
Result: Percentages are now displayed with one rounded decimal place
(e.g. 15.5%, 99.6%) without automatic replacement of extreme values.

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

kipstzz
2025-07-31 18:34:22 -04:00
Scott Anderson b05881fad0 Revert "Display OFM25 ad in WinModal (#1281)"
This reverts commit 61745ba39a.
2025-07-31 14:23:57 -04:00
Scott Anderson ebc0525c89 Enforce minimum test coverage (#1646)
## Description:

Enforce minimum test coverage.

## 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
- [ ] I have read and accepted the CLA agreement (only required once).
2025-07-30 22:35:23 -04:00
maxime.io c5484696f7 Display FPS monitor overview (#1573)
## Description:

Display an FPS monitor to track performance on each new feature.
It only appears in the development environment, positioned at the top
center to remain visible—especially on mobile.
The display can be closed via a close button.

I already use it to evaluate my other PR on low end device.

<img width="1126" height="845" alt="image"
src="https://github.com/user-attachments/assets/a7197572-6aea-47df-9dd2-e84947c7aee0"
/>


## 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
- [x] I have read and accepted the CLA aggreement (only required once).

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

devalnor
2025-07-30 15:28:38 -04:00
Duwibi 9d8bf329ad Fix inconsistent host lobby join URL (#1634)
## Description:
Fixes inconsistent host lobby join URL by adding a / before the #

## 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
- [ ] I have read and accepted the CLA agreement (only required once).

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

DISCORD_USERNAME
Nikola123
2025-07-30 11:15:47 -07:00
Duwibi 696201a06a Make Baikal More Common (#1616)
## Description:
This PR updates the chance of the Baikal Map from 1 to 2. (Following the
rise in popularity of the map)

## 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
- [ ] I have read and accepted the CLA agreement (only required once).

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

DISCORD_USERNAME
Nikola123
2025-07-30 13:28:19 -04:00
Antoine dc1f79d090 Fix all strict errors in /client (#1489)
## Description:

Second PR to fix issues in order to enable strict mode.

## Specifics

1. Most important change: Turned off errors for Class variables not
initialized in constructor. I've noticed that pretty much all Classes in
the project have at least one occurence of that issue. And fixing it
properly would require a large refactor across the whole project. So
disabling the rule seems like a good solution in this case.

#1075 

## 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
- [x] I have read and accepted the CLA aggreement (only required once).

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

azlod
2025-07-29 16:24:52 -04:00
evanpelle bf13c65657 fix territory modal performance (#1600)
## Description:

The territory patterns modal was listening for keypresses, and would
regenerate all patterns on each render().

So do:
1. Cache territory patterns to prevent regeneration
2. disable handler on close

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

evan
2025-07-28 13:08:07 -07:00
Tyler Hanavan 1db9b93950 Allow additional modals to close when clicking the Escape key (#1604)
## Description:

Allows ChatModal, EmojiTable, PlayerPanel and RadialMenu to accept the
CloseViewEvent, thereby enabling the modals/menus/tables to be closed by
clicking the Escape key.

As described in #1586, there are a number of modals that cannot be
closed by pressing Escape, such as ChatModal, EmojiTable, PlayerPanel
and RadialMenu, while other modals can already, such as the CTRL + Click
build menu.

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

slyty
2025-07-28 12:46:34 -07:00
Tyler Hanavan 0726449b6e Don't become traitor when betraying inactive player (#1610)
## Description:

Don't become traitor when betraying inactive player

This PR makes the following changes
- Do not mark the attacking player as a traitor, if they attack/betray
an ally who is disconnected from the game
- Do not send the attacking player the betrayal message (traitor debuff
applied message), if they attack/betray an ally who is disconnected from
the game
- Add test case for traitor debuff being applied if the attacking player
attacks an ally who is still connected to the game
- Add test case for traitor debuff NOT being applied if the attacking
player attacks an ally who is disconnected from the game


I also tested this manually with nuking an allied player who is
connected and nuking an allied player who is disconnected. The logic
worked as expected.

This PR was made in regards to the following issue: #1599 

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

slyty
2025-07-28 11:22:07 -07:00
DevelopingTom e8c6b93661 Improve UnitGrid performances by grouping units by type (#1592)
## Description:

Even with the internal grid, `UnitGrid::nearbyUnits` can consume a
significant amount of CPU, where it can account for ~5% of the rendering
thread. Most of this overhead comes from filtering units by type.

This PR improves performance by storing units in type-specific sets,
significantly reducing lookup time.

It reduces the usage to ~1% with this change:
![Sans
titre](https://github.com/user-attachments/assets/f206c2bb-4cdb-4b6e-a628-91b1ec7f56e3)

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

IngloriousTom

---------

Co-authored-by: Tom Rouillard <trouilla@mathworks.com>
Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-07-28 00:51:02 -04:00
Scott Anderson 2a3898043c Merge main into v25 2025-07-27 15:25:29 -04:00
djmrFunnyMan 53a8354e32 Fix and update Pluto map (#1587)
## Description:

I've made a mistake and accidentally uploaded the v23 binary instead of
v24. My apolocheese

I also updated the map based on Duwibi's feedback

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

aceralex
2025-07-27 14:25:47 -04:00
Aotumuri 866ea17bb4 Change variable name from dKeyPressed to debugKeyPressed in LangSelector (#1583)
## Description:

Renamed dKeyPressed to debugKeyPressed to better reflect the actual key
used for debug mode activation.

## 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
- [x] I have read and accepted the CLA agreement (only required once).
2025-07-26 20:02:20 -04:00
evanpelle 1cd4fdb75d fix ws mem leak (again) (#1591)
## Description:

The initial memory leak where websockets had references to GameServers
has been fixed. But a new memory leak has been introduced.

A memory dump showed that WebSockerServer was hanging onto 10s of
thousands of closed websockets. I believe it's because
removeAllListeners was removing internal clean up listeners, from the
comment:

* It is bad practice to remove listeners added elsewhere in the code,
* particularly when the EventEmitter instance was created by some other
* component or module (e.g. sockets or file streams).

This PR ensures that removeAllListeners is only called in the close
listener, which is executed after internal cleanup.


## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

evan
v0.24.10
2025-07-26 13:51:21 -07:00
Aleksey Orekhovsky 9c60fbc7d2 Reduce docker image size further by removing unused dependencies (#1588)
## Description:
This PR continues work on issue #1242 to reduce the size of docker
image. It moves frontend-related packages from dependencies to
devDependencies and completely removes packages that are no longer
referenced anywhere in the codebase. As a result, this further decreases
the image size by approximately 25%.

I'm slightly concerned about removing some `@opentelemetry/*` packages.
Locally the build succeeds and the application appears to work, but I'm
currently unable to verify logging through OpenTelemetry.

## 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
- [X] I have read and accepted the CLA agreement (only required once).

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

aaa4xu
2025-07-26 16:17:32 -04:00
Duwibi fb1e0585ab Yenisei map (#1517)
## Description:
This is a map of the Yenisei Bay in Russia. It contains 6 nations and
should be all compatable with all of the new map stuff. It has a size of
2000x2500 (which also means that it's larger vertically)

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
- [ ] I have read and accepted the CLA aggreement (only required once).

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

DISCORD_USERNAME
Nikola123
2025-07-26 14:24:55 -04:00
evanpelle 0f2089c9d0 fix mirv damage scaling (#1590)
## Description:


https://github.com/openfrontio/OpenFrontIO/commit/932d4f3be2cded197e5ed4712a9e9e35963b86a6
made the curve way too steep, so just one MIRVWarhead caused enormous
population damage, so receiving crossfire from a nuke could cause
extensive damage

This PR Makes the curve much more linear, so the first explosions aren't
as deadly. Also change the asymptote to 3%, in practice it ends up being
around 5%.



## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

evan
2025-07-26 11:23:26 -07:00
djmrFunnyMan 67dea7c60f Temporarily increase iterations cap for transports & warships (#1589)
## Description:

This PR increases the iteration cap for warships & transports, until a
better solution can be found.

Fixes the issue where warships & transports break when pathfinding very
far away.

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

aceralex
2025-07-26 10:04:51 -07:00
qunash 13a5349b21 Add Circassian nation (#1577)
## Description:

Adds Circassia as a nation to the `Black Sea` and `Between two seas`
maps. Circassia was a significant country and a historical region in the
North Caucasus that controlled the northeastern Black Sea coast. More
info on Wikipedia: https://en.wikipedia.org/wiki/Circassia

<img width="508" height="315" alt="image"
src="https://github.com/user-attachments/assets/3034c98c-5123-4e28-901f-b194a3f74c46"
/> <img width="504" height="378" alt="image"
src="https://github.com/user-attachments/assets/f63bd6c2-c44a-4620-aac5-c89f3694083a"
/>

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

qunash
2025-07-26 17:44:39 +02:00
Brandon Yi 86a06821a5 Ensuring that MutableAlliance::extend is called in test case (#1582)
## Description:

A test case for AllianceExtensionExecution was not actually checking if
the alliance was extended correctly. The method to extend the alliance,
MutableAlliance::extend, was never called during execution of
AllianceExtensionExecution.

The reason the extend() method was not being called is because both mock
players were not alive. This PR spies on the MutableAlliance object to
verify that extend() is correctly called.

Related: https://github.com/openfrontio/OpenFrontIO/pull/1536

## 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
- [x] I have read and accepted the CLA agreement (only required once).

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

bypie5
2025-07-26 04:10:47 -04:00
Aleksey Orekhovsky 97eb48a650 Reduce docker image size with multi-stage build and dependency pruning (#1581)
## Description:
This PR focuses on trimming down docker image size while keeping runtime
behaviour intact.
This partially addresses #1242 by slimming the production Docker image
by ~33%.
```
$ docker image ls | grep openfront
openfrontio  latest   992fb420f131   1 minute ago   1.05GB   # new
evanpelle/openfront-prod <none> 216c629def78 6 hours ago 1.58GB   # current prod
```

The savings come from three areas:
- Refactor `Dockerfile` into a three‑stage build (dependencies / build /
runtime).
- Installs dev‑only node packages in a throw‑away layer and copies only
production modules to the final image.
- Updated `webpack.config.js` to skip copying `resources/maps/**/*`
which never referenced by the client.

Because the current codebase does not cleanly separate dev/prod
requirements, extensive regression testing is necessary; some latent
prod usage of dev‑only modules might surface.

## 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
- [X] I have read and accepted the CLA agreement (only required once).

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

aaa4xu

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-07-26 02:36:13 -04:00