Skip to content

Instantly share code, notes, and snippets.

@TobiasBerg
Last active March 8, 2024 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TobiasBerg/3bd562bacf1b7f96c0029062a7351f8a to your computer and use it in GitHub Desktop.
Save TobiasBerg/3bd562bacf1b7f96c0029062a7351f8a to your computer and use it in GitHub Desktop.
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!");
});
});
}
}
@ronald112
Copy link

gist is outdated a little

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