Another fucking c# Steamworks implementation
Go to file
Garry Newman c9443b75f2 Fixes
2016-10-31 12:44:37 +00:00
.vs/config Interface versions 2016-10-26 16:37:16 +01:00
Facepunch.Steamworks Fixes 2016-10-31 12:44:37 +00:00
Facepunch.Steamworks.Test Generated callback registration 2016-10-30 20:52:42 +00:00
Generator Fixes 2016-10-31 12:44:37 +00:00
.gitattributes 💥🐫 Added .gitattributes & .gitignore files 2016-07-06 17:36:50 +01:00
.gitignore Ignores 2016-10-18 16:35:08 +01:00
Facepunch.Steamworks.sln Added Generator 2016-10-18 16:34:28 +01:00
LICENSE Update license with company/year 2016-10-11 07:40:42 -04:00
README.md Create README.md 2016-10-03 20:41:41 +01:00

Facepunch.Steamworks

Another fucking c# Steamworks implementation

Why

The Steamworks C# implementations I found that were compatible with Unity have worked for a long time. But I hate them all. For a number of different reasons.

  • They're not C#, they're just a collection of functions.
  • They're not up to date.
  • They require a 3rd party native dll.
  • They can't be compiled into a standalone dll (in Unity).
  • They have a license.

C# is meant to make things easier. So lets try to wrap it up in a way that makes it all easier.

What

So say you want to print a list of your friends?

foreach ( var friend in client.Friends.All )
{
    Console.WriteLine( "{0}: {1}", friend.Id, friend.Name );
}

But what if you want to get a list of friends playing the same game that we're playing?

foreach ( var friend in client.Friends.All.Where( x => x.IsPlayingThisGame ) )
{
    Console.WriteLine( "{0}: {1}", friend.Id, friend.Name );
}

You can view examples of everything in the Facepunch.Steamworks.Test project.

Usage

Client

Compile and add the library to your project. To create a client you can do this.

var client = new Facepunch.Steamworks.Client( 252490 );

Replace 252490 with the appid of your game. The client is disposable, so when you're done you should probably call..

client.Dispose();

Or use it in a using block if you can.

Server

To create a server do this.

var server = new Facepunch.Steamworks.Server( 252490, 0, 28015, true, "MyGame453" );

This will register a secure server for game 252490, any ip, port 28015. Again, more usage in the Facepunch.Steamworks.Test project.

Help

Wanna help? Go for it, pull requests, bug reports, yes, do it.

License

MIT - do whatever you want.