diff --git a/api/AltV.Net.Async/Elements/Entities/AsyncConnectionInfo.cs b/api/AltV.Net.Async/Elements/Entities/AsyncConnectionInfo.cs index b5e732b6..a10907eb 100644 --- a/api/AltV.Net.Async/Elements/Entities/AsyncConnectionInfo.cs +++ b/api/AltV.Net.Async/Elements/Entities/AsyncConnectionInfo.cs @@ -63,6 +63,19 @@ public ulong HardwareIdExHash } } } + + public string HardwareId3 + { + get + { + lock (ConnectionInfo) + { + if (!AsyncContext.CheckIfExistsOrCachedNullable(ConnectionInfo)) return default; + return ConnectionInfo.HardwareId3; + } + } + } + public string AuthToken { get @@ -74,6 +87,7 @@ public string AuthToken } } } + public bool IsDebug { get diff --git a/api/AltV.Net.Async/Elements/Entities/AsyncPlayer.cs b/api/AltV.Net.Async/Elements/Entities/AsyncPlayer.cs index 1ef1cef3..c5ef7985 100644 --- a/api/AltV.Net.Async/Elements/Entities/AsyncPlayer.cs +++ b/api/AltV.Net.Async/Elements/Entities/AsyncPlayer.cs @@ -100,6 +100,18 @@ public ulong HardwareIdExHash } } + public string HardwareId3 + { + get + { + lock (Player) + { + if (!AsyncContext.CheckIfExistsOrCachedNullable(Player)) return default; + return Player.HardwareId3; + } + } + } + public string AuthToken { get diff --git a/api/AltV.Net.CApi/Libraries/ClientLibrary.cs b/api/AltV.Net.CApi/Libraries/ClientLibrary.cs index 07c053ea..7f243116 100644 --- a/api/AltV.Net.CApi/Libraries/ClientLibrary.cs +++ b/api/AltV.Net.CApi/Libraries/ClientLibrary.cs @@ -908,7 +908,7 @@ public unsafe interface IClientLibrary public unsafe class ClientLibrary : IClientLibrary { - public readonly uint Methods = 1779; + public readonly uint Methods = 1781; public delegate* unmanaged[Cdecl] Audio_AddOutput { get; } public delegate* unmanaged[Cdecl] Audio_GetBaseObject { get; } public delegate* unmanaged[Cdecl] Audio_GetCurrentTime { get; } @@ -3597,7 +3597,7 @@ private IntPtr GetUnmanagedPtr(IDictionary funcTable, ulong ha public ClientLibrary(Dictionary funcTable) { if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true; - else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 11629663074568386340UL) Outdated = true; + else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 17036908327259488488UL) Outdated = true; Audio_AddOutput = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 9914412815391408844UL, Audio_AddOutputFallback); Audio_GetBaseObject = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 6330360502401226894UL, Audio_GetBaseObjectFallback); Audio_GetCurrentTime = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 2944324482134975819UL, Audio_GetCurrentTimeFallback); diff --git a/api/AltV.Net.CApi/Libraries/ServerLibrary.cs b/api/AltV.Net.CApi/Libraries/ServerLibrary.cs index 3c1ed824..0175bbea 100644 --- a/api/AltV.Net.CApi/Libraries/ServerLibrary.cs +++ b/api/AltV.Net.CApi/Libraries/ServerLibrary.cs @@ -35,6 +35,7 @@ public unsafe interface IServerLibrary public delegate* unmanaged[Cdecl] ConnectionInfo_GetCloudAuthResult { get; } public delegate* unmanaged[Cdecl] ConnectionInfo_GetCloudID { get; } public delegate* unmanaged[Cdecl] ConnectionInfo_GetDiscordUserID { get; } + public delegate* unmanaged[Cdecl] ConnectionInfo_GetHwId3 { get; } public delegate* unmanaged[Cdecl] ConnectionInfo_GetHwIdExHash { get; } public delegate* unmanaged[Cdecl] ConnectionInfo_GetHwIdHash { get; } public delegate* unmanaged[Cdecl] ConnectionInfo_GetID { get; } @@ -194,6 +195,7 @@ public unsafe interface IServerLibrary public delegate* unmanaged[Cdecl] Player_GetHeadBlendData { get; } public delegate* unmanaged[Cdecl] Player_GetHeadBlendPaletteColor { get; } public delegate* unmanaged[Cdecl] Player_GetHeadOverlay { get; } + public delegate* unmanaged[Cdecl] Player_GetHwId3 { get; } public delegate* unmanaged[Cdecl] Player_GetHwidExHash { get; } public delegate* unmanaged[Cdecl] Player_GetHwidHash { get; } public delegate* unmanaged[Cdecl] Player_GetInteriorLocation { get; } @@ -488,7 +490,7 @@ public unsafe interface IServerLibrary public unsafe class ServerLibrary : IServerLibrary { - public readonly uint Methods = 1779; + public readonly uint Methods = 1781; public delegate* unmanaged[Cdecl] BaseObject_DeleteSyncedMetaData { get; } public delegate* unmanaged[Cdecl] BaseObject_SetMultipleSyncedMetaData { get; } public delegate* unmanaged[Cdecl] BaseObject_SetSyncedMetaData { get; } @@ -513,6 +515,7 @@ public unsafe class ServerLibrary : IServerLibrary public delegate* unmanaged[Cdecl] ConnectionInfo_GetCloudAuthResult { get; } public delegate* unmanaged[Cdecl] ConnectionInfo_GetCloudID { get; } public delegate* unmanaged[Cdecl] ConnectionInfo_GetDiscordUserID { get; } + public delegate* unmanaged[Cdecl] ConnectionInfo_GetHwId3 { get; } public delegate* unmanaged[Cdecl] ConnectionInfo_GetHwIdExHash { get; } public delegate* unmanaged[Cdecl] ConnectionInfo_GetHwIdHash { get; } public delegate* unmanaged[Cdecl] ConnectionInfo_GetID { get; } @@ -672,6 +675,7 @@ public unsafe class ServerLibrary : IServerLibrary public delegate* unmanaged[Cdecl] Player_GetHeadBlendData { get; } public delegate* unmanaged[Cdecl] Player_GetHeadBlendPaletteColor { get; } public delegate* unmanaged[Cdecl] Player_GetHeadOverlay { get; } + public delegate* unmanaged[Cdecl] Player_GetHwId3 { get; } public delegate* unmanaged[Cdecl] Player_GetHwidExHash { get; } public delegate* unmanaged[Cdecl] Player_GetHwidHash { get; } public delegate* unmanaged[Cdecl] Player_GetInteriorLocation { get; } @@ -1010,6 +1014,8 @@ public unsafe class ServerLibrary : IServerLibrary private static nint ConnectionInfo_GetCloudIDFallback(IntPtr _connectionInfo, int* _size) => throw new Exceptions.OutdatedSdkException("ConnectionInfo_GetCloudID", "ConnectionInfo_GetCloudID SDK method is outdated. Please update your module nuget"); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate long ConnectionInfo_GetDiscordUserIDDelegate(IntPtr _connectionInfo); private static long ConnectionInfo_GetDiscordUserIDFallback(IntPtr _connectionInfo) => throw new Exceptions.OutdatedSdkException("ConnectionInfo_GetDiscordUserID", "ConnectionInfo_GetDiscordUserID SDK method is outdated. Please update your module nuget"); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate nint ConnectionInfo_GetHwId3Delegate(IntPtr _connectionInfo, int* _size); + private static nint ConnectionInfo_GetHwId3Fallback(IntPtr _connectionInfo, int* _size) => throw new Exceptions.OutdatedSdkException("ConnectionInfo_GetHwId3", "ConnectionInfo_GetHwId3 SDK method is outdated. Please update your module nuget"); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate ulong ConnectionInfo_GetHwIdExHashDelegate(IntPtr _connectionInfo); private static ulong ConnectionInfo_GetHwIdExHashFallback(IntPtr _connectionInfo) => throw new Exceptions.OutdatedSdkException("ConnectionInfo_GetHwIdExHash", "ConnectionInfo_GetHwIdExHash SDK method is outdated. Please update your module nuget"); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate ulong ConnectionInfo_GetHwIdHashDelegate(IntPtr _connectionInfo); @@ -1328,6 +1334,8 @@ public unsafe class ServerLibrary : IServerLibrary private static void Player_GetHeadBlendPaletteColorFallback(nint _player, byte _id, Rgba* _headBlendPaletteColor) => throw new Exceptions.OutdatedSdkException("Player_GetHeadBlendPaletteColor", "Player_GetHeadBlendPaletteColor SDK method is outdated. Please update your module nuget"); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void Player_GetHeadOverlayDelegate(nint _player, byte _overlayID, HeadOverlay* _headOverlay); private static void Player_GetHeadOverlayFallback(nint _player, byte _overlayID, HeadOverlay* _headOverlay) => throw new Exceptions.OutdatedSdkException("Player_GetHeadOverlay", "Player_GetHeadOverlay SDK method is outdated. Please update your module nuget"); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate nint Player_GetHwId3Delegate(nint _player, int* _size); + private static nint Player_GetHwId3Fallback(nint _player, int* _size) => throw new Exceptions.OutdatedSdkException("Player_GetHwId3", "Player_GetHwId3 SDK method is outdated. Please update your module nuget"); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate ulong Player_GetHwidExHashDelegate(nint _player); private static ulong Player_GetHwidExHashFallback(nint _player) => throw new Exceptions.OutdatedSdkException("Player_GetHwidExHash", "Player_GetHwidExHash SDK method is outdated. Please update your module nuget"); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate ulong Player_GetHwidHashDelegate(nint _player); @@ -1917,7 +1925,7 @@ private IntPtr GetUnmanagedPtr(IDictionary funcTable, ulong ha public ServerLibrary(Dictionary funcTable) { if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true; - else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 11629663074568386340UL) Outdated = true; + else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 17036908327259488488UL) Outdated = true; BaseObject_DeleteSyncedMetaData = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 8228424877092269355UL, BaseObject_DeleteSyncedMetaDataFallback); BaseObject_SetMultipleSyncedMetaData = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 1390762125822890831UL, BaseObject_SetMultipleSyncedMetaDataFallback); BaseObject_SetSyncedMetaData = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 8002999088966424231UL, BaseObject_SetSyncedMetaDataFallback); @@ -1942,6 +1950,7 @@ public ServerLibrary(Dictionary funcTable) ConnectionInfo_GetCloudAuthResult = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 7415605567391116903UL, ConnectionInfo_GetCloudAuthResultFallback); ConnectionInfo_GetCloudID = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 7998061229071288348UL, ConnectionInfo_GetCloudIDFallback); ConnectionInfo_GetDiscordUserID = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 4175744399917476392UL, ConnectionInfo_GetDiscordUserIDFallback); + ConnectionInfo_GetHwId3 = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 11277934694982627403UL, ConnectionInfo_GetHwId3Fallback); ConnectionInfo_GetHwIdExHash = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 3151831504154255688UL, ConnectionInfo_GetHwIdExHashFallback); ConnectionInfo_GetHwIdHash = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 11409383581668438027UL, ConnectionInfo_GetHwIdHashFallback); ConnectionInfo_GetID = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 8080268107975854795UL, ConnectionInfo_GetIDFallback); @@ -2101,6 +2110,7 @@ public ServerLibrary(Dictionary funcTable) Player_GetHeadBlendData = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 12996031514192232278UL, Player_GetHeadBlendDataFallback); Player_GetHeadBlendPaletteColor = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 6875264309357036667UL, Player_GetHeadBlendPaletteColorFallback); Player_GetHeadOverlay = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 18242810182906526031UL, Player_GetHeadOverlayFallback); + Player_GetHwId3 = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 12439246743379924111UL, Player_GetHwId3Fallback); Player_GetHwidExHash = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 424368865670330442UL, Player_GetHwidExHashFallback); Player_GetHwidHash = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 9546723288515311389UL, Player_GetHwidHashFallback); Player_GetInteriorLocation = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 16961931856292652951UL, Player_GetInteriorLocationFallback); diff --git a/api/AltV.Net.CApi/Libraries/SharedLibrary.cs b/api/AltV.Net.CApi/Libraries/SharedLibrary.cs index 9789da39..b964052a 100644 --- a/api/AltV.Net.CApi/Libraries/SharedLibrary.cs +++ b/api/AltV.Net.CApi/Libraries/SharedLibrary.cs @@ -426,7 +426,7 @@ public unsafe interface ISharedLibrary public unsafe class SharedLibrary : ISharedLibrary { - public readonly uint Methods = 1779; + public readonly uint Methods = 1781; public delegate* unmanaged[Cdecl] Audio_GetID { get; } public delegate* unmanaged[Cdecl] AudioAttachedOutput_GetID { get; } public delegate* unmanaged[Cdecl] AudioFilter_GetID { get; } @@ -1669,7 +1669,7 @@ private IntPtr GetUnmanagedPtr(IDictionary funcTable, ulong ha public SharedLibrary(Dictionary funcTable) { if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true; - else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 11629663074568386340UL) Outdated = true; + else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 17036908327259488488UL) Outdated = true; Audio_GetID = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 4464042055475980737UL, Audio_GetIDFallback); AudioAttachedOutput_GetID = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 17725794901805112189UL, AudioAttachedOutput_GetIDFallback); AudioFilter_GetID = (delegate* unmanaged[Cdecl]) GetUnmanagedPtr(funcTable, 8824535635529306325UL, AudioFilter_GetIDFallback); diff --git a/api/AltV.Net/Elements/Entities/ConnectionInfo.cs b/api/AltV.Net/Elements/Entities/ConnectionInfo.cs index caffd25c..a665631e 100644 --- a/api/AltV.Net/Elements/Entities/ConnectionInfo.cs +++ b/api/AltV.Net/Elements/Entities/ConnectionInfo.cs @@ -11,7 +11,6 @@ namespace AltV.Net.Elements.Entities; public class ConnectionInfo : BaseObject, IConnectionInfo { - public IntPtr ConnectionInfoNativePointer { get; } public override IntPtr NativePointer => ConnectionInfoNativePointer; @@ -32,7 +31,8 @@ public static uint GetId(IntPtr pointer) } - public ConnectionInfo(ICore core, IntPtr nativePointer, uint id) : base(core, GetBaseObjectPointer(core, nativePointer), BaseObjectType.ConnectionInfo, id) + public ConnectionInfo(ICore core, IntPtr nativePointer, uint id) : base(core, + GetBaseObjectPointer(core, nativePointer), BaseObjectType.ConnectionInfo, id) { ConnectionInfoNativePointer = nativePointer; } @@ -83,6 +83,19 @@ public ulong HardwareIdExHash } } + public string HardwareId3 + { + get + { + unsafe + { + var size = 0; + return Core.PtrToStringUtf8AndFree( + Core.Library.Server.ConnectionInfo_GetHwId3(ConnectionInfoNativePointer, &size), size); + } + } + } + public string AuthToken { get @@ -274,7 +287,8 @@ public CloudAuthResult CloudAuthResult { unsafe { - return (CloudAuthResult)Core.Library.Server.ConnectionInfo_GetCloudAuthResult(ConnectionInfoNativePointer); + return (CloudAuthResult)Core.Library.Server.ConnectionInfo_GetCloudAuthResult( + ConnectionInfoNativePointer); } } } diff --git a/api/AltV.Net/Elements/Entities/IConnectionInfo.cs b/api/AltV.Net/Elements/Entities/IConnectionInfo.cs index bceb3b01..1ca0d477 100644 --- a/api/AltV.Net/Elements/Entities/IConnectionInfo.cs +++ b/api/AltV.Net/Elements/Entities/IConnectionInfo.cs @@ -12,6 +12,7 @@ public interface IConnectionInfo : IBaseObject ulong SocialId { get; } ulong HardwareIdHash { get; } ulong HardwareIdExHash { get; } + string HardwareId3 { get; } string AuthToken { get; } bool IsDebug { get; } string Branch { get; } diff --git a/api/AltV.Net/Elements/Entities/IPlayer.cs b/api/AltV.Net/Elements/Entities/IPlayer.cs index d3eff7a7..43c374e9 100644 --- a/api/AltV.Net/Elements/Entities/IPlayer.cs +++ b/api/AltV.Net/Elements/Entities/IPlayer.cs @@ -36,6 +36,8 @@ public interface IPlayer : ISharedPlayer, IEntity ulong HardwareIdExHash { get; } + string HardwareId3 { get; } + string AuthToken { get; } long DiscordId { get; } diff --git a/api/AltV.Net/Elements/Entities/Player.cs b/api/AltV.Net/Elements/Entities/Player.cs index ba8fd745..e8400e0b 100644 --- a/api/AltV.Net/Elements/Entities/Player.cs +++ b/api/AltV.Net/Elements/Entities/Player.cs @@ -536,6 +536,20 @@ public ulong HardwareIdExHash } } + public string HardwareId3 + { + get + { + unsafe + { + CheckIfEntityExistsOrCached(); + var size = 0; + return Core.PtrToStringUtf8AndFree( + Core.Library.Server.Player_GetHwId3(PlayerNativePointer, &size), size); + } + } + } + public string AuthToken { get diff --git a/runtime b/runtime index c99af68a..21dd1822 160000 --- a/runtime +++ b/runtime @@ -1 +1 @@ -Subproject commit c99af68a38a1b9788201c36979bcc796bc6b8b49 +Subproject commit 21dd1822135bbb630cc0ddfb9d3ea1ac2dfab43f