2972e59e00
* Fixed dependency * Updates to NeoDictionary * Changes to NeoDictionary * Started working on a Git implementation to integrate into Game Engines in the future * Added commit functionality to the git library * New changes * Added select for NeoDictionary.cs * Fixed issue with previous new method * Added a Benchmarking Tool to be used mostly in game engines * Added IndexOf to NeoDictionary.cs * Added new method for BenchmarkUtility.cs * added an instacedobject class * Added a new shuffle method for lists * fixed return type * Added new Changelog generator * Added new Game logic library to assist with game projects * Added Web Project * Added Nuget package configs * Add workflow for publishing game library NuGet package * Add README for OmegaLeo's Helper Library * Updated Website to reflect all libraries * Fixed missing library in Changelog * Added Contributing and Code of Conduct * Fixed web project * new documentation changes * fix packages * Fixed DocumentationHelper package dependencies * Added Serilog * Added logging * Fixed documentation * Added logging for cache * fixed documentation * Updated README.md * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update OmegaLeo.HelperLib.Web/Controllers/HomeController.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update OmegaLeo.HelperLib.Web/Controllers/HomeController.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix error * changes for Github Packages * Cleanup * Started working on a SteamWorks integration * Added logging * Started working on a Steam library --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
103 lines
3.6 KiB
Markdown
103 lines
3.6 KiB
Markdown
# OmegaLeo's Helper Library - Steamworks
|
|
Lightweight Steamworks helper library for C# game projects.
|
|
|
|
This package provides a simple Steam API wrapper for common tasks like initialization, callback processing, player name lookup, and achievements.
|
|
|
|
## Features
|
|
- Simple Steam initialization via `SteamManager.Instance`
|
|
- Per-frame callback runner with `SteamManager.Update()`
|
|
- Safe shutdown with `SteamManager.Shutdown()`
|
|
- Player persona name access with `SteamManager.GetSteamName()`
|
|
- Achievement helpers via `AchievementManager`
|
|
- Steam Workshop (UGC) helpers via `SteamManager.Instance.Ugc`
|
|
- Steam Remote Play helpers via `SteamManager.Instance.RemotePlay`
|
|
- Additional interface managers: Controller, Friends, GameServer, Input, Inventory, Matchmaking, Parties, RemoteStorage, Screenshots, UserStats, Utils, Video, and more.
|
|
- Includes native Steam runtime files in NuGet package `runtimes/`
|
|
|
|
## Installation
|
|
```bash
|
|
dotnet add package OmegaLeo.HelperLib.Steamworks
|
|
```
|
|
|
|
## Quick Start
|
|
```cs
|
|
using OmegaLeo.HelperLib.Steamworks;
|
|
|
|
// Optional but recommended for local/editor runs.
|
|
SteamManager.ConfigureAppId(480); // Replace with your real AppId.
|
|
|
|
var steam = SteamManager.Instance;
|
|
if (steam.IsSteamworksInitialized)
|
|
{
|
|
Console.WriteLine($"Welcome {steam.GetSteamName()}");
|
|
}
|
|
|
|
// Call this in your game loop (Unity Update, Godot _Process, etc.)
|
|
steam.Update();
|
|
|
|
var achievements = new AchievementManager();
|
|
achievements.UnlockAchievement("ACH_FIRST_WIN");
|
|
|
|
// Steam Workshop (UGC) example
|
|
var subscribedIds = steam.Ugc.GetSubscribedItems();
|
|
|
|
// Steam Remote Play example
|
|
var remotePlaySessionCount = steam.RemotePlay.GetSessionCount();
|
|
|
|
steam.Shutdown();
|
|
```
|
|
|
|
## More API Examples
|
|
```cs
|
|
var steam = SteamManager.Instance;
|
|
|
|
// Friends / rich presence
|
|
steam.Friends.SetRichPresence("status", "In Match");
|
|
steam.Friends.SetRichPresence("map", "Arena_01");
|
|
var friendName = steam.Friends.GetFriendPersonaName(76561198000000000UL);
|
|
var friendStatus = steam.Friends.GetFriendRichPresence(76561198000000000UL, "status");
|
|
|
|
// Remote storage
|
|
var saveBytes = System.Text.Encoding.UTF8.GetBytes("save-data-v1");
|
|
steam.RemoteStorage.FileWrite("save_slot_1.dat", saveBytes);
|
|
if (steam.RemoteStorage.FileRead("save_slot_1.dat", out var loadedBytes))
|
|
{
|
|
var loadedText = System.Text.Encoding.UTF8.GetString(loadedBytes);
|
|
}
|
|
|
|
// User stats
|
|
steam.UserStats.SetStatInt32("KILLS", 25);
|
|
steam.UserStats.StoreStats();
|
|
steam.UserStats.RequestGlobalStats(7);
|
|
|
|
// UGC update convenience APIs (existing item)
|
|
var options = new SteamUgcItemUpdateOptions
|
|
{
|
|
Title = "My Workshop Item",
|
|
Description = "Updated description.",
|
|
Tags = new[] { "map", "coop" },
|
|
ContentFolder = "/absolute/path/to/content",
|
|
PreviewFile = "/absolute/path/to/preview.png"
|
|
};
|
|
var submitCallHandle = steam.Ugc.UpdateItem(480, 123456789012345678UL, options, "Updated content", out var failedStep);
|
|
|
|
// Fluent session alternative
|
|
var session = steam.Ugc.BeginUpdateSession(480, 123456789012345678UL)
|
|
.WithTitle("My Workshop Item")
|
|
.WithDescription("Updated description")
|
|
.WithTags("map", "coop")
|
|
.WithContentFolder("/absolute/path/to/content")
|
|
.WithPreviewFile("/absolute/path/to/preview.png");
|
|
var submitCallHandle2 = session.Submit("Updated content", out var failedStep2);
|
|
```
|
|
|
|
## Notes
|
|
- Steam must be running and your app must be launched in a valid Steam context.
|
|
- Configure your AppId before first access to `SteamManager.Instance`.
|
|
- `SteamManager.Update()` should be called continuously during runtime.
|
|
- If Steam is unavailable, `GetSteamName()` falls back to `"Player"`.
|
|
|
|
## License
|
|
Open source under the AGPL v3 License. See the repository `LICENSE` for details.
|
|
|