mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-12-09 23:53:03 +00:00
Switched to epics new hashing setup for unique ids
Also added new function GetLocalSteamIDFromSteam. Former-commit-id: 7a15f500cd86064444cedb47433417b7bb9298e4
This commit is contained in:
@@ -197,7 +197,8 @@ public:
|
|||||||
/** Needed for TMap::GetTypeHash() */
|
/** Needed for TMap::GetTypeHash() */
|
||||||
friend uint32 GetTypeHash(const FUniqueNetIdSteam2& A)
|
friend uint32 GetTypeHash(const FUniqueNetIdSteam2& A)
|
||||||
{
|
{
|
||||||
return (uint32)(A.UniqueNetId) + ((uint32)((A.UniqueNetId) >> 32) * 23);
|
return GetTypeHash(A.UniqueNetId);
|
||||||
|
//return (uint32)(A.UniqueNetId) + ((uint32)((A.UniqueNetId) >> 32) * 23);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Convenience cast to CSteamID */
|
/** Convenience cast to CSteamID */
|
||||||
@@ -296,6 +297,10 @@ public:
|
|||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedFriends|SteamAPI")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedFriends|SteamAPI")
|
||||||
static FBPUniqueNetId CreateSteamIDFromString(const FString SteamID64);
|
static FBPUniqueNetId CreateSteamIDFromString(const FString SteamID64);
|
||||||
|
|
||||||
|
// Retreives the local steam ID from steam
|
||||||
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedFriends|SteamAPI")
|
||||||
|
static FBPUniqueNetId GetLocalSteamIDFromSteam();
|
||||||
|
|
||||||
/* Gets the current game played by a friend - AppID is int32 even though steam ids are uint32, can't be helped in blueprint currently
|
/* Gets the current game played by a friend - AppID is int32 even though steam ids are uint32, can't be helped in blueprint currently
|
||||||
* can use the AppID with the WebAPI GetAppList request.
|
* can use the AppID with the WebAPI GetAppList request.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -196,6 +196,21 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FStri
|
|||||||
return netId;
|
return netId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FBPUniqueNetId UAdvancedSteamFriendsLibrary::GetLocalSteamIDFromSteam()
|
||||||
|
{
|
||||||
|
FBPUniqueNetId netId;
|
||||||
|
|
||||||
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
if (SteamAPI_Init())
|
||||||
|
{
|
||||||
|
FUniqueNetIdSteam2 SteamID(SteamUser()->GetSteamID());
|
||||||
|
netId.SetUniqueNetId(&SteamID);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return netId;
|
||||||
|
}
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly)
|
bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly)
|
||||||
{
|
{
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|||||||
Reference in New Issue
Block a user