Skip to content

Commit

Permalink
Revert "feature: Add support for creating and deleting leaderboard re…
Browse files Browse the repository at this point in the history
…wards"

This reverts commit 7361283.
  • Loading branch information
kirre-bylund committed Dec 2, 2024
1 parent 7667243 commit 5f87425
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ FLootLockerServerEndPoint ULootLockerServerEndpoints::GetLeaderboardArchive = In
FLootLockerServerEndPoint ULootLockerServerEndpoints::GetLeaderboardSchedule = InitEndpoint("leaderboards/{0}/schedule", ELootLockerServerHTTPMethod::GET);
FLootLockerServerEndPoint ULootLockerServerEndpoints::CreateLeaderboardSchedule = InitEndpoint("leaderboards/{0}/schedule", ELootLockerServerHTTPMethod::POST);
FLootLockerServerEndPoint ULootLockerServerEndpoints::DeleteLeaderboardSchedule = InitEndpoint("leaderboards/{0}/schedule", ELootLockerServerHTTPMethod::DELETE);
FLootLockerServerEndPoint ULootLockerServerEndpoints::CreateLeaderboardReward = InitEndpoint("leaderboards/{0}/reward", ELootLockerServerHTTPMethod::POST);
FLootLockerServerEndPoint ULootLockerServerEndpoints::DeleteLeaderboardReward = InitEndpoint("leaderboards/{0}/reward/{1}", ELootLockerServerHTTPMethod::DELETE);

// Assets
FLootLockerServerEndPoint ULootLockerServerEndpoints::GetAssets = InitEndpoint("assets", ELootLockerServerHTTPMethod::GET);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,6 @@ void ULootLockerServerForBlueprints::DeleteLeaderboardSchedule(const FString& Le
ULootLockerServerLeaderboardRequest::DeleteLeaderboardSchedule(LeaderboardKey, OnCompletedRequest);
}

void ULootLockerServerForBlueprints::CreateLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const ELootLockerServerLeaderboardRewardEntityKind& RewardKind, TArray<FLootLockerServerLeaderboardDetailPredicates> Predicates, const FLootLockerServerCreateLeaderboardRewardResponseBP& OnCompletedRequest)
{
ULootLockerServerLeaderboardRequest::CreateLeaderboardReward(LeaderboardKey, RewardId, RewardKind, Predicates, OnCompletedRequest);
}

void ULootLockerServerForBlueprints::DeleteLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const FLootLockerServerDeleteLeaderboardRewardResponseBP& OnCompletedRequest)
{
ULootLockerServerLeaderboardRequest::DeleteLeaderboardReward(LeaderboardKey, RewardId, OnCompletedRequest);
}

void ULootLockerServerForBlueprints::ListLeaderboardArchive(const FString& LeaderboardKey, const FLootLockerServerLeaderboardArchiveResponseBP& OnCompletedRequestBP)
{
ULootLockerServerLeaderboardArchiveRequestHandler::ListLeaderboardArchive(LeaderboardKey, OnCompletedRequestBP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,6 @@ void ULootLockerServerForCpp::DeleteLeaderboardSchedule(const FString& Leaderboa
ULootLockerServerLeaderboardRequest::DeleteLeaderboardSchedule(LeaderboardKey, FLootLockerServerDeleteLeaderboardScheduleResponseBP(), OnCompletedRequest);
}

void ULootLockerServerForCpp::CreateLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const ELootLockerServerLeaderboardRewardEntityKind& RewardKind, TArray<FLootLockerServerLeaderboardDetailPredicates> Predicates, const FLootLockerServerCreateLeaderboardRewardResponseDelegate& OnCompletedRequest)
{
ULootLockerServerLeaderboardRequest::CreateLeaderboardReward(LeaderboardKey, RewardId, RewardKind, Predicates, FLootLockerServerCreateLeaderboardRewardResponseBP(), OnCompletedRequest);
}

void ULootLockerServerForCpp::DeleteLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const FLootLockerServerDeleteLeaderboardRewardResponseDelegate& OnCompletedRequest)
{
ULootLockerServerLeaderboardRequest::DeleteLeaderboardReward(LeaderboardKey, RewardId, FLootLockerServerDeleteLeaderboardRewardResponseBP(), OnCompletedRequest);
}

