mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-25 09:24:18 +00:00
Added SteamRequestGroupOfficers function to the sessions plugin.
Added GetSteamGroups to the sessions plugin. Added GetSteamFriendGamePlayed function to the sessions plugin. Former-commit-id: 8e553495aa175521d91f9efd6b6432d237796fc9
This commit is contained in:
@@ -29,6 +29,29 @@ enum class SteamAvatarSize : uint8
|
||||
SteamAvatar_Large = 3
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType, Category = "Online|SteamAPI|SteamGroups")
|
||||
struct FBPSteamGroupInfo
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
public:
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
FBPUniqueNetId GroupID; // Uint64 representation
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
FString GroupName;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
FString GroupTag;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
int32 numOnline;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
int32 numInGame;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
int32 numChatting;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
UCLASS()
|
||||
class UAdvancedSteamFriendsLibrary : public UBlueprintFunctionLibrary
|
||||
@@ -57,4 +80,14 @@ public:
|
||||
// Creates a unique steam id directly from a string holding a uint64 value, useful for testing
|
||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedFriends|SteamAPI")
|
||||
static FBPUniqueNetId CreateSteamIDFromString(const FString SteamID64);
|
||||
|
||||
/* Gets the current game played by a friend - AppID is int32 even though steam ids are uint32, can't be helped in blueprint currently
|
||||
* The game name is retrieved from steamSDK AppList which isn't available to all game IDs without request, can use the AppID with the
|
||||
* WebAPI GetAppList request as an alternative.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI", meta = (ExpandEnumAsExecs = "Result"))
|
||||
static void GetSteamFriendGamePlayed(const FBPUniqueNetId UniqueNetId, EBlueprintResultSwitch &Result, FString & GameName, int32 & AppID);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|SteamAPI|SteamGroups")
|
||||
static void GetSteamGroups(TArray<FBPSteamGroupInfo> & SteamGroups);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
|
||||
// This is taken directly from UE4 - OnlineSubsystemSteamPrivatePCH.h as a fix for the array_count macro
|
||||
|
||||
// @todo Steam: Steam headers trigger secure-C-runtime warnings in Visual C++. Rather than mess with _CRT_SECURE_NO_WARNINGS, we'll just
|
||||
// disable the warnings locally. Remove when this is fixed in the SDK
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4996)
|
||||
#endif
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
#pragma push_macro("ARRAY_COUNT")
|
||||
#undef ARRAY_COUNT
|
||||
|
||||
#include <steam/steam_api.h>
|
||||
|
||||
#pragma pop_macro("ARRAY_COUNT")
|
||||
|
||||
#endif
|
||||
|
||||
// @todo Steam: See above
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#include "SteamRequestGroupOfficersCallbackProxy.generated.h"
|
||||
|
||||
USTRUCT(BlueprintType, Category = "Online|SteamAPI|SteamGroups")
|
||||
struct FBPSteamGroupOfficer
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
public:
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
FBPUniqueNetId OfficerUniqueNetID; // Uint64 representation
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
bool bIsOwner;
|
||||
|
||||
};
|
||||
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FBlueprintGroupOfficerDetailsDelegate, const TArray<FBPSteamGroupOfficer> &, OfficerList);
|
||||
|
||||
UCLASS(MinimalAPI)
|
||||
class USteamRequestGroupOfficersCallbackProxy : public UOnlineBlueprintCallProxyBase
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
// Called when there is a successful results return
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FBlueprintGroupOfficerDetailsDelegate OnSuccess;
|
||||
|
||||
// Called when there is an unsuccessful results return
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FBlueprintGroupOfficerDetailsDelegate OnFailure;
|
||||
|
||||
// Retruns a list of steam group officers
|
||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|SteamAPI|SteamGroups")
|
||||
static USteamRequestGroupOfficersCallbackProxy* GetSteamGroupOfficerList(UObject* WorldContextObject, FBPUniqueNetId GroupUniqueNetID);
|
||||
|
||||
// UOnlineBlueprintCallProxyBase interface
|
||||
virtual void Activate() override;
|
||||
// End of UOnlineBlueprintCallProxyBase interface
|
||||
|
||||
private:
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
void OnRequestGroupOfficerDetails( ClanOfficerListResponse_t *pResult, bool bIOFailure);
|
||||
CCallResult<USteamRequestGroupOfficersCallbackProxy, ClanOfficerListResponse_t> m_callResultGroupOfficerRequestDetails;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
FBPUniqueNetId GroupUniqueID;
|
||||
UObject* WorldContextObject;
|
||||
};
|
||||
Reference in New Issue
Block a user