Commit Graph

1823 Commits

Author SHA1 Message Date
1brucben 3a18b62b94 gold formula adjusted for new meta (#757)
## Description: 
Gold formula adjusted to form ~ workers ^ .7

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

1brucben
2025-05-18 15:52:24 -04:00
DevelopingTom bb24f18285 Add new FX layer and a nuke animation (#807)
## Description:

Changes:
- Added an AnimatedSprite class to handle spritesheets
- New FX layer, displaying cosmectics effects
- New Nuke FX: an animated sprite explosion, and a shockwave effect
- New "Special effects" setting, toggle to deactivate the FX layer for
lower-end hardware / personal taste


#### Note that the animation is a placeholder. It should be replaced
when a better looking one is available.

- Nuke:


https://github.com/user-attachments/assets/6eff1d0d-5081-47ad-932f-2bfcda72cb3c


- Mirv:


https://github.com/user-attachments/assets/3bc891b4-449c-4acb-8e24-e237b423c2a9


- SAM are also using the same Nuke animation. To be improved with a
custom FX:


https://github.com/user-attachments/assets/d65addce-5890-42c2-81e0-3eaa79ed87f3

## Performances:

Excellent since it's not manipulating the underlying imagedata directly.
Profiling during a MIRV with 100's of animations:

![image](https://github.com/user-attachments/assets/3477c963-d10f-493b-bcb1-93b7990d3edb)



### New settings:

- main menu:


![image](https://github.com/user-attachments/assets/5b1127bb-3b89-4c06-b519-fb173301d9fd)

- In game:


![image](https://github.com/user-attachments/assets/ba899253-a7cf-4d1c-8801-da41d2b1536b)


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

IngloriousTom
2025-05-18 12:43:12 -07:00
Scott Anderson 1ebf6d4fab bug: anon names (#795)
## Description:

Fix a bad conflict resolution from enabling `strictNullChecks`.

## 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-18 10:50:08 -07:00
Vivacious Box 95e0e9fa33 Fix regression: put sprite clearing in a distinct method to make the intent clearer (#800)
## Description:
Fix regression on unite sprites drawing, the old code which used 2 for
loops on the same object looked like there was an oversight.
By splitting it in 2 function calls and adding a comment the intent
should be clearer.


Before:

![image](https://github.com/user-attachments/assets/b396f35c-1ca0-4622-a93c-1ad2f728b5b9)

After:

![image](https://github.com/user-attachments/assets/17aa2e0a-4627-42a7-90d4-c6685b22a380)


## 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>
2025-05-18 10:49:29 -07:00
Duwibi 35069adee4 Add Halkidiki Map (#799)
## Description:
This PR adds the Halkidiki map. It's a region in Greece with rich
history that is very popular also with tourism.

## 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>
Nikola123
2025-05-18 09:54:27 -07:00
Vivacious Box 332629de78 Fix mirvhead spamming same location (#801)
## Description:
There is a bug in the proximity check in the mirvhead destination 

This fixes it.

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

Vivacious Box
2025-05-18 08:03:04 -07:00
VariableVince 01ef525e11 Update Instructions and text in Build menu/Player panel (#785)
## Description:

New images in Instructions where needed for:
- event panel: wasn't mentioned yet
- infopanel changed: quick chat, donate gold, stop/start trading etc
- player icons: traitor, embargo, requesting alliance
- radial menu: now differs between enemy/ally
- leaderboard: was changed
- options: time display was changed, cookie preferences button is now
visible so kept that in the new image

Some justifcations of part of the textual changes:
- Trade: info was already behind and now updated to include changes from
PR https://github.com/openfrontio/OpenFrontIO/pull/707
- Retreats: weren't yet mentioned. Added this to new info about Event
panel. Including https://github.com/openfrontio/OpenFrontIO/pull/699,
and not-yet-but-soon merged PR
https://github.com/openfrontio/OpenFrontIO/pull/740 and
https://github.com/openfrontio/OpenFrontIO/pull/705
- Radial Menu: close button has been replaced, explain that
right-clicking closes it now.
- Traitor: being a traitor and its consequences, like the changed
defense debuff and effects on trade.
- SAM: launcher hit chanches % changed.
- Port: Battleships > Warships and other changes.
- Warship: made more clear that only enemy trade ships/warships/boats
are captured/destroyed. Made 'attack-click' more clear.
- Boat: the word Boat was used, not Transport ship. While on server and
in code it is called a Transport (ship) too. Tried to clear this up.
Since it is now explained n Instructions, it doesn't have to be
clarified per se elsewhere. Like in Build menu for Warship it says
"Captures trade ships, destroys ships and boats" which can stay this way
as it is now assumed knowledge that boat = transport.
- More uniform capitalisation for 'Openfront' terms: capitalization was
used differently across terms like Info panel and build menu, Alternate
view and Alternate View. Other instances are more ambiguous like "Small
explosive bomb that destroys territory, buildings, ships and boats"
which i kept as is.
- Embargo: the word 'embargo' was deliberately removed earlier, because
it wasn't always understood by target audience
(https://github.com/openfrontio/OpenFrontIO/pull/147). But some remnants
were left. Using 'stop trading' in all but one spot now: it's used as
one-word explanation for the Dollar stop sign player icon, just like
other icons also have short 'Ally' 'Traitor' etc. So the players who do
use the word embargo still have one reference left.

- Build menu: left Warship description as is (see 'Boat:' above).
Updated Port description from "Sends trade ships to allies to generate
gold" to "Sends trade ships to generate gold". Trade is not only with
allies anymore. And there's more details that are in Instructions like
the effects stop/start trading, that don't have to be in the Build menu.
This lessens the chances of having to change the Port description in
Build menu again.

- Player info: changed "Embargo against you" to "Stopped trade with you"
(see 'Embargo:' above).

Keys that need to be (re)translated in MLS:
- NEW keys: info_chat, info_trade, ally_donate_gold, build_menu_desc,
icon_embargo, icon_request, ui_playeroverlay, ui_playeroverlay_desc,
ui_events, ui_events_desc, ui_events_alliance, ui_events_attack,
ui_events_quickchat
- UPDATED keys: info_enemy_desc, ally_betray, build_port_desc,
build_warship_desc, build_sam_desc, icon_crown, icon_traitor,
radial_boat, radial_build, build_menu.desc.port, embargo,
option_settings, build_defense_desc, radial_desc, ui_leaderboard_desc

Font looks weird in screenshots because of zoom 40% in browser to
capture it all:
![Instructions
1](https://github.com/user-attachments/assets/d349bb12-f0ec-407d-b29f-68b25cf98dc1)
![Instructions
2](https://github.com/user-attachments/assets/0d7753b7-99a6-41f3-99d7-182cf1ef57f3)
![Instructions
3](https://github.com/user-attachments/assets/9087f2e3-8e8e-4c77-8ec4-a2410e15d3d3)
![Instructions
4](https://github.com/user-attachments/assets/132c5b61-d211-4fbe-82a9-508feef1ad37)
![Instructions
5](https://github.com/user-attachments/assets/decde07b-9c63-4520-a845-109810c106a4)


![afbeelding](https://github.com/user-attachments/assets/10d12b20-48e9-406e-b3a3-01dbf5a76642)

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

tryout33

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Added new UI elements and icons for alliance requests, embargo status,
and gold donation in the help modal and player info panels.
- Introduced detailed sections in the help modal for events, player
overlays, and expanded build menu explanations.

- **Improvements**
- Enhanced and clarified descriptions for leaderboard, event panels,
player overlays, ally betrayal, and build menu items.
- Improved visual grouping, layout, and styling consistency in the help
modal and across UI icons.

- **Style**
- Updated and unified image and icon styles for consistent appearance in
the help modal.
- Added new CSS classes for modal images and icons; removed fixed-size
radial menu image style.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-17 21:04:33 -07:00
Scott Anderson b558bd722d Prevent multiple clients from using the same account (#706)
## Description:

This change blocks a persistent ID from being reused by more than one
client in the same game. This setting is only enabled in staging and
prod.

## 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-17 21:03:05 -07:00
Scott Anderson e4c8b17b48 Fix overly permissive regular expression range (#765)
## Description:

Add escaping to the `-` character to prevent it from specifying a
character range.

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

## Original description

Potential fix for
[https://github.com/openfrontio/OpenFrontIO/security/code-scanning/6](https://github.com/openfrontio/OpenFrontIO/security/code-scanning/6)

To fix the issue, we will replace the ambiguous range `)-_` with an
explicit list of the intended characters. This ensures that the regular
expression is unambiguous and matches only the desired characters. We
will carefully review the rest of the regular expression to ensure no
other overly permissive ranges exist. The updated regular expression
will maintain the same functionality while being more precise.


_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Improved the clarity of character validation for safe strings,
ensuring consistent handling of special characters. No changes to
user-facing features or functionality.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-17 20:41:49 -07:00
evanpelle 2f091bf24b reduce log spam during test: use debug logging for map generation, disable debug logging for unit tests 2025-05-17 18:32:22 -07:00
evanpelle 500b5fcfde Clean up and refactor the Unit class (#769)
## Description:

* Merged similar fields so they can be reused (eg warshipTarget =>
targetUnit)
* simplified isCooldown api
* added "touch" method to send update to UI layer
* standardized on "undefined"


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

<DISCORD USERNAME>
evan

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Unified and simplified how unit targets and cooldowns are managed
across all unit types, resulting in more consistent in-game behavior for
nukes, warships, trade ships, and SAM launchers.
- Updated naming and logic for unit targeting and cooldowns, improving
clarity in status displays and interactions.
- Reorganized unit interface and streamlined cooldown handling for
smoother gameplay experience.
- **Bug Fixes**
- Corrected visual indicators for nukes and warships to accurately
reflect their targets.
- **Tests**
- Updated automated tests to align with the new cooldown and targeting
logic.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-17 17:45:10 -07:00
evanpelle 0871c08858 update version 2025-05-17 08:23:27 -07:00
evanpelle 1a0b3dbe88 LocalServer: call endGame on replay when all turns have been executed 2025-05-17 08:20:02 -07:00
evanpelle 4cba9ae573 bugfix: when warship searches for patrol tile, fallback to allowing a shore tile. Return undefined to prevent unreachable code exception. 2025-05-17 08:19:53 -07:00
Scott Anderson 07122f6b9c Fix traitor duration text (#783)
## Description:

Fix traitor duration text

## 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
- [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-16 19:53:06 -07:00
Scott Anderson e298eafc5a Break alliance on launch (#775)
## Description:

- Break alliances on launch based on speculative damage.

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

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Behavior Changes**
- Alliances are now immediately broken when a nuke is launched and its
incoming message is displayed, rather than only at detonation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-16 20:03:51 -04:00
Scott Anderson 3e7fe607e8 PR description check (#766)
## Description:

Adds a PR description checker that enforce that the PR template is being
followed.

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

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Introduced automated validation for pull request descriptions to
ensure required sections and checklist items are completed before
merging.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-16 16:18:45 -07:00
Aotumuri 6431153903 Disable send button when required player not selected in quick chat (#767)
## Description:
This PR prevents players from sending Quick Chat messages that require a
player target ([P1]) unless a player has been selected. The Send button
is now disabled in such cases and visually dimmed for clarity.
## 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:
aotumuri

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- The chat send button is now disabled if a required player selection is
missing, preventing unintended sends.

- **Style**
- The chat send button visually indicates when it is disabled with a
gray background and a not-allowed cursor.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-16 16:15:53 -07:00
Scott Anderson 14e284bb40 Update deploy hosts (#774)
## Description:

Update the deploy script with new hosts.

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

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated deployment workflow to use new deployment targets: "masters"
and "nbg1" (replacing "eu" and "us"), while retaining "staging".
- Adjusted environment variables and SSH setup to support the new
deployment hosts.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-16 16:12:52 -07:00
Vivacious Box 1f6642888b Fix capturing isolated clusters (#761)
## Description:
Current behavior:
TerraNullius tiles are taken into account for capturing isolated
clusters
Also isolated clusters can be captured by allies

It might be intended behavior but in case it is not, here is a quick fix


Before:

![capturenuke](https://github.com/user-attachments/assets/d2df37ea-cc35-496e-a7f2-0980c7af29f6)

After:

![capturenuke2](https://github.com/user-attachments/assets/55694e84-ceb3-47b9-96b7-61c9a7b51d3b)


⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
### This will also change capturing isolated clusters while attacking as
long as there is TerraNullius as a neighbor so if it is intended
behavior, please discard.
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️


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

Vivacious Box
2025-05-16 14:33:41 -07:00
Duwibi 4a5b5ed5ff Fix Black Sea map lakes (#772)
## Description:
Fixes Black Sea map lakes

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

<DISCORD USERNAME>
Nikola123
2025-05-16 13:25:47 -07:00
Duwibi 4bf4d564de Fix inverted terrain on Black Sea map (#770)
## Description:
This PR fixes the inverted terrain on the Black Sea map

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

<DISCORD USERNAME>
Nikola123
2025-05-16 11:40:13 -07:00
evanpelle 86ce96fff5 update gatekeeper submodule ref 2025-05-16 10:00:58 -07:00
tnhnblgl 6e12948033 Display Warship count (#756)
## Description:
Missile launchers:
SAMs:
And now Warships:

## 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>
dovg
2025-05-15 23:13:14 -04:00
Scott Anderson e402687988 Add prettier-plugin-sh (#762)
## Description:

Add prettier-plugin-sh to format shell files.

## 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-15 23:09:39 -04:00
Scott Anderson 6517f80f68 Add path cache (#763)
Based on #753

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-15 19:12:02 -07:00
Scott Anderson 70745faac4 Enable strictNullChecks, eqeqeq (#436)
## Description:

Improve type safety and runtime correctness by:
1. Enabling TypeScript's
[strictNullChecks](https://www.typescriptlang.org/tsconfig/#strictNullChecks)
compiler option.
2. Replacing all loose equality operators (`==` and `!=`) with strict
equality operators (`===` and `!==`).
3. Cleaning up of type declarations, null handling logic, and equality
expressions throughout the project.

Currently, the code allows implicit assumptions that `null` and
`undefined` are interchangeable, and relies on type-coercing equality
checks that can introduce subtle bugs. These practices make it difficult
to reason about when values may be absent and hinder the effectiveness
of static analysis.

Migrating to strict null checks and enforcing strict equality
comparisons will clarify intent, reduce bugs, and make the codebase
safer and easier to maintain.

Fixes #466 

## 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>
Co-authored-by: evanpelle <openfrontio@gmail.com>
2025-05-15 16:39:40 -07:00
robert-pitt-foodhub 369483b4ac Small optimisation in TerritoryLayer.renderLayer call to dedupe Date.… (#759)
## Description:

Small optimisation in TerritoryLayer.renderLayer call to dedupe
Date.now()

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

N/A

Co-authored-by: robertpitt <robertpitt1988@gmail.com>
2025-05-15 16:07:39 -07:00
evanpelle 99a5d5b8d7 use prod env for deployment to openfront.io 2025-05-15 15:17:51 -07:00
Daniel 1fce721d3e Use trade ship travelled distance instead of Manhattan distance when calculating value (#646)
## Description:

This PR makes trade ships actually use their traveled distance when
calculating their monetary value, instead of the the Manhattan distance
from port to port.

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

Koranir
2025-05-15 11:52:58 -07:00
Vivacious Box c65c9a6ca8 Fix border color changes edge cases (#754)
## Description:

Fixes a couple of bugs with the defended border color:
- When a defense post is destroyed it doesnt redraw defended border to
normal ones
- The distance to draw borders at unit update is not the same as
territory update
- When a defense post changes owner, only the directly touching borders
were redrawn. Had to refactor units a bit so it keeps track of the last
owner

## Gifs:
Before fix:

![image](https://github.com/user-attachments/assets/99b2763c-9c49-4d5d-8059-a9f938e8cef8)


After fix:

![capture](https://github.com/user-attachments/assets/4ebf388d-91e4-4e9e-bc96-9fe6e02cd9ea)

![destruct](https://github.com/user-attachments/assets/5a1204a8-d5c4-473f-8f4d-5cc46cd19080)



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

VivaciousBox
2025-05-15 11:48:18 -07:00
DevelopingTom 3b9e94ddb9 Improve border drawing performances (#751)
## Description:
When drawing the border colors, the territory layer is using the generic
`nearbyUnit` function to check if any allied outpost is nearby.
But `nearbyUnit` is uselesly computing the distance with all units,
which is very costly specially in late games with plenty of units.

Early game (<1 min):


![image](https://github.com/user-attachments/assets/faa90c82-a7dd-43db-b2ff-1f6cd24b24cd)

Late game (> 10 min):


![image](https://github.com/user-attachments/assets/863d4d1a-6d5e-4971-a66c-461a876ca53f)

This PR adds another function tailored for this requirement.
## Improvements:
- New `hasNearbyUnit()` function stopping at the first correct unit,
rather than computing the distance with every unit
- Check the unit type before computing its distance
- Selecting the correct cells:
The previous algorithm was very generous and looking at cells uselessly.
Admittedly this is marginal but since it is called on every border pixel
change, we should squeeze the most performances out of it.



![overflow](https://github.com/user-attachments/assets/22b26c49-ba9d-4050-8ccd-9dde48913720)


Performances after (with bots):
Early:

![image](https://github.com/user-attachments/assets/f78d08d4-938c-466b-b8b3-9d1ad57b5dfb)

Late:

![image](https://github.com/user-attachments/assets/c12a8793-4039-4278-9413-07b2af5c8f3d)

Both Chrome and Firefox seems to benefit from it:
Previous behavior on chrome:
![Sans
titre](https://github.com/user-attachments/assets/e10256f7-dcc0-47c7-8878-fa0ce8a02b39)
After:
![Sans
titre-1](https://github.com/user-attachments/assets/15747e02-69fd-45a2-90f8-389250f261cd)


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

IngloriousTom
2025-05-15 11:25:12 -07:00
evanpelle 8b91fac717 bugfix: numWorkers() is called by the client, which does not have access to env variables, causing 'ReferenceError: process is not defined'. Long term solution, the client should not need to know how many workers there are. 2025-05-15 10:47:38 -07:00
Killersoren 2efc7d00fb Add team stats component (#678)
## Description:

Closes #677 

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


![TeamStats2](https://github.com/user-attachments/assets/f2bd3f06-8484-476a-8205-97d6e6fc2f1d)

![TeamStats1](https://github.com/user-attachments/assets/4d1f71ef-b6ad-4cee-af82-18bd73e9754a)


Killersoren
2025-05-15 10:31:36 -07:00
Léo Kosman 1b286f5518 Feat : Auto remove embargoes that were automatically created (#707)
## Description:

Adds two fields to an Embargo : 
- `createdAt` : the tick at which it was created
- `willExpire` : whether the embargo will expire on its own

An embargo will remove itself only if the player didn't intentionally
set it. It expires either when an alliance is made, or if enough time
has passed (according to the `embargoDuration` config entry).

I put 5 minutes for `embargoDuration` by default, which seems reasonable
to me.

closes #702 

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

leo21_
2025-05-15 10:09:27 -07:00
Aotumuri 2fe99dc2ce Mls4game (#755)
## Description:
I’ve expanded MLS (Multi-Language Support) coverage in the game.
All in-game elements except for chat messages are now translatable.
## 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:
aotumuri
2025-05-15 05:53:26 -04:00
evanpelle 005f0ddd03 have nginx support up to 40 workers 2025-05-14 15:47:27 -07:00
Léo Kosman 87fd9c3219 Feat : focus unit when clicking on warnings in chat (#699)
## Description:

Enables you to click on the `Naval invasion incoming from X` or `X -
atom bomb inbound` messages to focus the camera on the incoming unit
(boat or nuke). Works for boats, atom bombs, hydrogen bombs and MIRVs.

Nothing changes in looks, only the fact that the messages are clickable.

closes #641 

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

leo21_
2025-05-14 17:18:46 -04:00
Aotumuri 1dfa62f998 mls-3 (#752)
## Description:

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

<DISCORD USERNAME>
2025-05-14 15:36:31 -04:00
Scott Anderson 9029c6e281 bug: fix nuke tile score (#749)
## Description:

Fix a bug with nuke tile scoring.

## 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
2025-05-14 09:34:25 -07:00
Scott Anderson fc54cd7658 Docker TTL (#750)
## Description:

- Terminate docker containers in staging subdomains after 24 hours.
- Reduce worker count to 2 for these deployments.

## 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-14 09:33:07 -07:00
Scott Anderson 2b7b5f03c7 Reduce workflow permissions (#748)
Reduce workflow permissions to the minimum required.

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-13 20:26:22 -07:00
Scott Anderson 69f8e70d5d Install recommended security updates and updated browsers list (#747)
- npm audit fix --force
- npx update-browserslist-db@latest

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-13 18:02:41 -07:00
Scott Anderson 95f5cf68d2 Cleanup deploy script (#708)
## Description:

- Remove the environment from the deploy action, to prevent github
actions from automatically creating a second deployment. This is no
longer needed because the relevant secrets have been moved up to the
repository level.
- Remove the PR comment, as this is now redundant.


![image](https://github.com/user-attachments/assets/e07fde04-9788-4a5e-9a94-01b0917c45d1)

## 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-13 19:57:45 -04:00
Scott Anderson c4fad34bbe Create CODEOWNERS (#746)
https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
2025-05-13 19:38:19 -04:00
DevelopingTom 7c163e2361 Curved nuke trajectory (#734)
## Description:

Change nuke trajectory to follow a curve, and add a trail behind them.


![image](https://github.com/user-attachments/assets/f0fac8a0-d173-4e13-a889-3d19c36f85b8)

### Details:
- Use a look-up table to approximate the distance travelled, so the
speed remains constant along the curve
- The nuke speed is higher than a single pixel, so draw a line behind
for the trail
- Added a new "utility" file for the Bresenham/Bezier algorith: please
tell me if that's ok

### Edge cases (literally the edges):
The control points remains in the map so the curve can never go outside:


![image](https://github.com/user-attachments/assets/bb3a02fd-d76d-4643-a123-8bbc48c0ca87)



## 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: Scott Anderson <scottanderson@users.noreply.github.com>
2025-05-13 01:30:31 -04:00
evan 36759eaa87 remove tournament advert from win/lose modal 2025-05-12 21:03:20 -07:00
evan cb864f6fe9 on error makes sure to return status with json body, otherwise the request hangs 2025-05-12 20:43:31 -07:00
evan 8ed7b9eb52 increase number of worker in prod config 6=>20 2025-05-12 17:45:39 -07:00
evan 0fa751fc0a deploy.sh: replace us with nbg1 2025-05-12 17:30:25 -07:00