void ULootLockerServerForCpp::ListLeaderboardArchive(const FString& LeaderboardKey, const FLootLockerServerLeaderboardArchiveResponseDelegate& OnCompletedRequest)
{
ULootLockerServerLeaderboardArchiveRequestHandler::ListLeaderboardArchive(LeaderboardKey, FLootLockerServerLeaderboardArchiveResponseBP(), OnCompletedRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,5 @@ void ULootLockerServerLeaderboardRequest::CreateLeaderboardSchedule(const FStrin

void ULootLockerServerLeaderboardRequest::DeleteLeaderboardSchedule(const FString& LeaderboardKey, const FLootLockerServerDeleteLeaderboardScheduleResponseBP& OnCompletedRequestBP, const FLootLockerServerDeleteLeaderboardScheduleResponseDelegate& OnCompletedRequest)
{
ULootLockerServerHttpClient::SendRequest<FLootLockerServerResponse>(FLootLockerServerEmptyRequest(), ULootLockerServerEndpoints::DeleteLeaderboardSchedule, { LeaderboardKey }, {}, OnCompletedRequestBP, OnCompletedRequest);
}

void ULootLockerServerLeaderboardRequest::CreateLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const ELootLockerServerLeaderboardRewardEntityKind& RewardKind, TArray<FLootLockerServerLeaderboardDetailPredicates> Predicates, const FLootLockerServerCreateLeaderboardRewardResponseBP& OnCompletedRequestBP, const FLootLockerServerCreateLeaderboardRewardResponseDelegate& OnCompletedRequest)
{
ULootLockerServerHttpClient::SendRequest<FLootLockerServerResponse>(FLootLockerServerCreateLeaderboardRewardRequest{RewardId, RewardKind, Predicates}, ULootLockerServerEndpoints::CreateLeaderboardReward, { LeaderboardKey }, {}, OnCompletedRequestBP, OnCompletedRequest);
}

void ULootLockerServerLeaderboardRequest::DeleteLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const FLootLockerServerDeleteLeaderboardRewardResponseBP& OnCompletedRequestBP, const FLootLockerServerDeleteLeaderboardRewardResponseDelegate& OnCompletedRequest)
{
ULootLockerServerHttpClient::SendRequest<FLootLockerServerResponse>(FLootLockerServerEmptyRequest(), ULootLockerServerEndpoints::DeleteLeaderboardReward, { LeaderboardKey, RewardId }, {}, OnCompletedRequestBP, OnCompletedRequest);
ULootLockerServerHttpClient::SendRequest<FLootLockerServerGetLeaderboardScheduleResponse>(FLootLockerServerEmptyRequest(), ULootLockerServerEndpoints::DeleteLeaderboardSchedule, { LeaderboardKey }, {}, OnCompletedRequestBP, OnCompletedRequest);
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ class LOOTLOCKERSERVERSDK_API ULootLockerServerEndpoints : public UObject
static FLootLockerServerEndPoint GetLeaderboardSchedule;
static FLootLockerServerEndPoint CreateLeaderboardSchedule;
static FLootLockerServerEndPoint DeleteLeaderboardSchedule;
static FLootLockerServerEndPoint CreateLeaderboardReward;
static FLootLockerServerEndPoint DeleteLeaderboardReward;

// Assets
static FLootLockerServerEndPoint GetAssets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class LOOTLOCKERSERVERSDK_API ULootLockerServerForBlueprints : public UObject
* Results are sorted in ascending order.
* https://ref.lootlocker.com/server-api/#get-score-list
*
* @param LeaderboardKey the key of the leaderboard you want to connect to.
* @param LeaderboardKey The key of the leaderboard you want to connect to.
* @param OnCompletedRequest Delegate for handling the server response
*/
UFUNCTION(BlueprintCallable, Category = "LootLockerServer Methods | Leaderboards")
Expand All @@ -164,7 +164,7 @@ class LOOTLOCKERSERVERSDK_API ULootLockerServerForBlueprints : public UObject
* https://ref.lootlocker.com/server-api/#get-score-list
* Pagination: https://ref.lootlocker.com/server-api/#pagination
*
* @param LeaderboardKey the key of the leaderboard you want to connect to.
* @param LeaderboardKey The key of the leaderboard you want to connect to.
* @param Count Number of scores returned per page
* @param After Cursor for pagination, a cursor will be returned in the response
* @param OnCompletedRequest Delegate for handling the server response
Expand All @@ -174,7 +174,7 @@ class LOOTLOCKERSERVERSDK_API ULootLockerServerForBlueprints : public UObject

/**
* Get the schedule for the specified leaderboard
* @param LeaderboardKey the Key of the leaderboard for which to fetch the schedule
* @param LeaderboardKey The Key of the leaderboard for which to fetch the schedule
* @param OnCompletedRequestBP Delegate for handling the server response
*/
UFUNCTION(BlueprintCallable, Category = "LootLockerServer Methods | Leaderboard")
Expand All @@ -190,7 +190,7 @@ class LOOTLOCKERSERVERSDK_API ULootLockerServerForBlueprints : public UObject
* - @weekly: on Sunday, at midnight UTC.
* - @monthly: on the first day of the month, at midnight UTC.
* - @yearly: on the first day of the year, at midnight UTC.
* @param LeaderboardKey The Key of the leaderboard for which to set the schedule
* @param Key The Key of the leaderboard for which to set the schedule
* @param CronExpression The cron expression describing the schedule to set
* @param OnCompletedRequest Delegate for handling the server response
*/
Expand All @@ -199,39 +199,19 @@ class LOOTLOCKERSERVERSDK_API ULootLockerServerForBlueprints : public UObject

/**
* Remove the schedule (if any) from the specified leadeboard
* @param LeaderboardKey the Key of the leaderboard for which to remove the schedule
* @param Key the Key of the leaderboard for which to remove the schedule
* @param OnCompletedRequest Delegate for handling the server response
*/
UFUNCTION(BlueprintCallable, Category = "LootLockerServer Methods | Leaderboard")
static void DeleteLeaderboardSchedule(const FString& LeaderboardKey, const FLootLockerServerDeleteLeaderboardScheduleResponseBP& OnCompletedRequest);

/**
* Create a reward for the specified leaderboard according to the provided reward details
* @param LeaderboardKey The Key of the leaderboard for which to remove the schedule
* @param RewardId The id of the reward you wish to add to the this leaderboard
* @param RewardKind The kind of reward that this is
* @param Predicates The set of predicates that describes how this reward will be rewarded
* @param OnCompletedRequest Delegate for handling the server response
*/
UFUNCTION(BlueprintCallable, Category = "LootLockerServer Methods | Leaderboard")
static void CreateLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const ELootLockerServerLeaderboardRewardEntityKind& RewardKind, TArray<FLootLockerServerLeaderboardDetailPredicates> Predicates, const FLootLockerServerCreateLeaderboardRewardResponseBP& OnCompletedRequest);

/**
* Remove the specified reward from the specified leadeboard
* @param LeaderboardKey The Key of the leaderboard for which to remove the specified reward
* @param RewardId The id of the reward to remove
* @param OnCompletedRequest Delegate for handling the server response
*/
UFUNCTION(BlueprintCallable, Category = "LootLockerServer Methods | Leaderboard")
static void DeleteLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const FLootLockerServerDeleteLeaderboardRewardResponseBP& OnCompletedRequest);

