场外换币台实测修正:三个选项、换币账单不独占终端

- 原版对话最多三个选项:买币对话去掉"不卖"(第四个选项会越界),不想卖就打发客户;选项那句话带上报价和溢价,删除 otc.tier
- 换币账单单独挂着(OtcClient.Standing),WalletWindow.Pending 没有终端账单时回落到它:不独占 Web3、灰网页,换币、混币开的账单不会把它覆盖;签名后清掉,被挤出内存池时放回
- 到账后刷新终端;手册补一句"不想卖就把客户打发走"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Opus 5.5 committed 2026-11-08 15:10:03 +08:00
1 parent ec578a39d9
commit 7269c253af
12 files changed
+61 -51

No files matched your search

+14 -4
View File
@@ -37,8 +37,12 @@ namespace Decentralized
public Action<Wallet> Execute;
}
/// <summary>当前待付的账单(同一时间一张,新的覆盖旧的)。任何一台钱包都可以付。</summary>
public static Bill Pending;
/// <summary>
/// 当前待付的账单(终端开的同一时间一张,新的覆盖旧的)。任何一台钱包都可以付。
/// 没有终端账单时回落到换币客户的账单(<see cref="OtcClient.Standing"/>):它不会被换币、混币这些终端账单覆盖掉。
/// </summary>
public static Bill Pending { get => _pending ?? OtcClient.Standing; set => _pending = value; }
private static Bill _pending;
private sealed class Tx
{
@@ -129,6 +133,7 @@ namespace Decentralized
if (IsOpen(dev)) CustomUIManager.Instance.CloseWindow(dev.Id);
Devices.Clear();
Pending = null;
OtcClient.Void();
}
/// <summary>终端"打开钱包转账" / DEX 签名请求:在当前连接的钱包上打开。转账填好币种和金额,地址留给玩家手输。</summary>
@@ -522,7 +527,11 @@ namespace Decentralized
dev.Tx.Confs = TxRules.Confirmations(ValueOf(dev));
dev.Tx.Dropped = d.Rng.Chance(TxRules.DropChance(dev.Tier, cong));
dev.Tx.Times = Timeline(dev.Tx.Confs, TxRules.Slowdown(dev.Tier, cong), dev.Tx.Dropped);
if (dev.Tx.Bill != null) Pending = null;
if (dev.Tx.Bill != null)
{
if (dev.Tx.Bill == OtcClient.Standing) OtcClient.Standing = null; // 签了名就不再挂着,免得重复付
Pending = null;
}
dev.Screen = Screen.Broadcast;
dev.Note = null;
Open(dev);
@@ -544,7 +553,8 @@ namespace Decentralized
if (tx.Dropped)
{
// 没成交:账单还在,可以重新付
if (tx.Bill != null && Pending == null) Pending = tx.Bill;
if (tx.Bill != null && OtcClient.IsBill(tx.Bill)) OtcClient.Standing = tx.Bill;
else if (tx.Bill != null && Pending == null) Pending = tx.Bill;
TerminalWindow.Refresh(L.T("hw.tx.dropped"));
return;
}