Giter Site home page Giter Site logo

facepunch.steamworks's Introduction

Facepunch.Steamworks

Another fucking c# Steamworks implementation

Build All

Features

Feature Supported
Windows
Linux
MacOS
Unity Support
Unity IL2CPP Support
Async Callbacks (steam callresults)
Events (steam callbacks)
Single C# dll (no native requirements apart from Steam)
Open Source
MIT license
Any 32bit OS

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're not free
  • They have a restrictive license.

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

What

Get your own information

    SteamClient.SteamId // Your SteamId
    SteamClient.Name // Your Name

View your friends list

foreach ( var friend in SteamFriends.GetFriends() )
{
    Console.WriteLine( $"{friend.Id}: {friend.Name}" );
    Console.WriteLine( $"{friend.IsOnline} / {friend.SteamLevel}" );
    
    friend.SendMessage( "Hello Friend" );
}

App Info

    Console.WriteLine( SteamApps.GameLanguage ); // Print the current game language
    var installDir = SteamApps.AppInstallDir( 4000 ); // Get the path to the Garry's Mod install folder

    var fileinfo = await SteamApps.GetFileDetailsAsync( "hl2.exe" ); // async get file details
    DoSomething( fileinfo.SizeInBytes, fileinfo.Sha1 );

Get Avatars

    var image = await SteamFriends.GetLargeAvatarAsync( steamid );
    if ( !image.HasValue ) return DefaultImage;

    return MakeTextureFromRGBA( image.Value.Data, image.Value.Width, image.Value.Height );

Get a list of servers

using ( var list = new ServerList.Internet() )
{
    list.AddFilter( "map", "de_dust" );
    await list.RunQueryAsync();

    foreach ( var server in list.Responsive )
    {
        Console.WriteLine( $"{server.Address} {server.Name}" );
    }
}

Achievements

List them

    foreach ( var a in SteamUserStats.Achievements )
    {
        Console.WriteLine( $"{a.Name} ({a.State})" );
    }	

Unlock them

    var ach = new Achievement( "GM_PLAYED_WITH_GARRY" );
    ach.Trigger();

Voice

    SteamUser.VoiceRecord = KeyDown( "V" );

    if ( SteamUser.HasVoiceData )
    {
        var bytesrwritten = SteamUser.ReadVoiceData( stream );
        // Send Stream Data To Server or Something
    }

Auth

    // Client sends ticket data to server somehow
    var ticket = SteamUser.GetAuthSessionTicket();

    // server listens to event
    SteamServer.OnValidateAuthTicketResponse += ( steamid, ownerid, rsponse ) =>
    {
        if ( rsponse == AuthResponse.OK )
            TellUserTheyCanBeOnServer( steamid );
        else
            KickUser( steamid );
    };

    // server gets ticket data from client, calls this function.. which either returns
    // false straight away, or will issue a TicketResponse.
    if ( !SteamServer.BeginAuthSession( ticketData, clientSteamId ) )
    {
        KickUser( clientSteamId );
    }

    //
    // Client is leaving, cancels their ticket OnValidateAuth is called on the server again
    // this time with AuthResponse.AuthTicketCanceled
    //
    ticket.Cancel();

Utils

    SteamUtils.SecondsSinceAppActive;
    SteamUtils.SecondsSinceComputerActive;
    SteamUtils.IpCountry;
    SteamUtils.UsingBatteryPower;
    SteamUtils.CurrentBatteryPower;
    SteamUtils.AppId;
    SteamUtils.IsOverlayEnabled;
    SteamUtils.IsSteamRunningInVR;
    SteamUtils.IsSteamInBigPictureMode;

Workshop

Download a workshop item by ID

    SteamUGC.Download( 1717844711 );

