Created
August 27, 2017 10:09
-
-
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
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
// 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; | |
} |
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
// 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