Final verification pass: forged transfers, insider catch, rug pool, funding, news; debug helpers
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fb29b61a6a
commit
d0054443ec
4 files changed
+30
-4
No files matched your search
@@ -139,7 +139,13 @@ namespace Decentralized
|
||||
PlayerStore.Instance.storeClientManager.clientStack.Insert(0, BlackDelivery.CreateCourier());
|
||||
PlayerStore.Instance.TryCallNextClient();
|
||||
}));
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Coin buyer (test)", () => Log.Guard("用币付款顾客(测试)", () =>
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Coin buyer forged (test)", () => { ForceFake = true; CoinBuyerTest(); });
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Coin buyer (test)", () => { ForceFake = false; CoinBuyerTest(); });
|
||||
}
|
||||
|
||||
private static bool ForceFake;
|
||||
|
||||
private static void CoinBuyerTest() => Log.Guard("用币付款顾客(测试)", () =>
|
||||
{
|
||||
var c = new StoreClient
|
||||
{
|
||||
@@ -152,7 +158,7 @@ namespace Decentralized
|
||||
c.mainDialogue.SetText(c.displayName, "CRT.").SetEndAction(() => { });
|
||||
c.AddBasicDialog();
|
||||
c.CompleteClientCreation();
|
||||
Mark(c, Assets.CRT, false);
|
||||
Mark(c, Assets.CRT, ForceFake);
|
||||
Log.Info($"用币付款顾客(测试)已设置,钱包污点 {Session.Data.Hot.Taint:0.##},当前顾客 {PlayerStore.Instance.currentClientInstance?.GetClientBlueprint()?.identifier},队列 {PlayerStore.Instance.storeClientManager.clientStack.Count} 人");
|
||||
PlayerStore.Instance.currentClientInstance = null; // 测试:丢掉在场的顾客(开局的高利贷者不可遣散)
|
||||
PlayerStore.Instance.storeClientManager.clientStack.Insert(0, c);
|
||||
@@ -160,8 +166,8 @@ namespace Decentralized
|
||||
// 把后柜里的种子都标成赃物(热度 50%),买走后钱包的污点应为成交额的一半
|
||||
foreach (var it in EmporiumEntry.Instance.backInvinvElement.childItems)
|
||||
if (it.IsTag("SEED")) it.ModifyTag("STOLEN_VALUE_INT", t => t.Enable().SetInt(50));
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
public static void Unsubscribe() => ModHook.OnGenerateCustomerLate -= OnGenerate;
|
||||
|
||||
private static void OnGenerate(StoreClientManager manager)
|
||||
|
||||
@@ -169,6 +169,15 @@ namespace Decentralized
|
||||
d.Scams.Deposit(bad, w, 500, Session.Price); d.Scams.Deposit(ok, w, 500, Session.Price); d.Scams.Withdraw(ok, w, day);
|
||||
Log.Info($"测试:钓鱼授权 #{d.Scams.Approvals[0].Id}(明晚转走 CRT {w.Get(Assets.CRT):0}),骗局池存 500,时间锁池取款第 {day + Tuning.YieldLockDays} 天到账;CRC {w.Get(Assets.CRC):0}");
|
||||
}));
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Perp: PSC long 1000 x2 (test)", () => Log.Guard("永续测试", () =>
|
||||
{
|
||||
var d = Session.Data; d.Poinbase.Add(Assets.CRC, 2000);
|
||||
// 先让价格偏离 7 日均线,资金费才不为零:补几个历史标记价
|
||||
d.Perps.Marks["PSC"] = new System.Collections.Generic.List<double> { d.Market.Price * 0.8, d.Market.Price * 0.8, d.Market.Price * 0.8 };
|
||||
var res = d.Perps.Open(d.Poinbase, "PSC", true, 1000, 2, d.Market.Price, StoreStation.GetDayCounter(), Session.Price);
|
||||
Log.Info($"测试:永续开多 {res},现价 {d.Market.Price:0.00}");
|
||||
}));
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Give key drive (test)", () => Items.Give(ModHelper.SpawnItem(Items.KeyDrive)));
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Predict: window = tomorrow (test)", () => { foreach (var m in Session.Data.Predict.Markets) { m.FromDay = m.ToDay = StoreStation.GetDayCounter() + 1; } Log.Info("测试:所有盘口窗口改成明天"); });
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Perp fund 0 (test)", () => { Session.Data.Perps.InsuranceFund = 0; Log.Info("测试:保险基金清零"); });
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "SPARK x0.3 (test)", () => { var st = Session.Data.Stable; st.Spark *= 0.3; Log.Info($"测试:SPARK 价格 {st.Spark:0.00}"); });
|
||||
|
||||
@@ -196,6 +196,7 @@ namespace Decentralized
|
||||
PredictGame.ClosePrice = d.Market.Price; PredictGame.CloseGas = d.Gas; PredictGame.ClosePush = d.Market.PlayerPush;
|
||||
// 永续:用今天的标记价(当日均价)结算,要在今晚的价格更新之前
|
||||
var perpEvents = d.Perps.Night(day, new Dictionary<string, double> { ["PSC"] = pscMark, ["SPARK"] = d.Stable.Spark }, d.Poinbase, Session.Price);
|
||||
foreach (var pp in d.Perps.Positions) Log.Info($"永续夜间:{pp.Product} {(pp.Long ? "多" : "空")} 保证金 {pp.Margin:0.00},资金费率 {d.Perps.Rate(pp.Product) * 100:0.000}%,标记价 {(pp.Product == "PSC" ? pscMark : d.Stable.Spark):0.00}");
|
||||
if (perpEvents.Any(e => e.Kind == "seize")) SeizeForDebt(d, day);
|
||||
var stakeEvents = d.Staking.Night(day, d.Stable.CraRate, d.WalletAt);
|
||||
double crcFactor = d.Stable.Night(day, d.Rng, d.Staking.Earning);
|
||||
|
||||
Reference in new issue
Block a user