Get a workshop item information

    var itemInfo = await Ugc.Item.Get( 1720164672 );

    Console.WriteLine( $"Title: {itemInfo?.Title}" );
    Console.WriteLine( $"IsInstalled: {itemInfo?.IsInstalled}" );
    Console.WriteLine( $"IsDownloading: {itemInfo?.IsDownloading}" );
    Console.WriteLine( $"IsDownloadPending: {itemInfo?.IsDownloadPending}" );
    Console.WriteLine( $"IsSubscribed: {itemInfo?.IsSubscribed}" );
    Console.WriteLine( $"NeedsUpdate: {itemInfo?.NeedsUpdate}" );
    Console.WriteLine( $"Description: {itemInfo?.Description}" );

Query a list of workshop items

    var q = Ugc.Query.All
                    .WithTag( "Fun" )
                    .WithTag( "Movie" )
                    .MatchAllTags();

    var result = await q.GetPageAsync( 1 );

    Console.WriteLine( $"ResultCount: {result?.ResultCount}" );
    Console.WriteLine( $"TotalCount: {result?.TotalCount}" );

    foreach ( Ugc.Item entry in result.Value.Entries )
    {
        Console.WriteLine( $"{entry.Title}" );
    }

Query items created by friends

    var q = Ugc.UserQuery.All
                        .CreatedByFriends();

Query items created by yourself

    var q = Ugc.UserQuery.All
                        .FromSelf();

Publish your own file

    var result = await Ugc.Editor.NewCommunityFile
                      .WithTitle( "My New FIle" )
                      .WithDescription( "This is a description" )
                      .WithContent( "c:/folder/addon/location" )
                      .WithTag( "awesome" )
                      .WithTag( "small" )
                      .SubmitAsync( iProgressBar );

Steam Cloud

Write a cloud file

    SteamRemoteStorage.FileWrite( "file.txt", fileContents );

Read a cloud file

    var fileContents = SteamRemoteStorage.FileRead( "file.txt" );

List all files

    foreach ( var file in SteamRemoteStorage.Files )
    {
        Console.WriteLine( $"{file} ({SteamRemoteStorage.FileSize(file)} {SteamRemoteStorage.FileTime( file )})" );
    }

Steam Inventory

Get item definitions

    foreach ( InventoryDef def in SteamInventory.Definitions )
    {
        Console.WriteLine( $"{def.Name}" );
    }

Get items that are for sale in the item shop

    var defs = await SteamInventory.GetDefinitionsWithPricesAsync();

    foreach ( var def in defs )
    {
        Console.WriteLine( $"{def.Name} [{def.LocalPriceFormatted}]" );
    }

Get a list of your items

    var result = await SteamInventory.GetItems();

    // result is disposable, good manners to dispose after use
    using ( result )
    {
        var items = result?.GetItems( bWithProperties );

        foreach ( InventoryItem item in items )
        {
            Console.WriteLine( $"{item.Id} / {item.Quantity} / {item.Def.Name} " );
        }
    }

Getting Started

Client

To initialize a client you can do this.

using Steamworks;

// ...

try 
{
    SteamClient.Init( 4000 );
}
catch ( System.Exception e )
{
    // Couldn't init for some reason (steam is closed etc)
}

Replace 4000 with the appid of your game. You shouldn't call any Steam functions before you initialize.

When you're done, when you're closing your game, just shutdown.

SteamClient.Shutdown();

Server

To create a server do this.

var serverInit = new SteamServerInit( "gmod", "Garry Mode" )
{
    GamePort = 28015,
    Secure = true,
    QueryPort = 28016
};

try
{
    Steamworks.SteamServer.Init( 4000, serverInit );
}
catch ( System.Exception )
{
    // Couldn't init for some reason (dll errors, blocked ports)
}

Help

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

You can also hit up the Steamworks Thread for help/discussion.

We also have a wiki you can read and help fill out with examples and advice.

License

MIT - do whatever you want.

facepunch.steamworks's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facepunch.steamworks's Issues

(Leaderboard) Unable to determine why a score is not updated

Hey, all. I'm in the process of converting a working Steamworks.NET leaderboard implementation to Facepunch.Steamworks so I'm familiar with the steamworks stuff. I would like to move on to inventory management later, and I've read others talk about how awesome Facepunch.Steamworks is for that. So, I've begun!

