Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge rc into release #151

Merged
merged 353 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
353 commits
Select commit Hold shift + click to select a range
7815c40
update to latest sdk
Doxoh Apr 18, 2023
209fa56
centralize client to one delegate
Doxoh Apr 18, 2023
96ffc33
fix events
Doxoh Apr 18, 2023
5137857
add createTextLabel on client
Doxoh Apr 18, 2023
a7b2fd0
remove CPlayerBeforeConnectEvent
Doxoh Apr 19, 2023
94f7dc7
update sdk
martonp96 Apr 19, 2023
5abcc2b
make resource getConfig clientside available
Doxoh Apr 19, 2023
2bb44be
sdk compile fix
FabianTerhorst Apr 20, 2023
b606d9e
update sdk
Doxoh Apr 23, 2023
9d7ffab
fix cached CloudHash
Doxoh Apr 23, 2023
a042fad
add vehicle rpm setter
martonp96 Apr 24, 2023
e2dc0a6
update sdk
FabianTerhorst Apr 24, 2023
59c955b
fix client/server build
Doxoh Apr 25, 2023
373349a
add latest client methods
Doxoh Apr 25, 2023
6f7947b
fix typo and update cpp
Doxoh Apr 26, 2023
9d0a831
add new client events
Doxoh Apr 26, 2023
70daea8
add data to virtual entity
Doxoh Apr 26, 2023
f6dd69d
add visible setter/getter
Doxoh Apr 26, 2023
388da20
update sdk
Doxoh Apr 26, 2023
145cf41
add local vehicle
Doxoh Apr 26, 2023
88f60b4
add local ped
Doxoh Apr 28, 2023
df6b721
add create locale ped
Doxoh Apr 28, 2023
92d9bab
change getbaseobject logic
Doxoh Apr 30, 2023
e4aa94e
make Entity_SetRotation WorldObject_GetDimension WorldObject_SetPosit…
Doxoh Apr 30, 2023
5033398
add vehicle Quaternion
Doxoh Apr 30, 2023
0f56627
update sdk
FabianTerhorst Apr 30, 2023
c5ea5c7
update to latest sdk
Doxoh Apr 30, 2023
16c2055
add new marker methods
Doxoh Apr 30, 2023
f40496a
add facecamera to marker
Doxoh Apr 30, 2023
61a954a
add Object UsesStreaming
Doxoh May 1, 2023
3974173
Extended Voice Chat API
Doxoh May 1, 2023
1cb6e2e
add some missing feature to local vehicle
Doxoh May 1, 2023
eae3ada
fix build
Doxoh May 2, 2023
4f3394a
prepare text label streaming
Doxoh May 4, 2023
9f4e969
client add IsFullScreen
Doxoh May 4, 2023
fed3e90
Allow running module on internal branch
zziger May 4, 2023
0a5dfa0
Updated submodule cpp-sdk
Doxoh May 6, 2023
c614cf3
shared: add textlabel FaceCamera
Doxoh May 10, 2023
80a3bfc
SDK MValue changes
zziger May 10, 2023
633052f
Doxoh/ci (#144)
Doxoh May 11, 2023
72d4c54
fix create/remove event for marker and textlabel
Doxoh May 13, 2023
67639e7
add hash logs for invalid host
Doxoh May 13, 2023
11871a5
client: change bool to unit8_t
Doxoh May 13, 2023
d03ecd2
MValue workaround go brrrrr
zziger May 14, 2023
0b1bebf
Fixed includes
zziger May 14, 2023
f27c76f
Updated submodule cpp-sdk
Doxoh May 14, 2023
e79f3e2
Updated submodule cpp-sdk
Doxoh May 16, 2023
cad0e37
try fix mvalue
Doxoh May 17, 2023
54ace86
try fix #2
Doxoh May 17, 2023
73604a1
next try
Doxoh May 17, 2023
4e1d548
add logs
Doxoh May 18, 2023
e7e7d28
SDK update
zziger May 19, 2023
66f84a3
Fix IsEntityInStreamingRange
zziger May 20, 2023
6ea6f6c
change AttachToEntity callable
Doxoh May 20, 2023
b33b49c
fix network object
Doxoh May 20, 2023
bd2be08
add Core_CreateNetworkObject
Doxoh May 20, 2023
90021fb
SDK update
zziger May 20, 2023
e2b671d
Build fix
zziger May 20, 2023
3c02b26
change connection info to baseobject
Doxoh May 21, 2023
33307ca
add connection info to create remove event
Doxoh May 21, 2023
cb64788
add FreeConnectionInfoArray
Doxoh May 21, 2023
d4e8b75
update to latest sdk
Doxoh May 21, 2023
44becf7
update create rmlelement
Doxoh May 21, 2023
40dcc09
fix ID sizes
Doxoh May 21, 2023
38ac483
Updated submodule cpp-sdk
Doxoh May 21, 2023
5311af3
update to latest SDK
Doxoh May 23, 2023
1a9089d
add set model for IObject
Doxoh May 23, 2023
9d09628
add rotating and BobUpDown to marker
Doxoh May 25, 2023
bfcfec0
update to latest sdk
Doxoh May 26, 2023
deb6523
add register metric
Doxoh May 26, 2023
7dec04c
update blip properties
Doxoh May 27, 2023
07d8698
ILocalVehicle inherit ivehicle
Doxoh May 27, 2023
fd30522
fix import
Doxoh May 27, 2023
933431e
fix mvalue hopefully
Doxoh May 27, 2023
b6b0b1e
remove debug logs
Doxoh May 27, 2023
98cc605
Fix GetScriptGuid cached type
zziger May 28, 2023
9bc9951
update to latest sdk changes
Doxoh May 28, 2023
f77f75c
update nuget
Doxoh May 28, 2023
cc3fc98
update natives
Doxoh May 28, 2023
246d418
ILocalPed extends IPed, all entities now have a remote id and isrmeote
Doxoh May 29, 2023
06dd44b
fix c# client build
Doxoh May 29, 2023
bda9c31
SDK update
zziger May 31, 2023
c1e5ef0
fix compile
FabianTerhorst Jun 1, 2023
05ef225
Merge branch 'dev' of https://github.com/altmp/coreclr-module-runtime…
FabianTerhorst Jun 1, 2023
f1e255a
cleanup remoteid, cleanup scriptid
Doxoh Jun 2, 2023
c3ec516
move frozen methods to shared
martonp96 Jun 8, 2023
ee96701
update runtime with latest changes for weaponobject/font/frozen
Doxoh Jun 8, 2023
8551e45
SDK update
zziger Jun 9, 2023
72298d8
add new events and methods
Doxoh Jun 11, 2023
8e41933
fix
Doxoh Jun 11, 2023
b629ce6
fix comment
Doxoh Jun 11, 2023
6acfbf8
Add IPlayer::SetAmmo
Doxoh Jun 13, 2023
e5257a1
update ClrVehicleModelInfo and ClrWeaponModelInfo
Doxoh Jun 15, 2023
ababe46
add entity timestamp
Doxoh Jun 15, 2023
a9285cf
update sdk
FabianTerhorst Jun 18, 2023
88bb69e
update c# to latest runtime
Doxoh Jun 18, 2023
39e8069
add set pos(dim for client
Doxoh Jun 20, 2023
99c7d66
add missing parameter for create Object
Doxoh Jun 21, 2023
bc8ee58
Add IsWebViewGpuAccelerationActive getter
Doxoh Jun 22, 2023
8dd0d08
refactor blip getters/setters
Doxoh Jun 22, 2023
727b874
fix build
Doxoh Jun 22, 2023
fdcffce
fix getcurrentweapon
Doxoh Jun 27, 2023
fdc5c48
Startup error fix
zziger Jun 28, 2023
ca63f3b
add PLAYER_BULLET_HIT_EVENT event
Doxoh Jun 30, 2023
9e52023
update audiofilter
Doxoh Jul 1, 2023
fbb8d2d
implement blip changes
Doxoh Jul 1, 2023
e3e1131
fix game crash by weapon damage
Doxoh Jul 2, 2023
8fdac10
wip audio api rework
martonp96 Jul 4, 2023
838f7fe
Merge branch 'dev' into qa/audio-rework
martonp96 Jul 4, 2023
5dba189
fix compile
FabianTerhorst Jul 4, 2023
1f7c7bf
SDK update
zziger Jul 5, 2023
f38eefc
Merge branch 'qa/audio-rework' into dev
martonp96 Jul 5, 2023
0019d84
SDK update
zziger Jul 6, 2023
232677e
update to latest SDK
Doxoh Jul 6, 2023
58b150b
add player AmmoFlags
Doxoh Jul 7, 2023
4f89102
add baseCreateEvent/baseRemoveEvent for new Audio entities
Doxoh Jul 7, 2023
20232f5
add audio infos
Doxoh Jul 7, 2023
578dd13
add serverside decorations
Doxoh Jul 9, 2023
567cdc2
fix OnRmlEventDelegate
Doxoh Jul 9, 2023
9fae5e8
add audio category
Doxoh Jul 10, 2023
83c39f5
fix import
Doxoh Jul 10, 2023
7fe6656
fix syntax
Doxoh Jul 10, 2023
4359ef7
add player playscenario
Doxoh Jul 11, 2023
f0a7996
fix position
Doxoh Jul 11, 2023
7d36f59
add all weapon data getter
Doxoh Jul 12, 2023
34ef99a
add colshape for create/remove event
Doxoh Jul 13, 2023
2e4f337
add CVoiceConnectionEvent and SetVoiceExternalPublic
Doxoh Jul 19, 2023
5283814
rename local object base object type
FabianTerhorst Jul 20, 2023
e996f8a
add SetVoiceExternal for internal voice server connection, add CVoice…
Doxoh Jul 20, 2023
4f5a73f
Merge remote-tracking branch 'origin/dev' into dev
Doxoh Jul 20, 2023
ae820ab
add SetVoiceExternal for internal voice server connection, add CVoice…
Doxoh Jul 20, 2023
2381be9
update to latest changes
Doxoh Jul 20, 2023
e68092e
fix list getters
FabianTerhorst Jul 20, 2023
c7cb8c0
fix list getters
FabianTerhorst Jul 20, 2023
216d3d6
rename object
FabianTerhorst Jul 20, 2023
a12b044
update to latest sdk
Doxoh Jul 21, 2023
1c329ff
add ResetMinimapComponentPosition
Doxoh Jul 21, 2023
77b2f5f
update to latest change
Doxoh Jul 21, 2023
e3e0cbd
add GetVoiceConnectionState
zziger Jul 22, 2023
f5cea04
changed GetVoiceConnectionState export
zziger Jul 22, 2023
f4f689e
add new blip apis
Doxoh Jul 23, 2023
1a57e33
merge dev -> rc
Doxoh Jul 23, 2023
dffe718
add cloud auth api
Doxoh Jul 24, 2023
e825511
fix build
Doxoh Jul 24, 2023
8ebfc37
fix namespace
Doxoh Jul 24, 2023
a927231
Add some vehicle props
Doxoh Jul 25, 2023
095bc44
fix build
Doxoh Jul 25, 2023
8ea4c62
SDK update
zziger Jul 25, 2023
abfee95
Fix client build
vadzz-dev Jul 26, 2023
b58aca4
cache
martonp96 Jul 27, 2023
3dbda3b
add latest sdk changes
Doxoh Jul 27, 2023
4bf51cd
update func_table
Doxoh Jul 27, 2023
145947d
update type
martonp96 Jul 29, 2023
eb43c0d
audio api changes
martonp96 Aug 3, 2023
3de4728
SDK update
zziger Aug 5, 2023
165ecaf
Merge branch 'dev' into rc
emcifuntik Aug 5, 2023
e7963f8
update to latest changes
Doxoh Aug 6, 2023
16ae29b
Merge branch 'dev' into rc
Doxoh Aug 6, 2023
d242c6f
add event pointer for request scene
Doxoh Aug 6, 2023
817bc20
Merge branch 'dev' into rc
Doxoh Aug 6, 2023
9481ef8
fix export
Doxoh Aug 6, 2023
07d8ad2
Merge branch 'dev' into rc
Doxoh Aug 6, 2023
bcaf003
Fixed MValue thread safety
zziger Aug 9, 2023
dec6881
Merge branch 'dev' into rc
zziger Aug 9, 2023
2549410
add new server event
Doxoh Aug 12, 2023
65fca36
fix RegisterFont
Doxoh Aug 12, 2023
dc85f27
add connectioninfo Get/Set Text
Doxoh Aug 14, 2023
58c0c0b
ad VoiceChannel_GetPlayerCount
Doxoh Aug 14, 2023
04e295d
cache
martonp96 Aug 15, 2023
432ad46
add IsParachuting
Doxoh Aug 15, 2023
6ff6b51
Update SDK
zziger Aug 20, 2023
3245908
Merge branch 'dev' into rc
emcifuntik Aug 21, 2023
98fc789
fix c# events
FabianTerhorst Aug 21, 2023
fab07b1
fix c# events (#145)
FabianTerhorst Aug 21, 2023
1385987
add new audio event
Doxoh Aug 27, 2023
13d3f37
remove alt::Array
Doxoh Aug 27, 2023
a8a3d60
add new core methods and add playerhealevent
Doxoh Aug 29, 2023
a599342
all apis for tick, distance an thread count configurations
Doxoh Aug 30, 2023
3789d5f
add network object to game entity events
KiwisKiwi Sep 1, 2023
53029e0
Experimental change
zziger Sep 2, 2023
2bd58bb
Experimental C# client crash fix
zziger Sep 2, 2023
c4f1ec6
Merge branch 'rc' into dev
zziger Sep 2, 2023
78871a2
Merge pull request #146 from KiwisKiwi/fixcreateobject
zziger Sep 2, 2023
3e48a2c
added non-local object to base object events (#147)
KiwisKiwi Sep 7, 2023
1ec36fa
add meta data setters for setting multiple values at once
Doxoh Sep 9, 2023
e361559
fix cache (again)
martonp96 Sep 9, 2023
dc8645d
vehicle cache
vadzz-dev Sep 9, 2023
e7c303a
add Vehicle_SetSteeringAngle
Doxoh Sep 10, 2023
cb87ec6
fix cache
Doxoh Sep 10, 2023
6e90546
move event cancel logic to its own class
martonp96 Sep 10, 2023
3814f9e
Updated submodule cpp-sdk
Doxoh Sep 10, 2023
e57f4bf
add colshape classes
Doxoh Sep 10, 2023
77efd97
Merge branch 'dev' into rc
Doxoh Sep 10, 2023
340658f
fix import
Doxoh Sep 10, 2023
099d867
Merge branch 'dev' into rc
Doxoh Sep 10, 2023
5b0f9be
fix serverside bools
Doxoh Sep 11, 2023
b4b8f17
Merge branch 'dev' into rc
Doxoh Sep 11, 2023
3f35961
fix mvalue crash
Doxoh Sep 11, 2023
2fd6db9
Merge branch 'dev' into rc
Doxoh Sep 11, 2023
3ca4db1
extend get all functions (#149)
KiwisKiwi Sep 11, 2023
b993945
Merge branch 'dev' into rc
Doxoh Sep 11, 2023
ef62e90
fix invokers
Doxoh Sep 12, 2023
10d6e56
Merge branch 'dev' into rc
Doxoh Sep 12, 2023
599c812
fix build for client
Doxoh Sep 12, 2023
755d9f1
Merge branch 'dev' into rc
Doxoh Sep 12, 2023
1a26946
ConnectionInfo.RequestCloudID
emcifuntik Sep 16, 2023
d2a7830
Removed GetCloudAuthHash
zziger Sep 16, 2023
e72fc31
Merge branch 'dev' into rc
emcifuntik Sep 16, 2023
aa7db53
cpp-sdk update
emcifuntik Sep 18, 2023
2f23b95
added give ped scripted task event (#150)
KiwisKiwi Sep 19, 2023
4130cbd
fix OnGivePedScriptedTaskDelegate
Doxoh Sep 19, 2023
bcd23a3
update to latest sdk
Doxoh Sep 19, 2023
1c4e19f
change CGivePedScriptedTaskEvent taskType to uint32_t
Doxoh Sep 19, 2023
721b4a9
task debug
martonp96 Sep 21, 2023
460ad87
SDK update
zziger Sep 22, 2023
81c8e2e
Build fix
zziger Sep 22, 2023
12bf528
Merge remote-tracking branch 'origin/dev' into dev
zziger Sep 22, 2023
9667ff5
add latest events and fix runtime
Doxoh Sep 23, 2023
09d6a7c
Updated submodule cpp-sdk
Doxoh Sep 24, 2023
740dbed
Updated submodule cpp-sdk
Doxoh Sep 24, 2023
e3f3f8f
add RPC events
Doxoh Sep 24, 2023
f44a4ad
fix runtime
Doxoh Sep 24, 2023
f8160ee
change answer type for RPC
Doxoh Sep 24, 2023
e86d6c3
Merge remote-tracking branch 'origin/dev' into rc
emcifuntik Sep 27, 2023
a01f924
Updated submodule cpp-sdk
Doxoh Sep 29, 2023
65c7b74
make rpc events shared
Doxoh Sep 30, 2023
9bb0c18
rename ICore* server to ICore* core
Doxoh Sep 30, 2023
3e2149e
streaming distance per entity
Doxoh Sep 30, 2023
29b911a
streaming distance per entity
Doxoh Sep 30, 2023
32548a7
SDK update
zziger Sep 30, 2023
d2cef90
update sdk
martonp96 Oct 2, 2023
2d999ad
Merge remote-tracking branch 'origin/dev' into dev
martonp96 Oct 2, 2023
bfdb85c
Added clearCache argument to CreateAudio
zziger Oct 2, 2023
31414e8
CApi fix
zziger Oct 2, 2023
4d80312
Merge remote-tracking branch 'origin/dev' into rc
emcifuntik Oct 4, 2023
fbfd990
add entity SetStreamingDistance
Doxoh Oct 4, 2023
c023c0d
Merge branch 'dev' into rc
Doxoh Oct 4, 2023
91b9fb2
add Core_GetBaseObjectTypeSize
Doxoh Oct 4, 2023
9e8bd6a
Merge branch 'dev' into rc
Doxoh Oct 4, 2023
9f1a28f
refactor cloud auth
Doxoh Oct 7, 2023
d9c50e7
Added GetLoadedVehicleModels
Doxoh Oct 8, 2023
898673c
Merge branch 'dev' into rc
Doxoh Oct 13, 2023
5e77bca
Added method to pass more config entries to client
Doxoh Oct 16, 2023
4941083
add cloud auth result and benefit check
Doxoh Oct 16, 2023
59834d3
add blood damage getter / setter
Doxoh Oct 19, 2023
1b61599
Merge remote-tracking branch 'origin/dev' into rc
emcifuntik Oct 20, 2023
e205b3f
fix GetEntitiesIn*
Doxoh Oct 20, 2023
fcccba8
fix getid data type
Doxoh Oct 20, 2023
d91cedf
Merge branch 'dev' into rc
Doxoh Oct 20, 2023
f6ad842
merge rc into release
Doxoh Oct 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 168 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: Build client and server

on:
push:

jobs:
fetch-nethost-linux:
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup .NET Core
shell: pwsh
run: |
.\download_dotnet.ps1 ${{ runner.temp }} linux
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: nethost-linux
path: ${{ runner.temp }}/libnethost.tar
fetch-nethost-windows:
runs-on: windows-2022
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup .NET Core
shell: pwsh
run: |
.\download_dotnet.ps1 ${{ runner.temp }} win
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: nethost-windows
path: ${{ runner.temp }}\libnethost.tar
build-server:
runs-on: ${{ matrix.config.os }}
needs: [fetch-nethost-linux, fetch-nethost-windows]
strategy:
matrix:
config:
- {
name: linux,
os: ubuntu-20.04,
cc: gcc-9,
cxx: g++-9,
args: -DCMAKE_BUILD_TYPE=RelWithDebInfo,
nethost: nethost-linux,
}
- {
name: windows,
os: windows-latest,
cc: cl,
cxx: cl,
args: -DCMAKE_BUILD_TYPE=RelWithDebInfo -A x64 -T host=x64,
nethost: nethost-windows,
}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/download-artifact@v3
with:
name: ${{ matrix.config.nethost }}
path: ./nethost
- working-directory: ./nethost
shell: bash
run: |
tar xvf libnethost.tar
ls -l
pwd
- working-directory: ./server
shell: cmake -P {0}
run: |
set(ENV{CC} ${{ matrix.config.cc }})
set(ENV{CXX} ${{ matrix.config.cxx }})
file(MAKE_DIRECTORY build)
execute_process(
COMMAND cmake .. ${{ matrix.config.args }}
RESULT_VARIABLE result
WORKING_DIRECTORY build
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()
- working-directory: ./server
shell: bash
run: cmake --build build --config RelWithDebInfo
- if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
mkdir -p modules/linux/modules/
cp ./server/build/src/libcsharp-module.so ./modules/linux/modules
- if: ${{ runner.os == 'Windows' }}
shell: bash
run: |
mkdir -p modules/windows/modules/
cp ./server/build/src/RelWithDebInfo/csharp-module.dll ./modules/windows/modules
cp ./server/build/src/RelWithDebInfo/csharp-module.pdb ./modules/windows/modules
- id: create_archive
shell: bash
run: |
filename=$(echo "${{ matrix.config.name }}")
tar -cvf ./$filename.tar modules/$filename/modules
echo "art_name=$filename" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: csharp-module-${{ matrix.config.name }}
path: ./${{ steps.create_archive.outputs.art_name }}.tar
build-client:
runs-on: windows-latest
needs: [fetch-nethost-linux, fetch-nethost-windows]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/download-artifact@v3
with:
name: nethost-windows
path: ./nethost
- working-directory: ./nethost
shell: bash
run: |
tar xvf libnethost.tar
ls -l
pwd
- working-directory: ./client
shell: cmake -P {0}
run: |
set(ENV{CC} cl)
set(ENV{CXX} cl)
file(MAKE_DIRECTORY build )
execute_process(
COMMAND cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -A x64 -T host=x64 -DDYNAMIC_BUILD=1
RESULT_VARIABLE result
WORKING_DIRECTORY build
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()
- working-directory: ./client
shell: bash
run: cmake --build build --config RelWithDebInfo
- shell: bash
run: |
mkdir -p client/windows/client/
cp ./client/build/RelWithDebInfo/altv-client-csharp.dll ./client/windows/client
- id: create_archive
shell: bash
run: |
tar -cvf ./$filename.tar client/windows/client
echo "art_name=$filename" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: client-windows
path: ./${{ steps.create_archive.outputs.art_name }}.tar
cleanup:
runs-on: ubuntu-latest
needs: [build-server, build-client]
if: ${{ always() }}
steps:
- uses: geekyeggo/delete-artifact@v2
with:
name: |
nethost-linux
nethost-windows
csharp-module-linux
csharp-module-windows
client-windows
111 changes: 91 additions & 20 deletions c-api/altv.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "altv.h"

#include "data/types.h"
#include "utils/macros.h"
#include "version/version.h"
#if defined ALTV_CSHARP_SHARED || defined ALT_SERVER_API
#include "cpp-sdk/version/version.h"
Expand All @@ -19,28 +20,12 @@
#pragma clang diagnostic pop
#endif

using alt::Array;
CAPI_START()

void FreeUIntArray(alt::Array<uint32_t>* array) {
array->~Array<uint32_t>();
void FreeUIntArray(std::vector<uint32_t>* array) {
array->clear();
}

/*void FreeStringViewArray(alt::Array<std::stringView>* array) {
array->~Array<std::stringView>();
}*/

/*void FreeStringArray(alt::Array<std::string>* array) {
array->~Array<std::string>();
}*/

/*void FreeMValueArray(alt::Array<alt::MValue>* array) {
array->~Array<alt::MValue>();
}*/

/*void FreePlayerPointerArray(alt::Array<alt::IPlayer*>* array) {
array->~Array<alt::IPlayer*>();
}*/

void FreeCharArray(char charArray[]) {
delete[] charArray;
}
Expand All @@ -53,6 +38,11 @@ void FreeUInt8Array(uint8_t uInt8Array[]) {
delete[] uInt8Array;
}

void FreeVector2Array(vector2_t* vector2Array)
{
delete[] vector2Array;
}

void FreeVoidPointerArray(void* voidPointerArray[]) {
delete[] voidPointerArray;
}
Expand All @@ -75,10 +65,79 @@ void FreeResourceArray(alt::IResource** resourceArray) {
delete[] resourceArray;
}

void FreeObjectArray(alt::IObject** objectArray) {
void FreePlayerArray(alt::IPlayer** playerArray) {
delete[] playerArray;
}

void FreeBlipArray(alt::IBlip** blipArray)
{
delete[] blipArray;
}

void FreeVehicleArray(alt::IVehicle** vehicleArray)
{
delete[] vehicleArray;
}

void FreePedArray(alt::IPed** pedArray)
{
delete[] pedArray;
}

void FreeNetworkObjectArray(alt::IObject** networkObjectArray)
{
delete[] networkObjectArray;
}

void FreeColShapeArray(alt::IColShape** colShapeArray)
{
delete[] colShapeArray;
}

void FreeMarkerArray(alt::IMarker** markerArray)
{
delete[] markerArray;
}

void FreeTextLabelArray(alt::ITextLabel** textLabelArray)
{
delete[] textLabelArray;
}

void FreeCheckpointArray(alt::ICheckpoint** checkPointArray)
{
delete[] checkPointArray;
}

void FreeVirtualEntityArray(alt::IVirtualEntity** virtualEntityArray)
{
delete[] virtualEntityArray;
}

void FreeVirtualEntityGroupArray(alt::IVirtualEntityGroup** virtualEntityGroupArray)
{
delete[] virtualEntityGroupArray;
}

void FreeConnectionInfoArray(alt::IConnectionInfo** connectionInfoArray)
{
delete[] connectionInfoArray;
}

void FreeLocalObjectArray(alt::ILocalObject** objectArray) {
delete[] objectArray;
}

void FreeAudioArray(alt::IAudio** audioArray)
{
delete[] audioArray;
}

void FreeAudioOutputArray(alt::IAudioOutput** audioOutputArray)
{
delete[] audioOutputArray;
}

void FreeMValueConstArray(alt::MValueConst** mValueConstArray) {
delete[] mValueConstArray;
}
Expand Down Expand Up @@ -112,6 +171,16 @@ void FreeRmlElementArray(alt::IRmlElement** rmlElementArray) {
delete[] rmlElementArray;
}

void FreeLocalVehicleArray(alt::ILocalVehicle** localVehicleArray)
{
delete[] localVehicleArray;
}

void FreeLocalPedArray(alt::ILocalPed** localPedArray)
{
delete[] localPedArray;
}

void* Win_GetTaskDialog() {
char *pValue;
size_t len;
Expand All @@ -131,3 +200,5 @@ void* Win_GetTaskDialog() {
}

#endif

CAPI_END()
21 changes: 19 additions & 2 deletions c-api/altv.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,35 @@
#include "cpp-sdk/SDK.h"
#include "data/types.h"

EXPORT_SHARED void FreeUIntArray(alt::Array<uint32_t> *array);
EXPORT_SHARED void FreeUIntArray(std::vector<uint32_t> *array);
//EXPORT void FreePlayerPointerArray(alt::Array<alt::IPlayer*> *array);
//EXPORT void FreeStringViewArray(alt::Array<std::stringView> *array);
//EXPORT void FreeStringArray(alt::Array<std::string>* array);
/*EXPORT void FreeMValueArray(alt::Array<alt::MValue> *array);*/
EXPORT_SHARED void FreeCharArray(char charArray[]);
EXPORT_SHARED void FreeUInt32Array(/** nint */ uint32_t* uInt32Array);
EXPORT_SHARED void FreeUInt8Array(/** nint */ uint8_t* uInt8Array);
EXPORT_SHARED void FreeVector2Array(/** nint */ vector2_t* vector2Array);
EXPORT_SHARED void FreeVoidPointerArray(/** nint */void** voidPointerArray);
EXPORT_SHARED void FreeWeaponTArray(/** nint */ weapon_t* weaponArray, uint32_t size);
EXPORT_SHARED void FreeString(const char* string);
EXPORT_SHARED void FreeStringArray(const char** stringArray, uint32_t size);
EXPORT_SHARED void FreeResourceArray(alt::IResource** resourceArray);
EXPORT_SHARED void FreeObjectArray(alt::IObject** objectArray);
EXPORT_SHARED void FreePlayerArray(alt::IPlayer** playerArray);
EXPORT_SHARED void FreeBlipArray(alt::IBlip** blipArray);
EXPORT_SHARED void FreeVehicleArray(alt::IVehicle** vehicleArray);
EXPORT_SHARED void FreePedArray(alt::IPed** pedArray);
EXPORT_SHARED void FreeNetworkObjectArray(alt::IObject** networkObjectArray);
EXPORT_SHARED void FreeColShapeArray(alt::IColShape** colShapeArray);
EXPORT_SHARED void FreeMarkerArray(alt::IMarker** markerArray);
EXPORT_SHARED void FreeTextLabelArray(alt::ITextLabel** textLabelArray);
EXPORT_SHARED void FreeCheckpointArray(alt::ICheckpoint** checkpointArray);
EXPORT_SHARED void FreeVirtualEntityArray(alt::IVirtualEntity** virtualEntityArray);
EXPORT_SHARED void FreeVirtualEntityGroupArray(alt::IVirtualEntityGroup** virtualEntityGroupArray);
EXPORT_SHARED void FreeConnectionInfoArray(alt::IConnectionInfo** connectionInfoArray);
EXPORT_SHARED void FreeLocalObjectArray(alt::ILocalObject** objectArray);
EXPORT_SHARED void FreeAudioArray(alt::IAudio** audioArray);
EXPORT_SHARED void FreeAudioOutputArray(alt::IAudioOutput** audioOutputArray);
EXPORT_SHARED void FreeMValueConstArray(alt::MValueConst** mvalueConstArray);
EXPORT_SHARED const char* GetVersionStatic(int32_t &size);
EXPORT_SHARED const char* GetBranchStatic(int32_t &size);
Expand All @@ -27,4 +42,6 @@ EXPORT_SHARED const char* GetCApiVersion(int32_t &size);
EXPORT_SHARED const char* GetSDKVersion(int32_t &size);

EXPORT_CLIENT void FreeRmlElementArray(alt::IRmlElement** rmlElementArray);
EXPORT_CLIENT void FreeLocalVehicleArray(alt::ILocalVehicle** localVehicleArray);
EXPORT_CLIENT void FreeLocalPedArray(alt::ILocalPed** localPedArray);
EXPORT_CLIENT void* Win_GetTaskDialog();
Loading