Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Commit

Permalink
Updated calling code to 0.13.0 code
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusRannare committed Feb 15, 2021
1 parent 2195fe8 commit 5c75b7c
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ UCallbackProxy_GalaxyAuth::UCallbackProxy_GalaxyAuth(const FObjectInitializer &O
{
}

UCallbackProxy_GalaxyAuth *UCallbackProxy_GalaxyAuth::GalaxyAuth( UObject *WorldContext, const FString& Appdata )
UCallbackProxy_GalaxyAuth *UCallbackProxy_GalaxyAuth::GalaxyAuth( UObject *WorldContext, const FString& Appdata, bool bTermsAgreed)
{
UCallbackProxy_GalaxyAuth *Proxy = NewObject<UCallbackProxy_GalaxyAuth>();
Proxy->SetFlags(RF_StrongRefOnFrame);
Proxy->Appdata = Appdata;
Proxy->WorldContextObject = WorldContext;
Proxy->bTermsAgreed = bTermsAgreed;
return Proxy;
}

Expand All @@ -25,7 +26,7 @@ void UCallbackProxy_GalaxyAuth::Activate()
FModioSubsystemPtr Modio = FModioSubsystem::Get( World );
if( Modio.IsValid() )
{
Modio->GalaxyAuth( Appdata, FModioGenericDelegate::CreateUObject( this, &UCallbackProxy_GalaxyAuth::OnGalaxyAuthDelegate ) );
Modio->GalaxyAuth( Appdata, bTermsAgreed, FModioGenericDelegate::CreateUObject( this, &UCallbackProxy_GalaxyAuth::OnGalaxyAuthDelegate ) );
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ UCallbackProxy_OculusAuth::UCallbackProxy_OculusAuth(const FObjectInitializer &O
{
}

UCallbackProxy_OculusAuth *UCallbackProxy_OculusAuth::OculusAuth( UObject *WorldContext, const FString& Nonce, const FString& OculusUserId, const FString& AccessToken, const FString& Email, const FString& Device, int32 DateExpires )
UCallbackProxy_OculusAuth *UCallbackProxy_OculusAuth::OculusAuth( UObject *WorldContext, const FString& Nonce, const FString& OculusUserId, const FString& AccessToken, const FString& Email, const FString& Device, int32 DateExpires, bool bTermsAgreed)
{
UCallbackProxy_OculusAuth *Proxy = NewObject<UCallbackProxy_OculusAuth>();
Proxy->SetFlags(RF_StrongRefOnFrame);
Expand All @@ -21,6 +21,7 @@ UCallbackProxy_OculusAuth *UCallbackProxy_OculusAuth::OculusAuth( UObject *World
Proxy->Device = Device;
Proxy->DateExpires = DateExpires;
Proxy->WorldContextObject = WorldContext;
Proxy->bTermsAgreed = bTermsAgreed;
return Proxy;
}

Expand All @@ -30,7 +31,7 @@ void UCallbackProxy_OculusAuth::Activate()
FModioSubsystemPtr Modio = FModioSubsystem::Get( World );
if( Modio.IsValid() )
{
Modio->OculusAuth( Nonce, OculusUserId, AccessToken, Email, Device, DateExpires, FModioGenericDelegate::CreateUObject( this, &UCallbackProxy_OculusAuth::OnOculusAuthDelegate ) );
Modio->OculusAuth( Nonce, OculusUserId, AccessToken, Email, Device, DateExpires, bTermsAgreed, FModioGenericDelegate::CreateUObject( this, &UCallbackProxy_OculusAuth::OnOculusAuthDelegate ) );
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ UCallbackProxy_SteamAuth::UCallbackProxy_SteamAuth(const FObjectInitializer &Obj
{
}

UCallbackProxy_SteamAuth *UCallbackProxy_SteamAuth::SteamAuth( UObject *WorldContext, const FString& Base64Ticket )
UCallbackProxy_SteamAuth *UCallbackProxy_SteamAuth::SteamAuth( UObject *WorldContext, const FString& Base64Ticket, bool bTermsAgreed)
{
UCallbackProxy_SteamAuth *Proxy = NewObject<UCallbackProxy_SteamAuth>();
Proxy->SetFlags(RF_StrongRefOnFrame);
Proxy->Base64Ticket = Base64Ticket;
Proxy->WorldContextObject = WorldContext;
Proxy->bTermsAgreed = bTermsAgreed;
return Proxy;
}

Expand All @@ -25,7 +26,7 @@ void UCallbackProxy_SteamAuth::Activate()
FModioSubsystemPtr Modio = FModioSubsystem::Get( World );
if( Modio.IsValid() )
{
Modio->SteamAuth( Base64Ticket, FModioGenericDelegate::CreateUObject( this, &UCallbackProxy_SteamAuth::OnSteamAuthDelegate ) );
Modio->SteamAuth( Base64Ticket, bTermsAgreed, FModioGenericDelegate::CreateUObject( this, &UCallbackProxy_SteamAuth::OnSteamAuthDelegate ) );
}
else
{
Expand Down
12 changes: 6 additions & 6 deletions Source/modio/Private/ModioSubsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,22 +186,22 @@ void FModioSubsystem::GetUserModfiles(int32 Limit, int32 Offset, FModioModfileAr
modioFreeFilter(&modio_filter_creator);
}

void FModioSubsystem::SteamAuth(const FString &Base64Ticket, FModioGenericDelegate SteamAuthDelegate)
void FModioSubsystem::SteamAuth(const FString &Base64Ticket, bool TermsAgreed, FModioGenericDelegate SteamAuthDelegate)
{
FModioAsyncRequest_SteamAuth *Request = CreateAsyncRequest<FModioAsyncRequest_SteamAuth>( this, SteamAuthDelegate );
modioSteamAuthEncoded( Request, TCHAR_TO_UTF8(*Base64Ticket), FModioAsyncRequest_SteamAuth::Response );
modioSteamAuthEncoded( Request, TCHAR_TO_UTF8(*Base64Ticket), TermsAgreed, FModioAsyncRequest_SteamAuth::Response );
}

void FModioSubsystem::GalaxyAuth(const FString &Appdata, FModioGenericDelegate GalaxyAuthDelegate)
void FModioSubsystem::GalaxyAuth(const FString &Appdata, bool TermsAgreed, FModioGenericDelegate GalaxyAuthDelegate)
{
FModioAsyncRequest_GalaxyAuth *Request = CreateAsyncRequest<FModioAsyncRequest_GalaxyAuth>( this, GalaxyAuthDelegate );
modioGalaxyAuth( Request, TCHAR_TO_UTF8(*Appdata), FModioAsyncRequest_GalaxyAuth::Response );
modioGalaxyAuth( Request, TCHAR_TO_UTF8(*Appdata), TermsAgreed, FModioAsyncRequest_GalaxyAuth::Response );
}

void FModioSubsystem::OculusAuth(const FString& Nonce, const FString& OculusUserId, const FString& AccessToken, const FString& Email, const FString& Device, int32 DateExpires, FModioGenericDelegate OculusAuthDelegate)
void FModioSubsystem::OculusAuth(const FString& Nonce, const FString& OculusUserId, const FString& AccessToken, const FString& Email, const FString& Device, int32 DateExpires, bool TermsAgreed, FModioGenericDelegate OculusAuthDelegate)
{
FModioAsyncRequest_OculusAuth *Request = CreateAsyncRequest<FModioAsyncRequest_OculusAuth>( this, OculusAuthDelegate );
modioOculusAuth( Request, TCHAR_TO_UTF8(*Nonce), TCHAR_TO_UTF8(*OculusUserId), TCHAR_TO_UTF8(*AccessToken), TCHAR_TO_UTF8(*Email), TCHAR_TO_UTF8(*Device), (u32)DateExpires, FModioAsyncRequest_GalaxyAuth::Response );
modioOculusAuth( Request, TCHAR_TO_UTF8(*Nonce), TCHAR_TO_UTF8(*OculusUserId), TCHAR_TO_UTF8(*AccessToken), TCHAR_TO_UTF8(*Email), TCHAR_TO_UTF8(*Device), (u32)DateExpires, TermsAgreed, FModioAsyncRequest_GalaxyAuth::Response );
}

void FModioSubsystem::Process()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class MODIO_API UCallbackProxy_GalaxyAuth : public UOnlineBlueprintCallProxyBase
GENERATED_UCLASS_BODY()

FString Appdata;
bool bTermsAgreed;

// The world context object in which this call is taking place
UPROPERTY()
Expand All @@ -31,7 +32,7 @@ class MODIO_API UCallbackProxy_GalaxyAuth : public UOnlineBlueprintCallProxyBase
FGalaxyAuthResult OnFailure;

UFUNCTION(BlueprintCallable, Category = "mod.io", meta = (BlueprintInternalUseOnly = "true", DefaultToSelf="WorldContext"))
static UCallbackProxy_GalaxyAuth *GalaxyAuth( UObject *WorldContext, const FString &Appdata);
static UCallbackProxy_GalaxyAuth *GalaxyAuth( UObject *WorldContext, const FString &Appdata, bool bTermsAgreed = false);

virtual void Activate() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class MODIO_API UCallbackProxy_OculusAuth : public UOnlineBlueprintCallProxyBase
FString Email;
FString Device;
int32 DateExpires;
bool bTermsAgreed;

// The world context object in which this call is taking place
UPROPERTY()
Expand All @@ -37,7 +38,7 @@ class MODIO_API UCallbackProxy_OculusAuth : public UOnlineBlueprintCallProxyBase
FOculusAuthResult OnFailure;

UFUNCTION(BlueprintCallable, Category = "mod.io", meta = (BlueprintInternalUseOnly = "true", DefaultToSelf="WorldContext"))
static UCallbackProxy_OculusAuth *OculusAuth( UObject *WorldContext, const FString &Nonce, const FString &OculusUserId, const FString &AccessToken, const FString &Email, const FString &Device, int32 DateExpires);
static UCallbackProxy_OculusAuth *OculusAuth( UObject *WorldContext, const FString &Nonce, const FString &OculusUserId, const FString &AccessToken, const FString &Email, const FString &Device, int32 DateExpires, bool bTermsAgreed);

virtual void Activate() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class MODIO_API UCallbackProxy_SteamAuth : public UOnlineBlueprintCallProxyBase
GENERATED_UCLASS_BODY()

FString Base64Ticket;
bool bTermsAgreed;

// The world context object in which this call is taking place
UPROPERTY()
Expand All @@ -31,7 +32,7 @@ class MODIO_API UCallbackProxy_SteamAuth : public UOnlineBlueprintCallProxyBase
FSteamAuthResult OnFailure;

UFUNCTION(BlueprintCallable, Category = "mod.io", meta = (BlueprintInternalUseOnly = "true", DefaultToSelf="WorldContext"))
static UCallbackProxy_SteamAuth *SteamAuth( UObject *WorldContext, const FString &Base64Ticket);
static UCallbackProxy_SteamAuth *SteamAuth( UObject *WorldContext, const FString &Base64Ticket, bool bTermsAgreed);

virtual void Activate() override;

Expand Down
6 changes: 3 additions & 3 deletions Source/modio/Public/ModioSubsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ struct MODIO_API FModioSubsystem : public TSharedFromThis<FModioSubsystem, ESPMo
/** Send your Security code to the backend */
void EmailExchange(const FString &SecurityCode, FModioGenericDelegate EmailExchangeDelegate);
/** Log in to mod.io on behalf of a Steam Galaxy user */
void SteamAuth(const FString &Base64Ticket, FModioGenericDelegate SteamAuthDelegate);
void SteamAuth(const FString &Base64Ticket, bool TermsAgreed, FModioGenericDelegate SteamAuthDelegate);
/** Log in to mod.io on behalf of a GOG Galaxy user */
void GalaxyAuth(const FString &Appdata, FModioGenericDelegate GalaxyAuthDelegate);
void GalaxyAuth(const FString &Appdata, bool TermsAgreed, FModioGenericDelegate GalaxyAuthDelegate);
/** Log in to mod.io on behalf of a Oculus user */
void OculusAuth(const FString &Nonce, const FString &OculusUserId, const FString &AccessToken, const FString &Email, const FString &Device, int32 DateExpires, FModioGenericDelegate GalaxyAuthDelegate);
void OculusAuth(const FString &Nonce, const FString &OculusUserId, const FString &AccessToken, const FString &Email, const FString &Device, int32 DateExpires, bool TermsAgreed, FModioGenericDelegate GalaxyAuthDelegate);
/** Logs out the current user from mod.io */
void Logout();
/** Returns true if there is a user currently logged in */
Expand Down

0 comments on commit 5c75b7c

Please sign in to comment.