39 Commits

Author SHA1 Message Date
Copilot
0449e33b40 Add independent alignment for custom roles (#217)
* Initial plan

* Add independent alignment: constants, validation, UI, and CSS

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* Add unit tests for independent alignment validation

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* Fix remaining binary alignment checks in role display

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* Add independent player container and game-role-independent CSS

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* fix a couple bugs, tweak colors

* remove import

* remove duplicate tag

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>
Co-authored-by: AlecM33 <leohfx@gmail.com>
2026-01-24 23:55:11 -05:00
Copilot
7b6da37ef5 Refactor timer system from child processes to main thread (#216)
* Initial plan

* Refactor timer system to run on main thread instead of child processes

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* Remove obsolete GameProcess.js and simplify TimerManager to stub

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* Address code review feedback: add comments and reduce duplication

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* Remove comments, delete TimerManager, and simplify SOURCE_TIMER_EVENT

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* Fix cross-instance timer communication and expired timer handling

- GET_TIME_REMAINING now publishes response through Redis for cross-instance communication
- SOURCE_TIMER_EVENT handles GET_TIME_REMAINING even when timer is not running locally
- Returns 0 time remaining when timer has expired or timerParams is null
- Updated test to expect Redis publish instead of direct method call

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* Simplify GET_TIME_REMAINING flow and add ended flag

- Add ended: true flag to timerParams when timer completes
- Simplify TIMER_EVENT to check ended flag first, then local timer, then publish SOURCE_TIMER_EVENT
- SOURCE_TIMER_EVENT only publishes GET_TIME_REMAINING if it has the timer
- Remove GET_TIME_REMAINING from handleTimerCommand helper
- Direct socket emission for local timers instead of Redis publish
- Updated test to verify socket emission

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* Refactor GET_TIME_REMAINING into handleTimerCommand switch case

- Moved GET_TIME_REMAINING logic from TIMER_EVENT handler into handleTimerCommand function
- Simplified TIMER_EVENT to just call handleTimerCommand for all timer operations
- Maintains same flow: check ended flag, check local timer, publish SOURCE_TIMER_EVENT if needed
- All tests passing

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* Remove unused getTimeRemaining function from GameManager

- Function is no longer called after refactoring GET_TIME_REMAINING into handleTimerCommand
- All timer time remaining logic now handled in Events.js handleTimerCommand switch case
- Tests still passing

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* Reset timerParams.ended flag when restarting game

- Added reset of ended flag to false in restartGame function
- Ensures restarted games don't have timer marked as already ended
- Placed right after timer cleanup for logical grouping

Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>

* remuse unused constant

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlecM33 <24642328+AlecM33@users.noreply.github.com>
Co-authored-by: AlecM33 <leohfx@gmail.com>
2026-01-24 11:58:51 -05:00
AlecM33
95d0cee35f fix logic that determines whether games are startable when the game is first constructed 2023-11-28 18:19:21 -05:00
AlecM33
a2ed634558 edit names 2023-08-14 02:50:46 -04:00
AlecM33
0b7dd9f4d7 various refactors 2023-08-13 17:51:41 -04:00
AlecM33
a7e442640b add specs 2023-08-05 03:12:50 -04:00
AlecM33
7c61b3a724 fix expectations, remove outdated specs 2023-08-03 18:42:00 -04:00
AlecM33
bef8cd8d59 fix bug with redundant play/pause events, fix spec, tweak current moderator css 2023-04-08 16:01:39 -04:00
AlecM33
dd0c0c0917 fix specs, lint 2023-04-02 00:00:33 -04:00
AlecM33
bc986005c8 add specs 2023-01-31 21:06:09 -05:00
AlecM33
1278d7132a update comment 2023-01-22 23:00:28 -05:00
AlecM33
33a6d43cb8 lint 2023-01-22 21:20:13 -05:00
AlecM33
bd359e878e fix bug with displaying killed player for mod transfer, expand specs 2023-01-22 21:17:29 -05:00
AlecM33
07cc193930 lint 2023-01-21 18:50:41 -05:00
AlecM33
c762f88159 redis part 6, fix test suites 2023-01-21 15:26:50 -05:00
AlecM33
81a132458e redis effort part 5 2023-01-14 22:48:30 -05:00
AlecM33
d760f72ac0 refactor singletons to their own folder 2023-01-01 22:27:23 -05:00
AlecM33
138fc08fde fix problem with updating spectator count 2022-12-30 14:26:14 -05:00
AlecM33
cc5a423168 refactor game state curator 2022-12-27 18:46:38 -05:00
AlecM33
92327dbd7d restart game from in-progress state 2022-12-26 22:40:30 -05:00
AlecM33
249f7c6b74 lint 2022-12-21 20:01:24 -05:00
AlecM33
171640f431 refactor singletons 2022-12-20 22:11:51 -05:00
AlecM33
3b37585640 fix number of arguments to function call 2022-12-17 15:12:23 -05:00
AlecM33
6250f71819 don't emit killed event to person receiving mod powers 2022-12-17 14:52:21 -05:00
AlecM33
235b280240 emit mod transfer events selectively 2022-12-13 22:43:59 -05:00
AlecM33
9c6dfaaca5 correctly 404 invalid games 2022-11-06 17:09:46 -05:00
AlecM33
a891251ac7 fix pruneStaleGames function 2022-07-23 22:10:13 -04:00
AlecM33
6b9c2309c3 change active games to map 2022-07-21 21:33:42 -04:00
AlecM33
b644fe0960 more refactoring 2022-07-17 12:45:38 -04:00
AlecM33
8fbf77e0c8 restart functionality 2022-05-10 15:03:48 -04:00
AlecM33
3b052f66c8 lint under new rules 2022-03-30 21:26:30 -04:00
AlecM33
2e9ab08d5a 4-digit access codes 2022-03-30 21:19:43 -04:00
AlecM33
a2888f9d1e fix constructor, lint 2022-03-01 21:21:24 -05:00
AlecM33
07ec22820e lint 2022-02-26 03:45:01 -05:00
AlecM33
6d5b74d9d9 specs for timer 2022-02-26 03:43:15 -05:00
AlecM33
85fcaacb5b lint specs 2022-02-24 23:49:21 -05:00
AlecM33
740813f05c fix bug with transferring mod powers to spectators that join after game is started 2022-02-24 23:09:25 -05:00
AlecM33
b932a06fe0 simplify connection logic 2021-12-30 02:20:50 -05:00
AlecM33
2cdd40ba27 test critical parts of game manager 2021-12-30 01:40:37 -05:00