From 3c62550a1306f8eaf9e807f10c03a949f1810049 Mon Sep 17 00:00:00 2001 From: deluvas Date: Fri, 29 Nov 2024 09:57:44 +0100 Subject: [PATCH 1/6] Fix build --- shared/src/helpers/CallContext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/src/helpers/CallContext.h b/shared/src/helpers/CallContext.h index fb46e171..9da140f0 100644 --- a/shared/src/helpers/CallContext.h +++ b/shared/src/helpers/CallContext.h @@ -103,7 +103,7 @@ namespace js bool CheckExtraInternalFieldJSValue() { - return Check(!info.This()->GetInternalField(1).As()->IsNullOrUndefined(), "Invalid extra internal field value"); + return Check(!info.This()->GetInternalField(1).template As()->IsNullOrUndefined(), "Invalid extra internal field value"); } v8::Local GetThis() @@ -131,7 +131,7 @@ namespace js { if(errored) return {}; if(info.This()->InternalFieldCount() != 2) return {}; - std::optional value = CppValue(info.This()->GetInternalField(1).As()); + std::optional value = CppValue(info.This()->GetInternalField(1).template As()); if(!value.has_value()) return T{}; return value.value(); } From 50792364e2aec3cdb72b19e46b4c2096e675c3a3 Mon Sep 17 00:00:00 2001 From: deluvas Date: Fri, 29 Nov 2024 10:14:16 +0100 Subject: [PATCH 2/6] Fix CI --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 6d787926..0dd0753e 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -99,7 +99,7 @@ jobs: run: | mkdir -p upload/modules cp build/linux/x86_64/release/libjs-module-v2.so upload/modules - cp server/deps/nodejs/lib/libnodev2.so upload + cp server/deps/nodejs/lib/libnode.so upload echo ${{ steps.version.outputs.SDK_COMMIT }} >> upload/sdk.version - name: Upload artifacts From 813e74eab3d22d468d8d056318b6e625f37a14ce Mon Sep 17 00:00:00 2001 From: xshady Date: Sat, 30 Nov 2024 01:32:13 +0300 Subject: [PATCH 3/6] Checkout RC sdk commit --- deps/cpp-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/cpp-sdk b/deps/cpp-sdk index f18e52bb..30b5e35a 160000 --- a/deps/cpp-sdk +++ b/deps/cpp-sdk @@ -1 +1 @@ -Subproject commit f18e52bbb7fd9cc57efa66f6c40449b41cdc13a0 +Subproject commit 30b5e35ab7081f7e8ff7ac2bc0568aa7cf38e6be From 6b0ba5b47db38e1fa02eafbba12805e9bab5ae78 Mon Sep 17 00:00:00 2001 From: xshady <54737754+xxshady@users.noreply.github.com> Date: Fri, 6 Dec 2024 03:39:13 +0300 Subject: [PATCH 4/6] Checkout current RC sdk commit --- deps/cpp-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/cpp-sdk b/deps/cpp-sdk index 30b5e35a..f18e52bb 160000 --- a/deps/cpp-sdk +++ b/deps/cpp-sdk @@ -1 +1 @@ -Subproject commit 30b5e35ab7081f7e8ff7ac2bc0568aa7cf38e6be +Subproject commit f18e52bbb7fd9cc57efa66f6c40449b41cdc13a0 From feacd9b840ec6f3436f5eea7937ffe3532090479 Mon Sep 17 00:00:00 2001 From: xshady <54737754+xxshady@users.noreply.github.com> Date: Fri, 13 Dec 2024 19:52:51 +0300 Subject: [PATCH 5/6] docs: Add installation guide for server developers --- README.md | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7276ecdf..c7ff4f64 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ # alt:V JS module v2 -> NOTE: The v2 module is still a work in progress and not ready for production use. - Repository containing the new JS module v2 module for [alt:V multiplayer](https://altv.mp/). ## Structure @@ -25,7 +23,37 @@ If there are any questions or you would like to discuss a feature, contact the _ ## Installing Module -## Installing the Module on the Client +## As server developer + +Create `.altvpkgrc.json` in your server directory (directory where you have altv-server binary): +```json +{ + "loadJSV2Module": true +} +``` + +Use [altv-pkg](https://github.com/altmp/altv-pkg) to install all needed binaries: +``` +npx altv-pkg release +``` + +Create resource with resource.toml containing the following: +```toml +type = 'jsv2' +main = 'server.js' +client-type = 'jsv2' +client-main = 'server.js' + +# Uncomment if you want to use v1 API (alt-server, alt-client modules) +# [js-module-v2] +# compatibilityEnabled = true +``` + +## As contributor + +### Installing the Module on the Client + +**NOTE:** It's only needed if you are contributing or debugging the module, normally it's shipped with alt:V client on release and rc branches **NOTE:** Client modules are only loaded when you are on the `dev` branch and have `debug` mode enabled. @@ -35,7 +63,7 @@ If there are any questions or you would like to discuss a feature, contact the _ 3. Once you start alt:V, a popup will appear, asking whether you want to run unofficial modules. Click "Yes" -## Installing the Module on Your Server +### Installing the Module on Your Server **NOTE:** Your server must be on the latest `dev` branch for the module to load correctly. From 0fa033dc2cecc31372bc25179c5d22da71e727ee Mon Sep 17 00:00:00 2001 From: deluvas Date: Fri, 20 Dec 2024 12:07:26 +0100 Subject: [PATCH 6/6] Update sdk --- deps/cpp-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/cpp-sdk b/deps/cpp-sdk index f18e52bb..30b5e35a 160000 --- a/deps/cpp-sdk +++ b/deps/cpp-sdk @@ -1 +1 @@ -Subproject commit f18e52bbb7fd9cc57efa66f6c40449b41cdc13a0 +Subproject commit 30b5e35ab7081f7e8ff7ac2bc0568aa7cf38e6be