XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEEDToolBox

【WinUI】XFE精英危险工具箱

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFEEDToolBox

Retain confirmed destination prices when resuming a completed trade

8d6ba19
XFE工作室室长 <mail@xfegzs.com>
提交于

代码差异

2 个文件 +25 -0
Modified XFEEDToolBox/ViewModels/AutomaticTradeViewModel.cs +18 -0
@@ -190,6 +190,7 @@ public partial class ToolboxViewModel
190 190 var saved=JsonSerializer.Deserialize<TradeLeg>(await File.ReadAllTextAsync(Path.Combine(pending[0],"leg.json"),token),ToolboxSettings.JsonOptions)
191 191 ??throw new InvalidDataException("未完成批次缺少原始计划。");
192 192 await CompleteJourney(pending[0],saved,membershipClient);
193 await Quotes(configuration.Destination);
193 194 }
194 195 if(configuration.ValidateMenuReentry)
195 196 {
@@ -210,6 +211,23 @@ public partial class ToolboxViewModel
210 211 var saved=JsonSerializer.Deserialize<CommodityQuote[]>(await File.ReadAllTextAsync(quoteCache,token),ToolboxSettings.JsonOptions);
211 212 if(saved is {Length:>0}&&saved.All(row=>row.MarketId==configuration.Destination.MarketId&&DateTimeOffset.UtcNow-row.CollectedAt<TimeSpan.FromMinutes(30)))destinationQuotes=saved;
212 213 }
214 if(destinationQuotes.Count==0)
215 {
216 // A server-confirmed sale is an observed price at its actual
217 // receipt time. It does not assert future station demand.
218 var paidPrices=new List<CommodityQuote>();var now=DateTimeOffset.UtcNow;
219 foreach(var directory in Directory.EnumerateDirectories(root,"journey-*"))
220 {
221 var path=Path.Combine(directory,"result.json");if(!File.Exists(path))continue;
222 var result=JsonSerializer.Deserialize<NativeTradeJourneyResult>(await File.ReadAllTextAsync(path,token),ToolboxSettings.JsonOptions);
223 if(result?.Passed!=true||result.Checkpoint.Sold is not {} sale||sale.CommanderId!=initial.CommanderId
224 ||sale.MarketId!=configuration.Destination.MarketId||!sale.ServerConfirmed||!sale.ClientApplied||sale.QuantityDelta>=0||sale.UnitPrice<=0
225 ||sale.ConfirmedAt>now||now-sale.ConfirmedAt>TimeSpan.FromMinutes(30))continue;
226 paidPrices.Add(new(){MarketId=sale.MarketId,Commodity=sale.Commodity,DisplayName=sale.Commodity,SellPrice=sale.UnitPrice,
227 CollectedAt=sale.ConfirmedAt,Source=DataSource.Journal});
228 }
229 destinationQuotes=paidPrices.GroupBy(row=>row.Commodity).Select(group=>group.MaxBy(row=>row.CollectedAt)!).ToArray();
230 }
213 231 if(destinationQuotes.Count==0){await Travel(configuration.Destination);destinationQuotes=await Quotes(configuration.Destination);}
214 232 await State("travelling-to-source");
215 233 if(destinationQuotes.Count==0)throw new InvalidDataException("目的站原始报价为空。");
Modified docs/TRADE-WORK-COORDINATION.md +7 -0
@@ -2,6 +2,13 @@
2 2
3 3 更新:2026-10-24(Asia/Shanghai)。最新状态以紧接下方的记录为准,后文保留历史故障及验收过程。
4 4
5 ## 恢复后报价缓存与第二轮衔接(2026-10-24 21:01)
6
7 - c479eb65226ee8550e0c0d041e2273bf793788bc已正常推送codex/csharp-cg-trading并远端核对,共15个本任务文件;共享master/index及其他UI/星图改动保留,原ABI未改,work原始账户文件未提交。
8 - 第二轮在12:52:11Z原归零arm回执未能核对,未重放;游戏原AI仍完成12:53:07Z实际Polyakov停靠,原始只读ready/serviceReady/fresh/healthy全true。此前模块最近reset记录仍为上一轮,不能把它拼接成这次原请求成功。没有结束游戏或跳过真实停靠核对。
9 - 恢复后发现首批是从pending检查点完成的,后续初始化仍使用20:17的旧报价缓存,导致程序为刷新报价空载返回Homer。已修正:恢复完成交货时立即读取目的站原始报价;当全量报价缓存过期时,可使用本工作目录passed旅程中同指挥官、同目的市场、serverConfirmed/clientApplied的30分钟内真实售出单价。采集时间严格使用原成交确认时间,不刷新时间、不推定库存或需求,实际卖出仍重新读取原始市场。
10 - 新Release构建0警告0错误。当前唯一工具箱PID99832/startTicks639284435654422843,exe `work/trade-page-delivery-20261024/artifacts/direct-production-price-resume/XFEEDToolBox.exe`,已从同工作目录继续第二轮,12:59:47Z原始跃迁、13:00:12Z抵达Duamta,仍空舱;第二笔采购尚未确认。第一批净9572959及CG576保持,不能将第二批预计收益计入。游戏88060与唯一独立保护87996保持,无定时任务或子智能体。
11
5 12 ## 首批工具箱实际自主贸易完整结算,自动继续(2026-10-24 20:47)
6 13
7 14 - `direct-production-20261024-195824/journey-241318fd98984d19a99be09783ea542c/result.json` 最新passed=true。同一采购130de9a40e1e4418998affe6ca2c5345的192t铀已于12:47:07Z以57104 Cr/t全部售出,唯一卖单e9725491ecd84ba48190f929749c51c4;原始服务器/客户端、空货舱、Homer实际停靠与全部维护核对通过。原SCO故障尝试保存在attempts,不重写为成功。