Bot releases are hidden (Show)
Mostly fixes, but I implemented the SteamNetworkSocket stuff into Rust so there's been some changes and additions there too.
Published by garrynewman over 4 years ago
We're now using Valve's latest SDK - version 1.48
Facepunch.Steamworks.Posix32/64.dll are now combined and we only have Facepunch.Steamworks.Posix.dll.
If you have Facepunch.Steamworks.Posix32.dll or Facepunch.Steamworks.Posix64.dll anywhere - delete them.
We're using the new ManualDispatch for events & callbacks. It's cleaner and friendlier to C#.
Nothing should change from an end user's point of view - but if you had other code, like c++ code or something that is using the Steam callback code - it's not going to work anymore.
We're back to using the provided flat functions instead of recreating the internal classes. Valve put a lot of work into cleaning this up for us and it's now a lot cleaner, friendlier and feature complete.
This has also meant that we can now support 32bit platforms properly again.
There's a bunch of new examples and usage help on the wiki !
Published by garrynewman about 5 years ago
A big change here is that the dlls are now split between Posix (Linux+Mac) and Windows. This simplified some of the code paths internally, but it also prevents some (non harmful) warnings in Unity which looks for the other platforms libraries.
We've been testing this version with Rust for a while with a new IL2CPP compile, so have managed to work out and fix a few bugs related to it. This means that if you're using Unity and want to ship a IL2CPP build with Steamworks, it should no longer be an issue.
Published by garrynewman over 5 years ago
Hey guys - I've dropped the preview in this version because we've been running it in Rust for a month without any real problems.
If you're using Unity and want to see how to use some stuff, there's a test repo here.
Published by garrynewman over 5 years ago
Facepunch.Steamworks v2.0 is an almost total rewrite of the previous version of Facepunch.Steamworks.
I felt that we should be using global static classes to make things easier, and that we were being too heavy handed in some places. This version stays a bit more faithful to the regular API, while making things a bit easier.
We're using async for callbacks too - which makes things a lot less shitty.
var leaderboard = await SteamUserStats.FindLeaderboardAsync( "Testleaderboard" );
var friendScores = await leaderboard.Value.GetScoresFromFriendsAsync();
foreach ( var e in friendScores )
{
Console.WriteLine( $"{e.GlobalRank}: {e.Score} {e.User}" );
}
I've implemented this into Rust on the staging branch. This has meant I've added and tested everything that Rust is using, and it's being actively tested and used on Windows, Linux and Mac.
Valve's new netcode stuff is implemented, but not tested. I've tried to keep it as relatively raw as possible while keeping it relatively simple to use.
This should get better over the next few months because I intend to try replacing our current Raknet implementation with it in Rust, and also adding netcode from scratch into one of our prototypes using it.
Creating a normal socket on any/all ip addresses on port 21893:
private class MySocketInterface : SocketInterface
{
public override unsafe void OnMessage( Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel )
{
// Handle Incoming Message
}
}
var mysocket = SteamNetworkingSockets.CreateNormalSocket<MySocketInterface>( Data.NetAddress.AnyIp( 21893 ) );
Or using Valve's relay system (clients connect via the server's steamid)
var mysocket = SteamNetworkingSockets.CreateRelaySocket<MySocketInterface>();
Connecting to a normal thing
private class TestConnectionInterface : ConnectionInterface
{
public override unsafe void OnMessage( IntPtr data, int size, long messageNum, long recvTime, int channel )
{
// Handle messages from server
}
}
var connection = SteamNetworkingSockets.ConnectNormal<MyConnectionInterface>( NetAddress.From( "127.0.0.1", 21893 ) )
Or via Steam relay
var connection = SteamNetworkingSockets.ConnectRelay<TestConnectionInterface>( serverSteamId );
SocketInterface and ConnectionInterface have a few different methods you can override. SocketInterface tries to maintain a good list of connecting/connected clients to easy access.
Published by garrynewman over 5 years ago
This is a preview of version 2 of Facepunch.Steamworks. This has had a decent enough testing across Windows, Osx and Linux, but it could do with more before it comes out of alpha.
Things have changed in Unity and C# since I made the original library. We now have a decently up to date .net version and can use some more advanced features that wasn't possible before.
Big changes here:
Let me know if there are any problems.
Published by garrynewman almost 7 years ago
So some breaking changes there. Biggest one you'll probably run into is GetAvatar. If you're too lazy to fuck about just change the calls to GetCachedAvatar instead. The benefit of using GetAvatar with the callback is that if Steam hasn't downloaded that user's avatar, it'll download it so you don't have to test and refresh download manually.
Published by garrynewman over 7 years ago
Some people found it difficult to create a server that was actually visible in the previous versions. This was because to get your server listed you needed to fill in GameDescription, ModDir and Product. Since these things can't be changed at any point beyond initialization I've refactored the way servers are created.
Old Way:
var server = new Facepunch.Steamworks.Server( 252490, 0, 30003, 30004, 30005, false, "VersionString" )
New Way:
var serverInit = new ServerInit( "rust", "Rust" );
serverInit.GamePort = 28015;
serverInit.Secure = true;
serverInit.QueryPort = 28016;
var server = new Facepunch.Steamworks.Server( 252490, serverInit )
This feels like a common sense change, making the process a bit more self documenting and a lot more foolproof. We've been using this new initialization method in Rust for a couple of weeks, so it's all tried and tested.
If you're using the library and are missing features - open a new issue and we'll try to add it as soon as possible.
Published by garrynewman over 7 years ago
Published by garrynewman over 7 years ago
Added leader-boards, a ton of App functions and fixed a bunch of bugs.
Published by garrynewman over 7 years ago
Many many changes. Should better support 32bit systems. Uses Steamworks SDK v1.39.
Published by garrynewman almost 8 years ago
Newly generated code. This should better support osx/linux.
Published by garrynewman almost 8 years ago
Obviously incomplete, but has all of the basics. Holla if you need help.