First: THANK YOU to whoever decides to help me. Helping noobs sucks. I know.

Issue: User scores are not getting added to the leaderboard. The success on callback is "false" and I have no clue why it's happening. I wish I had some sort of additional logging, but I'm simply at a loss. I've scoured the Tests Cases on this project and I'm now stuck. I'm sure it's something I'm doing wrong, but I can't figure it out for the life of me and I've been stuck long enough now that I'm willing to ask for help.

  1. My leaderboards can be queried using Facepunch.Steamworks just fine
  2. Yes, my appidtxt is in the root of my project.
  3. Yes, I'm calling client.Update() in Update() on a singleton game object (and I've confirmed it's still cookin' when I get this success=false -- though, I suspect if this wasn't happening I wouldn't even get the callback)
  4. I am logged into steam, but I'm running this out of a Unity editor (I also tried making a game build too - same behavior)

My leaderboard init code (called at game startup). This stuff works fine, no errors (leaderboard object is set to IsValid)

        private void Start()
        {
            worldUIHelper = GetComponent<WorldUIHelper>();
            foreach (string leaderboardName in new string[] { MOLE_MOUNTAIN, CLIFF_CASTLE })
            {
                Leaderboard leaderBoard;
                if (ALL_LEADERBOARDS.ContainsKey(leaderboardName))
                {
                    leaderBoard = ALL_LEADERBOARDS[leaderboardName];
                }
                else
                {
                    leaderBoard = client.GetLeaderboard(leaderboardName, Client.LeaderboardSortMethod.Ascending, Client.LeaderboardDisplayType.Numeric);
                    ALL_LEADERBOARDS.Add(leaderboardName, leaderBoard);
                }
                if (leaderBoard != null && !leaderBoard.IsError)
                {
                    StartCoroutine(DownloadLeaderboard(leaderBoard));
                }
            }
        }

        private IEnumerator DownloadLeaderboard(Leaderboard leaderBoard)
        {
            while (!leaderBoard.IsValid)
            {
                client.Update(); // This probably isn't necessary
                yield return new WaitForEndOfFrame();
            }
            Debug.Log("Downloading status of leaderboard: " + leaderBoard.Name);
            leaderBoard.FetchScores(Leaderboard.RequestType.GlobalAroundUser, 0, 100, (bool success, Leaderboard.Entry[] results) =>
            {
                if (!success)
                {
                    Debug.LogError("Leaderboard didn't download: " + leaderBoard.Name);
                }
                if (results != null && leaderBoard.Name == MOLE_MOUNTAIN) // TODO: multiple leaderboards on single GUI
                {
                    foreach (Leaderboard.Entry result in results)
                    {
                        AddLeader(result.Name, "" + result.Score);
                    }
                }
            });
        }

My update score method. It wasn't always static, but I was trying different things and I'm just trying to "make it work" right now.

        public static void UpdateScore(string leaderboardName, int score)
        {
            bool tried = false;
            if (ALL_LEADERBOARDS.ContainsKey(leaderboardName))
            {
                Leaderboard leaderboard = ALL_LEADERBOARDS[leaderboardName];
                // Yes, the leaderboard IsValid=true, IsError=false, IsQuerying=false
                tried = leaderboard.AddScore(false, score, null, (bool success, Leaderboard.AddScoreResult result) => {
                    if (!success)
                    {
                        // This is the output that I see in my Unity logs
                        Debug.LogError("Score not updated: " + leaderboard.Name + " => " + score);
                    }
                });
            }
            if (!tried)
            {
                Debug.LogError("Leaderboard not valid for update: " + leaderboardName + " => " + score);
            }
        }

Is there any way to increase the visibility of what's going on?

Callbacks?

I'm trying to register the Game rich presence join callback. Where would I register it?

Steam Client Crashes with access violation in Unity Build

