SetNet.Auction 1.2.0

dotnet add package SetNet.Auction --version 1.2.0
                    
NuGet\Install-Package SetNet.Auction -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SetNet.Auction" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SetNet.Auction" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="SetNet.Auction" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SetNet.Auction --version 1.2.0
                    
#r "nuget: SetNet.Auction, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SetNet.Auction@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SetNet.Auction&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=SetNet.Auction&version=1.2.0
                    
Install as a Cake Tool

<p align="center"> <img src="https://raw.githubusercontent.com/Povstalez/SetNet/master/assets/icon.png" alt="SetNet" width="96"> </p>

SetNet.Auction

Player-driven auction house for SetNet.

List an item (it's escrowed from your inventory), let players bid or buy out (each bid escrows the bidder's currency and refunds the previous high bidder), and a background timer settles expired listings — the winner gets the item, the seller gets the winning bid, or the item comes back if nobody bid. Every move goes through SetNet.Inventory and SetNet.Wallet, so escrow can't dupe or lose anything. Added by composition — no base class.

Install

dotnet add package SetNet
dotnet add package SetNet.Inventory
dotnet add package SetNet.Wallet
dotnet add package SetNet.Auction

Usage

Call InventoryRuntime.Enable(), WalletRuntime.Enable(), and AuctionRuntime.Enable() at startup.

// server
InventoryRuntime.Enable(); WalletRuntime.Enable(); AuctionRuntime.Enable();
var inventory = server.UseInventory();
var wallet = server.UseWallet();
server.UseAuction(inventory, wallet);

// client
InventoryRuntime.Enable(); WalletRuntime.Enable(); AuctionRuntime.Enable();
var ah = client.UseAuction();
ah.Outbid   += e => Toast($"Outbid — {e.Amount} {e.Currency} refunded");
ah.Won      += e => Toast($"Won {e.Count}× {e.ItemId}!");
ah.Sold     += e => Toast($"Sold for {e.Amount} {e.Currency}");
ah.Returned += e => Toast("Listing expired — item returned");

string id = await ah.SellAsync("epic_sword", 1, minBid: 500, durationSeconds: 3600, buyout: 5000);
foreach (var l in await ah.BrowseAsync()) ShowRow(l);
await ah.BidAsync(someListingId, 600);
await ah.BuyoutAsync(someListingId);

API

Server: server.UseAuction(InventoryServer, WalletServer)AuctionServer (holds listings, runs the settlement timer; Dispose() stops it). Client: client.UseAuction()AuctionClient

Member Purpose
BrowseAsync() active listings
SellAsync(itemId, count, minBid, durationSeconds, buyout = 0, currency = "gold") list (escrows the item)
BidAsync(listingId, amount) / BuyoutAsync(listingId) bid / instant-buy (escrows currency)
CancelAsync(listingId) cancel your bid-free listing
event Outbid / Won / Sold / Returned outcomes

InventoryRuntime.Enable() + WalletRuntime.Enable() + AuctionRuntime.Enable() — one-time bootstrap.

Notes

  • Rides the unified SetNet.Protocol messaging layer on the Channels.Auction channel (all modules share one envelope wire type, 65447) — no per-module wire ids to reserve. Serializer-agnostic: the control protocol is hand-framed byte[], your payloads use your SetNetSerializer.
  • Escrow everywhere. The item leaves the seller's inventory at listing; each bid withdraws currency and refunds the prior bidder; settlement grants item↔currency. Nothing is created or destroyed — a cancel/expiry returns the item, an outbid returns the money.
  • Settlement runs on a ~1 s timer; a buyout settles instantly. Cancel is only allowed before the first bid.
  • Persistence. Listings and escrow live in memory here; back SetNet.Inventory/SetNet.Wallet with durable stores and persist listings yourself if auctions must survive a restart.
  • Node-local. Listings live on the auction node. For a cluster, run one auction endpoint (or shard sellers/buyers to it) so escrow stays consistent.

Documentation & source

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 85 8/5/2026