Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Shared/Cluster/ClusterConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public static class ClusterConfig
// SE-1525: a store trade finishes against the node's banking replica and settles with the World Authority in the
// background. false: every trade waits on the game thread for the WA to approve its debit, as before.
["store.asyncPayments"] = "true",
// SE-1909: a player's contract reservation at the World Authority that its origin has neither confirmed nor
// released this long no longer blocks the offer or counts against the contract limit. A later confirmation
// still installs the contract if nobody else took the offer in the meantime.
["contracts.reservationSeconds"] = "900",
// SE-1892: a station purchase of ore, ingots, components or ammo adds its items in one call, not one per unit.
// false: vanilla's per-unit loop (a 78,063-ingot purchase was a 300-840 ms frame on the live cluster).
["store.batchPurchases"] = "true",
Expand Down
31 changes: 31 additions & 0 deletions Shared/Cluster/ContractAcceptIntentFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;

namespace ClusterPlugin;

internal static class ContractAcceptIntentFile
{
public static string[] Pending(string directory) =>
Directory
.GetFiles(directory, "*.intent")
.Concat(Directory.GetFiles(directory, "*.release"))
.ToArray();

public static bool IsReleasing(string path) =>
path.EndsWith(".release", StringComparison.Ordinal);

public static async Task<string> PrepareRelease(string path, Func<Task<bool>> ensureReserved)
{
// Recreating a reservation after its Release can strand it if the authority
// still remembers the Release result but has evicted the older Reserve.
if (IsReleasing(path))
return path;
if (!await ensureReserved().ConfigureAwait(false))
return null;
string release = Path.ChangeExtension(path, ".release");
File.Move(path, release);
return release;
}
}
Loading
Loading