I've implemented achievements in my game and it works fine in the editor however when I build the game and run it, the game crashes. Here's the logs that were generated

error.log
https://pastebin.com/reYGKhHv
output_log.txt
https://pastebin.com/hj9YS5cU

I think the core error from the log is here
steamclient.dll caused an Access Violation (0xc0000005) in module steamclient.dll at 0023:386b34da.

I tried multiple builds where I commented out pieces of code and I found that the following line caused the error
SteamClient = new Client( ...... ); //went ahead and dotted out our app id

Any idea what I could do differently?

NativeInterface.InitClient() returning false on Ubuntu (32bit)

Hi there!
Thanks for this great C# implementation of Steamworks, it's doing a great job for us atm, however running our Unity game on a Ubuntu machine is causing some problems...

We are getting "Client not setup okay" printed into log (see code below). However Client.Dispose() is getting called before it is called in quit() (see other code below), as in the log I can see "BShutdownIfAllPipesClosed returned false" printed before "Client not setup okay", and this is printed in NativeInterface.Dispose(). So I think NativeInterface.InitClient() is returning false.

 hPipe = api.SteamAPI_GetHSteamPipe();
            if ( hPipe == 0 )
                return false;

I think this is where it is returning false, as at the very top of the log I also see the line:
"Assertion Failed: IsValidHSteamPipe(hSteamPipe)"
(This is the same error being caused by the other issue posted, however the assertion fail isn't happening in Dispose)

Unity Awake() code

void Awake() {
	//.....other init code
	mClient = new Client(APPID);
	if(!mClient.IsValid) {
		Debug.Log("Client not setup okay");
		quit();
		return;
	}
	//.....other init code
}
void quit() {
		dispose();
#if UNITY_EDITOR
		UnityEditor.EditorApplication.isPlaying = false;
#else
		Application.Quit();
#endif
	}

Cheers!

Project doesn't build under Unity

I'm trying to integrate the library directly into Unity, not as a standalone .dll, to make debugging and modifications easier. Unfortunately it relies (in a very loose sense) on some syntactic sugar features that are part of .NET 6.0.

Would the project maintainers be okay with stripping these out and bringing the project to a state where it can be embedded directly in a Unity project?

Note that, if you're okay with the idea but don't want to spend the time yourself, I'm happy to do it for you and send a pull request. I just don't want to go forking the project if it's something unwanted.

SetAchievement / GetAchievement?

Are SetAchievement/GetAchievement already exposed somewhere in the SteamClient implementation (and I'm just overlooking them)? I see them in the SteamUserStats native wrapper, but don't think I can easily call into there.

I guess the other achievement functions wouldn't be handy to have just in case, but honestly I doubt we'll have time/energy to do anything beyond simple triggering in-game. The Steam overlay interface can take care of the rest...

TriggerItemDrop() equivalent

Hi!
Is there an equivalent for SteamInventory.TriggerItemDrop(out m_SteamInventoryResult, SteamItemDef_t) and what Inventory.PlaytimeHeartbeat() do exactly?

Great work anyway, keep going!

Workshop Upload Progress always 0

Workshop.Editor.Progress, Workshop.Editor.BytesUploaded and Workshop.Editor.BytesTotal always return 0.
This could be the case because CreateItem is never set to null, it's only disposed here.

Unity Constantly crashing

It crashed almost every time i hit the play button (Only when i am using this, if i remove the script it works fine)
My code: the default unity test script

Add ResetAllUserStats ?

Just add one function to Stats.cs? ( Sorry, bit too lazy to do a pull request for this right now).

    public bool ResetAllUserStats(bool shouldResetAchievementsToo)
    {
        return client.native.userstats.ResetAllStats(
            bAchievementsToo: shouldResetAchievementsToo);
    }

Compile. How?

You write "Compile and add the library to your project."

Does this only work in Visual Studio? Or should I be able to compile this under Mono ( or using Rider) as well? Getting some errors when trying to compile in Rider.

Unity 3D crashing

Hello!
Unity version: 5.5.2f1 (latest)
Facepunch.Steamworks version: the lastes on AssetsStore

My Unity 3D crashes when I try to call client variable without surrounding the part of code with a
"using (client) { }"

I don't want to use it because it seems to be the cause of the lag in my game when I get usernames and avatars of 6 players (in my scoreboard).

this is the crash.dmp : http://pastebin.com/Tyb6Bv9e

And this is error.log : http://pastebin.com/7F8kpCfY

Unit Tests Failing

In a new clone of the project, most unit tests are failing. The two successful tests are:

  • Server/Init
  • Server/StatsGet

After some debugging I found the bug inside the InitClient() method of Facepunch.Steamworks.Interop.NativeInterface.

Inside of this method the calls to Valve.Interop.NativeEntrypoints.Extended.SteamAPI_GetHSteamUser() and Valve.Interop.NativeEntrypoints.Extended.SteamAPI_GetHSteamPipe() both return zero.

That triggers the if ( pipe == 0 ) return false; guard clause which prevents client initialization.

Help

I have game made in unity and I have an app id for steam.
I tried using steam.net and It did not work for me so I looked for something a little more artist friendly.
I found facepunch unity package and got it to connect with steam via the test script
I have no idea were to go from here.

Server not listed on ServerList.Internet

Hello,

I started to use your wrapper to implement steamworks on my game but I have an issue with creating a steam lobby, the lobby seems correctly registred to steam (server.LoggedOn returns true) but I can't find the server, even without filters
I'm using the source from the Facepunch.Steamworks.Unity project

Here is the code of the server creation :

// SteamManager.APP_ID = 480 (same as steam_appid.txt)
// version = "0.25.0"
// SteamManager.SteamClient is instance of Client

server = new Server (SteamManager.APP_ID, 0, port, port, port, true, version);
server.LogOnAnonymous ();
server.MaxPlayers = maxPlayers;
server.ServerName = serverName ;
// some other settings & setKeys

ticket = SteamManager.SteamClient.Auth.GetAuthSessionTicket ();
if (!server.Auth.StartSession (ticket.Data, SteamManager.SteamClient.SteamId)) {
    Debug.LogWarning ("Auth failed on server creation");
}

Is something missing from the server creation ?

For the listing I simply use

SteamManager.SteamClient.ServerList.Internet ();

With or without filters

Thanks for your support

P2P Data - Is this really implemented?

Trying out some other features of the wrapper, can't seem to get a P2P message sent. Also curious to know if testing will work sending and receiving on the same steamid.

Init'd steam client, steamid shows up...

Setup listening to appropriate methods... (Channel 0)
steamClient.Networking.SetListenChannel(channel, true);
steamClient.Networking.OnConnectionFailed = OnConnectionFailed;
steamClient.Networking.OnIncomingConnection = OnIncomingConnection;
steamClient.Networking.OnP2PData = OnP2PData;

Send some data...
Texture2D texture = (Texture2D)image.mainTexture;
byte[] data = texture.GetRawTextureData();
steamClient.Networking.SendP2PPacket(steamClient.SteamId, data, data.Length, Networking.SendType.Reliable, channel);

But no activity from the "On..." methods. Is there something else that needs to get set-up?
I'm using an active and commercial appid.

Workshop Item Created and Modified invalid

When you query items from steam workshop the modified and created DateTime variables will always return 1/1/0001 12:02:29 AM. If you get the item from getItem it returns 1/1/0001 12:00:00 AM .

Leaderboards

Good Day

I require leaderboards for my game but unless I'm mistaken the api does not include leaderboards yet. I started to code my own with the intent to request a pull and add it to the project if I get it working in a nice easy way. Everything went very well from within Unity and my leaderboards worked perfectly but when I build my game the game crashes with an "steam_api.dll caused an Access Violation (0xc0000005)
in module steam_api.dll at 0023:5cbc7b80." error. I really noob with this and I'm hoping someone who knows a bit more about the steamworks sdk could point out my mistake.

I've attached my code. I created a completely new class Leaderboard.cs because I didn't want to mess to much with the original api. My code is still experimental but it works fine from Unity with the following code:

    LeaderboardSeason = steamClient.Leaderboards.GetLeaderoard("Sample Leaderboard");
    LeaderboardSeason.LoadLeaderboard();

    if (LeaderboardSeason.LeaderboardLoaded)
        LeaderboardSeason.DownloadEntries();

Leaderboard Class.docx

Thanks
Rousseau

ISteamAppList.GetAppName()?

It's a small thing but I want to get the name of the game a SteamFriend is playing with it's appid.
The Native method is ISteamAppList.GetAppName() and SteamAppList.GetAppName() with Steamworks.net.

I tried implementing it myself, but couldn't figure out how to return the System.Text.StringBuilder with the name.

macOS + Unity : DllNotFoundException: steam_api64.dll

Hello,

I'm having troubles integrating the Steamworks library into my Unity project. I downloaded it from the Asset Store and followed the readme instructions by moving the native DLLs from Native to my project root along with the appid file.

When I fire up Unity with the FacepunchSteamworksTest.cs component added, I get the dll not found error above.

One thing that caught my eye was the stack trace shows SteamNative.Platform+Win64.SteamApi_SteamAPI_Init (), which seemed odd considering I'm running on mac. Should these files be in a different location on a mac than for windows? I also noticed mono is reporting Unix as the Environment.OSVersion.Platform instead of MacOSX which seems contrary to the expectations of the code in SteamNative.Platform.cs. Not sure if that's an issue, but figured more information is better

OS: macOS Sierra 10.12.5
Unity: 5.6.1f1

Steam Achievement updates only during exit instead of after Trigger

I'm having an issue with Steam Achievements only updating after the game exits instead of updating when I call SteamClient.Achievements.Trigger(some_string).

I am calling SteamClient.Update (); in Update as well.

I'm using the Facepunch.Steamworks dll in this thread and my steam sdk version is 1.4.0

Callback for microtransactions?

Thanks for the great work, it has simplified things a lot!

Is there an example on how to use the MicroTxnAuthorizationResponse_t callback?
I am looking to add microtransactions, and the client needs to register when their transaction has succeeded so it can send the information to the purchase server for verification.

Mac Integration - How?

Having trouble getting this to work for our OSX client; which files + folders should go where? I've got the dylib and api dlls next to .app, to no success.

<3 FP

Any work being done on Lobby integration?

I see that a lot of the interface classes for Lobby functionality are in place but have no ties in Steamworks.NetCore outside of their wrappers in SteamNative.SteamMatchmaking. I'd be interested in taking a whack at it, but I wasn't sure if you all were working on them already for a push or a release. I'd also be interested to hear more about the general philosophy/coding style of the library so I could better contribute to it if possible. Thanks!

Having trouble removing/updating additional preview images from Workshop file

I have modified the source of Workshop.Editor.cs to accept an array of additional preview images (utilizing workshop.ugc.AddItemPreviewFile for each image). This is working (yay).

For my game, the desired behavior would be to clear all of the preview images from a workshop item, then add all of the new ones. However, when I update an existing workshop item, all of the old preview images still remain, and the new ones are added to that list.

To achieve the behavior I want, I would need to get the number of preview files using GetQueryUGCNumAdditionalPreviews and call workshop.ugc.RemoveItemPreview on each of them before adding the new preview images.

My question is, should I attempt to make this behavior generic to be merged into Facepunch.Steamworks, or should I just keep this as a local "hack" for my game? I would imagine other people would want similar functionality (the ability to add more than one preview image to a workshop item, and to clear the preview images from a workshop item on update).

Alternatively, if you already had different plans on how you wanted to implement this functionality, maybe you could enlighten me on a better solution.

Thanks!

Auth callback not firing more than one time.

I'm using session tickets. The OnAuthChange only gets called once. Is this by design? I couldn't find anything in the official steamworks docs about it. If this is by design, should I just cancel session tickets and request new ones whenever I want to check their status?

Update the version in the AssetStore.

Hey,
I just saw there are tons of new commits here... Great job!

The version in the Unity AssetStore was never updated since release (Nov 14, 2016).
Could you please upload the new version?

Thanks!

Score not added

Hello,
I've been trying figuring out for hours why my score is not uploaded to the leaderboard.
Have you got any idea?
this is my code:
` private String scoreboardName = "SWD9000_infinite";

private SteamScript steam;

private Leaderboard leaderBoard;


void Awake()
{
    steam = (SteamScript)FindObjectOfType(typeof(SteamScript));
    print(steam.getClient().AppId);
}

void Start()
{
    leaderBoard = steam.getClient().GetLeaderboard(scoreboardName, Client.LeaderboardSortMethod.Ascending, Client.LeaderboardDisplayType.Numeric);
}


public void post(int score)
{
    leaderBoard.AddScore(true, true, score);
    print("Published score");
}`

Unity 3D assets store new version

May you update the version in the assets store?
I tried compiling with Visual Studio 2017 and when I use the library in Unity I get this:
steamclient64.dll caused an Access Violation (0xc0000005) in module steamclient64.dll at 0033:5dea84b9.
Thanks.

Steam Only properly working when"build + run"

This library works perfectly when I do build and run in the build menu, but as soon as I try to run the exe outside of unity it doesn't work. I've tested it on multiple pc's with the same issue

SteamAPI not shutting down correctly?

After stopping the game whist developing in Unity, it still registers as "Running" in my Steam library. I have to close Unity completely in order for it to register as not playing anymore. This has the side affect of when in Visual Studio, pressing Shift+Tab to unindent also causes the Steam overlay appears in Visual Studio (very buggily too!)

I call client.Dispose() in OnApplicationQuit(), which has been confirmed as running with a print

Windows 64bit

Cheers

A bit of doc for the location of the DLLs.

TBH, I'm constantly confused where these .dlls (and other lib files) need to go for a Unity build.

Where do they have to be :

1.) when running in the Editor?
2.) when running a build outside of the editor, but not in the steam installation.
3.) in the build depot when publishing for Steam.

