Sprint 3.5: Alliance Wars N-vs-M — backend, API client, UI controller, tests - #105
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/makr-code/GalaxyQuest/sessions/62d8d191-bbcf-4f8a-912d-2dabbbca310f Co-authored-by: makr-code <150588092+makr-code@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Develop backend and UI for multi-alliance wars
Sprint 3.5: Alliance Wars N-vs-M — backend, API client, UI controller, tests
Apr 12, 2026
makr-code
marked this pull request as ready for review
April 12, 2026 06:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing war system only supported 1v1 player wars. This adds full N-vs-M alliance war support (2v2, 3v4, etc.) with declare/list/status/peace-offer endpoints, an API client layer, and a new UI controller.
Backend —
api/alliance_wars.php(new)Three new tables auto-created via
aw_ensure_schema():alliance_wars— war metadata (name, status, scores, exhaustion, casus belli)alliance_war_sides— maps any number of alliance IDs to side'a'or'b'alliance_war_peace_offers— tracks offers between partiesFive actions:
declareside_a/side_barrays; validates no overlap, ≤8/side, leader/diplomat auth, no duplicate active warslistget_statusoffer_peacerespond_peaceExample declare payload:
{ "side_a": [1, 3], "side_b": [2, 4, 5], "casus_belli": "Territorial aggression" }War name is auto-generated as
[IF]+[VP] vs [SE]+[DN]+[AL]when omitted.API client —
js/network/api.jsFive new methods:
allianceWars(),allianceWarStatus(warId),declareAllianceWar(),offerAlliancePeace(),respondAlliancePeaceOffer(). Added cache TTL entries and POST-invalidation pattern forapi/alliance_wars.php.UI —
RuntimeWarController.jsNew
createAllianceWarController()factory (existingcreateWarController()untouched):Tests
tests/js/alliance-wars.test.js— 25 unit tests (factory, rendering, declare interaction, detail view, peace offer incoming vs outgoing)tests/Unit/AllianceWarsTest.php— 26 PHPUnit tests (term normalization, war summary, alliance queries,load_sidesincluding 3v4 config, expired offer marking, overlap detection, auto-name generation)Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/sebastianbergmann/exporter/zipball/70a298763b40b213ec087c51c739efcaa90bcd74/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/gnkcOf /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/gnkcOf /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/gnkcOf /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/gnkcOf /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/f6458abbf32a6c8174f8f26261475dc133b3d9dc/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/gnkcOf /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/type/zipball/f77d2d4e78738c98d9a68d2596fe5e8fa380f449/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/gnkcOf /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/gnkcOf /usr/bin/composer install(http block)https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/gnkcOf /usr/bin/composer install(http block)If you need me to access, download, or install something from one of these locations, you can either: