Bind player negotiations and release cancelled contract quotes (by Codex)
This commit is contained in:
1 parent
e9483048f4
commit
622973c2cf
18 files changed
+381
-28
No files matched your search
@@ -10018,6 +10018,16 @@ cli::Json ModernSession::ui_command(const cli::Json& request, uint64_t& revision
|
||||
answer = modern::ui_command_result(request_id, previous, revision, {"stadium", "desktop", "bank"},
|
||||
!feedback.empty() ? feedback : yes ? "Der Bau beginnt." : "Abgelehnt.");
|
||||
}
|
||||
} else if (kind == "contract.cancel") {
|
||||
// Close only this owner's exact quote. Releasing the UI owner must
|
||||
// neither rewind nor advance either engine random stream.
|
||||
const int team = g_.manager_teams[size_t(manager)];
|
||||
if (!contract_quote_ || ui_text(*payload, "quoteId") != "quote:contract-" + std::to_string(contract_quote_->quote_id) ||
|
||||
contract_quote_->manager_slot != manager || contract_quote_->runtime_club != team)
|
||||
return refuse("stale_quote", "Diese Verhandlung ist nicht mehr geöffnet.");
|
||||
contract_quote_.reset();
|
||||
revision = previous + 1;
|
||||
answer = modern::ui_command_result(request_id, previous, revision, {"contracts"}, "Verhandlung abgebrochen.");
|
||||
} else if (kind == "quote.request" || kind == "contract.offer") {
|
||||
// quote.request {kind: "contract", playerId}: the player's demands for one to four years
|
||||
// (draws a random number, as at the desk); contract.offer {quoteId, years 1-4,
|
||||
|
||||
Reference in new issue
Block a user