Skip to content

Commit c17578f

Browse files
committed
fix checkpoint events and fix bool translate from runtime
1 parent 34e8fee commit c17578f

File tree

6 files changed

+25
-27
lines changed

6 files changed

+25
-27
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace AltV.Net.CApi.ClientEvents
6060

6161
public delegate void NetOwnerChangeModuleDelegate(IntPtr target, BaseObjectType type, IntPtr newOwner, IntPtr oldOwner);
6262

63-
public delegate void DiscordOAuth2TokenResultModuleDelegate(bool success, string token);
63+
public delegate void DiscordOAuth2TokenResultModuleDelegate(byte success, string token);
6464

6565
public delegate void WeaponDamageModuleDelegate(IntPtr eventPointer, IntPtr entityPointer,
6666
BaseObjectType entityType, uint weapon, ushort damage, Position shotOffset, BodyPart bodyPart, IntPtr sourceEntityPointer,
@@ -71,9 +71,9 @@ public delegate void WeaponDamageModuleDelegate(IntPtr eventPointer, IntPtr enti
7171
public delegate void RemoveBaseObjectModuleDelegate(IntPtr baseObject, BaseObjectType type);
7272

7373
public delegate void ColShapeModuleDelegate(IntPtr colShapePointer, IntPtr targetEntityPointer, BaseObjectType entityType,
74-
bool state);
74+
byte state);
7575
public delegate void CheckpointModuleDelegate(IntPtr colShapePointer, IntPtr targetEntityPointer, BaseObjectType entityType,
76-
bool state);
76+
byte state);
7777

7878
public delegate void EntityHitEntityModuleDelegate(IntPtr targetPointer, BaseObjectType targetType, IntPtr damagerPointer,
7979
BaseObjectType damagerType, uint weaponHash);

api/AltV.Net.CApi/Native/AltV.Resource.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ internal delegate void MainDelegate(IntPtr serverPointer, IntPtr resourcePointer
2222

2323
internal delegate void CheckpointDelegate(IntPtr checkpointPointer, IntPtr entityPointer,
2424
BaseObjectType baseObjectType,
25-
bool state);
25+
byte state);
2626

2727
internal delegate void PlayerConnectDelegate(IntPtr playerPointer, ushort playerId, string reason);
2828

2929
internal delegate void PlayerConnectDeniedDelegate(PlayerConnectDeniedReason reason, string name, string ip,
30-
ulong passwordHash, bool isDebug, string branch, uint majorVersion, string cdnUrl, long discordId);
30+
ulong passwordHash, byte isDebug, string branch, uint majorVersion, string cdnUrl, long discordId);
3131

3232
internal delegate void ResourceEventDelegate(IntPtr resourcePointer);
3333

@@ -58,7 +58,7 @@ internal delegate void PlayerChangeVehicleSeatDelegate(IntPtr vehiclePointer, In
5858
internal delegate void ServerEventDelegate(string name, IntPtr args, ulong size);
5959

6060
internal delegate void ColShapeDelegate(IntPtr colShapePointer, IntPtr targetEntityPointer,
61-
BaseObjectType entityType, bool state);
61+
BaseObjectType entityType, byte state);
6262

6363
internal delegate void VehicleDestroyDelegate(IntPtr vehiclePointer);
6464

@@ -93,7 +93,7 @@ internal delegate void FireDelegate(IntPtr eventPointer, IntPtr playerPointer,
9393
internal delegate void VehicleDamageDelegate(IntPtr eventPointer, IntPtr targetPointer, IntPtr sourcePointer, BaseObjectType sourceType, uint bodyHealthDamage, uint additionalBodyHealthDamage, uint engineHealthDamage, uint petrolTankDamage, uint weaponHash);
9494

9595
internal delegate void VehicleHornDelegate(IntPtr eventPointer, IntPtr targetPointer,
96-
IntPtr reporterPointer, bool state);
96+
IntPtr reporterPointer, byte state);
9797

9898
internal delegate void ConnectionQueueAddDelegate(IntPtr connectionInfoPointer);
9999

