Facepunch.Steamworks Wiki

Revision Difference

#517221

<title>Facepunch.Steamworks</title>⤶ ⤶ # What Is Steamworks?⤶ ⤶ Steamworks is a set of API's made available by Valve to allow developers to create integrations with Steam.⤶ ⤶ This ranges from the simple things like getting the local player's name, to more complicated things like server lists and UGC (Workshop Stuff).⤶ ⤶ # What is Facepunch.Steamworks?⤶ ⤶ Valve's Steamwork library is written in C++. Due to the popularity of Unity a lot of game development is now done in C#.⤶ ⤶ [Facepunch.Steamworks](https://github.com/Facepunch/Facepunch.Steamworks) is a C# wrapper on top of Valve's steamwork library.⤶ ⤶ # How does it differ from Steamworks.Net?⤶ ⤶ [Steamworks.NET](https://steamworks.github.io/) aims to be a faithful wrapper with the C++ version. Facepunch.Steamworks is a re-interpretation of the Api in a C# world. Here's an example⤶ ⤶ ⤶ **Getting Friends List on Steamworks.Net**:⤶ ⤶ ```csharp⤶ int friendCount = SteamFriends.GetFriendCount(EFriendFlags.k_EFriendFlagImmediate);⤶ Debug.Log("[STEAM-FRIENDS] Listing " + friendCount + " Friends.");⤶ for (int i = 0; i < friendCount; ++i) {⤶ CSteamID friendSteamId = SteamFriends.GetFriendByIndex(i, EFriendFlags.k_EFriendFlagImmediate);⤶ string friendName = SteamFriends.GetFriendPersonaName(friendSteamId);⤶ EPersonaState friendState = SteamFriends.GetFriendPersonaState(friendSteamId);⤶ ⤶ Debug.Log(friendName + " is " + friendState);⤶ }⤶ ```⤶ ⤶ ⤶ **Getting Friends List on Facepunch.Steamworks**:⤶ ⤶ ```⤶ foreach ( var friend in SteamFriends.GetFriends() )⤶ {⤶ Console.WriteLine( "{friend.Id}: {friend.Name}" );⤶ Console.WriteLine( "{friend.IsOnline} / {friend.SteamLevel}" );⤶ }⤶ ```⤶ ⤶ ⤶ # Where can I get it?⤶ ⤶ You can download a release on the [Github Page](https://github.com/Facepunch/Facepunch.Steamworks).