Skip to content

Commit b890d68

Browse files
committed
Merge branch 'dev' into rc
2 parents 891b38c + 060b9ea commit b890d68

File tree

14 files changed

+169
-25
lines changed

14 files changed

+169
-25
lines changed

api/AltV.Net.Async/Elements/Entities/AsyncPlayer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,12 +1482,12 @@ public int GetAmmoMax100(uint ammoHash)
14821482
}
14831483
}
14841484

1485-
public void AddDecoration(uint collection, uint overlay)
1485+
public void AddDecoration(uint collection, uint overlay, byte count = 1)
14861486
{
14871487
lock (Player)
14881488
{
14891489
if (!AsyncContext.CheckIfExistsNullable(Player)) return;
1490-
Player.AddDecoration(collection, overlay);
1490+
Player.AddDecoration(collection, overlay, count);
14911491
}
14921492
}
14931493

api/AltV.Net.CApi.Generator/TypeRegistry.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,15 @@ public static class TypeRegistry
112112
{ "rgba_t", "Rgba" },
113113
{ "rgba_t&", "Rgba*" },
114114
{ "std::vector<uint32_t>", "UIntArray*" },
115-
116115
{ "alt::Quaternion", "Quaternion" },
117116
{ "alt::Quaternion&", "Quaternion*" },
118-
119117
{ "position_t&", "Vector3*" },
120118
{ "position_t", "Vector3" },
121119
{ "alt::Position", "Vector3" },
122120
{ "rotation_t&", "Rotation*" },
123121
{ "rotation_t", "Rotation" },
124122
{ "alt::Rotation", "Rotation" },
125-
126123
{ "vehicleBadgePosition_t[]", "VehicleBadgePosition[]" },
127-
128124
{ "cloth_t&", "Cloth*" },
129125
{ "cloth_t", "Cloth" },
130126
{ "dlccloth_t&", "DlcCloth*" },
@@ -170,9 +166,7 @@ public static class TypeRegistry
170166
{ "const alt::MValueList&", "MValue*" }, //no c# representation for MValue list memory layout yet
171167
{ "alt::MValueDict&", "MValue*" }, //no c# representation for MValue dictionary memory layout yet
172168
{ "alt::ICheckpoint*", "nint" },
173-
{
174-
"alt::MValueFunction&", "MValue*"
175-
}, //no c# representation for MValue function memory layout yet, this is only in commented code and not required
169+
{ "alt::MValueFunction&", "MValue*" }, //no c# representation for MValue function memory layout yet, this is only in commented code and not required
176170
{ "alt::CEvent::Type", "ushort" },
177171
{ "alt::CEvent*", "nint" },
178172
{ "alt::CCancellableEvent*", "nint" },

api/AltV.Net.CApi/Libraries/ClientLibrary.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ public unsafe interface IClientLibrary
273273
public delegate* unmanaged[Cdecl]<nint, nint> CustomTexture_GetBaseObject { get; }
274274
public delegate* unmanaged[Cdecl]<nint, uint> CustomTexture_GetID { get; }
275275
public delegate* unmanaged[Cdecl]<nint, uint> Entity_GetScriptID { get; }
276+
public delegate* unmanaged[Cdecl]<nint, nint*, void> Entity_GetSyncInfo { get; }
276277
public delegate* unmanaged[Cdecl]<nint, ClientEvents.AnyResourceErrorModuleDelegate, void> Event_SetAnyResourceErrorDelegate { get; }
277278
public delegate* unmanaged[Cdecl]<nint, ClientEvents.AnyResourceStartModuleDelegate, void> Event_SetAnyResourceStartDelegate { get; }
278279
public delegate* unmanaged[Cdecl]<nint, ClientEvents.AnyResourceStopModuleDelegate, void> Event_SetAnyResourceStopDelegate { get; }
@@ -900,7 +901,7 @@ public unsafe interface IClientLibrary
900901

901902
public unsafe class ClientLibrary : IClientLibrary
902903
{
903-
public readonly uint Methods = 1767;
904+
public readonly uint Methods = 1769;
904905
public delegate* unmanaged[Cdecl]<nint, nint, void> Audio_AddOutput { get; }
905906
public delegate* unmanaged[Cdecl]<nint, nint> Audio_GetBaseObject { get; }
906907
public delegate* unmanaged[Cdecl]<nint, double> Audio_GetCurrentTime { get; }
@@ -1163,6 +1164,7 @@ public unsafe class ClientLibrary : IClientLibrary
11631164
public delegate* unmanaged[Cdecl]<nint, nint> CustomTexture_GetBaseObject { get; }
11641165
public delegate* unmanaged[Cdecl]<nint, uint> CustomTexture_GetID { get; }
11651166
public delegate* unmanaged[Cdecl]<nint, uint> Entity_GetScriptID { get; }
1167+
public delegate* unmanaged[Cdecl]<nint, nint*, void> Entity_GetSyncInfo { get; }
11661168
public delegate* unmanaged[Cdecl]<nint, ClientEvents.AnyResourceErrorModuleDelegate, void> Event_SetAnyResourceErrorDelegate { get; }
11671169
public delegate* unmanaged[Cdecl]<nint, ClientEvents.AnyResourceStartModuleDelegate, void> Event_SetAnyResourceStartDelegate { get; }
11681170
public delegate* unmanaged[Cdecl]<nint, ClientEvents.AnyResourceStopModuleDelegate, void> Event_SetAnyResourceStopDelegate { get; }
@@ -2310,6 +2312,8 @@ public unsafe class ClientLibrary : IClientLibrary
23102312
private static uint CustomTexture_GetIDFallback(nint _costumTexture) => throw new Exceptions.OutdatedSdkException("CustomTexture_GetID", "CustomTexture_GetID SDK method is outdated. Please update your module nuget");
23112313
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate uint Entity_GetScriptIDDelegate(nint _entity);
23122314
private static uint Entity_GetScriptIDFallback(nint _entity) => throw new Exceptions.OutdatedSdkException("Entity_GetScriptID", "Entity_GetScriptID SDK method is outdated. Please update your module nuget");
2315+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void Entity_GetSyncInfoDelegate(nint _entity, nint* _syncInfo);
2316+
private static void Entity_GetSyncInfoFallback(nint _entity, nint* _syncInfo) => throw new Exceptions.OutdatedSdkException("Entity_GetSyncInfo", "Entity_GetSyncInfo SDK method is outdated. Please update your module nuget");
23132317
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void Event_SetAnyResourceErrorDelegateDelegate(nint _resource, ClientEvents.AnyResourceErrorModuleDelegate _delegate);
23142318
private static void Event_SetAnyResourceErrorDelegateFallback(nint _resource, ClientEvents.AnyResourceErrorModuleDelegate _delegate) => throw new Exceptions.OutdatedSdkException("Event_SetAnyResourceErrorDelegate", "Event_SetAnyResourceErrorDelegate SDK method is outdated. Please update your module nuget");
23152319
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void Event_SetAnyResourceStartDelegateDelegate(nint _resource, ClientEvents.AnyResourceStartModuleDelegate _delegate);
@@ -3565,7 +3569,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
35653569
public ClientLibrary(Dictionary<ulong, IntPtr> funcTable)
35663570
{
35673571
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
3568-
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 13630124142623987997UL) Outdated = true;
3572+
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 12612033657027659340UL) Outdated = true;
35693573
Audio_AddOutput = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<Audio_AddOutputDelegate>(funcTable, 9914412815391408844UL, Audio_AddOutputFallback);
35703574
Audio_GetBaseObject = (delegate* unmanaged[Cdecl]<nint, nint>) GetUnmanagedPtr<Audio_GetBaseObjectDelegate>(funcTable, 6330360502401226894UL, Audio_GetBaseObjectFallback);
35713575
Audio_GetCurrentTime = (delegate* unmanaged[Cdecl]<nint, double>) GetUnmanagedPtr<Audio_GetCurrentTimeDelegate>(funcTable, 2944324482134975819UL, Audio_GetCurrentTimeFallback);
@@ -3828,6 +3832,7 @@ public ClientLibrary(Dictionary<ulong, IntPtr> funcTable)
38283832
CustomTexture_GetBaseObject = (delegate* unmanaged[Cdecl]<nint, nint>) GetUnmanagedPtr<CustomTexture_GetBaseObjectDelegate>(funcTable, 4168880360490742954UL, CustomTexture_GetBaseObjectFallback);
38293833
CustomTexture_GetID = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<CustomTexture_GetIDDelegate>(funcTable, 12755828446518747613UL, CustomTexture_GetIDFallback);
38303834
Entity_GetScriptID = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<Entity_GetScriptIDDelegate>(funcTable, 11915813456855488252UL, Entity_GetScriptIDFallback);
3835+
Entity_GetSyncInfo = (delegate* unmanaged[Cdecl]<nint, nint*, void>) GetUnmanagedPtr<Entity_GetSyncInfoDelegate>(funcTable, 18237250479106097113UL, Entity_GetSyncInfoFallback);
38313836
Event_SetAnyResourceErrorDelegate = (delegate* unmanaged[Cdecl]<nint, ClientEvents.AnyResourceErrorModuleDelegate, void>) GetUnmanagedPtr<Event_SetAnyResourceErrorDelegateDelegate>(funcTable, 14079997901958077241UL, Event_SetAnyResourceErrorDelegateFallback);
38323837
Event_SetAnyResourceStartDelegate = (delegate* unmanaged[Cdecl]<nint, ClientEvents.AnyResourceStartModuleDelegate, void>) GetUnmanagedPtr<Event_SetAnyResourceStartDelegateDelegate>(funcTable, 18259284189737259993UL, Event_SetAnyResourceStartDelegateFallback);
38333838
Event_SetAnyResourceStopDelegate = (delegate* unmanaged[Cdecl]<nint, ClientEvents.AnyResourceStopModuleDelegate, void>) GetUnmanagedPtr<Event_SetAnyResourceStopDelegateDelegate>(funcTable, 13707820718504089625UL, Event_SetAnyResourceStopDelegateFallback);