//==================================================
// Leaderboard Archives
//==================================================

/**
* List the archive of a specific Leaderboard,
* @param LeaderboardKey the Key of the Leaderboard you want the list of archives
* @param LeaderboardKey The Key of the Leaderboard you want the list of archives
* @param OnCompletedRequestBP Delegate for handling the server response
*/
UFUNCTION(BlueprintCallable, Category = "LootLockerServer Methods | Leaderboard")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,36 +173,18 @@ class LOOTLOCKERSERVERSDK_API ULootLockerServerForCpp : public UObject
* - @weekly: on Sunday, at midnight UTC.
* - @monthly: on the first day of the month, at midnight UTC.
* - @yearly: on the first day of the year, at midnight UTC.
* @param LeaderboardKey The Key of the leaderboard for which to set the schedule
* @param Key The Key of the leaderboard for which to set the schedule
* @param CronExpression The cron expression describing the schedule to set
* @param OnCompletedRequest Delegate for handling the server response
*/
static void CreateLeaderboardSchedule(const FString& LeaderboardKey, const FString& CronExpression, const FLootLockerServerGetLeaderboardScheduleResponseDelegate& OnCompletedRequest);

/**
* Remove the schedule (if any) from the specified leadeboard
* @param LeaderboardKey the Key of the leaderboard for which to remove the schedule
* @param Key the Key of the leaderboard for which to remove the schedule
* @param OnCompletedRequest Delegate for handling the server response
*/
static void DeleteLeaderboardSchedule(const FString& LeaderboardKey, const FLootLockerServerDeleteLeaderboardScheduleResponseDelegate& OnCompletedRequest);

