Mint Steam auth tickets client-side — the input for RegisterPlayerWithSteam
The Michitai.Multiplayer.Steam classes load the Steamworks flat API directly — no Steamworks.NET or Facepunch package needed. Required files:
steam_api64.dll from the Steamworks SDK redistributable_bin/win64 → Assets/Plugins/x86_64/ (x86 builds: steam_api.dll → Assets/Plugins/x86/)steam_appid.txt at the project root and beside the built exe — just the AppID as text (480/Spacewar for development)SteamTicket.Initialize() returns falseCallbacks are pumped automatically: SteamBehaviour self-creates before the first scene and calls RunFrame() per Update plus Shutdown() on quit.
public static class SteamTicket
{
static bool Available { get; } // SteamAPI_InitFlat succeeded
static ulong SteamId { get; } // SteamID64, 0 when unavailable
static string PersonaName { get; }
static int InitResult { get; } // ESteamAPIInitResult, -1 when never attempted
static string InitError { get; } // why init failed, or null
static bool Initialize(); // idempotent; false = no Steam client
static Task<SteamAuthTicket> GetAuthTicketAsync(
string identity = "michitai",
CancellationToken ct = default);
static void RunFrame(); // per-frame pump (SteamBehaviour calls it)
static void Shutdown();
}
public static class SteamFriends
{
static bool Available { get; } // SteamTicket.Available
static List<SteamFriend> GetFriends(bool includeAll = false);
static bool SetRichPresence(string key, string value);
static string GetFriendRichPresence(ulong steamId, string key);
static bool SetJoinConnectString(string connect); // rich presence "connect"
static void ClearJoinConnectString();
static void OpenInviteDialog(string connectString);// overlay invite picker
static void OpenOverlay(string dialog = "friends");
static void OpenFriendProfile(ulong steamId);
static void SetPlayedWith(ulong steamId);
static string GetLaunchConnectString(string[] args = null); // "+connect" param
}
// Accept side — on SteamTicket:
static event Action<ulong, string> SteamTicket.RichPresenceJoinRequested;
Friend list, persona states, rich presence and the overlay invite dialog — all backed by the same Steamworks flat bindings, no extra packages.
using Michitai.Multiplayer.Steam;
if (!SteamTicket.Initialize())
goto offline; // no Steam client — game decides the offline policy
using (var ticket = await SteamTicket.GetAuthTicketAsync("michitai"))
{
var reg = await Players.RegisterPlayerWithSteam<PlayerData>(
client, ticket.Hex, "michitai", SteamTicket.PersonaName);
playerToken = reg.private_key;
} // Dispose cancels the ticket handle — always dispose
Ticket rules:
steam_identity — keep "michitai"