Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AuthSessionTicket implementation #102

Open
mogaika opened this issue Dec 20, 2019 · 2 comments
Open

AuthSessionTicket implementation #102

mogaika opened this issue Dec 20, 2019 · 2 comments

Comments

@mogaika
Copy link

mogaika commented Dec 20, 2019

I implemented AuthSessionTicket generation (and AuthTIcket verification), but I do not know how to format and fix code. Almost sure that I did wrong sync.Mutex stuff and naming/packaging.

mogaika@f4c74f9

If someone need this and want to risk to use my code there is gs bot example main cycle change which illustrates how to use new feature

        var ast []byte

	for event := range client.Events() {
		auth.HandleEvent(event)
		debug.HandleEvent(event)
		serverList.HandleEvent(event)

		switch e := event.(type) {
		case error:
			fmt.Printf("Error: %v", e)
		case *steam.LoggedOnEvent:
			client.Social.SetPersonaState(steamlang.EPersonaState_Online)
			log.Printf("Logged on")

			log.Printf("Setting game played")
			client.GC.SetGamesPlayed(APPID)

			log.Printf("Getting app ownership ticket")
			client.GetAppOwnershipTicket(APPID)
		case *steam.TicketAuthComplete:
			log.Printf("can be ignored")
		case *steam.TicketAuthAck:
			// DO YOUR MAGIC WITH AST TICKET
                        // TO CONVERT TO STRING USE
                        ticket := fmt.Sprintf("%X", ast)
                        _ = ticket
		case *steam.AppOwnershipTicket:
			aot := event.(*steam.AppOwnershipTicket)

			ast = client.AuthSessionTicket(aot.AppOwnershipTicket)
			log.Printf("verifiying ast: %X", ast)
		}
	}

as reference I used
https://github.com/DoctorMcKay/node-steam-user
https://github.com/dotdotmaples/node-steam-user
SteamRE/SteamKit#789
so it also would be good to check LICENSE files

@Philipp15b
Copy link
Owner

Nice! Yeah, the code could be cleaned up a bit. In particular, I'm not sure the manual serialization is the cleanest way to do this. Unfortunately, I don't have the time to personally review this in detail.

But I think if you'd open a pull request someone may turn up to help 👍

@molecul
Copy link

molecul commented Apr 25, 2022

@Philipp15b so, probably we can merge this implementation? i think that it better then nothing

#127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants