Skip to content

Commit

Permalink
Merge branch 'rc' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Jul 29, 2024
2 parents 319c3e7 + c0cd603 commit d98c0bc
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
9 changes: 7 additions & 2 deletions api/AltV.Net.CApi/Libraries/ClientLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public unsafe interface IClientLibrary
public delegate* unmanaged[Cdecl]<nint, nint, void> Core_OverrideFocusEntity { get; }
public delegate* unmanaged[Cdecl]<nint, Vector3, Vector3, void> Core_OverrideFocusPosition { get; }
public delegate* unmanaged[Cdecl]<nint, nint, nint, uint*, nint> Core_RegisterFont { get; }
public delegate* unmanaged[Cdecl]<nint, uint, byte> Core_ReloadVehiclePhysics { get; }
public delegate* unmanaged[Cdecl]<nint, nint, uint, void> Core_RemoveGXTText { get; }
public delegate* unmanaged[Cdecl]<nint, nint, void> Core_RemoveIpl { get; }
public delegate* unmanaged[Cdecl]<nint, uint, void> Core_RemoveVoiceFilter { get; }
Expand Down Expand Up @@ -902,7 +903,7 @@ public unsafe interface IClientLibrary

public unsafe class ClientLibrary : IClientLibrary
{
public readonly uint Methods = 1773;
public readonly uint Methods = 1774;
public delegate* unmanaged[Cdecl]<nint, nint, void> Audio_AddOutput { get; }
public delegate* unmanaged[Cdecl]<nint, nint> Audio_GetBaseObject { get; }
public delegate* unmanaged[Cdecl]<nint, double> Audio_GetCurrentTime { get; }
Expand Down Expand Up @@ -1110,6 +1111,7 @@ public unsafe class ClientLibrary : IClientLibrary
public delegate* unmanaged[Cdecl]<nint, nint, void> Core_OverrideFocusEntity { get; }
public delegate* unmanaged[Cdecl]<nint, Vector3, Vector3, void> Core_OverrideFocusPosition { get; }
public delegate* unmanaged[Cdecl]<nint, nint, nint, uint*, nint> Core_RegisterFont { get; }
public delegate* unmanaged[Cdecl]<nint, uint, byte> Core_ReloadVehiclePhysics { get; }
public delegate* unmanaged[Cdecl]<nint, nint, uint, void> Core_RemoveGXTText { get; }
public delegate* unmanaged[Cdecl]<nint, nint, void> Core_RemoveIpl { get; }
public delegate* unmanaged[Cdecl]<nint, uint, void> Core_RemoveVoiceFilter { get; }
Expand Down Expand Up @@ -2204,6 +2206,8 @@ public unsafe class ClientLibrary : IClientLibrary
private static void Core_OverrideFocusPositionFallback(nint _core, Vector3 _pos, Vector3 _offset) => throw new Exceptions.OutdatedSdkException("Core_OverrideFocusPosition", "Core_OverrideFocusPosition SDK method is outdated. Please update your module nuget");
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate nint Core_RegisterFontDelegate(nint _core, nint _resource, nint _path, uint* _id);
private static nint Core_RegisterFontFallback(nint _core, nint _resource, nint _path, uint* _id) => throw new Exceptions.OutdatedSdkException("Core_RegisterFont", "Core_RegisterFont SDK method is outdated. Please update your module nuget");
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate byte Core_ReloadVehiclePhysicsDelegate(nint _core, uint _modelHash);
private static byte Core_ReloadVehiclePhysicsFallback(nint _core, uint _modelHash) => throw new Exceptions.OutdatedSdkException("Core_ReloadVehiclePhysics", "Core_ReloadVehiclePhysics SDK method is outdated. Please update your module nuget");
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void Core_RemoveGXTTextDelegate(nint _core, nint _resource, uint _key);
private static void Core_RemoveGXTTextFallback(nint _core, nint _resource, uint _key) => throw new Exceptions.OutdatedSdkException("Core_RemoveGXTText", "Core_RemoveGXTText SDK method is outdated. Please update your module nuget");
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void Core_RemoveIplDelegate(nint _core, nint _path);
Expand Down Expand Up @@ -3573,7 +3577,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
public ClientLibrary(Dictionary<ulong, IntPtr> funcTable)
{
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 78812385462098472UL) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 4464148992254491289UL) Outdated = true;
Audio_AddOutput = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<Audio_AddOutputDelegate>(funcTable, 9914412815391408844UL, Audio_AddOutputFallback);
Audio_GetBaseObject = (delegate* unmanaged[Cdecl]<nint, nint>) GetUnmanagedPtr<Audio_GetBaseObjectDelegate>(funcTable, 6330360502401226894UL, Audio_GetBaseObjectFallback);
Audio_GetCurrentTime = (delegate* unmanaged[Cdecl]<nint, double>) GetUnmanagedPtr<Audio_GetCurrentTimeDelegate>(funcTable, 2944324482134975819UL, Audio_GetCurrentTimeFallback);
Expand Down Expand Up @@ -3781,6 +3785,7 @@ public ClientLibrary(Dictionary<ulong, IntPtr> funcTable)
Core_OverrideFocusEntity = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<Core_OverrideFocusEntityDelegate>(funcTable, 11543552066785919265UL, Core_OverrideFocusEntityFallback);
Core_OverrideFocusPosition = (delegate* unmanaged[Cdecl]<nint, Vector3, Vector3, void>) GetUnmanagedPtr<Core_OverrideFocusPositionDelegate>(funcTable, 15255809094076439747UL, Core_OverrideFocusPositionFallback);
Core_RegisterFont = (delegate* unmanaged[Cdecl]<nint, nint, nint, uint*, nint>) GetUnmanagedPtr<Core_RegisterFontDelegate>(funcTable, 84574382701044016UL, Core_RegisterFontFallback);
Core_ReloadVehiclePhysics = (delegate* unmanaged[Cdecl]<nint, uint, byte>) GetUnmanagedPtr<Core_ReloadVehiclePhysicsDelegate>(funcTable, 6341556497973967320UL, Core_ReloadVehiclePhysicsFallback);
Core_RemoveGXTText = (delegate* unmanaged[Cdecl]<nint, nint, uint, void>) GetUnmanagedPtr<Core_RemoveGXTTextDelegate>(funcTable, 2950682702415179672UL, Core_RemoveGXTTextFallback);
Core_RemoveIpl = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<Core_RemoveIplDelegate>(funcTable, 3186817815537256556UL, Core_RemoveIplFallback);
Core_RemoveVoiceFilter = (delegate* unmanaged[Cdecl]<nint, uint, void>) GetUnmanagedPtr<Core_RemoveVoiceFilterDelegate>(funcTable, 4203146524234440953UL, Core_RemoveVoiceFilterFallback);
Expand Down
4 changes: 2 additions & 2 deletions api/AltV.Net.CApi/Libraries/ServerLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public unsafe interface IServerLibrary

