Skip to content

Commit b5d5959

Browse files
committed
Merge tag '15.0.180-dev' into rc
# Conflicts: # runtime
2 parents 0c0799e + 74f719a commit b5d5959

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+622
-398
lines changed

api/AltV.Net.Async/AltAsync.Ped.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ namespace AltV.Net.Async
77
{
88
public static partial class AltAsync
99
{
10-
public static Task<IPed> CreatePed(uint model, Position pos, Rotation rot) => AltVAsync.Schedule(() =>
11-
Alt.Core.CreatePed(model, pos, rot));
10+
public static Task<IPed> CreatePed(uint model, Position pos, Rotation rot, uint streamingDistance = 0) => AltVAsync.Schedule(() =>
11+
Alt.Core.CreatePed(model, pos, rot, streamingDistance));
1212

13-
public static Task<IPed> CreatePed(PedModel model, Position pos, Rotation rot) =>
14-
CreatePed((uint)model, pos, rot);
13+
public static Task<IPed> CreatePed(PedModel model, Position pos, Rotation rot, uint streamingDistance = 0) =>
14+
CreatePed((uint)model, pos, rot, streamingDistance);
1515

16-
public static Task<IPed> CreatePed(string model, Position pos, Rotation rot) =>
17-
CreatePed(Alt.Hash(model), pos, rot);
16+
public static Task<IPed> CreatePed(string model, Position pos, Rotation rot, uint streamingDistance = 0) =>
17+
CreatePed(Alt.Hash(model), pos, rot, streamingDistance);
1818

1919
}
2020
}

api/AltV.Net.Async/AltAsync.Vehicle.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ namespace AltV.Net.Async
1212
{
1313
public static partial class AltAsync
1414
{
15-
public static Task<IVehicle> CreateVehicle(uint model, Position pos, Rotation rot) => AltVAsync.Schedule(() =>
16-
Alt.Core.CreateVehicle(model, pos, rot));
15+
public static Task<IVehicle> CreateVehicle(uint model, Position pos, Rotation rot, uint streamingDistance = 0) => AltVAsync.Schedule(() =>
16+
Alt.Core.CreateVehicle(model, pos, rot, streamingDistance));
1717

18-
public static Task<IVehicle> CreateVehicle(VehicleModel model, Position pos, Rotation rot) =>
19-
CreateVehicle((uint) model, pos, rot);
18+
public static Task<IVehicle> CreateVehicle(VehicleModel model, Position pos, Rotation rot, uint streamingDistance = 0) =>
19+
CreateVehicle((uint) model, pos, rot, streamingDistance);
2020

21-
public static Task<IVehicle> CreateVehicle(string model, Position pos, Rotation rot) =>
22-
CreateVehicle(Alt.Hash(model), pos, rot);
21+
public static Task<IVehicle> CreateVehicle(string model, Position pos, Rotation rot, uint streamingDistance = 0) =>
22+
CreateVehicle(Alt.Hash(model), pos, rot, streamingDistance);
2323

2424
[Obsolete("Use AltAsync.CreateVehicle or Alt.CreateVehicle instead")]
2525
public static IVehicleBuilder CreateVehicleBuilder(uint model, Position pos, Rotation rot) =>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,18 @@ public uint Timestamp
276276
return Entity.Timestamp;
277277
}
278278
}
279+
}
279280

281+
public uint StreamingDistance
282+
{
283+
get
284+
{
285+
lock (Entity)
286+
{
287+
if (!AsyncContext.CheckIfExistsOrCachedNullable(Entity)) return default;
288+
return Entity.StreamingDistance;
289+
}
290+
}
280291
}
281292

282293
public bool Frozen

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ public AsyncVehicle(ICore core, IntPtr nativePointer, uint id) : this(new Vehicl
586586
}
587587

588588
[Obsolete("Use AltAsync.CreateVehicle instead")]
589-
public AsyncVehicle(ICore core, uint model, Position position, Rotation rotation) : this(
590-
core, core.CreateVehicleEntity(out var id, model, position, rotation), id)
589+
public AsyncVehicle(ICore core, uint model, Position position, Rotation rotation, uint streamingDistance = 0) : this(
590+
core, core.CreateVehicleEntity(out var id, model, position, rotation, streamingDistance), id)
591591
{
592592
core.PoolManager.Vehicle.Add(this);
593593
}

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@ public class VehicleBuilder : IVehicleBuilder
1919

2020
private readonly Rotation rotation;
2121

22+
private readonly uint streamingDistance;
23+
2224
private readonly Dictionary<string, Action<IntPtr>> functions = new Dictionary<string, Action<IntPtr>>();
2325

2426
private readonly List<IntPtr> memoryToFree = new List<IntPtr>();
2527

26-
public VehicleBuilder(uint model, Position position, Rotation rotation)
28+
public VehicleBuilder(uint model, Position position, Rotation rotation, uint streamingDistance = 0)
2729
{
2830
this.model = model;
2931
this.position = position;
3032
this.rotation = rotation;
33+
this.streamingDistance = streamingDistance;
3134
}
3235

3336
public IVehicleBuilder ModKit(byte value)
@@ -423,8 +426,7 @@ public async Task<IVehicle> Build()
423426
{
424427
uint id = default;
425428
var ptr = Alt.Core.Library.Server.Core_CreateVehicle(((Core) Alt.Core).NativePointer, model,
426-
position, rotation,
427-
&id);
429+
position, rotation, streamingDistance, &id);
428430

429431
while (enumerator.MoveNext())
430432
{

api/AltV.Net.CApi/Events/ClientEvents.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ public delegate void PlayerBulletHitModuleDelegate(uint weapon, IntPtr victimPoi
8686

8787
public delegate void VoiceConnectionModuleDelegate(VoiceConnectionState state);
8888

89-
public delegate void ServerScriptRPCAnswerModuleDelegate(ushort answerId, IntPtr answer,
89+
public delegate void ScriptRPCModuleDelegate(IntPtr eventPointer, string name, IntPtr args, ulong size, ushort answerId);
90+
91+
public delegate void ScriptRPCAnswerModuleDelegate(ushort answerId, IntPtr answer,
9092
string answerError);
9193
}

0 commit comments

Comments
 (0)