api/AltV.Net.CApi/Libraries/ServerLibrary.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public unsafe interface IServerLibrary
157157
public delegate* unmanaged[Cdecl]<nint, uint, void> Ped_SetCurrentWeapon { get; }
158158
public delegate* unmanaged[Cdecl]<nint, ushort, void> Ped_SetHealth { get; }
159159
public delegate* unmanaged[Cdecl]<nint, ushort, void> Ped_SetMaxHealth { get; }
160-
public delegate* unmanaged[Cdecl]<nint, uint, uint, void> Player_AddDecoration { get; }
160+
public delegate* unmanaged[Cdecl]<nint, uint, uint, byte, void> Player_AddDecoration { get; }
161161
public delegate* unmanaged[Cdecl]<nint, uint, uint, void> Player_AddWeaponComponent { get; }
162162
public delegate* unmanaged[Cdecl]<nint, void> Player_ClearBloodDamage { get; }
163163
public delegate* unmanaged[Cdecl]<nint, byte, byte> Player_ClearClothes { get; }
@@ -485,7 +485,7 @@ public unsafe interface IServerLibrary
485485

486486
public unsafe class ServerLibrary : IServerLibrary
487487
{
488-
public readonly uint Methods = 1767;
488+
public readonly uint Methods = 1769;
489489
public delegate* unmanaged[Cdecl]<nint, nint, void> BaseObject_DeleteSyncedMetaData { get; }
490490
public delegate* unmanaged[Cdecl]<nint, nint[], nint[], ulong, void> BaseObject_SetMultipleSyncedMetaData { get; }
491491
public delegate* unmanaged[Cdecl]<nint, nint, nint, void> BaseObject_SetSyncedMetaData { get; }
@@ -632,7 +632,7 @@ public unsafe class ServerLibrary : IServerLibrary
632632
public delegate* unmanaged[Cdecl]<nint, uint, void> Ped_SetCurrentWeapon { get; }
633633
public delegate* unmanaged[Cdecl]<nint, ushort, void> Ped_SetHealth { get; }
634634
public delegate* unmanaged[Cdecl]<nint, ushort, void> Ped_SetMaxHealth { get; }
635-
public delegate* unmanaged[Cdecl]<nint, uint, uint, void> Player_AddDecoration { get; }
635+
public delegate* unmanaged[Cdecl]<nint, uint, uint, byte, void> Player_AddDecoration { get; }
636636
public delegate* unmanaged[Cdecl]<nint, uint, uint, void> Player_AddWeaponComponent { get; }
637637
public delegate* unmanaged[Cdecl]<nint, void> Player_ClearBloodDamage { get; }
638638
public delegate* unmanaged[Cdecl]<nint, byte, byte> Player_ClearClothes { get; }
@@ -1248,8 +1248,8 @@ public unsafe class ServerLibrary : IServerLibrary
12481248
private static void Ped_SetHealthFallback(nint _ped, ushort _health) => throw new Exceptions.OutdatedSdkException("Ped_SetHealth", "Ped_SetHealth SDK method is outdated. Please update your module nuget");
12491249
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void Ped_SetMaxHealthDelegate(nint _ped, ushort _maxHealth);
12501250
private static void Ped_SetMaxHealthFallback(nint _ped, ushort _maxHealth) => throw new Exceptions.OutdatedSdkException("Ped_SetMaxHealth", "Ped_SetMaxHealth SDK method is outdated. Please update your module nuget");
1251-
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void Player_AddDecorationDelegate(nint _player, uint _collection, uint _overlay);
1252-
private static void Player_AddDecorationFallback(nint _player, uint _collection, uint _overlay) => throw new Exceptions.OutdatedSdkException("Player_AddDecoration", "Player_AddDecoration SDK method is outdated. Please update your module nuget");
1251+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void Player_AddDecorationDelegate(nint _player, uint _collection, uint _overlay, byte _count);
1252+
private static void Player_AddDecorationFallback(nint _player, uint _collection, uint _overlay, byte _count) => throw new Exceptions.OutdatedSdkException("Player_AddDecoration", "Player_AddDecoration SDK method is outdated. Please update your module nuget");
12531253
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void Player_AddWeaponComponentDelegate(nint _player, uint _weapon, uint _component);
12541254
private static void Player_AddWeaponComponentFallback(nint _player, uint _weapon, uint _component) => throw new Exceptions.OutdatedSdkException("Player_AddWeaponComponent", "Player_AddWeaponComponent SDK method is outdated. Please update your module nuget");
12551255
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void Player_ClearBloodDamageDelegate(nint _player);
@@ -1905,7 +1905,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
19051905
public ServerLibrary(Dictionary<ulong, IntPtr> funcTable)
19061906
{
19071907
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
1908-
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 13630124142623987997UL) Outdated = true;
1908+
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 12612033657027659340UL) Outdated = true;
19091909
BaseObject_DeleteSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<BaseObject_DeleteSyncedMetaDataDelegate>(funcTable, 8228424877092269355UL, BaseObject_DeleteSyncedMetaDataFallback);
19101910
BaseObject_SetMultipleSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint[], nint[], ulong, void>) GetUnmanagedPtr<BaseObject_SetMultipleSyncedMetaDataDelegate>(funcTable, 1390762125822890831UL, BaseObject_SetMultipleSyncedMetaDataFallback);
19111911
BaseObject_SetSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) GetUnmanagedPtr<BaseObject_SetSyncedMetaDataDelegate>(funcTable, 8002999088966424231UL, BaseObject_SetSyncedMetaDataFallback);
@@ -2052,7 +2052,7 @@ public ServerLibrary(Dictionary<ulong, IntPtr> funcTable)
20522052
Ped_SetCurrentWeapon = (delegate* unmanaged[Cdecl]<nint, uint, void>) GetUnmanagedPtr<Ped_SetCurrentWeaponDelegate>(funcTable, 1890144317981520558UL, Ped_SetCurrentWeaponFallback);
20532053
Ped_SetHealth = (delegate* unmanaged[Cdecl]<nint, ushort, void>) GetUnmanagedPtr<Ped_SetHealthDelegate>(funcTable, 15651278310887155719UL, Ped_SetHealthFallback);
20542054
Ped_SetMaxHealth = (delegate* unmanaged[Cdecl]<nint, ushort, void>) GetUnmanagedPtr<Ped_SetMaxHealthDelegate>(funcTable, 487582698440451683UL, Ped_SetMaxHealthFallback);
2055-
Player_AddDecoration = (delegate* unmanaged[Cdecl]<nint, uint, uint, void>) GetUnmanagedPtr<Player_AddDecorationDelegate>(funcTable, 11189476182745634495UL, Player_AddDecorationFallback);
2055+
Player_AddDecoration = (delegate* unmanaged[Cdecl]<nint, uint, uint, byte, void>) GetUnmanagedPtr<Player_AddDecorationDelegate>(funcTable, 4335399707847968795UL, Player_AddDecorationFallback);
20562056
Player_AddWeaponComponent = (delegate* unmanaged[Cdecl]<nint, uint, uint, void>) GetUnmanagedPtr<Player_AddWeaponComponentDelegate>(funcTable, 9305362021789278268UL, Player_AddWeaponComponentFallback);
20572057
Player_ClearBloodDamage = (delegate* unmanaged[Cdecl]<nint, void>) GetUnmanagedPtr<Player_ClearBloodDamageDelegate>(funcTable, 1935399752104807234UL, Player_ClearBloodDamageFallback);
20582058
Player_ClearClothes = (delegate* unmanaged[Cdecl]<nint, byte, byte>) GetUnmanagedPtr<Player_ClearClothesDelegate>(funcTable, 992364219024894490UL, Player_ClearClothesFallback);

0 commit comments

Comments
 (0)