/**
* Create a reward for the specified leaderboard according to the provided reward details
* @param LeaderboardKey The Key of the leaderboard for which to remove the schedule
* @param RewardId The id of the reward you wish to add to the this leaderboard
* @param RewardKind The kind of reward that this is
* @param Predicates The set of predicates that describes how this reward will be rewarded
* @param OnCompletedRequest Delegate for handling the server response
*/
static void CreateLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const ELootLockerServerLeaderboardRewardEntityKind& RewardKind, TArray<FLootLockerServerLeaderboardDetailPredicates> Predicates, const FLootLockerServerCreateLeaderboardRewardResponseDelegate& OnCompletedRequest);

/**
* Remove the specified reward from the specified leadeboard
* @param LeaderboardKey The Key of the leaderboard for which to remove the specified reward
* @param RewardId The id of the reward to remove
* @param OnCompletedRequest Delegate for handling the server response
*/
static void DeleteLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const FLootLockerServerDeleteLeaderboardRewardResponseDelegate& OnCompletedRequest);

//==================================================
// Leaderboard Archives
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ struct FLootLockerServerLeaderboardReward
FLootLockerServerLeaderboardGroupReward group;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
FString reward_id;

};

USTRUCT(BlueprintType)
Expand Down Expand Up @@ -595,18 +596,6 @@ struct FLootLockerServerCreateLeaderboardScheduleRequest
FString Cron_expression = "";
};

USTRUCT(BlueprintType)
struct FLootLockerServerCreateLeaderboardRewardRequest
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
FString reward_id;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
ELootLockerServerLeaderboardRewardEntityKind reward_kind = ELootLockerServerLeaderboardRewardEntityKind::Asset;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "LootLockerServer")
TArray<FLootLockerServerLeaderboardDetailPredicates> predicates;
};

