-
-
Save TobiasBerg/3bd562bacf1b7f96c0029062a7351f8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LootLocker.Requests; | |
using Steamworks; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Text; | |
using UnityEngine; | |
public class NewBehaviourScript : MonoBehaviour | |
{ | |
void Start() | |
{ | |
if (!SteamManager.Initialized) | |
{ | |
return; | |
} | |
var ticket = new byte[1024]; | |
SteamUser.GetAuthSessionTicket(ticket, 1024, out uint ticketSize); | |
Array.Resize(ref ticket, (int)ticketSize); | |
StringBuilder sb = new StringBuilder(); | |
for (int i = 0; i < ticketSize; i++) | |
{ | |
sb.AppendFormat("{0:x2}", ticket[i]); | |
} | |
var steamSessionTicket = sb.ToString(); | |
LootLockerSDKManager.VerifySteamID(steamSessionTicket, (response) => | |
{ | |
if (!response.success) | |
{ | |
Debug.Log("error verifying steam ID"); | |
return; | |
} | |
Debug.Log("successfully verified steam user"); | |
CSteamID SteamID = SteamUser.GetSteamID(); | |
LootLockerSDKManager.StartSession(SteamID.ToString(), (response) => | |
{ | |
if (!response.success) | |
{ | |
Debug.Log("error starting session"); | |
return; | |
} | |
Debug.Log("session started!"); | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gist is outdated a little