Skip to content

Commit 67f9064

Browse files
committed
update to latest sdk
1 parent e6767ff commit 67f9064

File tree

8 files changed

+24
-20
lines changed

8 files changed

+24
-20
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ public unsafe interface IServerLibrary
7676
public delegate* unmanaged[Cdecl]<nint, uint> Core_GetMigrationDistance { get; }
7777
public delegate* unmanaged[Cdecl]<nint, byte> Core_GetMigrationThreadCount { get; }
7878
public delegate* unmanaged[Cdecl]<nint, uint> Core_GetMigrationTickRate { get; }
79-
public delegate* unmanaged[Cdecl]<nint, int> Core_GetNetTime { get; }
8079
public delegate* unmanaged[Cdecl]<nint, uint, nint> Core_GetPedModelInfo { get; }
8180
public delegate* unmanaged[Cdecl]<nint, int*, nint> Core_GetRootDirectory { get; }
8281
public delegate* unmanaged[Cdecl]<nint, nint> Core_GetServerConfig { get; }
@@ -536,7 +535,6 @@ public unsafe class ServerLibrary : IServerLibrary
536535
public delegate* unmanaged[Cdecl]<nint, uint> Core_GetMigrationDistance { get; }
537536
public delegate* unmanaged[Cdecl]<nint, byte> Core_GetMigrationThreadCount { get; }
538537
public delegate* unmanaged[Cdecl]<nint, uint> Core_GetMigrationTickRate { get; }
539-
public delegate* unmanaged[Cdecl]<nint, int> Core_GetNetTime { get; }
540538
public delegate* unmanaged[Cdecl]<nint, uint, nint> Core_GetPedModelInfo { get; }
541539
public delegate* unmanaged[Cdecl]<nint, int*, nint> Core_GetRootDirectory { get; }
542540
public delegate* unmanaged[Cdecl]<nint, nint> Core_GetServerConfig { get; }
@@ -1057,8 +1055,6 @@ public unsafe class ServerLibrary : IServerLibrary
10571055
private static byte Core_GetMigrationThreadCountFallback(nint _core) => throw new Exceptions.OutdatedSdkException("Core_GetMigrationThreadCount", "Core_GetMigrationThreadCount SDK method is outdated. Please update your module nuget");
10581056
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate uint Core_GetMigrationTickRateDelegate(nint _core);
10591057
private static uint Core_GetMigrationTickRateFallback(nint _core) => throw new Exceptions.OutdatedSdkException("Core_GetMigrationTickRate", "Core_GetMigrationTickRate SDK method is outdated. Please update your module nuget");
1060-
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate int Core_GetNetTimeDelegate(nint _server);
1061-
private static int Core_GetNetTimeFallback(nint _server) => throw new Exceptions.OutdatedSdkException("Core_GetNetTime", "Core_GetNetTime SDK method is outdated. Please update your module nuget");
10621058
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate nint Core_GetPedModelInfoDelegate(nint _core, uint _hash);
10631059
private static nint Core_GetPedModelInfoFallback(nint _core, uint _hash) => throw new Exceptions.OutdatedSdkException("Core_GetPedModelInfo", "Core_GetPedModelInfo SDK method is outdated. Please update your module nuget");
10641060
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate nint Core_GetRootDirectoryDelegate(nint _server, int* _size);
@@ -1911,7 +1907,6 @@ public ServerLibrary(Dictionary<ulong, IntPtr> funcTable)
19111907
Core_GetMigrationDistance = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<Core_GetMigrationDistanceDelegate>(funcTable, 8442828755754917489UL, Core_GetMigrationDistanceFallback);
19121908
Core_GetMigrationThreadCount = (delegate* unmanaged[Cdecl]<nint, byte>) GetUnmanagedPtr<Core_GetMigrationThreadCountDelegate>(funcTable, 5757616980701278724UL, Core_GetMigrationThreadCountFallback);
19131909
Core_GetMigrationTickRate = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<Core_GetMigrationTickRateDelegate>(funcTable, 9990683150417934189UL, Core_GetMigrationTickRateFallback);
1914-
Core_GetNetTime = (delegate* unmanaged[Cdecl]<nint, int>) GetUnmanagedPtr<Core_GetNetTimeDelegate>(funcTable, 15652019729912249391UL, Core_GetNetTimeFallback);
19151910
Core_GetPedModelInfo = (delegate* unmanaged[Cdecl]<nint, uint, nint>) GetUnmanagedPtr<Core_GetPedModelInfoDelegate>(funcTable, 7718568480211772772UL, Core_GetPedModelInfoFallback);
19161911
Core_GetRootDirectory = (delegate* unmanaged[Cdecl]<nint, int*, nint>) GetUnmanagedPtr<Core_GetRootDirectoryDelegate>(funcTable, 12125306445698504265UL, Core_GetRootDirectoryFallback);
19171912
Core_GetServerConfig = (delegate* unmanaged[Cdecl]<nint, nint>) GetUnmanagedPtr<Core_GetServerConfigDelegate>(funcTable, 14723504540957489106UL, Core_GetServerConfigFallback);

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ public unsafe interface ISharedLibrary
188188
public delegate* unmanaged[Cdecl]<byte> Core_GetEventEnumSize { get; }
189189
public delegate* unmanaged[Cdecl]<nint, ulong*, nint> Core_GetMarkers { get; }
190190
public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_GetMetaData { get; }
191+
public delegate* unmanaged[Cdecl]<nint, int> Core_GetNetTime { get; }
191192
public delegate* unmanaged[Cdecl]<nint, ulong*, nint> Core_GetNetworkObjects { get; }
192193
public delegate* unmanaged[Cdecl]<nint, ulong*, nint> Core_GetPeds { get; }
193194
public delegate* unmanaged[Cdecl]<nint, ulong*, nint> Core_GetPlayers { get; }
@@ -584,6 +585,7 @@ public unsafe class SharedLibrary : ISharedLibrary
584585
public delegate* unmanaged[Cdecl]<byte> Core_GetEventEnumSize { get; }
585586
public delegate* unmanaged[Cdecl]<nint, ulong*, nint> Core_GetMarkers { get; }
586587
public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_GetMetaData { get; }
588+
public delegate* unmanaged[Cdecl]<nint, int> Core_GetNetTime { get; }
587589
public delegate* unmanaged[Cdecl]<nint, ulong*, nint> Core_GetNetworkObjects { get; }
588590
public delegate* unmanaged[Cdecl]<nint, ulong*, nint> Core_GetPeds { get; }
589591
public delegate* unmanaged[Cdecl]<nint, ulong*, nint> Core_GetPlayers { get; }
@@ -1153,6 +1155,8 @@ public unsafe class SharedLibrary : ISharedLibrary
11531155
private static nint Core_GetMarkersFallback(nint _core, ulong* _size) => throw new Exceptions.OutdatedSdkException("Core_GetMarkers", "Core_GetMarkers SDK method is outdated. Please update your module nuget");
11541156
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate nint Core_GetMetaDataDelegate(nint _core, nint _key);
11551157
private static nint Core_GetMetaDataFallback(nint _core, nint _key) => throw new Exceptions.OutdatedSdkException("Core_GetMetaData", "Core_GetMetaData SDK method is outdated. Please update your module nuget");
1158+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate int Core_GetNetTimeDelegate(nint _server);
1159+
private static int Core_GetNetTimeFallback(nint _server) => throw new Exceptions.OutdatedSdkException("Core_GetNetTime", "Core_GetNetTime SDK method is outdated. Please update your module nuget");
11561160
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate nint Core_GetNetworkObjectsDelegate(nint _core, ulong* _size);
11571161
private static nint Core_GetNetworkObjectsFallback(nint _core, ulong* _size) => throw new Exceptions.OutdatedSdkException("Core_GetNetworkObjects", "Core_GetNetworkObjects SDK method is outdated. Please update your module nuget");
11581162
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate nint Core_GetPedsDelegate(nint _core, ulong* _size);
@@ -1767,6 +1771,7 @@ public SharedLibrary(Dictionary<ulong, IntPtr> funcTable)
17671771
Core_GetEventEnumSize = (delegate* unmanaged[Cdecl]<byte>) GetUnmanagedPtr<Core_GetEventEnumSizeDelegate>(funcTable, 6921054663232355759UL, Core_GetEventEnumSizeFallback);
17681772
Core_GetMarkers = (delegate* unmanaged[Cdecl]<nint, ulong*, nint>) GetUnmanagedPtr<Core_GetMarkersDelegate>(funcTable, 7482854450085275693UL, Core_GetMarkersFallback);
17691773
Core_GetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) GetUnmanagedPtr<Core_GetMetaDataDelegate>(funcTable, 2139798095052897524UL, Core_GetMetaDataFallback);
1774+
Core_GetNetTime = (delegate* unmanaged[Cdecl]<nint, int>) GetUnmanagedPtr<Core_GetNetTimeDelegate>(funcTable, 15652019729912249391UL, Core_GetNetTimeFallback);
17701775
Core_GetNetworkObjects = (delegate* unmanaged[Cdecl]<nint, ulong*, nint>) GetUnmanagedPtr<Core_GetNetworkObjectsDelegate>(funcTable, 8454955647873390265UL, Core_GetNetworkObjectsFallback);
17711776
Core_GetPeds = (delegate* unmanaged[Cdecl]<nint, ulong*, nint>) GetUnmanagedPtr<Core_GetPedsDelegate>(funcTable, 5411021830103603795UL, Core_GetPedsFallback);
17721777
Core_GetPlayers = (delegate* unmanaged[Cdecl]<nint, ulong*, nint>) GetUnmanagedPtr<Core_GetPlayersDelegate>(funcTable, 6799731000550763773UL, Core_GetPlayersFallback);

