mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-26 09:54:20 +00:00
Compare commits
21 Commits
4.18_Locke
...
4.20_Locke
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
525e6411a6 | ||
|
|
6b4ac8d00c | ||
|
|
50752d2a95 | ||
|
|
abb9e5687c | ||
|
|
47c6981a2a | ||
|
|
20f99a5e10 | ||
|
|
289fa84dd5 | ||
|
|
b8a5e7500b | ||
|
|
4cc84d68c4 | ||
|
|
b553a8c3b6 | ||
|
|
bc0e8f7d1b | ||
|
|
886b4c2f8a | ||
|
|
47775e70bf | ||
|
|
924b1ecf1c | ||
|
|
c73b96993c | ||
|
|
0229b69d9c | ||
|
|
ad2881cd75 | ||
|
|
d007eed9a8 | ||
|
|
c2a5598582 | ||
|
|
2db3b7221c | ||
|
|
ea77c18a2e |
@@ -2,8 +2,8 @@
|
||||
"FileVersion" : 3,
|
||||
|
||||
"FriendlyName" : "Advanced Sessions",
|
||||
"Version" : 4.17,
|
||||
"VersionName": "4.17",
|
||||
"Version" : 4.20,
|
||||
"VersionName": "4.20",
|
||||
"Description" : "Adds new blueprint functions to handle more advanced session operations.",
|
||||
"Category" : "Advanced Sessions Plugin",
|
||||
"CreatedBy" : "Joshua Statzer",
|
||||
|
||||
@@ -7,11 +7,11 @@ public class AdvancedSessions : ModuleRules
|
||||
{
|
||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
//bEnforceIWYU = true;
|
||||
|
||||
Definitions.Add("WITH_ADVANCED_SESSIONS=1");
|
||||
|
||||
PrivateIncludePaths.AddRange(new string[] { "AdvancedSessions/Private"/*, "OnlineSubsystemSteam/Private"*/ });
|
||||
PublicIncludePaths.AddRange(new string[] { "AdvancedSessions/Public" });
|
||||
PublicDefinitions.Add("WITH_ADVANCED_SESSIONS=1");
|
||||
|
||||
// PrivateIncludePaths.AddRange(new string[] { "AdvancedSessions/Private"/*, "OnlineSubsystemSteam/Private"*/ });
|
||||
// PublicIncludePaths.AddRange(new string[] { "AdvancedSessions/Public" });
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem", "CoreUObject", "OnlineSubsystemUtils", "Networking", "Sockets"/*"Voice", "OnlineSubsystemSteam"*/ });
|
||||
PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "Sockets", "Networking", "OnlineSubsystemUtils" /*"Voice", "Steamworks","OnlineSubsystemSteam"*/});
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//#include "OnlineMessageInterface.h"
|
||||
//#include "OnlinePresenceInterface.h"
|
||||
//#include "Engine/GameInstance.h"
|
||||
#include "OnlineSessionInterface.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
|
||||
//#include "UObjectIterator.h"
|
||||
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "Online.h"
|
||||
#include "OnlineSubsystem.h"
|
||||
#include "OnlineFriendsInterface.h"
|
||||
#include "OnlineUserInterface.h"
|
||||
#include "OnlineMessageInterface.h"
|
||||
#include "OnlinePresenceInterface.h"
|
||||
#include "Interfaces/OnlineFriendsInterface.h"
|
||||
#include "Interfaces/OnlineUserInterface.h"
|
||||
#include "Interfaces/OnlineMessageInterface.h"
|
||||
#include "Interfaces/OnlinePresenceInterface.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "Engine/LocalPlayer.h"
|
||||
#include "OnlineSessionInterface.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
#include "OnlineSessionSettings.h"
|
||||
#include "UObjectIterator.h"
|
||||
#include "UObject/UObjectIterator.h"
|
||||
#include "AdvancedFriendsInterface.h"
|
||||
|
||||
#include "AdvancedFriendsGameInstance.generated.h"
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
void OnSessionInviteAcceptedMaster(const bool bWasSuccessful, int32 LocalPlayer, TSharedPtr<const FUniqueNetId> PersonInviting, const FOnlineSessionSearchResult& SessionToJoin);
|
||||
|
||||
// After a session invite has been accepted by the local player this event is triggered, call JoinSession on the session result to join it
|
||||
// This function is currently not hooked up in any of Epics default subsystems, it is here for custom subsystems
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "AdvancedFriends")
|
||||
void OnSessionInviteAccepted(int32 LocalPlayerNum, FBPUniqueNetId PersonInvited, const FBlueprintSessionResult& SessionToJoin);
|
||||
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "Online.h"
|
||||
#include "OnlineSubsystem.h"
|
||||
#include "OnlineFriendsInterface.h"
|
||||
#include "OnlineUserInterface.h"
|
||||
#include "OnlineMessageInterface.h"
|
||||
#include "OnlinePresenceInterface.h"
|
||||
#include "Interfaces/OnlineFriendsInterface.h"
|
||||
#include "Interfaces/OnlineUserInterface.h"
|
||||
#include "Interfaces/OnlineMessageInterface.h"
|
||||
#include "Interfaces/OnlinePresenceInterface.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "OnlineSessionInterface.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
#include "OnlineSessionSettings.h"
|
||||
#include "UObjectIterator.h"
|
||||
#include "UObject/UObjectIterator.h"
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
#include "AdvancedFriendsInterface.generated.h"
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
#include "Online.h"
|
||||
#include "Engine/LocalPlayer.h"
|
||||
#include "OnlineSubsystem.h"
|
||||
#include "OnlineFriendsInterface.h"
|
||||
#include "OnlineUserInterface.h"
|
||||
#include "OnlineMessageInterface.h"
|
||||
#include "OnlinePresenceInterface.h"
|
||||
#include "Interfaces/OnlineFriendsInterface.h"
|
||||
#include "Interfaces/OnlineUserInterface.h"
|
||||
#include "Interfaces/OnlineMessageInterface.h"
|
||||
#include "Interfaces/OnlinePresenceInterface.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "OnlineSessionInterface.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
|
||||
#include "UObjectIterator.h"
|
||||
#include "UObject/UObjectIterator.h"
|
||||
|
||||
#include "AdvancedFriendsLibrary.generated.h"
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "Online.h"
|
||||
#include "OnlineSubsystem.h"
|
||||
#include "OnlineIdentityInterface.h"
|
||||
#include "OnlineUserInterface.h"
|
||||
#include "OnlinePresenceInterface.h"
|
||||
#include "Interfaces/OnlineIdentityInterface.h"
|
||||
#include "Interfaces/OnlineUserInterface.h"
|
||||
#include "Interfaces/OnlinePresenceInterface.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "Engine/LocalPlayer.h"
|
||||
|
||||
#include "UObjectIterator.h"
|
||||
#include "UObject/UObjectIterator.h"
|
||||
|
||||
#include "AdvancedIdentityLibrary.generated.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "ModuleManager.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
class AdvancedSessions : public IModuleInterface
|
||||
{
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "Online.h"
|
||||
#include "OnlineSubsystem.h"
|
||||
#include "OnlineFriendsInterface.h"
|
||||
#include "OnlineUserInterface.h"
|
||||
#include "OnlineMessageInterface.h"
|
||||
#include "OnlinePresenceInterface.h"
|
||||
#include "Interfaces/OnlineFriendsInterface.h"
|
||||
#include "Interfaces/OnlineUserInterface.h"
|
||||
#include "Interfaces/OnlineMessageInterface.h"
|
||||
#include "Interfaces/OnlinePresenceInterface.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "OnlineSessionInterface.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
|
||||
//#include "UObjectIterator.h"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
#include "Online.h"
|
||||
#include "OnlineSubsystem.h"
|
||||
#include "VoiceInterface.h"
|
||||
#include "Interfaces/VoiceInterface.h"
|
||||
//#include "OnlineFriendsInterface.h"
|
||||
//#include "OnlineUserInterface.h"
|
||||
//#include "OnlineMessageInterface.h"
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "Engine/GameInstance.h"
|
||||
//#include "OnlineSessionInterface.h"
|
||||
|
||||
#include "UObjectIterator.h"
|
||||
#include "UObject/UObjectIterator.h"
|
||||
|
||||
#include "AdvancedVoiceLibrary.generated.h"
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
static bool RegisterLocalTalker(uint8 LocalPlayerNum = 0);
|
||||
|
||||
// Registers all signed in players as local talkers
|
||||
// This is already done automatically, only do it manually if you unregistered someone
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||
static void RegisterAllLocalTalkers();
|
||||
|
||||
@@ -60,6 +61,7 @@ public:
|
||||
static void UnRegisterAllLocalTalkers();
|
||||
|
||||
// Registers a remote player as a talker
|
||||
// This is already done automatically, only do it manually if you unregistered someone
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||
static bool RegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId);
|
||||
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
#pragma once
|
||||
#include "CoreMinimal.h"
|
||||
#include "EngineMinimal.h"
|
||||
//#include "EngineMinimal.h"
|
||||
#include "Engine/Engine.h"
|
||||
#include "GameFramework/PlayerState.h"
|
||||
#include "Core.h"
|
||||
#include "OnlineSessionInterface.h"
|
||||
//#include "Core.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
#include "OnlineSessionSettings.h"
|
||||
#include "OnlineDelegateMacros.h"
|
||||
#include "OnlineSubsystem.h"
|
||||
#include "OnlineSubsystemImpl.h"
|
||||
#include "OnlineSubsystemUtils.h"
|
||||
#include "OnlineSubsystemUtilsModule.h"
|
||||
#include "ModuleManager.h"
|
||||
#include "GameFramework/PlayerController.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
#include "OnlineSubsystemUtilsClasses.h"
|
||||
#include "BlueprintDataDefinitions.generated.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||
#pragma once
|
||||
#include "CoreMinimal.h"
|
||||
#include "OnlineSessionInterface.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
#include "CancelFindSessionsCallbackProxy.generated.h"
|
||||
|
||||
|
||||
@@ -18,7 +18,13 @@ class UCreateSessionCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FEmptyOnlineDelegate OnFailure;
|
||||
|
||||
// Creates a session with the default online subsystem with advanced optional inputs, for dedicated servers leave UsePresence as false and set IsDedicatedServer to true. Dedicated servers don't use presence.
|
||||
/**
|
||||
* Creates a session with the default online subsystem with advanced optional inputs, for dedicated servers leave UsePresence as false and set IsDedicatedServer to true. Dedicated servers don't use presence.
|
||||
* @param PublicConnections When doing a 'listen' server, this must be >=2 (ListenServer itself counts as a connection)
|
||||
* @param bUseLAN When you want to play LAN, the level to play on must be loaded with option 'bIsLanMatch'
|
||||
* @param bUsePresence Must be true for a 'listen' server (Map must be loaded with option 'listen'), false for a 'dedicated' server.
|
||||
* @param bShouldAdvertise Set to true when the OnlineSubsystem should list your server when someone is searching for servers. Otherwise the server is hidden and only join via invite is possible.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject",AutoCreateRefTerm="ExtraSettings"), Category = "Online|AdvancedSessions")
|
||||
static UCreateSessionCallbackProxyAdvanced* CreateAdvancedSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair> &ExtraSettings, class APlayerController* PlayerController = NULL, int32 PublicConnections = 100, int32 PrivateConnections = 0, bool bUseLAN = false, bool bAllowInvites = true, bool bIsDedicatedServer = false, bool bUsePresence = true, bool bAllowJoinViaPresence = true, bool bAllowJoinViaPresenceFriendsOnly = false, bool bAntiCheatProtected = false, bool bUsesStats = false, bool bShouldAdvertise = true);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||
#pragma once
|
||||
#include "CoreMinimal.h"
|
||||
#include "OnlineSessionInterface.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
#include "EndSessionCallbackProxy.generated.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||
#pragma once
|
||||
#include "CoreMinimal.h"
|
||||
#include "OnlineSessionInterface.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
#include "FindSessionsCallbackProxy.h"
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
#include "FindSessionsCallbackProxyAdvanced.generated.h"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
#include "OnlineIdentityInterface.h"
|
||||
#include "Interfaces/OnlineIdentityInterface.h"
|
||||
#include "GetUserPrivilegeCallbackProxy.generated.h"
|
||||
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FBlueprintGetUserPrivilegeDelegate,/* const &FBPUniqueNetId, PlayerID,*/ EBPUserPrivileges, QueriedPrivilege, bool, HadPrivilege);
|
||||
@@ -21,7 +21,7 @@ class UGetUserPrivilegeCallbackProxy : public UOnlineBlueprintCallProxyBase
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FEmptyOnlineDelegate OnFailure;
|
||||
|
||||
// Logs out of the identity interface
|
||||
// Gets the privilage of the user
|
||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|AdvancedIdentity")
|
||||
static UGetUserPrivilegeCallbackProxy* GetUserPrivilege(UObject* WorldContextObject, const EBPUserPrivileges & PrivilegeToCheck, const FBPUniqueNetId & PlayerUniqueNetID);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
#include "OnlineIdentityInterface.h"
|
||||
#include "Interfaces/OnlineIdentityInterface.h"
|
||||
#include "Engine/LocalPlayer.h"
|
||||
#include "LoginUserCallbackProxy.generated.h"
|
||||
|
||||
@@ -20,7 +20,7 @@ class ULoginUserCallbackProxy : public UOnlineBlueprintCallProxyBase
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FEmptyOnlineDelegate OnFailure;
|
||||
|
||||
// Logs out of the identity interface
|
||||
// Logs into the identity interface
|
||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|AdvancedIdentity")
|
||||
static ULoginUserCallbackProxy* LoginUser(UObject* WorldContextObject, class APlayerController* PlayerController, FString UserID, FString UserToken);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
#include "OnlineIdentityInterface.h"
|
||||
#include "Interfaces/OnlineIdentityInterface.h"
|
||||
#include "Engine/LocalPlayer.h"
|
||||
#include "LogoutUserCallbackProxy.generated.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
#include "AdvancedFriendsGameInstance.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "GameFramework/PlayerController.h"
|
||||
|
||||
//General Log
|
||||
DEFINE_LOG_CATEGORY(AdvancedFriendsInterfaceLog);
|
||||
|
||||
@@ -427,7 +427,7 @@ void UAdvancedSessionsLibrary::GetPlayerName(APlayerController *PlayerController
|
||||
|
||||
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
|
||||
{
|
||||
PlayerName = PlayerState->PlayerName;
|
||||
PlayerName = PlayerState->GetPlayerName();
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"FileVersion" : 3,
|
||||
|
||||
"FriendlyName" : "Advanced Steam Sessions",
|
||||
"Version" : 4.17,
|
||||
"VersionName": "4.17",
|
||||
"Version" : 4.20,
|
||||
"VersionName": "4.20",
|
||||
"Description" : "Adds new blueprint functions to handle more advanced session operations in Steam. REQUIRES ADVANCED SESSIONS",
|
||||
"Category" : "Advanced Sessions Plugin",
|
||||
"CreatedBy" : "Joshua Statzer",
|
||||
|
||||
@@ -8,7 +8,7 @@ public class AdvancedSteamSessions : ModuleRules
|
||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
//bEnforceIWYU = true;
|
||||
|
||||
Definitions.Add("WITH_ADVANCED_STEAM_SESSIONS=1");
|
||||
PublicDefinitions.Add("WITH_ADVANCED_STEAM_SESSIONS=1");
|
||||
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem", "CoreUObject", "OnlineSubsystemUtils", "Networking", "Sockets", "AdvancedSessions"/*"Voice", "OnlineSubsystemSteam"*/ });
|
||||
PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "Sockets", "Networking", "OnlineSubsystemUtils" /*"Voice", "Steamworks","OnlineSubsystemSteam"*/});
|
||||
|
||||
@@ -6,14 +6,231 @@
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "Online.h"
|
||||
#include "OnlineSubsystem.h"
|
||||
#include "OnlineFriendsInterface.h"
|
||||
#include "OnlineUserInterface.h"
|
||||
#include "OnlineMessageInterface.h"
|
||||
#include "OnlinePresenceInterface.h"
|
||||
#include "Interfaces/OnlineFriendsInterface.h"
|
||||
#include "Interfaces/OnlineUserInterface.h"
|
||||
#include "Interfaces/OnlineMessageInterface.h"
|
||||
#include "Interfaces/OnlinePresenceInterface.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "OnlineSessionInterface.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
#include "UObject/UObjectIterator.h"
|
||||
|
||||
#include "UObjectIterator.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)
|
||||
// #TODO check back on this at some point
|
||||
#pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on....
|
||||
#endif
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
#pragma push_macro("ARRAY_COUNT")
|
||||
#undef ARRAY_COUNT
|
||||
|
||||
#if USING_CODE_ANALYSIS
|
||||
MSVC_PRAGMA(warning(push))
|
||||
MSVC_PRAGMA(warning(disable : ALL_CODE_ANALYSIS_WARNINGS))
|
||||
#endif // USING_CODE_ANALYSIS
|
||||
|
||||
#include <steam/steam_api.h>
|
||||
|
||||
#if USING_CODE_ANALYSIS
|
||||
MSVC_PRAGMA(warning(pop))
|
||||
#endif // USING_CODE_ANALYSIS
|
||||
|
||||
#include <steam/isteamapps.h>
|
||||
#include <steam/isteamapplist.h>
|
||||
//#include <OnlineSubsystemSteamTypes.h>
|
||||
#pragma pop_macro("ARRAY_COUNT")
|
||||
|
||||
// @todo Steam: See above
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
// Making a copy of this here since the original is still in a private folder and is screwing with things
|
||||
/**
|
||||
* Steam specific implementation of the unique net id
|
||||
*/
|
||||
class FUniqueNetIdSteam2 :
|
||||
public FUniqueNetId
|
||||
{
|
||||
PACKAGE_SCOPE:
|
||||
/** Holds the net id for a player */
|
||||
uint64 UniqueNetId;
|
||||
|
||||
/** Hidden on purpose */
|
||||
FUniqueNetIdSteam2() :
|
||||
UniqueNetId(0)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy Constructor
|
||||
*
|
||||
* @param Src the id to copy
|
||||
*/
|
||||
explicit FUniqueNetIdSteam2(const FUniqueNetIdSteam2& Src) :
|
||||
UniqueNetId(Src.UniqueNetId)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructs this object with the specified net id
|
||||
*
|
||||
* @param InUniqueNetId the id to set ours to
|
||||
*/
|
||||
explicit FUniqueNetIdSteam2(uint64 InUniqueNetId) :
|
||||
UniqueNetId(InUniqueNetId)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs this object with the steam id
|
||||
*
|
||||
* @param InUniqueNetId the id to set ours to
|
||||
*/
|
||||
explicit FUniqueNetIdSteam2(CSteamID InSteamId) :
|
||||
UniqueNetId(InSteamId.ConvertToUint64())
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs this object with the specified net id
|
||||
*
|
||||
* @param String textual representation of an id
|
||||
*/
|
||||
explicit FUniqueNetIdSteam2(const FString& Str) :
|
||||
UniqueNetId(FCString::Atoi64(*Str))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructs this object with the specified net id
|
||||
*
|
||||
* @param InUniqueNetId the id to set ours to (assumed to be FUniqueNetIdSteam in fact)
|
||||
*/
|
||||
explicit FUniqueNetIdSteam2(const FUniqueNetId& InUniqueNetId) :
|
||||
UniqueNetId(*(uint64*)InUniqueNetId.GetBytes())
|
||||
{
|
||||
}
|
||||
|
||||
virtual FName GetType() const override
|
||||
{
|
||||
return STEAM_SUBSYSTEM;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the raw byte representation of this net id
|
||||
* This data is platform dependent and shouldn't be manipulated directly
|
||||
*
|
||||
* @return byte array of size GetSize()
|
||||
*/
|
||||
virtual const uint8* GetBytes() const override
|
||||
{
|
||||
return (uint8*)&UniqueNetId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the size of the id
|
||||
*
|
||||
* @return size in bytes of the id representation
|
||||
*/
|
||||
virtual int32 GetSize() const override
|
||||
{
|
||||
return sizeof(uint64);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the validity of the id
|
||||
*
|
||||
* @return true if this is a well formed ID, false otherwise
|
||||
*/
|
||||
virtual bool IsValid() const override
|
||||
{
|
||||
return UniqueNetId != 0 && CSteamID(UniqueNetId).IsValid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Platform specific conversion to string representation of data
|
||||
*
|
||||
* @return data in string form
|
||||
*/
|
||||
virtual FString ToString() const override
|
||||
{
|
||||
return FString::Printf(TEXT("%llu"), UniqueNetId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a human readable representation of the net id
|
||||
* Shouldn't be used for anything other than logging/debugging
|
||||
*
|
||||
* @return id in string form
|
||||
*/
|
||||
virtual FString ToDebugString() const override
|
||||
{
|
||||
CSteamID SteamID(UniqueNetId);
|
||||
if (SteamID.IsLobby())
|
||||
{
|
||||
return FString::Printf(TEXT("Lobby [0x%llX]"), UniqueNetId);
|
||||
}
|
||||
else if (SteamID.BAnonGameServerAccount())
|
||||
{
|
||||
return FString::Printf(TEXT("Server [0x%llX]"), UniqueNetId);
|
||||
}
|
||||
else if (SteamID.IsValid())
|
||||
{
|
||||
const FString NickName(SteamFriends() ? UTF8_TO_TCHAR(SteamFriends()->GetFriendPersonaName(UniqueNetId)) : TEXT("UNKNOWN"));
|
||||
return FString::Printf(TEXT("%s [0x%llX]"), *NickName, UniqueNetId);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FString::Printf(TEXT("INVALID [0x%llX]"), UniqueNetId);
|
||||
}
|
||||
}
|
||||
|
||||
/** Needed for TMap::GetTypeHash() */
|
||||
friend uint32 GetTypeHash(const FUniqueNetIdSteam2& A)
|
||||
{
|
||||
return (uint32)(A.UniqueNetId) + ((uint32)((A.UniqueNetId) >> 32) * 23);
|
||||
}
|
||||
|
||||
/** Convenience cast to CSteamID */
|
||||
operator CSteamID()
|
||||
{
|
||||
return UniqueNetId;
|
||||
}
|
||||
|
||||
/** Convenience cast to CSteamID */
|
||||
operator const CSteamID() const
|
||||
{
|
||||
return UniqueNetId;
|
||||
}
|
||||
|
||||
/** Convenience cast to CSteamID pointer */
|
||||
operator CSteamID*()
|
||||
{
|
||||
return (CSteamID*)&UniqueNetId;
|
||||
}
|
||||
|
||||
/** Convenience cast to CSteamID pointer */
|
||||
operator const CSteamID*() const
|
||||
{
|
||||
return (const CSteamID*)&UniqueNetId;
|
||||
}
|
||||
|
||||
friend FArchive& operator<<(FArchive& Ar, FUniqueNetIdSteam2& UserId)
|
||||
{
|
||||
return Ar << UserId.UniqueNetId;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#include "AdvancedSteamFriendsLibrary.generated.h"
|
||||
|
||||
@@ -29,30 +246,63 @@ enum class SteamAvatarSize : uint8
|
||||
SteamAvatar_Large = 3
|
||||
};
|
||||
|
||||
UENUM(Blueprintable)
|
||||
enum class ESteamUserOverlayType : uint8
|
||||
{
|
||||
/*Opens the overlay web browser to the specified user or groups profile.*/
|
||||
steamid,
|
||||
/*Opens a chat window to the specified user, or joins the group chat.*/
|
||||
chat,
|
||||
/*Opens a window to a Steam Trading session that was started with the ISteamEconomy / StartTrade Web API.*/
|
||||
jointrade,
|
||||
/*Opens the overlay web browser to the specified user's stats.*/
|
||||
stats,
|
||||
/*Opens the overlay web browser to the specified user's achievements.*/
|
||||
achievements,
|
||||
/*Opens the overlay in minimal mode prompting the user to add the target user as a friend.*/
|
||||
friendadd,
|
||||
/*Opens the overlay in minimal mode prompting the user to remove the target friend.*/
|
||||
friendremove,
|
||||
/*Opens the overlay in minimal mode prompting the user to accept an incoming friend invite.*/
|
||||
friendrequestaccept,
|
||||
/*Opens the overlay in minimal mode prompting the user to ignore an incoming friend invite.*/
|
||||
friendrequestignore
|
||||
};
|
||||
|
||||
static FString EnumToString(const FString& enumName, uint8 value)
|
||||
{
|
||||
const UEnum* EnumPtr = FindObject<UEnum>(ANY_PACKAGE, *enumName, true);
|
||||
|
||||
if (!EnumPtr)
|
||||
return FString();
|
||||
|
||||
FString EnumName = EnumPtr->GetNameStringByIndex(value);
|
||||
return EnumName;
|
||||
}
|
||||
|
||||
|
||||
USTRUCT(BlueprintType, Category = "Online|SteamAPI|SteamGroups")
|
||||
struct FBPSteamGroupInfo
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
public:
|
||||
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
FBPUniqueNetId GroupID; // Uint64 representation
|
||||
FBPUniqueNetId GroupID; // Uint64 representation
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
FString GroupName;
|
||||
FString GroupName;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
FString GroupTag;
|
||||
FString GroupTag;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
int32 numOnline;
|
||||
int32 numOnline;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
int32 numInGame;
|
||||
int32 numInGame;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||
int32 numChatting;
|
||||
int32 numChatting;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
UCLASS()
|
||||
class UAdvancedSteamFriendsLibrary : public UBlueprintFunctionLibrary
|
||||
{
|
||||
@@ -68,6 +318,10 @@ public:
|
||||
// Preloads the avatar and name of a steam friend, return whether it is already available or not, STEAM ONLY, Takes time to actually load everything after this is called.
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
||||
static bool RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly = false);
|
||||
|
||||
// Opens the steam overlay to go to the specified user dialog
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
||||
static bool OpenSteamUserOverlay(const FBPUniqueNetId UniqueNetId, ESteamUserOverlayType DialogType);
|
||||
|
||||
// Gets the level of a friends steam account, STEAM ONLY, Returns -1 if the steam level is not known, might need RequestSteamFriendInfo called first.
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
||||
@@ -82,12 +336,12 @@ public:
|
||||
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.
|
||||
* can use the AppID with the WebAPI GetAppList request.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI", meta = (ExpandEnumAsExecs = "Result"))
|
||||
static void GetSteamFriendGamePlayed(const FBPUniqueNetId UniqueNetId, EBlueprintResultSwitch &Result, FString & GameName, int32 & AppID);
|
||||
static void GetSteamFriendGamePlayed(const FBPUniqueNetId UniqueNetId, EBlueprintResultSwitch &Result/*, FString & GameName*/, int32 & AppID);
|
||||
|
||||
// Get a full list of steam groups
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|SteamAPI|SteamGroups")
|
||||
static void GetSteamGroups(TArray<FBPSteamGroupInfo> & SteamGroups);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "ModuleManager.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
class AdvancedSteamSessions : public IModuleInterface
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "Online.h"
|
||||
#include "OnlineSubsystem.h"
|
||||
#include "OnlineSessionInterface.h"
|
||||
#include "Interfaces/OnlineSessionInterface.h"
|
||||
|
||||
// @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
|
||||
@@ -227,6 +227,25 @@ public:
|
||||
CreatorSteamID = FString::Printf(TEXT("%llu"), hUGCDetails.m_ulSteamIDOwner);
|
||||
}
|
||||
|
||||
FBPSteamWorkshopItemDetails(const SteamUGCDetails_t &hUGCDetails)
|
||||
{
|
||||
ResultOfRequest = (FBPSteamResult)hUGCDetails.m_eResult;
|
||||
FileType = (FBPWorkshopFileType)hUGCDetails.m_eFileType;
|
||||
CreatorAppID = (int32)hUGCDetails.m_nCreatorAppID;
|
||||
ConsumerAppID = (int32)hUGCDetails.m_nConsumerAppID;
|
||||
Title = FString(hUGCDetails.m_rgchTitle, k_cchPublishedDocumentTitleMax);
|
||||
Description = FString(hUGCDetails.m_rgchDescription, k_cchPublishedDocumentDescriptionMax);
|
||||
ItemUrl = FString(hUGCDetails.m_rgchURL, k_cchPublishedFileURLMax);
|
||||
VotesUp = (int32)hUGCDetails.m_unVotesUp;
|
||||
VotesDown = (int32)hUGCDetails.m_unVotesDown;
|
||||
CalculatedScore = hUGCDetails.m_flScore;
|
||||
bBanned = hUGCDetails.m_bBanned;
|
||||
bAcceptedForUse = hUGCDetails.m_bAcceptedForUse;
|
||||
bTagsTruncated = hUGCDetails.m_bTagsTruncated;
|
||||
|
||||
CreatorSteamID = FString::Printf(TEXT("%llu"), hUGCDetails.m_ulSteamIDOwner);
|
||||
}
|
||||
|
||||
// Result of obtaining the details
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|AdvancedSteamWorkshop")
|
||||
FBPSteamResult ResultOfRequest;
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
#include "OnlineSubsystemSteam.h"
|
||||
|
||||
#pragma push_macro("ARRAY_COUNT")
|
||||
#undef ARRAY_COUNT
|
||||
|
||||
@@ -75,7 +77,7 @@ class USteamRequestGroupOfficersCallbackProxy : public UOnlineBlueprintCallProxy
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FBlueprintGroupOfficerDetailsDelegate OnFailure;
|
||||
|
||||
// Retruns a list of steam group officers
|
||||
// Returns a list of steam group officers
|
||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|SteamAPI|SteamGroups")
|
||||
static USteamRequestGroupOfficersCallbackProxy* GetSteamGroupOfficerList(UObject* WorldContextObject, FBPUniqueNetId GroupUniqueNetID);
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
#include "OnlineSubsystemSteam.h"
|
||||
|
||||
#pragma push_macro("ARRAY_COUNT")
|
||||
#undef ARRAY_COUNT
|
||||
|
||||
|
||||
@@ -2,45 +2,6 @@
|
||||
#include "AdvancedSteamFriendsLibrary.h"
|
||||
#include "OnlineSubSystemHeader.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)
|
||||
// #TODO check back on this at some point
|
||||
#pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on....
|
||||
#endif
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
#pragma push_macro("ARRAY_COUNT")
|
||||
#undef ARRAY_COUNT
|
||||
|
||||
#if USING_CODE_ANALYSIS
|
||||
MSVC_PRAGMA(warning(push))
|
||||
MSVC_PRAGMA(warning(disable : ALL_CODE_ANALYSIS_WARNINGS))
|
||||
#endif // USING_CODE_ANALYSIS
|
||||
|
||||
#include <steam/steam_api.h>
|
||||
|
||||
#if USING_CODE_ANALYSIS
|
||||
MSVC_PRAGMA(warning(pop))
|
||||
#endif // USING_CODE_ANALYSIS
|
||||
|
||||
#include <steam/isteamapps.h>
|
||||
#include <steam/isteamapplist.h>
|
||||
#include <OnlineSubsystemSteamTypes.h>
|
||||
#pragma pop_macro("ARRAY_COUNT")
|
||||
|
||||
#endif
|
||||
|
||||
// @todo Steam: See above
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
//General Log
|
||||
DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
|
||||
|
||||
@@ -50,7 +11,7 @@ DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
|
||||
{
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||
{
|
||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
|
||||
return 0;
|
||||
@@ -97,6 +58,7 @@ DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
|
||||
|
||||
void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray<FBPSteamGroupInfo> & SteamGroups)
|
||||
{
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
if (SteamAPI_Init())
|
||||
@@ -112,7 +74,7 @@ void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray<FBPSteamGroupInfo> & St
|
||||
|
||||
FBPSteamGroupInfo GroupInfo;
|
||||
|
||||
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam(SteamGroupID));
|
||||
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam2(SteamGroupID));
|
||||
GroupInfo.GroupID.SetUniqueNetId(ValueID);
|
||||
SteamFriends()->GetClanActivityCounts(SteamGroupID, &GroupInfo.numOnline, &GroupInfo.numInGame, &GroupInfo.numChatting);
|
||||
GroupInfo.GroupName = FString(UTF8_TO_TCHAR(SteamFriends()->GetClanName(SteamGroupID)));
|
||||
@@ -122,13 +84,14 @@ void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray<FBPSteamGroupInfo> & St
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void UAdvancedSteamFriendsLibrary::GetSteamFriendGamePlayed(const FBPUniqueNetId UniqueNetId, EBlueprintResultSwitch &Result, FString & GameName, int32 & AppID)
|
||||
void UAdvancedSteamFriendsLibrary::GetSteamFriendGamePlayed(const FBPUniqueNetId UniqueNetId, EBlueprintResultSwitch &Result/*, FString & GameName*/, int32 & AppID)
|
||||
{
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||
{
|
||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendGamePlayed Had a bad UniqueNetId!"));
|
||||
Result = EBlueprintResultSwitch::OnFailure;
|
||||
@@ -146,13 +109,15 @@ void UAdvancedSteamFriendsLibrary::GetSteamFriendGamePlayed(const FBPUniqueNetId
|
||||
{
|
||||
AppID = GameInfo.m_gameID.AppID();
|
||||
|
||||
char NameBuffer[512];
|
||||
// Forgot this test and left it in, it is incorrect, you would need restricted access
|
||||
// And it would only find games in the local library anyway
|
||||
/*char NameBuffer[512];
|
||||
int Len = SteamAppList()->GetAppName(GameInfo.m_gameID.AppID(), NameBuffer, 512);
|
||||
|
||||
if (Len != -1) // Invalid
|
||||
{
|
||||
GameName = FString(UTF8_TO_TCHAR(NameBuffer));
|
||||
}
|
||||
}*/
|
||||
|
||||
Result = EBlueprintResultSwitch::OnSuccess;
|
||||
return;
|
||||
@@ -168,7 +133,7 @@ int32 UAdvancedSteamFriendsLibrary::GetFriendSteamLevel(const FBPUniqueNetId Uni
|
||||
{
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||
{
|
||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
|
||||
return 0;
|
||||
@@ -189,7 +154,7 @@ FString UAdvancedSteamFriendsLibrary::GetSteamPersonaName(const FBPUniqueNetId U
|
||||
{
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||
{
|
||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamPersonaName Had a bad UniqueNetId!"));
|
||||
return FString(TEXT(""));
|
||||
@@ -209,7 +174,7 @@ FString UAdvancedSteamFriendsLibrary::GetSteamPersonaName(const FBPUniqueNetId U
|
||||
FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FString SteamID64)
|
||||
{
|
||||
FBPUniqueNetId netId;
|
||||
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
if (!(SteamID64.Len() > 0))
|
||||
{
|
||||
@@ -220,7 +185,7 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FStri
|
||||
if (SteamAPI_Init())
|
||||
{
|
||||
// Already does the conversion
|
||||
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam(SteamID64));
|
||||
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam2(SteamID64));
|
||||
//FCString::Atoi64(*SteamID64));
|
||||
|
||||
netId.SetUniqueNetId(ValueID);
|
||||
@@ -234,7 +199,7 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FStri
|
||||
bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly)
|
||||
{
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||
{
|
||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("RequestSteamFriendInfo Had a bad UniqueNetId!"));
|
||||
return false;
|
||||
@@ -252,10 +217,33 @@ bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId U
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool UAdvancedSteamFriendsLibrary::OpenSteamUserOverlay(const FBPUniqueNetId UniqueNetId, ESteamUserOverlayType DialogType)
|
||||
{
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||
{
|
||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("OpenSteamUserOverlay Had a bad UniqueNetId!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (SteamAPI_Init())
|
||||
{
|
||||
uint64 id = *((uint64*)UniqueNetId.UniqueNetId->GetBytes());
|
||||
FString DialogName = EnumToString("ESteamUserOverlayType", (uint8)DialogType);
|
||||
SteamFriends()->ActivateGameOverlayToUser(TCHAR_TO_ANSI(*DialogName), id);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("OpenSteamUserOverlay Couldn't init steamAPI!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueNetId UniqueNetId, EBlueprintAsyncResultSwitch &Result, SteamAvatarSize AvatarSize)
|
||||
{
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||
{
|
||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendAvatar Had a bad UniqueNetId!"));
|
||||
Result = EBlueprintAsyncResultSwitch::OnFailure;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "SteamRequestGroupOfficersCallbackProxy.h"
|
||||
#include "CoreOnline.h"
|
||||
#include "UObject/CoreOnline.h"
|
||||
#include "AdvancedSteamFriendsLibrary.h"
|
||||
#include "OnlineSubSystemHeader.h"
|
||||
#include "OnlineSubsystemSteamTypes.h"
|
||||
//#include "OnlineSubsystemSteamTypes.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// UEndSessionCallbackProxy
|
||||
@@ -44,12 +45,22 @@ void USteamRequestGroupOfficersCallbackProxy::Activate()
|
||||
void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanOfficerListResponse_t *pResult, bool bIOFailure)
|
||||
{
|
||||
TArray<FBPSteamGroupOfficer> OfficerArray;
|
||||
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
||||
|
||||
if (bIOFailure || !pResult || !pResult->m_bSuccess)
|
||||
{
|
||||
OnFailure.Broadcast(OfficerArray);
|
||||
if (SteamSubsystem != nullptr)
|
||||
{
|
||||
SteamSubsystem->ExecuteNextTick([this]()
|
||||
{
|
||||
TArray<FBPSteamGroupOfficer> FailureArray;
|
||||
OnFailure.Broadcast(FailureArray);
|
||||
});
|
||||
}
|
||||
//OnFailure.Broadcast(OfficerArray);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -62,7 +73,7 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
|
||||
|
||||
Officer.bIsOwner = true;
|
||||
|
||||
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam(ClanOwner));
|
||||
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam2(ClanOwner));
|
||||
Officer.OfficerUniqueNetID.SetUniqueNetId(ValueID);
|
||||
OfficerArray.Add(Officer);
|
||||
|
||||
@@ -72,17 +83,37 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
|
||||
|
||||
Officer.bIsOwner = false;
|
||||
|
||||
TSharedPtr<const FUniqueNetId> newValueID(new const FUniqueNetIdSteam(OfficerSteamID));
|
||||
TSharedPtr<const FUniqueNetId> newValueID(new const FUniqueNetIdSteam2(OfficerSteamID));
|
||||
Officer.OfficerUniqueNetID.SetUniqueNetId(newValueID);
|
||||
|
||||
OfficerArray.Add(Officer);
|
||||
}
|
||||
|
||||
OnSuccess.Broadcast(OfficerArray);
|
||||
if (SteamSubsystem != nullptr)
|
||||
{
|
||||
SteamSubsystem->ExecuteNextTick([OfficerArray, this]()
|
||||
{
|
||||
OnSuccess.Broadcast(OfficerArray);
|
||||
});
|
||||
}
|
||||
|
||||
//OnSuccess.Broadcast(OfficerArray);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SteamSubsystem != nullptr)
|
||||
{
|
||||
SteamSubsystem->ExecuteNextTick([this]()
|
||||
{
|
||||
TArray<FBPSteamGroupOfficer> FailureArray;
|
||||
OnFailure.Broadcast(FailureArray);
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
OnFailure.Broadcast(OfficerArray);
|
||||
// Should never hit this anyway
|
||||
//OnFailure.Broadcast(OfficerArray);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,23 +49,51 @@ void USteamWSRequestUGCDetailsCallbackProxy::Activate()
|
||||
void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure)
|
||||
{
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
||||
|
||||
if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0)
|
||||
{
|
||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
{
|
||||
if (SteamSubsystem != nullptr)
|
||||
{
|
||||
SteamSubsystem->ExecuteNextTick([this]()
|
||||
{
|
||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
});
|
||||
}
|
||||
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
return;
|
||||
}
|
||||
if (SteamAPI_Init())
|
||||
{
|
||||
SteamUGCDetails_t Details;
|
||||
if (SteamUGC()->GetQueryUGCResult(pResult->m_handle, 0, &Details))
|
||||
{
|
||||
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||
{
|
||||
if (SteamSubsystem != nullptr)
|
||||
{
|
||||
SteamSubsystem->ExecuteNextTick([Details, this]()
|
||||
{
|
||||
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||
});
|
||||
}
|
||||
|
||||
//OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SteamSubsystem != nullptr)
|
||||
{
|
||||
SteamSubsystem->ExecuteNextTick([this]()
|
||||
{
|
||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
// Not needed, should never hit here
|
||||
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1,7 @@
|
||||
Readme and documentation will be worked on soon
|
||||
### How do I use it? ###
|
||||
|
||||
**KantanDocGen Automatic Documentation ([KantanDocGen](http://kantandev.com/free/kantan-doc-gen))**
|
||||
|
||||
**[AdvancedSessions](https://mordentral.bitbucket.io/AdvancedSessions/Advanced)**
|
||||
|
||||
**[AdvancedSteamSessions](https://mordentral.bitbucket.io/AdvancedSteamSessions/Advanced)**
|
||||
|
||||
Reference in New Issue
Block a user