I think a clear documentation of this in the repo would be super helpful for people new to this stuff.

( I'm pretty new to this Steamworks API stuff, but so a lot of things that might be obvious for a lot of other people are simply confusing )

=========================================
Here's my try to answers for the above, hope this is correct/clear enough.

1.) Editor: dlls go in the Unity project folder, next to the "Assets" folder.
2.) Build, outside of editor
a. Windows: The appropriate dlls (steam_api64.dll and steam_api64.dll) need to be "next to" the exe file. Also, don't forget the steam_api64.dll and the steam_appid.txt ) updated with your game's ID).
Note: just because these files are in the Unity project directory doesn't mean Unity will bundle them. You need to manually copy them next to the exe after the build.
b. OSX : {???}

3.) a: Windows: Steam API DLLs need to be in the depot next to the exe file. The "steam_appid.txt" is not required since Steam will take care of this info.
b. OSX : {???}

Hope this helps some people.

SteamFriend.IsOnline not working?

SteamFriend.IsOnline only returning false even when friend is actually online or IsPlaying is true.

Example ( in Unity )
foreach (var friend in Client.Instance.Friends.AllFriends) { Debug.Log(friend.IsOnline); }

Dispose() gives me Assertion Failed

When my game exits, I call Dispose() on my Facepunch.Steamworks.Client, I get the follow output in the console:

steamclient.cpp (692) : Assertion Failed: IsValidHSteamPipe( hSteamPipe )
steamclient.cpp (693) : Assertion Failed: IsValidHSteamUserPipe( hUser, hSteamPipe )
Assert( Assertion Failed: IsValidHSteamPipe( hSteamPipe ) ):steamclient.cpp:692

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.