Skip to content

Instantly share code, notes, and snippets.

@KiaArmani
Created August 27, 2017 10:09
Show Gist options
  • Save KiaArmani/d09a020ddbce007511b60ddc47ff35c7 to your computer and use it in GitHub Desktop.
Save KiaArmani/d09a020ddbce007511b60ddc47ff35c7 to your computer and use it in GitHub Desktop.
UE4 Blueprint Library containing function to get Steam Session Ticket for use with Third-Party services like playfab or GameSparks
// Fill out your copyright notice in the Description page of Project Settings.
// Replace YOURGAME with the projectname of your game
#include "YOURGAME.h"
#include "Online.h"
#include "OnlineSubsystem.h"
#include "SteamHelper.h"
USteamHelper::USteamHelper(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
FString USteamHelper::GetSessionTicket()
{
IOnlineSubsystem* OnlineInterface;
OnlineInterface = IOnlineSubsystem::Get();
FString SessionTicket = OnlineInterface->GetIdentityInterface()->GetAuthToken(0);
return SessionTicket;
}
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "SteamHelper.generated.h"
UCLASS()
class USteamHelper : public UBlueprintFunctionLibrary
{
GENERATED_UCLASS_BODY()
UFUNCTION(BlueprintCallable, Category = "Steam")
static FString GetSessionTicket();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment