Skip to content

Commit

Permalink
Merge pull request #631 from zziger/rc
Browse files Browse the repository at this point in the history
Rc update
  • Loading branch information
FabianTerhorst committed Jul 12, 2022
2 parents fe1d45d + 282d6a3 commit 795c142
Show file tree
Hide file tree
Showing 12 changed files with 8,311 additions and 8,316 deletions.
3 changes: 3 additions & 0 deletions api/AltV.Net.CApi/Libraries/ServerLibrary.cs
Expand Up @@ -103,6 +103,7 @@ public unsafe interface IServerLibrary
public delegate* unmanaged[Cdecl]<nint, byte, HeadOverlay*, void> Player_GetHeadOverlay { get; }
public delegate* unmanaged[Cdecl]<nint, ulong> Player_GetHwidExHash { get; }
public delegate* unmanaged[Cdecl]<nint, ulong> Player_GetHwidHash { get; }
public delegate* unmanaged[Cdecl]<nint, uint> Player_GetInteriorLocation { get; }
public delegate* unmanaged[Cdecl]<nint, byte> Player_GetInvincible { get; }
public delegate* unmanaged[Cdecl]<nint, int*, nint> Player_GetIP { get; }
public delegate* unmanaged[Cdecl]<nint, nint, nint> Player_GetLocalMetaData { get; }
Expand Down Expand Up @@ -447,6 +448,7 @@ public unsafe class ServerLibrary : IServerLibrary
public delegate* unmanaged[Cdecl]<nint, byte, HeadOverlay*, void> Player_GetHeadOverlay { get; }
public delegate* unmanaged[Cdecl]<nint, ulong> Player_GetHwidExHash { get; }
public delegate* unmanaged[Cdecl]<nint, ulong> Player_GetHwidHash { get; }
public delegate* unmanaged[Cdecl]<nint, uint> Player_GetInteriorLocation { get; }
public delegate* unmanaged[Cdecl]<nint, byte> Player_GetInvincible { get; }
public delegate* unmanaged[Cdecl]<nint, int*, nint> Player_GetIP { get; }
public delegate* unmanaged[Cdecl]<nint, nint, nint> Player_GetLocalMetaData { get; }
Expand Down Expand Up @@ -791,6 +793,7 @@ public ServerLibrary(string dllName)
Player_GetHeadOverlay = (delegate* unmanaged[Cdecl]<nint, byte, HeadOverlay*, void>) NativeLibrary.GetExport(handle, "Player_GetHeadOverlay");
Player_GetHwidExHash = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "Player_GetHwidExHash");
Player_GetHwidHash = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "Player_GetHwidHash");
Player_GetInteriorLocation = (delegate* unmanaged[Cdecl]<nint, uint>) NativeLibrary.GetExport(handle, "Player_GetInteriorLocation");
Player_GetInvincible = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_GetInvincible");
Player_GetIP = (delegate* unmanaged[Cdecl]<nint, int*, nint>) NativeLibrary.GetExport(handle, "Player_GetIP");
Player_GetLocalMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Player_GetLocalMetaData");
Expand Down
6 changes: 3 additions & 3 deletions api/AltV.Net.CApi/Libraries/SharedLibrary.cs
Expand Up @@ -124,6 +124,7 @@ public unsafe interface ISharedLibrary
public delegate* unmanaged[Cdecl]<nint, int*, nint> Core_GetBranch { get; }
public delegate* unmanaged[Cdecl]<nint> Core_GetCoreInstance { get; }
public delegate* unmanaged[Cdecl]<nint, ushort, byte*, nint> Core_GetEntityById { get; }
public delegate* unmanaged[Cdecl]<byte> Core_GetEventEnumSize { get; }
public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_GetMetaData { get; }
public delegate* unmanaged[Cdecl]<nint, ulong> Core_GetPlayerCount { get; }
public delegate* unmanaged[Cdecl]<nint, nint[], ulong, void> Core_GetPlayers { get; }
Expand Down Expand Up @@ -202,7 +203,6 @@ public unsafe interface ISharedLibrary
public delegate* unmanaged[Cdecl]<nint, Rotation*, void> Player_GetHeadRotation { get; }
public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetHealth { get; }
public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetID { get; }
public delegate* unmanaged[Cdecl]<nint, uint> Player_GetInteriorLocation { get; }
public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetMaxArmor { get; }
public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetMaxHealth { get; }
public delegate* unmanaged[Cdecl]<nint, float> Player_GetMoveSpeed { get; }
Expand Down Expand Up @@ -359,6 +359,7 @@ public unsafe class SharedLibrary : ISharedLibrary
public delegate* unmanaged[Cdecl]<nint, int*, nint> Core_GetBranch { get; }
public delegate* unmanaged[Cdecl]<nint> Core_GetCoreInstance { get; }
public delegate* unmanaged[Cdecl]<nint, ushort, byte*, nint> Core_GetEntityById { get; }
public delegate* unmanaged[Cdecl]<byte> Core_GetEventEnumSize { get; }
public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_GetMetaData { get; }
public delegate* unmanaged[Cdecl]<nint, ulong> Core_GetPlayerCount { get; }
public delegate* unmanaged[Cdecl]<nint, nint[], ulong, void> Core_GetPlayers { get; }
Expand Down Expand Up @@ -437,7 +438,6 @@ public unsafe class SharedLibrary : ISharedLibrary
public delegate* unmanaged[Cdecl]<nint, Rotation*, void> Player_GetHeadRotation { get; }
public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetHealth { get; }
public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetID { get; }
public delegate* unmanaged[Cdecl]<nint, uint> Player_GetInteriorLocation { get; }
public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetMaxArmor { get; }
public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetMaxHealth { get; }
public delegate* unmanaged[Cdecl]<nint, float> Player_GetMoveSpeed { get; }
Expand Down Expand Up @@ -594,6 +594,7 @@ public SharedLibrary(string dllName)
Core_GetBranch = (delegate* unmanaged[Cdecl]<nint, int*, nint>) NativeLibrary.GetExport(handle, "Core_GetBranch");
Core_GetCoreInstance = (delegate* unmanaged[Cdecl]<nint>) NativeLibrary.GetExport(handle, "Core_GetCoreInstance");
Core_GetEntityById = (delegate* unmanaged[Cdecl]<nint, ushort, byte*, nint>) NativeLibrary.GetExport(handle, "Core_GetEntityById");
Core_GetEventEnumSize = (delegate* unmanaged[Cdecl]<byte>) NativeLibrary.GetExport(handle, "Core_GetEventEnumSize");
Core_GetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Core_GetMetaData");
Core_GetPlayerCount = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "Core_GetPlayerCount");
Core_GetPlayers = (delegate* unmanaged[Cdecl]<nint, nint[], ulong, void>) NativeLibrary.GetExport(handle, "Core_GetPlayers");
Expand Down Expand Up @@ -672,7 +673,6 @@ public SharedLibrary(string dllName)
Player_GetHeadRotation = (delegate* unmanaged[Cdecl]<nint, Rotation*, void>) NativeLibrary.GetExport(handle, "Player_GetHeadRotation");
Player_GetHealth = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Player_GetHealth");
Player_GetID = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Player_GetID");
Player_GetInteriorLocation = (delegate* unmanaged[Cdecl]<nint, uint>) NativeLibrary.GetExport(handle, "Player_GetInteriorLocation");
Player_GetMaxArmor = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Player_GetMaxArmor");
Player_GetMaxHealth = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Player_GetMaxHealth");
Player_GetMoveSpeed = (delegate* unmanaged[Cdecl]<nint, float>) NativeLibrary.GetExport(handle, "Player_GetMoveSpeed");
Expand Down
12 changes: 0 additions & 12 deletions api/AltV.Net.Client/Elements/Entities/Player.cs
Expand Up @@ -145,18 +145,6 @@ public Position EntityAimOffset
}
}

public uint InteriorLocation
{
get
{
unsafe
{
CheckIfEntityExists();
return this.Core.Library.Shared.Player_GetInteriorLocation(this.PlayerNativePointer);
}
}
}

public void GetCurrentWeaponComponents(out uint[] weaponComponents)
{
unsafe
Expand Down
9 changes: 9 additions & 0 deletions api/AltV.Net.Client/ModuleWrapper.cs
Expand Up @@ -9,6 +9,7 @@
using AltV.Net.Client.WinApi;
using AltV.Net.Elements.Entities;
using AltV.Net.Shared;
using AltV.Net.Shared.Events;

namespace AltV.Net.Client
{
Expand All @@ -28,6 +29,14 @@ public static void MainWithAssembly(Assembly resourceAssembly, IntPtr resourcePo
var logger = new Logger(library, corePointer);
Alt.Logger = logger;
Alt.Log("Library initialized");

unsafe
{
if (library.Shared.Core_GetEventEnumSize() != (byte) EventType.SIZE)
{
throw new Exception("Event type enum size doesn't match. Please, update the nuget");
}
}

AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

Expand Down

0 comments on commit 795c142

Please sign in to comment.