//==================================================
// Response Definitions
//==================================================
Expand Down Expand Up @@ -809,14 +798,6 @@ DECLARE_DYNAMIC_DELEGATE_OneParam(FLootLockerServerGetLeaderboardScheduleRespons
Blueprint response delegate for leaderboard schedule deletion
*/
DECLARE_DYNAMIC_DELEGATE_OneParam(FLootLockerServerDeleteLeaderboardScheduleResponseBP, FLootLockerServerResponse, Response);
/*
Blueprint response delegate for leaderboard reward creation
*/
DECLARE_DYNAMIC_DELEGATE_OneParam(FLootLockerServerCreateLeaderboardRewardResponseBP, FLootLockerServerResponse, Response);
/*
Blueprint response delegate for leaderboard reward deletion
*/
DECLARE_DYNAMIC_DELEGATE_OneParam(FLootLockerServerDeleteLeaderboardRewardResponseBP, FLootLockerServerResponse, Response);

//==================================================
// C++ Delegate Definitions
Expand Down Expand Up @@ -859,14 +840,6 @@ DECLARE_DELEGATE_OneParam(FLootLockerServerGetLeaderboardScheduleResponseDelegat
C++ response delegate for leaderboard schedule deletion
*/
DECLARE_DELEGATE_OneParam(FLootLockerServerDeleteLeaderboardScheduleResponseDelegate, FLootLockerServerResponse);
/*
C++ response delegate for leaderboard reward creation
*/
DECLARE_DELEGATE_OneParam(FLootLockerServerCreateLeaderboardRewardResponseDelegate, FLootLockerServerResponse);
/*
C++ response delegate for leaderboard reward deletion
*/
DECLARE_DELEGATE_OneParam(FLootLockerServerDeleteLeaderboardRewardResponseDelegate, FLootLockerServerResponse);

//==================================================
// Interface Definition
Expand All @@ -889,9 +862,6 @@ class LOOTLOCKERSERVERSDK_API ULootLockerServerLeaderboardRequest : public UObje
static void GetLeaderboardSchedule(const FString& LeaderboardKey, const FLootLockerServerGetLeaderboardScheduleResponseBP& OnCompletedRequestBP = FLootLockerServerGetLeaderboardScheduleResponseBP(), const FLootLockerServerGetLeaderboardScheduleResponseDelegate& OnCompletedRequest = FLootLockerServerGetLeaderboardScheduleResponseDelegate());
static void CreateLeaderboardSchedule(const FString& LeaderboardKey, const FString& CronExpression, const FLootLockerServerGetLeaderboardScheduleResponseBP& OnCompletedRequestBP = FLootLockerServerGetLeaderboardScheduleResponseBP(), const FLootLockerServerGetLeaderboardScheduleResponseDelegate& OnCompletedRequest = FLootLockerServerGetLeaderboardScheduleResponseDelegate());
static void DeleteLeaderboardSchedule(const FString& LeaderboardKey, const FLootLockerServerDeleteLeaderboardScheduleResponseBP& OnCompletedRequestBP = FLootLockerServerDeleteLeaderboardScheduleResponseBP(), const FLootLockerServerDeleteLeaderboardScheduleResponseDelegate& OnCompletedRequest = FLootLockerServerDeleteLeaderboardScheduleResponseDelegate());

static void CreateLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const ELootLockerServerLeaderboardRewardEntityKind& RewardKind, TArray<FLootLockerServerLeaderboardDetailPredicates> Predicates, const FLootLockerServerCreateLeaderboardRewardResponseBP& OnCompletedRequestBP = FLootLockerServerCreateLeaderboardRewardResponseBP(), const FLootLockerServerCreateLeaderboardRewardResponseDelegate& OnCompletedRequest = FLootLockerServerCreateLeaderboardRewardResponseDelegate());
static void DeleteLeaderboardReward(const FString& LeaderboardKey, const FString& RewardId, const FLootLockerServerDeleteLeaderboardRewardResponseBP& OnCompletedRequestBP = FLootLockerServerDeleteLeaderboardRewardResponseBP(), const FLootLockerServerDeleteLeaderboardRewardResponseDelegate& OnCompletedRequest = FLootLockerServerDeleteLeaderboardRewardResponseDelegate());

public:
ULootLockerServerLeaderboardRequest();
Expand Down

0 comments on commit 5f87425

Please sign in to comment.