Commit Graph

21 Commits

Author SHA1 Message Date
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
Evan 8b6895d745 add prettier import plugin 2025-03-31 13:09:27 -07:00
evanpelle ab3f4fbac1 All players must join game before spawn (#380)
## Description:
The server stores all players that have joined, and once the game starts
it sends a list of players to all clients. Players cannot join after the
game has started. Server now generated the PlayerID instead of the
client.

The is necessary for team mode, we need to know how who is playing the
game before it starts so we can properly assign teams based on clans.

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

evan
2025-03-30 17:04:29 -07:00
Evan 4ee37323f9 format codebase with prettier 2025-02-01 12:05:11 -08:00
Evan f0f5bae79f thread_split: convert all tile to tileref 2025-02-01 12:05:11 -08:00
evanpelle 162b6dc349 in progress 2025-02-01 12:05:11 -08:00
Evan dab427d614 put methods onto terraintile 2025-02-01 12:05:11 -08:00
Mittani aba8e5dd81 + add validation server side 2024-12-31 13:06:43 -08:00
Mittani aa01ea7694 + add random bot names 2024-12-31 13:05:22 -08:00
evanpelle ff02d9d8b6 have core/ directory use consolex for remote logging 2024-12-18 12:00:00 -08:00
evanpelle c87d0ef3b8 make bot spawner seed gameID 2024-09-21 19:41:21 -07:00
evanpelle f3307300ef refactored GameImpl into multiple files 2024-09-17 19:49:16 -07:00
evanpelle 8331047a9b have client create player id 2024-09-07 21:23:38 -07:00
evanpelle 4caaaea140 created PlayerType enum add FakeHuman type 2024-09-06 17:55:12 -07:00
evanpelle c1dc6217a5 improve AttackExecution perf 2024-09-01 19:18:38 -07:00
evanpelle f01949f007 lose disconnected territory 2024-08-30 19:41:40 -07:00
evanpelle 64265b1a75 more efficient spawns 2024-08-30 11:48:07 -07:00
evanpelle c8518ce30b better UX for boats 2024-08-29 20:04:29 -07:00
evanpelle 7b8c5c11dd fix bot attacks each other same time bug, improve spawns 2024-08-28 20:51:49 -07:00
evanpelle 5e7c206f0d improved terrain api 2024-08-21 19:51:01 -07:00
evanpelle 05f55c490f First Commit 2024-08-04 19:51:23 -07:00