Skip to content

Commit 63b94a0

Browse files
committed
Merge tag '15.0.190-dev' into rc
# Conflicts: # runtime
2 parents a910cc9 + df87e18 commit 63b94a0

File tree

18 files changed

+194
-8
lines changed

18 files changed

+194
-8
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Threading.Tasks;
3+
using AltV.Net.Data;
34
using AltV.Net.Elements.Entities;
45

56
namespace AltV.Net.Async.Elements.Entities;
@@ -224,6 +225,18 @@ public string CloudId
224225
}
225226
}
226227

228+
public CloudAuthResult CloudAuthResult
229+
{
230+
get
231+
{
232+
lock (ConnectionInfo)
233+
{
234+
if (!AsyncContext.CheckIfExistsOrCachedNullable(ConnectionInfo)) return default;
235+
return ConnectionInfo.CloudAuthResult;
236+
}
237+
}
238+
}
239+
227240

228241
[Obsolete("Use new async API instead")]
229242
public IConnectionInfo ToAsync(IAsyncContext asyncContext)

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,38 @@ public string CloudId
15071507
}
15081508
}
15091509

1510+
public CloudAuthResult CloudAuthResult
1511+
{
1512+
get
1513+
{
1514+
lock (Player)
1515+
{
1516+
if (!AsyncContext.CheckIfExistsOrCachedNullable(Player)) return default;
1517+
return Player.CloudAuthResult;
1518+
}
1519+
}
1520+
}
1521+
1522+
public string BloodDamage
1523+
{
1524+
get
1525+
{
1526+
lock (Player)
1527+
{
1528+
if (!AsyncContext.CheckIfExistsOrCachedNullable(Player)) return default;
1529+
return Player.BloodDamage;
1530+
}
1531+
}
1532+
set
1533+
{
1534+
lock (Player)
1535+
{
1536+
if (!AsyncContext.CheckIfExistsNullable(Player)) return;
1537+
Player.BloodDamage = value;
1538+
}
1539+
}
1540+
}
1541+
15101542
[Obsolete("Use new async API instead")]
15111543
public IPlayer ToAsync(IAsyncContext asyncContext)
15121544
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ public unsafe interface IClientLibrary
886886

887887
public unsafe class ClientLibrary : IClientLibrary
888888
{
889-
public readonly uint Methods = 1729;
889+
public readonly uint Methods = 1735;
890890
public delegate* unmanaged[Cdecl]<nint, nint, void> Audio_AddOutput { get; }
891891
public delegate* unmanaged[Cdecl]<nint, nint> Audio_GetBaseObject { get; }
892892
public delegate* unmanaged[Cdecl]<nint, double> Audio_GetCurrentTime { get; }
@@ -3512,7 +3512,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
35123512
public ClientLibrary(Dictionary<ulong, IntPtr> funcTable)
35133513
{
35143514
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
3515-
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 17234525495073991761UL) Outdated = true;
3515+
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 14520310097856707558UL) Outdated = true;
35163516
Audio_AddOutput = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<Audio_AddOutputDelegate>(funcTable, 9914412815391408844UL, Audio_AddOutputFallback);
35173517
Audio_GetBaseObject = (delegate* unmanaged[Cdecl]<nint, nint>) GetUnmanagedPtr<Audio_GetBaseObjectDelegate>(funcTable, 6330360502401226894UL, Audio_GetBaseObjectFallback);
35183518
Audio_GetCurrentTime = (delegate* unmanaged[Cdecl]<nint, double>) GetUnmanagedPtr<Audio_GetCurrentTimeDelegate>(funcTable, 2944324482134975819UL, Audio_GetCurrentTimeFallback);

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

Lines changed: 32 additions & 2 deletions
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public unsafe interface ISharedLibrary
410410

