SteamRE / SteamKit

SteamKit2 is a .NET library designed to interoperate with Valve's Steam network. It aims to provide a simple, yet extensible, interface to perform various actions on the network.
GNU Lesser General Public License v2.1
2.63k stars 497 forks source link

How get UniqueID and WebAPIUserNonce #344

Closed Jallvar closed 7 years ago

Jallvar commented 7 years ago

How get UniqueID and WebAPIUserNonce from SteamClient in last version? I get a lot of messages about classes incompatibility. and the response from getcallbacks no method Handler

JustArchi commented 7 years ago

Get it from LoggedOnCallback - example of usage.

JustArchi commented 7 years ago

Alternatively, if you can't or don't want to access the LoggedOnCallback callback (which is preferred way of doing it), you can also request nonce on-demand.

JustArchi commented 7 years ago

And if you mean SteamID in place of UniqueID, then you can get it also from LoggedOnCallback (like in my first example of usage above), or while being logged on, from SteamClient.SteamID.

Jallvar commented 7 years ago

i do auth to SteamBot.Trade.SteamWeb

private static void OnLoginKey(SteamUser.LoginKeyCallback callback) { if (string.IsNullOrEmpty(callback?.LoginKey)) { return; }

        loginKey = callback.LoginKey;
        UniqueID = callback.UniqueID.ToString();
        user.AcceptNewLoginKey(callback);
        var i1 = SteamWeb.Authenticate(UniqueID, client, loginKey);

        Console.WriteLine(i1);
    }

Me return Auth = FALSE Why?

JustArchi commented 7 years ago

This is SK2, not SteamBot. I don't know why your SteamBot method fails - my one works just fine.

Jallvar commented 7 years ago

Can you suggest. what could be the problem? how to get cookies from steamkit2?

JustArchi commented 7 years ago

I would if I was using your library and knew one - I don't, I'm using pure SK2 and my own code, I don't like SteamBot's code.

Jallvar commented 7 years ago

I agree with you. How can I get cookies from SK2?

JustArchi commented 7 years ago

You can find many working examples in my ASF code I linked you above, but that has nothing to do with SK2.

Jallvar commented 7 years ago

I do like you have authorization code. I will return FALSE response

SK2 returns incorrect data from calbacks?

WildCard65 commented 7 years ago

SteamBot receives the UniqueId from SteamUser.LoginKeyCallback and a WebApiNonce from both SteamUser.LoggedOnCallback and SteamUser.WebAPIUserNonceCallback(where the latter is only retrieved upon re-auth being required)

voided commented 7 years ago

Closing this due to inactivity. Feel free to reopen if you're still having issues retrieving a WebAPI nonce.