Yet another C# steamworks interop library.
Check the example project here or follow the steps below.
First, install the base package SteamworksSharp
and SteamworksSharp.Native
.
If you are developing for a x86
platform (most likely not), install;
SteamworksSharp.Native.Windows_x86
SteamworksSharp.Native.Linux_x86
SteamworksSharp.Native.Osx_x86
If you are developing for a x64
platform, install;
SteamworksSharp.Native.Windows_x64
SteamworksSharp.Native.Linux_x64
The native packages provide the necessary steam binaries to use the library.
First, you have to initialize SteamNative
.
SteamNative.Initialize();
This will load the native steam binaries from the installed NuGet packages from the installation step. It will either succeed or throw an exception telling you that the required binary could not be found.
Now you have to initialize SteamApi
.
var result = SteamApi.Initialize(480); // Replace 480 with your appid.
If the result
is false
, you can not use the library. Either the native library for your platform could not be found, steam is not running or the steam_appid.txt
content is wrong.
If you are sure that you have done everything correctly, open the
steam_appid.txt
in a hex editor. Make sure it does not contain a byte order mark (BOM), which looks likeEF BB BF
. If it does, remove it and you are good to go.
You can also check if steam is open using;
var result = SteamApi.IsSteamRunning();
Why not?
Do whatever you want a.k.a. MIT. (Except for the steam binaries)