public unsafe class ServerLibrary : IServerLibrary
{
public readonly uint Methods = 1773;
public readonly uint Methods = 1774;
public delegate* unmanaged[Cdecl]<nint, nint, void> BaseObject_DeleteSyncedMetaData { get; }
public delegate* unmanaged[Cdecl]<nint, nint[], nint[], ulong, void> BaseObject_SetMultipleSyncedMetaData { get; }
public delegate* unmanaged[Cdecl]<nint, nint, nint, void> BaseObject_SetSyncedMetaData { get; }
Expand Down Expand Up @@ -1917,7 +1917,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
public ServerLibrary(Dictionary<ulong, IntPtr> funcTable)
{
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 78812385462098472UL) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 4464148992254491289UL) Outdated = true;
BaseObject_DeleteSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<BaseObject_DeleteSyncedMetaDataDelegate>(funcTable, 8228424877092269355UL, BaseObject_DeleteSyncedMetaDataFallback);
BaseObject_SetMultipleSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint[], nint[], ulong, void>) GetUnmanagedPtr<BaseObject_SetMultipleSyncedMetaDataDelegate>(funcTable, 1390762125822890831UL, BaseObject_SetMultipleSyncedMetaDataFallback);
BaseObject_SetSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) GetUnmanagedPtr<BaseObject_SetSyncedMetaDataDelegate>(funcTable, 8002999088966424231UL, BaseObject_SetSyncedMetaDataFallback);
Expand Down
4 changes: 2 additions & 2 deletions api/AltV.Net.CApi/Libraries/SharedLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public unsafe interface ISharedLibrary

public unsafe class SharedLibrary : ISharedLibrary
{
public readonly uint Methods = 1773;
public readonly uint Methods = 1774;
public delegate* unmanaged[Cdecl]<nint, uint> Audio_GetID { get; }
public delegate* unmanaged[Cdecl]<nint, uint> AudioAttachedOutput_GetID { get; }
public delegate* unmanaged[Cdecl]<nint, uint> AudioFilter_GetID { get; }
Expand Down Expand Up @@ -1669,7 +1669,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
public SharedLibrary(Dictionary<ulong, IntPtr> funcTable)
{
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 78812385462098472UL) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 4464148992254491289UL) Outdated = true;
Audio_GetID = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<Audio_GetIDDelegate>(funcTable, 4464042055475980737UL, Audio_GetIDFallback);
AudioAttachedOutput_GetID = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<AudioAttachedOutput_GetIDDelegate>(funcTable, 17725794901805112189UL, AudioAttachedOutput_GetIDFallback);
AudioFilter_GetID = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<AudioFilter_GetIDDelegate>(funcTable, 8824535635529306325UL, AudioFilter_GetIDFallback);
Expand Down
2 changes: 2 additions & 0 deletions api/AltV.Net.Client/Alt.Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,7 @@ public static partial class Alt
public static int MsPerGameMinute { get => Core.MsPerGameMinute; set => Core.MsPerGameMinute = value; }

public static ulong ServerTime => Core.ServerTime;

public static bool ReloadVehiclePhysics(uint modelHash) => Core.ReloadVehiclePhysics(modelHash);
}
}
8 changes: 8 additions & 0 deletions api/AltV.Net.Client/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,14 @@ public ulong ServerTime
}
}

public bool ReloadVehiclePhysics(uint modelHash)
{
unsafe
{
return Library.Client.Core_ReloadVehiclePhysics(NativePointer, modelHash) == 1;
}
}

#endregion

#region TriggerServerEvent
Expand Down
2 changes: 2 additions & 0 deletions api/AltV.Net.Client/ICore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,7 @@ ILocalObject CreateLocalObject(uint modelHash, Position position, Rotation rotat
void UpdateClipContext(Dictionary<string, string> context);

ulong ServerTime { get; }

bool ReloadVehiclePhysics(uint modelHash);
}
}

0 comments on commit d98c0bc

Please sign in to comment.