api/AltV.Net.Shared/ISharedCore.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,7 @@ void CreateMValueDict(out MValueConst mValue, string[] keys, MValueConst[] val,
134134
#endregion
135135

136136
VoiceConnectionState GetVoiceConnectionState();
137+
138+
int NetTime { get; }
137139
}
138140
}

api/AltV.Net.Shared/SharedCore.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ public string Branch
103103
}
104104
}
105105

106+
public int NetTime
107+
{
108+
get
109+
{
110+
unsafe
111+
{
112+
return Library.Shared.Core_GetNetTime(NativePointer);
113+
}
114+
}
115+
}
116+
106117
private bool? isDebug;
107118
public bool IsDebug
108119
{

api/AltV.Net/Core.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ public partial class Core : SharedCore, ICore, IInternalCore
3535

3636
private readonly ConcurrentDictionary<string, Metric?> metricCache;
3737

38-
public int NetTime
39-
{
40-
get
41-
{
42-
unsafe
43-
{
44-
return Library.Server.Core_GetNetTime(NativePointer);
45-
}
46-
}
47-
}
48-
4938
private string rootDirectory;
5039

5140
public string RootDirectory

api/AltV.Net/Data/VehicleModelInfo.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ internal readonly struct VehicleModelInfoInternal
5959
[MarshalAs(UnmanagedType.I1)]
6060
private readonly bool CanAttachCars;
6161

62+
private readonly uint HandlingNameHash;
63+
6264
public VehicleModelInfo ToPublic()
6365
{
6466
var arr = new BoneInfo[BonesSize];
@@ -85,7 +87,8 @@ public VehicleModelInfo ToPublic()
8587
ModKits = ModKits,
8688
HasAutoAttachTrailer = HasAutoAttachTrailer,
8789
Bones = arr,
88-
CanAttachCars = CanAttachCars
90+
CanAttachCars = CanAttachCars,
91+
HandlingNameHash = HandlingNameHash
8992
};
9093
}
9194
}
@@ -110,6 +113,7 @@ public struct VehicleModelInfo
110113
public bool HasAutoAttachTrailer;
111114
public BoneInfo[] Bones;
112115
public bool CanAttachCars;
116+
public uint HandlingNameHash;
113117

114118
public bool HasExtra(byte extraId)
115119
{

api/AltV.Net/ICore.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ public interface ICore : ISharedCore
1919
Dictionary<IntPtr, List<InternalPlayerSeat>> VehiclePassengers { get; }
2020
INativeResourcePool NativeResourcePool { get; }
2121

22-
int NetTime { get; }
23-
2422
string RootDirectory { get; }
2523

2624
INativeResource Resource { get; }

runtime

0 commit comments

Comments
 (0)