SetNet.Guilds 1.2.0

dotnet add package SetNet.Guilds --version 1.2.0
                    
NuGet\Install-Package SetNet.Guilds -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.Guilds" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SetNet.Guilds" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="SetNet.Guilds" />
                    
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.Guilds --version 1.2.0
                    
#r "nuget: SetNet.Guilds, 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.Guilds@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.Guilds&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=SetNet.Guilds&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.Guilds

Guilds / clans for SetNet — roles and a shared bank.

Create or join a guild, manage members with three roles (member / officer / leader), and share a guild bank — which is just a guild-keyed inventory in the same SetNet.Inventory hub, so deposits and withdrawals are atomic item moves with the same anti-dupe guarantees. Anyone deposits; officers and the leader withdraw and kick; the leader promotes, transfers, and disbands. Added by composition — no base class.

Install

dotnet add package SetNet
dotnet add package SetNet.Inventory
dotnet add package SetNet.Guilds

Usage

Call InventoryRuntime.Enable() and GuildRuntime.Enable() once at startup.

// server
InventoryRuntime.Enable(); GuildRuntime.Enable();
var inventory = server.UseInventory();
server.UseGuilds(inventory);

// client
InventoryRuntime.Enable(); GuildRuntime.Enable();
var guilds = client.UseGuilds();
guilds.MemberJoined += key => Log($"{key} joined");
guilds.MemberLeft   += key => Log($"{key} left");
guilds.Disbanded    += ()  => Log("guild disbanded");

string id = await guilds.CreateAsync("The Night Watch");   // creator = leader
// another player:
await guilds.JoinAsync(id);

await guilds.PromoteAsync(memberKey, GuildRole.Officer);
await guilds.BankDepositAsync("gold", 1000);               // anyone can deposit
await guilds.BankWithdrawAsync("gold", 200);               // officer/leader only

API

Server: server.UseGuilds(InventoryServer, IGuildStore?) → GuildServer. Client: client.UseGuilds() → GuildClient

Member Purpose
CreateAsync(name) / JoinAsync(guildId) / LeaveAsync() membership
PromoteAsync(memberKey, role) / KickAsync(memberKey) management (leader / officer+)
ListMembersAsync() members + roles
BankDepositAsync(itemId, count) / BankWithdrawAsync(...) / BankListAsync() shared bank
event MemberJoined / MemberLeft / Disbanded membership changes

InventoryRuntime.Enable() + GuildRuntime.Enable() — one-time bootstrap.

Notes

  • Rides the unified SetNet.Protocol messaging layer on the Channels.Guilds 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.
  • The bank is a keyed inventory. It lives under guild:<id> in your SetNet.Inventory hub — deposits/withdrawals go through TryRevokeAsync/GrantAsync, so they're atomic and can't dupe. Persist it by using a durable IInventoryStore.
  • Role rules. Deposit: any member. Withdraw / kick: officer or leader (and you can't kick an equal/higher rank). Promote / transfer / disband: leader. Promoting someone to Leader transfers leadership (you become officer).
  • Leaving. A leader who leaves passes leadership to the highest-ranked remaining member; the last member leaving disbands the guild and gets the bank contents back (nothing is destroyed).
  • Persistence. Default MemoryGuildStore is per-process; implement IGuildStore (and a durable IInventoryStore) for guilds and banks that survive restarts.

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 132 8/5/2026