Materialize purchased ships in daemon state

This commit is contained in:
Meta Vens 2026-06-21 12:18:54 +01:00
commit c063ff63f4
3 changed files with 123 additions and 0 deletions

View file

@ -8889,6 +8889,27 @@ static void RequireTradePurchaseRequestAuthority(string root)
string.Join(", ", unityTradeAcceptanceHits));
}
var daemonOperationsPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonOperations.cs");
var daemonOperations = File.Exists(daemonOperationsPath)
? File.ReadAllText(daemonOperationsPath)
: throw new InvalidOperationException("Cannot verify trade purchase authority; daemon operations are missing.");
var requiredDaemonShipPurchaseSymbols = new[]
{
"ApplyCreateDockedShipPurchase(",
"purchase.CreatesDockedShip",
"run.CurrentEntityKey = purchasedShipKey",
"HullItemKey = itemKey"
};
var missingDaemonShipPurchaseSymbols = requiredDaemonShipPurchaseSymbols
.Where(symbol => !daemonOperations.Contains(symbol, StringComparison.Ordinal))
.ToArray();
if (missingDaemonShipPurchaseSymbols.Length > 0)
{
throw new InvalidOperationException(
"Daemon trade purchase no longer materializes purchased docked ships as typed run state: " +
string.Join(", ", missingDaemonShipPurchaseSymbols));
}
var tradeMenuPath = Path.Combine(root, "Assets", "Scripts", "UI", "Menu", "TradeMenu.cs");
var tradeMenu = File.Exists(tradeMenuPath)
? File.ReadAllText(tradeMenuPath)