Repository navigation
Implement Stop/Start trading with all - #2278
Conversation
WalkthroughA new "embargo all" feature enables players to instantly stop trading with all eligible opponents via a single action, featuring UI controls, event handling, schema definitions, execution logic, and cooldown configuration. No existing embargo logic was altered. Changes
Sequence DiagramsequenceDiagram
actor User
participant UI as PlayerPanel UI
participant Transport
participant ExecutionManager as ExecutionManager
participant Execution as EmbargoAllExecution
participant Player
User->>UI: Click Stop/Start Trading<br/>with All
UI->>Transport: emit SendEmbargoAllIntentEvent
Transport->>ExecutionManager: embargo_all intent<br/>(action: start|stop)
ExecutionManager->>Execution: new EmbargoAllExecution<br/>(player, action)
Execution->>Execution: init(): iterate players
Execution->>Player: createEmbargo() or<br/>removeEmbargo() for each<br/>eligible opponent
Execution->>Player: recordEmbargoAll()
Player->>Player: update lastEmbargoAllTick
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Related issue: #808; that should probably also be fixed in this PR. In FFA I think your current buttons are good, but in teams mode it would be better to have "Stop trading with all other teams" and "Stop trading with |
Right now, teammates are already excluded in team mode. Let’s keep this PR focused and add team-level controls in a subsequent one. If you’ve got a design idea for the team trading UX, please share it here or on Discord. |
+1 for small PRs, makes my life much easier. |
Removed checks for player status before processing.
## Description: fixes openfrontio#2275 Added global Start/Stop trading; use your **player panel** to trigger it. <img width="370" height="540" alt="Screenshot 2025-10-23 184447" src="https://github.com/user-attachments/assets/c3b7967e-ffdd-4f37-ba67-b60a602278ce" /> ## 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 ## Please put your Discord username so you can be contacted if a bug or regression is found: abodcraft1
fixes #2275 Added global Start/Stop trading; use your **player panel** to trigger it. <img width="370" height="540" alt="Screenshot 2025-10-23 184447" src="https://github.com/user-attachments/assets/c3b7967e-ffdd-4f37-ba67-b60a602278ce" /> - [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 regression is found: abodcraft1
Description:
fixes #2275
Added global Start/Stop trading; use your player panel to trigger it.
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
abodcraft1