@@ -106,7 +106,7 @@ internal delegate void VehicleHornDelegate(IntPtr eventPointer, IntPtr targetPoi
106106
internal delegate void PlayerChangeInteriorDelegate(IntPtr target, uint oldIntLoc, uint newIntLoc);
107107
internal delegate void PlayerDimensionChangeDelegate(IntPtr player, int oldDimension, int newDimension);
108108

109-
internal delegate void VehicleSirenDelegate(IntPtr targetVehicle, bool state);
109+
internal delegate void VehicleSirenDelegate(IntPtr targetVehicle, byte state);
110110

111111
internal delegate void PlayerSpawnDelegate(IntPtr player);
112112

api/AltV.Net.Client/Discord.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public async Task<string> RequestOAuth2Token(string appId)
2222

2323
unsafe
2424
{
25-
void ResolveTask(bool success, string token)
25+
void ResolveTask(byte success, string token)
2626
{
27-
resultSuccess = success;
27+
resultSuccess = success == 1;
2828
data = token;
2929
semaphore.Release();
3030
}

api/AltV.Net.Client/ModuleWrapper.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
using AltV.Net.Client.Elements.Data;
66
using AltV.Net.Client.Elements.Factories;
77
using AltV.Net.Client.Elements.Pools;
8-
using AltV.Net.Client.Extensions;
9-
using AltV.Net.Client.WinApi;
108
using AltV.Net.Data;
119
using AltV.Net.Elements.Entities;
1210
using AltV.Net.Shared;
@@ -396,14 +394,14 @@ public static void OnWorldObjectStreamOut(IntPtr target, BaseObjectType type)
396394
_core.OnWorldObjectStreamOut(target, type);
397395
}
398396

399-
public static void OnColShape(IntPtr colshapepointer, IntPtr targetentitypointer, BaseObjectType entitytype, bool state)
397+
public static void OnColShape(IntPtr colshapepointer, IntPtr targetentitypointer, BaseObjectType entitytype, byte state)
400398
{
401-
_core.OnColShape(colshapepointer, targetentitypointer, entitytype, state);
399+
_core.OnColShape(colshapepointer, targetentitypointer, entitytype, state == 1);
402400
}
403401

404-
public static void OnCheckpoint(IntPtr colshapepointer, IntPtr targetentitypointer, BaseObjectType entitytype, bool state)
402+
public static void OnCheckpoint(IntPtr colshapepointer, IntPtr targetentitypointer, BaseObjectType entitytype, byte state)
405403
{
406-
_core.OnCheckpoint(colshapepointer, targetentitypointer, entitytype, state);
404+
_core.OnCheckpoint(colshapepointer, targetentitypointer, entitytype, state == 1);
407405
}
408406

409407
public static void OnMetaChange(IntPtr target, BaseObjectType type, string key, IntPtr value, IntPtr oldvalue)

api/AltV.Net/ModuleWrapper.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ public static void OnTick()
196196
}
197197

198198
public static void OnCheckpoint(IntPtr checkpointPointer, IntPtr entityPointer, BaseObjectType baseObjectType,
199-
bool state)
199+
byte state)
200200
{
201-
_core.OnCheckpoint(checkpointPointer, entityPointer, baseObjectType, state);
201+
_core.OnCheckpoint(checkpointPointer, entityPointer, baseObjectType, state == 1);
202202
}
203203

204204
public static void OnPlayerConnect(IntPtr playerPointer, ushort playerId, string reason)
@@ -321,9 +321,9 @@ public static void OnSyncedMetaDataChange(IntPtr entityPointer, BaseObjectType e
321321
}
322322

323323
public static void OnColShape(IntPtr colShapePointer, IntPtr targetEntityPointer, BaseObjectType entityType,
324-
bool state)
324+
byte state)
325325
{
326-
_core.OnColShape(colShapePointer, targetEntityPointer, entityType, state);
326+
_core.OnColShape(colShapePointer, targetEntityPointer, entityType, state == 1);
327327
}
328328

329329
public static void OnVehicleDestroy(IntPtr vehiclePointer)
@@ -371,9 +371,9 @@ public static void OnVehicleDamage(IntPtr eventPointer, IntPtr vehiclePointer, I
371371
engineHealthDamage, petrolTankDamage, weaponHash);
372372
}
373373

374-
public static void OnVehicleHorn(IntPtr eventPointer, IntPtr targetPointer, IntPtr reporterPointer, bool state)
374+
public static void OnVehicleHorn(IntPtr eventPointer, IntPtr targetPointer, IntPtr reporterPointer, byte state)
375375
{
376-
_core.OnVehicleHorn(eventPointer, targetPointer, reporterPointer, state);
376+
_core.OnVehicleHorn(eventPointer, targetPointer, reporterPointer, state == 1);
377377
}
378378

379379
public static void OnConnectionQueueAdd(IntPtr connectionInfo)
@@ -411,15 +411,15 @@ public static void OnPlayerDimensionChange(IntPtr player, int oldDimension, int
411411
_core.OnPlayerDimensionChange(player, oldDimension, newDimension);
412412
}
413413

414-
public static void OnPlayerConnectDenied(PlayerConnectDeniedReason reason, string name, string ip, ulong passwordHash, bool isDebug, string branch, uint majorVersion, string cdnUrl, long discordId)
414+
public static void OnPlayerConnectDenied(PlayerConnectDeniedReason reason, string name, string ip, ulong passwordHash, byte isDebug, string branch, uint majorVersion, string cdnUrl, long discordId)
415415
{
416-
_core.onPlayerConnectDenied(reason, name, ip, passwordHash, isDebug, branch, majorVersion, cdnUrl,
416+
_core.onPlayerConnectDenied(reason, name, ip, passwordHash, isDebug == 1, branch, majorVersion, cdnUrl,
417417
discordId);
418418
}
419419

420-
public static void OnVehicleSiren(IntPtr targetVehiclePointer, bool state)
420+
public static void OnVehicleSiren(IntPtr targetVehiclePointer, byte state)
421421
{
422-
_core.OnVehicleSiren(targetVehiclePointer, state);
422+
_core.OnVehicleSiren(targetVehiclePointer, state == 1);
423423
}
424424

425425
public static void OnPlayerSpawn(IntPtr playerPointer)

runtime

0 commit comments

Comments
 (0)