Release 1.9.7.0 - Summer Update 2025
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Steamworks
|
||||
/// <summary>
|
||||
/// Return true if this user is playing the game we're running
|
||||
/// </summary>
|
||||
public bool IsPlayingThisGame => GameInfo?.GameID == SteamClient.AppId;
|
||||
public bool IsPlayingThisGame => GameInfo?.GameID is { Type: GameIdType.App } && GameInfo.Value.GameID.AppId == SteamClient.AppId;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this friend is online
|
||||
@@ -75,7 +75,26 @@ namespace Steamworks
|
||||
|
||||
public Relationship Relationship => SteamFriends.Internal?.GetFriendRelationship( Id ) ?? Relationship.None;
|
||||
public FriendState State => SteamFriends.Internal?.GetFriendPersonaState( Id ) ?? FriendState.Offline;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the player's current Steam name.
|
||||
/// <remarks>
|
||||
/// Steam returns nicknames here if "Append nicknames to friends' names" is disabled in the Steam client.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public string? Name => SteamFriends.Internal?.GetFriendPersonaName( Id );
|
||||
|
||||
/// <summary>
|
||||
/// Returns the nickname that was set for this Steam player, if any.
|
||||
/// <remarks>
|
||||
/// Steam will never return nicknames if "Append nicknames to friends' names" is disabled in the Steam client.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
public string? Nickname => SteamFriends.Internal?.GetPlayerNickname( Id );
|
||||
|
||||
/// <summary>
|
||||
/// Returns the player's Steam name history.
|
||||
/// </summary>
|
||||
public IEnumerable<string> NameHistory
|
||||
{
|
||||
get
|
||||
@@ -114,10 +133,10 @@ namespace Steamworks
|
||||
|
||||
public struct FriendGameInfo
|
||||
{
|
||||
public ulong GameID; // m_gameID class CGameID
|
||||
public uint GameIP; // m_unGameIP uint32
|
||||
public ulong SteamIDLobby; // m_steamIDLobby class CSteamID
|
||||
internal uint GameIP; // m_unGameIP uint32
|
||||
internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID
|
||||
|
||||
public GameId GameID;
|
||||
public int ConnectionPort;
|
||||
public int QueryPort;
|
||||
|
||||
|
||||
@@ -1,25 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace Steamworks.Data
|
||||
{
|
||||
public struct GameId
|
||||
public enum GameIdType : byte
|
||||
{
|
||||
App = 0,
|
||||
GameMod = 1,
|
||||
Shortcut = 2,
|
||||
P2P = 3,
|
||||
}
|
||||
|
||||
public struct GameId : IEquatable<GameId>
|
||||
{
|
||||
// TODO - Be able to access these vars
|
||||
|
||||
/*
|
||||
|
||||
enum EGameIDType
|
||||
{
|
||||
k_EGameIDTypeApp = 0,
|
||||
k_EGameIDTypeGameMod = 1,
|
||||
k_EGameIDTypeShortcut = 2,
|
||||
k_EGameIDTypeP2P = 3,
|
||||
};
|
||||
|
||||
# ifdef VALVE_BIG_ENDIAN
|
||||
unsigned int m_nModID : 32;
|
||||
unsigned int m_nType : 8;
|
||||
@@ -30,8 +23,31 @@ namespace Steamworks.Data
|
||||
unsigned int m_nModID : 32;
|
||||
#endif
|
||||
*/
|
||||
|
||||
// 0xAAAAAAAA_BBCCCCCC
|
||||
// A = m_nModID
|
||||
// B = m_nType
|
||||
// C = m_nAppID
|
||||
public ulong Value;
|
||||
|
||||
public GameIdType Type
|
||||
{
|
||||
get => (GameIdType)(byte)( Value >> 24 );
|
||||
set => Value = ( Value & 0xFFFFFFFF_00FFFFFF ) | ( (ulong)(byte)value << 24 );
|
||||
}
|
||||
|
||||
public uint AppId
|
||||
{
|
||||
get => (uint)( Value & 0x00000000_00FFFFFF );
|
||||
set => Value = ( Value & 0xFFFFFFFF_FF000000 ) | (value & 0x00000000_00FFFFFF);
|
||||
}
|
||||
|
||||
public uint ModId
|
||||
{
|
||||
get => (uint)( Value >> 32 );
|
||||
set => Value = ( Value & 0x00000000_FFFFFFFF ) | ( (ulong)value << 32 );
|
||||
}
|
||||
|
||||
public static implicit operator GameId( ulong value )
|
||||
{
|
||||
return new GameId { Value = value };
|
||||
@@ -41,5 +57,30 @@ namespace Steamworks.Data
|
||||
{
|
||||
return value.Value;
|
||||
}
|
||||
|
||||
public bool Equals(GameId other)
|
||||
{
|
||||
return Value == other.Value;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return obj is GameId other && Equals(other);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Value.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(GameId left, GameId right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(GameId left, GameId right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Steamworks;
|
||||
|
||||
public struct GamePhaseRecordingInfo
|
||||
{
|
||||
public string PhaseId;
|
||||
public ulong RecordingMs;
|
||||
public ulong LongestClipMs;
|
||||
public uint ClipCount;
|
||||
public uint ScreenshotCount;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ namespace Steamworks
|
||||
|
||||
uint _ = (uint)Helpers.MemoryBufferSize;
|
||||
|
||||
if ( SteamInventory.Internal is null || !SteamInventory.Internal.GetItemDefinitionProperty( Id, name, out var vl, ref _ ) )
|
||||
if ( SteamInventory.Internal is null || !SteamInventory.Internal.GetItemDefinitionProperty( Id, name, out var vl ) )
|
||||
return null;
|
||||
|
||||
if (name == null) //return keys string
|
||||
|
||||
@@ -100,18 +100,14 @@ namespace Steamworks
|
||||
|
||||
internal static Dictionary<string, string>? GetProperties( SteamInventoryResult_t result, int index )
|
||||
{
|
||||
var strlen = (uint) Helpers.MemoryBufferSize;
|
||||
|
||||
if ( SteamInventory.Internal is null || !SteamInventory.Internal.GetResultItemProperty( result, (uint)index, null, out var propNames, ref strlen ) )
|
||||
if ( SteamInventory.Internal is null || !SteamInventory.Internal.GetResultItemProperty( result, (uint)index, null, out var propNames ) )
|
||||
return null;
|
||||
|
||||
var props = new Dictionary<string, string>();
|
||||
|
||||
foreach ( var propertyName in propNames.Split( ',' ) )
|
||||
{
|
||||
strlen = (uint)Helpers.MemoryBufferSize;
|
||||
|
||||
if ( SteamInventory.Internal.GetResultItemProperty( result, (uint)index, propertyName, out var strVal, ref strlen ) )
|
||||
if ( SteamInventory.Internal.GetResultItemProperty( result, (uint)index, propertyName, out var strVal ) )
|
||||
{
|
||||
props.Add( propertyName, strVal );
|
||||
}
|
||||
@@ -179,4 +175,4 @@ namespace Steamworks
|
||||
public override int GetHashCode() => _id.GetHashCode();
|
||||
public bool Equals( InventoryItem p ) => p._id == _id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace Steamworks.Data
|
||||
public bool SendChatString( string message )
|
||||
{
|
||||
//adding null terminator as it's used in Helpers.MemoryToString
|
||||
var data = System.Text.Encoding.UTF8.GetBytes( message + '\0' );
|
||||
var data = Utility.Utf8NoBom.GetBytes( message + '\0' );
|
||||
return SendChatBytes( data );
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Steamworks.Data
|
||||
{
|
||||
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )]
|
||||
[StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize, CharSet = CharSet.Ansi )]
|
||||
internal partial struct MatchMakingKeyValuePair
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace Steamworks.Ugc
|
||||
using ( var a = SteamParamStringArray.From( Tags.ToArray() ) )
|
||||
{
|
||||
var val = a.Value;
|
||||
SteamUGC.Internal.SetItemTags( handle, ref val );
|
||||
SteamUGC.Internal.SetItemTags( handle, ref val, false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,10 +116,10 @@ namespace Steamworks.Ugc
|
||||
/// The number of downvotes of this item
|
||||
/// </summary>
|
||||
public uint VotesDown => details.VotesDown;
|
||||
/// <summary>
|
||||
/// Dependencies/children of this item or collection, available only from WithChildren(true) queries
|
||||
/// </summary>
|
||||
public PublishedFileId[]? Children;
|
||||
/// <summary>
|
||||
/// Dependencies/children of this item or collection, available only from WithDependencies(true) queries
|
||||
/// </summary>
|
||||
public PublishedFileId[]? Children;
|
||||
|
||||
/// <summary>
|
||||
/// Additional previews of this item or collection, available only from WithAdditionalPreviews(true) queries
|
||||
|
||||
Reference in New Issue
Block a user