411411
public unsafe class SharedLibrary : ISharedLibrary
412412
{
413-
public readonly uint Methods = 1729;
413+
public readonly uint Methods = 1735;
414414
public delegate* unmanaged[Cdecl]<nint, uint> Audio_GetID { get; }
415415
public delegate* unmanaged[Cdecl]<nint, uint> AudioAttachedOutput_GetID { get; }
416416
public delegate* unmanaged[Cdecl]<nint, uint> AudioFilter_GetID { get; }
@@ -1608,7 +1608,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
16081608
public SharedLibrary(Dictionary<ulong, IntPtr> funcTable)
16091609
{
16101610
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
1611-
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 17234525495073991761UL) Outdated = true;
1611+
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 14520310097856707558UL) Outdated = true;
16121612
Audio_GetID = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<Audio_GetIDDelegate>(funcTable, 4464042055475980737UL, Audio_GetIDFallback);
16131613
AudioAttachedOutput_GetID = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<AudioAttachedOutput_GetIDDelegate>(funcTable, 17725794901805112189UL, AudioAttachedOutput_GetIDFallback);
16141614
AudioFilter_GetID = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<AudioFilter_GetIDDelegate>(funcTable, 8824535635529306325UL, AudioFilter_GetIDFallback);

api/AltV.Net.Mock/MockConnectionInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Threading.Tasks;
3+
using AltV.Net.Data;
34
using AltV.Net.Elements.Args;
45
using AltV.Net.Elements.Entities;
56
using AltV.Net.Shared.Elements.Entities;
@@ -41,5 +42,6 @@ public void Decline(string reason)
4142
}
4243

4344
public string CloudId { get; }
45+
public CloudAuthResult CloudAuthResult { get; }
4446
}
4547
}

api/AltV.Net.Mock/MockCore.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,15 @@ public void SetVoiceExternal(string host, ushort port)
10131013
public byte SyncReceiveThreadCount { get; set; }
10141014
public byte SyncSendThreadCount { get; set; }
10151015
public uint[] LoadedVehicleModels { get; }
1016+
public void AddClientConfigKey(string key)
1017+
{
1018+
throw new NotImplementedException();
1019+
}
1020+
1021+
public bool HasBenefit(Benefit benefit)
1022+
{
1023+
throw new NotImplementedException();
1024+
}
10161025

10171026
public string PtrToStringUtf8AndFree(nint str, int size)
10181027
{

api/AltV.Net/Alt.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ public static Task ForEachColShapes(IAsyncBaseObjectCallback<IColShape> baseObje
147147

148148
public static int NetTime => Core.NetTime;
149149

150+
public static void AddClientConfigKey(string key) => Core.AddClientConfigKey(key);
151+
150152
public static ushort MaxStreamingPeds
151153
{
152154
get => Core.MaxStreamingPeds;
@@ -208,5 +210,7 @@ public static byte SyncSendThreadCount
208210
get => Core.SyncSendThreadCount;
209211
set => Core.SyncSendThreadCount = value;
210212
}
213+
214+
public static bool HasBenefit(Benefit benefit) => Core.HasBenefit(benefit);
211215
}
212216
}

api/AltV.Net/Core.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,19 @@ public void RestartResource(string name)
10991099
}
11001100
}
11011101

1102+
public void AddClientConfigKey(string key)
1103+
{
1104+
unsafe
1105+
{
1106+
CheckIfCallIsValid();
1107+
var keyPtr = MemoryUtils.StringToHGlobalUtf8(key);
1108+
Library.Server.Core_AddClientConfigKey(NativePointer, keyPtr);
1109+
Marshal.FreeHGlobal(keyPtr);
1110+
}
1111+
}
1112+
1113+
1114+
11021115
#region SyncedMetaData
11031116
public void SetSyncedMetaData(string key, object value)
11041117
{
@@ -1618,6 +1631,15 @@ public uint MigrationDistance
16181631
}
16191632
}
16201633
}
1634+
1635+
public bool HasBenefit(Benefit benefit)
1636+
{
1637+
unsafe
1638+
{
1639+
return Library.Server.Core_HasBenefit(NativePointer, (byte)benefit) == 1;
1640+
}
1641+
}
1642+
16211643
public byte MigrationThreadCount
16221644
{
16231645
get

api/AltV.Net/Data/Benefit.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace AltV.Net.Data;
2+
3+
public enum Benefit : byte
4+
{
5+
None,
6+
CloudAuth
7+
}

0 commit comments

Comments
 (0)