mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 18:43:29 +00:00
Compare commits
127 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cad4aaa1a5 | ||
|
|
2e017f97c9 | ||
|
|
fbd58d9426 | ||
|
|
894a11f087 | ||
|
|
dacb38fe45 | ||
|
|
2298254e24 | ||
|
|
853000a5c9 | ||
|
|
d0b47dd315 | ||
|
|
3c9dd1bea4 | ||
|
|
4d89ea7bc5 | ||
|
|
b97d13121e | ||
|
|
dcfdb0451c | ||
|
|
83b9082e87 | ||
|
|
2ab83a17b9 | ||
|
|
4ae35335e2 | ||
|
|
a1bf9472ae | ||
|
|
15129bb344 | ||
|
|
f143d80c34 | ||
|
|
e713c2f35f | ||
|
|
b1fac90e78 | ||
|
|
8341288457 | ||
|
|
4ad2b2d6dd | ||
|
|
485e67120c | ||
|
|
60f04bc4e8 | ||
|
|
35742847a7 | ||
|
|
c8c2b639ea | ||
|
|
0453470f1f | ||
|
|
d9da877da6 | ||
|
|
ed2b09a5f6 | ||
|
|
c1198ef287 | ||
|
|
58f6d3f349 | ||
|
|
67a7fa99af | ||
|
|
220c56f01d | ||
|
|
30be943581 | ||
|
|
a859e55c1b | ||
|
|
f491b06664 | ||
|
|
874686c975 | ||
|
|
2a7c1b8ae8 | ||
|
|
8ddbefee18 | ||
|
|
2b190d72c5 | ||
|
|
9fb8311aca | ||
|
|
d4f6ddb0fa | ||
|
|
0dd12a275b | ||
|
|
c45708066e | ||
|
|
0de4cf75e8 | ||
|
|
9bb4483266 | ||
|
|
ffc75cf4c4 | ||
|
|
2919805844 | ||
|
|
f3bff2b9cf | ||
|
|
74cda1c9a6 | ||
|
|
6c667d69b8 | ||
|
|
5f62304965 | ||
|
|
082831951e | ||
|
|
645a16394b | ||
|
|
0340a84e9c | ||
|
|
50cf9b10bd | ||
|
|
6e220e5807 | ||
|
|
c1f61dc4aa | ||
|
|
d8e08b8da8 | ||
|
|
1fee414ff0 | ||
|
|
b41008df8b | ||
|
|
3d775db2cc | ||
|
|
7b5510698e | ||
|
|
3f028b48c8 | ||
|
|
aa7b27ac2e | ||
|
|
2d207965db | ||
|
|
2e2a321006 | ||
|
|
67fa1cfe52 | ||
|
|
730440f4ac | ||
|
|
1d65705aa8 | ||
|
|
f04c0141ef | ||
|
|
e06c199816 | ||
|
|
94c7752844 | ||
|
|
9bdb4770c9 | ||
|
|
98e63a7152 | ||
|
|
3a179ea958 | ||
|
|
af15a44fb6 | ||
|
|
ac18c45bef | ||
|
|
65b8aaebe3 | ||
|
|
b3bd58385e | ||
|
|
29574bc36c | ||
|
|
6208286294 | ||
|
|
2299a3f5c9 | ||
|
|
098de89d95 | ||
|
|
8f7d5425ad | ||
|
|
938f0bcb6a | ||
|
|
577125120d | ||
|
|
5c599877ca | ||
|
|
c1b00cb050 | ||
|
|
319ea9b32a | ||
|
|
eda786931d | ||
|
|
31f7b5178e | ||
|
|
8a6dcff05d | ||
|
|
f2fe8b586c | ||
|
|
bcefc7670f | ||
|
|
12c8781236 | ||
|
|
d81c8fa67b | ||
|
|
6de6a29a09 | ||
|
|
ffcd4feb4e | ||
|
|
39f4936bf7 | ||
|
|
25549cda25 | ||
|
|
5231dae17a | ||
|
|
f669cc1cc0 | ||
|
|
43f1cd3bb2 | ||
|
|
ec9d3693bf | ||
|
|
01efe4e01d | ||
|
|
a997c54170 | ||
|
|
68b0fd1e38 | ||
|
|
9c82832a54 | ||
|
|
d9e7dfe497 | ||
|
|
49afb54b80 | ||
|
|
5d6846c5fa | ||
|
|
9bb4a8feaa | ||
|
|
50b118cbfe | ||
|
|
d11050fcc8 | ||
|
|
3d8baae344 | ||
|
|
1d7cce8409 | ||
|
|
3f4535cf17 | ||
|
|
4412b67d63 | ||
|
|
3128ac0022 | ||
|
|
b230515675 | ||
|
|
ad2f529345 | ||
|
|
162f3c7e7a | ||
|
|
ca4231f669 | ||
|
|
8334ff4be5 | ||
|
|
19907184be | ||
|
|
f2ba112ae4 |
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
*.rs linguist-language=Rust
|
||||||
|
|
||||||
*.paa filter=lfs diff=lfs merge=lfs -text
|
*.paa filter=lfs diff=lfs merge=lfs -text
|
||||||
*.p3d filter=lfs diff=lfs merge=lfs -text
|
*.p3d filter=lfs diff=lfs merge=lfs -text
|
||||||
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|||||||
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,4 +1,5 @@
|
|||||||
**When merged this pull request will:**
|
**When merged this pull request will:**
|
||||||
|
|
||||||
- _Describe what this pull request will do_
|
- _Describe what this pull request will do_
|
||||||
- _Each change in a separate line_
|
- _Each change in a separate line_
|
||||||
|
|
||||||
|
|||||||
33
.github/workflows/pack_early.yaml
vendored
33
.github/workflows/pack_early.yaml
vendored
@@ -5,32 +5,6 @@ on:
|
|||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
package_application:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
lfs: true
|
|
||||||
- name: set up JDK 11
|
|
||||||
uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
java-version: '17'
|
|
||||||
distribution: 'zulu'
|
|
||||||
cache: gradle
|
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
|
||||||
run: chmod +x gradlew
|
|
||||||
- name: Build with Gradle
|
|
||||||
run: ./gradlew assembleDebug
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: simtak
|
|
||||||
path: app/build/outputs/apk/debug/app-debug.apk
|
|
||||||
if-no-files-found: error
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
build_extension:
|
build_extension:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -66,7 +40,7 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
package:
|
package:
|
||||||
needs: [build_extension, package_application]
|
needs: [build_extension]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
@@ -88,11 +62,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: x86_64-unknown-linux-gnu
|
name: x86_64-unknown-linux-gnu
|
||||||
- run: mv ./libarmatak.so ./armatak_x64.so
|
- run: mv ./libarmatak.so ./armatak_x64.so
|
||||||
- name: Download Android Application Installer
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: simtak
|
|
||||||
- run: mv ./app-debug.apk ./simtak.apk
|
|
||||||
- name: Setup HEMTT
|
- name: Setup HEMTT
|
||||||
uses: arma-actions/hemtt@v1
|
uses: arma-actions/hemtt@v1
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|||||||
33
.github/workflows/publish.yaml
vendored
33
.github/workflows/publish.yaml
vendored
@@ -5,32 +5,6 @@ on:
|
|||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
package_application:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
lfs: true
|
|
||||||
- name: set up JDK 11
|
|
||||||
uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
java-version: '17'
|
|
||||||
distribution: 'zulu'
|
|
||||||
cache: gradle
|
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
|
||||||
run: chmod +x gradlew
|
|
||||||
- name: Build with Gradle
|
|
||||||
run: ./gradlew assembleDebug
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: simtak
|
|
||||||
path: app/build/outputs/apk/debug/app-debug.apk
|
|
||||||
if-no-files-found: error
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
build_extension:
|
build_extension:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -66,7 +40,7 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
package:
|
package:
|
||||||
needs: [build_extension, package_application]
|
needs: [build_extension]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
@@ -88,11 +62,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: x86_64-unknown-linux-gnu
|
name: x86_64-unknown-linux-gnu
|
||||||
- run: mv ./libarmatak.so ./armatak_x64.so
|
- run: mv ./libarmatak.so ./armatak_x64.so
|
||||||
- name: Download Android Application Installer
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: simtak
|
|
||||||
- run: mv ./app-debug.apk ./simtak.apk
|
|
||||||
- name: Setup HEMTT
|
- name: Setup HEMTT
|
||||||
uses: arma-actions/hemtt@v1
|
uses: arma-actions/hemtt@v1
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|||||||
36
.github/workflows/release_drafter.yaml
vendored
36
.github/workflows/release_drafter.yaml
vendored
@@ -9,31 +9,6 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
package_application:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
lfs: true
|
|
||||||
- name: Set up JDK 11
|
|
||||||
uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
java-version: '17'
|
|
||||||
distribution: 'zulu'
|
|
||||||
cache: gradle
|
|
||||||
- name: Grant execute permission for gradlew
|
|
||||||
run: chmod +x gradlew
|
|
||||||
- name: Build with Gradle
|
|
||||||
run: ./gradlew assembleDebug
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: simtak
|
|
||||||
path: app/build/outputs/apk/debug/app-debug.apk
|
|
||||||
if-no-files-found: error
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
build_extension:
|
build_extension:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -69,7 +44,7 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
package:
|
package:
|
||||||
needs: [build_extension, package_application]
|
needs: [build_extension]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
@@ -91,11 +66,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: x86_64-unknown-linux-gnu
|
name: x86_64-unknown-linux-gnu
|
||||||
- run: mv ./libarmatak.so ./armatak_x64.so
|
- run: mv ./libarmatak.so ./armatak_x64.so
|
||||||
- name: Download Android Application Installer
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: simtak
|
|
||||||
- run: mv ./app-debug.apk ./simtak.apk
|
|
||||||
- name: Setup HEMTT
|
- name: Setup HEMTT
|
||||||
uses: arma-actions/hemtt@v1
|
uses: arma-actions/hemtt@v1
|
||||||
- name: Build
|
- name: Build
|
||||||
@@ -121,8 +91,8 @@ jobs:
|
|||||||
release_name: ${{ github.ref }}
|
release_name: ${{ github.ref }}
|
||||||
body: |
|
body: |
|
||||||
Changes in this release:
|
Changes in this release:
|
||||||
${{ env.COMMIT_MESSAGES }}
|
${{ github.event.head_commit.message }}
|
||||||
draft: false
|
draft: true
|
||||||
prerelease: false
|
prerelease: false
|
||||||
- name: Upload Release Asset
|
- name: Upload Release Asset
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
|
|||||||
79
.github/workflows/release_publisher.yaml
vendored
Normal file
79
.github/workflows/release_publisher.yaml
vendored
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
name: Publish Production
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_extension:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os_target:
|
||||||
|
- { os: "windows-latest", target: "i686-pc-windows-msvc", artifact: "armatak.dll", name: "armatak.dll" }
|
||||||
|
- { os: "windows-latest", target: "x86_64-pc-windows-msvc", artifact: "armatak.dll", name: "armatak_x64.dll" }
|
||||||
|
- { os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu", artifact: "libarmatak.so", name: "armatak.so" }
|
||||||
|
runs-on: ${{ matrix.os_target.os }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
- name: Install Rust Toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
target: ${{ matrix.os_target.target }}
|
||||||
|
toolchain: stable
|
||||||
|
default: true
|
||||||
|
- name: Install Dependencies (Linux only)
|
||||||
|
if: matrix.os_target.os == 'ubuntu-latest'
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y build-essential
|
||||||
|
- name: Cargo Build
|
||||||
|
run: cargo build --release --target ${{ matrix.os_target.target }}
|
||||||
|
- name: check stuff
|
||||||
|
run: ls target/release
|
||||||
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.os_target.target }}
|
||||||
|
path: target/${{ matrix.os_target.target }}/release/${{ matrix.os_target.artifact }}
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
package:
|
||||||
|
needs: [build_extension]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
- run: mkdir -p ./target/release
|
||||||
|
- name: Download Windows x64 Artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: x86_64-pc-windows-msvc
|
||||||
|
- run: mv ./armatak.dll ./armatak_x64.dll
|
||||||
|
- name: Download Windows x86 Artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: i686-pc-windows-msvc
|
||||||
|
- name: Download Linux x64 Artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: x86_64-unknown-linux-gnu
|
||||||
|
- run: mv ./libarmatak.so ./armatak_x64.so
|
||||||
|
- name: Setup HEMTT
|
||||||
|
uses: arma-actions/hemtt@v1
|
||||||
|
- name: Build
|
||||||
|
run: hemtt release
|
||||||
|
- name: Extract Zipped Mod
|
||||||
|
run: unzip releases/armatak-latest.zip -d releases
|
||||||
|
- uses: arma-actions/workshop-upload@v1
|
||||||
|
with:
|
||||||
|
appId: '107410'
|
||||||
|
itemId: ${{ secrets.STEAM_WORKSHOP_PROD_ID }}
|
||||||
|
contentPath: releases/@armatak
|
||||||
|
changelog: 'Update'
|
||||||
|
env:
|
||||||
|
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
|
||||||
|
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
|
||||||
@@ -4,10 +4,10 @@ name = "ARMA Team Awareness Kit"
|
|||||||
prefix = "armatak"
|
prefix = "armatak"
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
build = 9
|
build = 0
|
||||||
major = 0
|
major = 1
|
||||||
minor = 9
|
minor = 1
|
||||||
patch = 9
|
patch = 0
|
||||||
|
|
||||||
git_hash = 0
|
git_hash = 0
|
||||||
|
|
||||||
@@ -25,8 +25,7 @@ include = [
|
|||||||
"LICENSE",
|
"LICENSE",
|
||||||
"*.dll",
|
"*.dll",
|
||||||
"*.so",
|
"*.so",
|
||||||
"*.paa",
|
"*.paa"
|
||||||
"simtak.apk"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[properties]
|
[properties]
|
||||||
@@ -38,28 +37,29 @@ preset = "Hemtt"
|
|||||||
|
|
||||||
[hemtt.launch.default]
|
[hemtt.launch.default]
|
||||||
workshop = [
|
workshop = [
|
||||||
"450814997", # CBA
|
"450814997", # CBA_A3
|
||||||
"463939057", # ACE
|
"463939057", # ACE
|
||||||
"623475643", # 3den enhanced
|
|
||||||
"1779063631", # Zeus enhanced
|
|
||||||
"1673595418", # User Input Menus
|
|
||||||
"1678581937", # Extended Function Viewer
|
|
||||||
"1231625987", #Debug Console
|
|
||||||
"751965892", # ACRE2
|
"751965892", # ACRE2
|
||||||
|
"2522638637", # ACE Extended Arsenal
|
||||||
|
"333310405", # Enhanced Movement
|
||||||
|
"2034363662", # Enhanced Movement Rework
|
||||||
|
"2941986336", # Hatchet Interaction Framework - Stable Version
|
||||||
|
"1745501605", # Hatchet H-60 pack - Stable Version
|
||||||
"843577117", # RHSUSAF
|
"843577117", # RHSUSAF
|
||||||
"843425103", # RHSAFRF
|
"843425103", # RHSAFRF
|
||||||
|
"843632231", # RHSSAF
|
||||||
"843593391", # RHSGREF
|
"843593391", # RHSGREF
|
||||||
"735566597", # Project OPFOR
|
"1673456286", # 3CB Factions
|
||||||
"3030830594", # Western Dusk
|
"623475643", # 3den Enhanced
|
||||||
"3147473073", # TOTT Core
|
"2257686620", # Blastcore Murr Edition
|
||||||
"3147480843", # TOTT CAG
|
"583496184", # CUP Terrains - Core
|
||||||
"3147476552", # TOTT Optics
|
"3078351739", # Kunduz River
|
||||||
"2975268929", # GPNVG
|
"1858075458", # LAMBS_Danger.fsm
|
||||||
"583496184", # CUP Terrains
|
"1808238502", # LAMBS_Suppression
|
||||||
"421620913", # Kunduz
|
"3425368881", # M4A1_URGI
|
||||||
"2397360831", # USAF Core
|
"2268351256", # Tier One Weapons
|
||||||
"2397376046", # USAF Utility
|
"2560276469", # Restrict Markers
|
||||||
"2226368165", # USAF AC130
|
"3493557838" # Ballad of the Green Berets
|
||||||
]
|
]
|
||||||
|
|
||||||
parameters = [
|
parameters = [
|
||||||
|
|||||||
1743
Cargo.lock
generated
1743
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
12
Cargo.toml
12
Cargo.toml
@@ -1,26 +1,16 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "armatak"
|
name = "armatak"
|
||||||
version = "0.9.9"
|
version = "1.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
arma-rs = "1.10.4"
|
arma-rs = "1.10.4"
|
||||||
chrono = "0.4.39"
|
chrono = "0.4.39"
|
||||||
futures = "0.3.31"
|
|
||||||
futures-util = "0.3.31"
|
|
||||||
http = "1.1.0"
|
|
||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
log = "0.4.22"
|
log = "0.4.22"
|
||||||
log4rs = "1.3.0"
|
log4rs = "1.3.0"
|
||||||
once_cell = "1.19.0"
|
once_cell = "1.19.0"
|
||||||
qrcode = "0.14.1"
|
|
||||||
regex = "1.10.6"
|
|
||||||
reqwest = { version = "0.12.7", features = ["blocking"] }
|
|
||||||
serde = { version = "1.0.210", features = ["derive"] }
|
serde = { version = "1.0.210", features = ["derive"] }
|
||||||
serde_json = "1.0.128"
|
|
||||||
tokio = { version = "1.40", features = ["full"] }
|
|
||||||
tokio-tungstenite = "0.24.0"
|
|
||||||
ws = "0.9.2"
|
|
||||||
|
|
||||||
[dependencies.uuid]
|
[dependencies.uuid]
|
||||||
version = "1.10.0"
|
version = "1.10.0"
|
||||||
|
|||||||
1
addons/client/$PBOPREFIX$
Normal file
1
addons/client/$PBOPREFIX$
Normal file
@@ -0,0 +1 @@
|
|||||||
|
armatak\armatak\addons\client
|
||||||
17
addons/client/CfgEventHandlers.hpp
Normal file
17
addons/client/CfgEventHandlers.hpp
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
class Extended_PreStart_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_PreInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_PostInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
|
||||||
|
};
|
||||||
|
};
|
||||||
3
addons/client/XEH_PREP.hpp
Normal file
3
addons/client/XEH_PREP.hpp
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
PREP(convertClientLocation);
|
||||||
|
PREP(extractClientPosition);
|
||||||
|
PREP(startUDPSocket);
|
||||||
8
addons/client/XEH_postInit.sqf
Normal file
8
addons/client/XEH_postInit.sqf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
|
_local_address = "armatak" callExtension ["local_ip", []] select 0;
|
||||||
|
|
||||||
|
SETVAR(player,GVAR(localAddress),_local_address);
|
||||||
|
SETVAR(player,GVAR(eudConnected),false);
|
||||||
9
addons/client/XEH_preInit.sqf
Normal file
9
addons/client/XEH_preInit.sqf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
ADDON = false;
|
||||||
|
|
||||||
|
PREP_RECOMPILE_START;
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
|
PREP_RECOMPILE_END;
|
||||||
|
|
||||||
|
ADDON = true;
|
||||||
3
addons/client/XEH_preStart.sqf
Normal file
3
addons/client/XEH_preStart.sqf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
35
addons/client/config.cpp
Normal file
35
addons/client/config.cpp
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
class CfgPatches {
|
||||||
|
class ADDON {
|
||||||
|
name = COMPONENT_NAME;
|
||||||
|
units[] = {};
|
||||||
|
weapons[] = {};
|
||||||
|
requiredAddons[] = {
|
||||||
|
"cba_main",
|
||||||
|
"ace_main",
|
||||||
|
"armatak_main"
|
||||||
|
};
|
||||||
|
requiredVersion = REQUIRED_VERSION;
|
||||||
|
author = PROJECT_AUTHOR;
|
||||||
|
url = "https://github.com/valmojr/armatak";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class CfgVehicles {
|
||||||
|
class Man;
|
||||||
|
class CAManBase: Man {
|
||||||
|
class ACE_SelfActions {
|
||||||
|
class danceParty {
|
||||||
|
displayName = "Connect to EUD";
|
||||||
|
condition = "!(player getVariable ['armatak_client_eudConnected', false])";
|
||||||
|
exceptions[] = {};
|
||||||
|
statement = "createDialog 'armatak_udp_socket_start_dialog'";
|
||||||
|
icon = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "CfgEventHandlers.hpp"
|
||||||
|
#include "dialog.hpp"
|
||||||
73
addons/client/dialog.hpp
Normal file
73
addons/client/dialog.hpp
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
class RscText;
|
||||||
|
class RscBackground;
|
||||||
|
class RscButton;
|
||||||
|
class RscEdit;
|
||||||
|
|
||||||
|
class armatak_udp_socket_start_dialog {
|
||||||
|
idd = 999091;
|
||||||
|
movingEnable = 0;
|
||||||
|
class ControlsBackground {
|
||||||
|
class armatak_gui_module_udp_socket_dialog_main_frame: RscBackground {
|
||||||
|
idc = 16960;
|
||||||
|
x = "0.386562 * safezoneW + safezoneX";
|
||||||
|
y = "0.401 * safezoneH + safezoneY";
|
||||||
|
w = "0.216563 * safezoneW";
|
||||||
|
h = "0.242 * safezoneH";
|
||||||
|
colorBackground[]={0,0,0,0.45};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class Controls {
|
||||||
|
class armatak_gui_module_udp_socket_dialog_address_edit: RscEdit {
|
||||||
|
idc = 16961;
|
||||||
|
text = "168.15.0.3";
|
||||||
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
|
y = "0.445 * safezoneH + safezoneY";
|
||||||
|
w = "0.20625 * safezoneW";
|
||||||
|
h = "0.044 * safezoneH";
|
||||||
|
colorBackground[]={0,0,0,0.5};
|
||||||
|
};
|
||||||
|
class armatak_gui_module_udp_socket_dialog_address_port_edit: RscEdit {
|
||||||
|
idc = 16962;
|
||||||
|
text = "4349";
|
||||||
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
|
y = "0.522 * safezoneH + safezoneY";
|
||||||
|
w = "0.20625 * safezoneW";
|
||||||
|
h = "0.044 * safezoneH";
|
||||||
|
colorBackground[]={0,0,0,0.5};
|
||||||
|
};
|
||||||
|
class armatak_gui_module_udp_socket_dialog_address_text: RscText {
|
||||||
|
idc = 16963;
|
||||||
|
text = "Phone's Socket Local Address";
|
||||||
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
|
y = "0.412 * safezoneH + safezoneY";
|
||||||
|
w = "0.20625 * safezoneW";
|
||||||
|
h = "0.033 * safezoneH";
|
||||||
|
};
|
||||||
|
class armatak_gui_module_udp_socket_dialog_address_port_text: RscText {
|
||||||
|
idc = 16964;
|
||||||
|
text = "Phone's Socket Local Port";
|
||||||
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
|
y = "0.489 * safezoneH + safezoneY";
|
||||||
|
w = "0.20625 * safezoneW";
|
||||||
|
h = "0.033 * safezoneH";
|
||||||
|
};
|
||||||
|
class armatak_gui_module_udp_socket_dialog_address_button_cancel: RscButton {
|
||||||
|
idc = 16965;
|
||||||
|
text = "Cancel";
|
||||||
|
action = "closeDialog 2;";
|
||||||
|
x = "0.551563 * safezoneW + safezoneX";
|
||||||
|
y = "0.577 * safezoneH + safezoneY";
|
||||||
|
w = "0.0464063 * safezoneW";
|
||||||
|
h = "0.055 * safezoneH";
|
||||||
|
};
|
||||||
|
class armatak_gui_module_udp_socket_dialog_address_button_ok: RscButton {
|
||||||
|
idc = 16966;
|
||||||
|
text = "Ok";
|
||||||
|
action = QUOTE(call FUNC(startUDPSocket));
|
||||||
|
x = "0.5 * safezoneW + safezoneX";
|
||||||
|
y = "0.577 * safezoneH + safezoneY";
|
||||||
|
w = "0.0464063 * safezoneW";
|
||||||
|
h = "0.055 * safezoneH";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -1,3 +1,24 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Author: Valmo Trindade
|
||||||
|
* This function is used to convert the position of a unit to the world world location.
|
||||||
|
*
|
||||||
|
* Argument:
|
||||||
|
* 0: in game latitude <NUMBER> is the latitude of the unit.
|
||||||
|
* 1: in game longitude <NUMBER> is the longitude of the unit.
|
||||||
|
* 2: in game altitude <NUMBER> is the altitude of the unit.
|
||||||
|
* 3: in game bearing <NUMBER> is the bearing of the unit.
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* ARRAY -> [latitude, longitude, altitude, bearing]
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [player] call armatak_client_fnc_convertClientLocation;
|
||||||
|
*
|
||||||
|
* Public: Yes
|
||||||
|
*/
|
||||||
|
|
||||||
params["_latitude", "_longitude", "_altitude"];
|
params["_latitude", "_longitude", "_altitude"];
|
||||||
|
|
||||||
_position = [_latitude, _longitude, _altitude];
|
_position = [_latitude, _longitude, _altitude];
|
||||||
@@ -50,6 +71,12 @@ switch (toLower worldName) do {
|
|||||||
case "kunduz": {
|
case "kunduz": {
|
||||||
_realLocation = _position call armatak_fnc_convert_to_kunduz;
|
_realLocation = _position call armatak_fnc_convert_to_kunduz;
|
||||||
};
|
};
|
||||||
|
case "kunduz_valley": {
|
||||||
|
_realLocation = _position call armatak_fnc_convert_to_kunduz_valley;
|
||||||
|
};
|
||||||
|
case "tanoa": {
|
||||||
|
_realLocation = _position call armatak_fnc_convert_to_tanoa;
|
||||||
|
}
|
||||||
default {
|
default {
|
||||||
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Unsupported Map"];
|
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Unsupported Map"];
|
||||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||||
@@ -58,4 +85,4 @@ switch (toLower worldName) do {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_realLocation
|
_realLocation
|
||||||
29
addons/client/functions/fnc_extractClientPosition.sqf
Normal file
29
addons/client/functions/fnc_extractClientPosition.sqf
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Author: Valmo Trindade
|
||||||
|
* This function is used to extract the position of a unit and convert it to a format suitable for SIMTAK.
|
||||||
|
*
|
||||||
|
* Argument:
|
||||||
|
* 0: The first argument <OBJECT> is the unit whose position you want to extract.
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* ARRAY -> [latitude, longitude, altitude, bearing]
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [player] call armatak_client_fnc_extractClientPosition;
|
||||||
|
*
|
||||||
|
* Public: Yes
|
||||||
|
*/
|
||||||
|
|
||||||
|
params["_unit"];
|
||||||
|
|
||||||
|
private _uuid = _unit call armatak_fnc_extract_uuid;
|
||||||
|
private _pos = (getPos _unit) call FUNC(convertClientLocation);
|
||||||
|
private _callsign = _unit call armatak_fnc_extract_unit_callsign;
|
||||||
|
private _bearing = parseNumber ((getDir _unit) toFixed 0);
|
||||||
|
private _speed = speed _unit / 3.6;
|
||||||
|
|
||||||
|
_payload = [_uuid, _pos select 0, _pos select 1, _pos select 2, _callsign, _bearing, _speed, _callsign];
|
||||||
|
|
||||||
|
_payload
|
||||||
31
addons/client/functions/fnc_startUDPSocket.sqf
Normal file
31
addons/client/functions/fnc_startUDPSocket.sqf
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
|
params ["_logic"];
|
||||||
|
|
||||||
|
_socket_is_running = player getVariable [QGVAR(eudConnected), false];
|
||||||
|
|
||||||
|
if (_socket_is_running) exitWith {
|
||||||
|
["Socket is already running", "error", "UDP Socket"] call EFUNC(main,notify);
|
||||||
|
closeDialog 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
disableSerialization;
|
||||||
|
|
||||||
|
_udp_socket_instance_address = ctrlText 16961;
|
||||||
|
_udp_socket_instance_port = ctrlText 16962;
|
||||||
|
|
||||||
|
_udp_socket_fulladdress = ((_udp_socket_instance_address) + ":" + (_udp_socket_instance_port));
|
||||||
|
|
||||||
|
player setVariable [QGVAR(udp_socket_address), _udp_socket_fulladdress];
|
||||||
|
player setVariable [QGVAR(eudConnected), true];
|
||||||
|
|
||||||
|
"armatak" callExtension ["udp_socket:start", [_udp_socket_fulladdress]];
|
||||||
|
|
||||||
|
[{
|
||||||
|
if (player getVariable [QGVAR(eudConnected), false]) then {
|
||||||
|
"armatak" callExtension ["udp_socket:send_gps_cot", [player call FUNC(extractClientPosition)]];
|
||||||
|
};
|
||||||
|
}, 0.5, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
|
deleteVehicle _logic;
|
||||||
|
closeDialog 1;
|
||||||
17
addons/client/script_component.hpp
Normal file
17
addons/client/script_component.hpp
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#define COMPONENT client
|
||||||
|
#define COMPONENT_BEAUTIFIED WebSocket Client
|
||||||
|
#include "\armatak\armatak\addons\main\script_mod.hpp"
|
||||||
|
|
||||||
|
// #define DEBUG_MODE_FULL
|
||||||
|
// #define DISABLE_COMPILE_CACHE
|
||||||
|
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||||
|
|
||||||
|
#ifdef DEBUG_ENABLED_CLIENT
|
||||||
|
#define DEBUG_MODE_FULL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_SETTINGS_CLIENT
|
||||||
|
#define DEBUG_SETTINGS DEBUG_SETTINGS_CLIENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "\z\ace\addons\main\script_macros.hpp"
|
||||||
@@ -1 +1 @@
|
|||||||
armatak\armatak\armatak_main
|
armatak\armatak\addons\main
|
||||||
160
addons/main/Cfg3den.hpp
Normal file
160
addons/main/Cfg3den.hpp
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
class Cfg3den {
|
||||||
|
class Object {
|
||||||
|
class AttributeCategories {
|
||||||
|
class armatak_3den_attributes {
|
||||||
|
displayName = "ARMA Team Awareness Kit";
|
||||||
|
class Attributes {
|
||||||
|
class armatak_attribute_unit_callsign {
|
||||||
|
displayName = "Unit Callsign";
|
||||||
|
tooltip = "Unit callsign on TAK";
|
||||||
|
property = "armatak_attribute_unit_callsign";
|
||||||
|
control = "Edit";
|
||||||
|
expression = "_this setVariable ['armatak_attribute_unit_callsign',_value]";
|
||||||
|
defaultValue = "''";
|
||||||
|
condition = "objectBrain";
|
||||||
|
typeName = "STRING";
|
||||||
|
};
|
||||||
|
class armatak_attribute_unit_role {
|
||||||
|
displayName = "Unit Role";
|
||||||
|
tooltip = "Unit role on TAK";
|
||||||
|
property = "armatak_attribute_unit_role";
|
||||||
|
control = "Combo";
|
||||||
|
class Values {
|
||||||
|
class armatak_attribute_unit_role_value_teammember {
|
||||||
|
name = "Team Member";
|
||||||
|
value = "Team Member";
|
||||||
|
default = 1;
|
||||||
|
};
|
||||||
|
class armatak_attribute_unit_role_value_teamleader {
|
||||||
|
name = "Team Leader";
|
||||||
|
value = "Team Lead";
|
||||||
|
};
|
||||||
|
class armatak_attribute_unit_role_value_hq {
|
||||||
|
name = "Headquarters";
|
||||||
|
value = "HQ";
|
||||||
|
};
|
||||||
|
class armatak_attribute_unit_role_value_sniper {
|
||||||
|
name = "Sniper";
|
||||||
|
value = "Sniper";
|
||||||
|
};
|
||||||
|
class armatak_attribute_unit_role_value_medic {
|
||||||
|
name = "Medic";
|
||||||
|
value = "Medic";
|
||||||
|
};
|
||||||
|
class armatak_attribute_unit_role_value_forward_observer {
|
||||||
|
name = "Forward Observer";
|
||||||
|
value = "Forward Observer";
|
||||||
|
};
|
||||||
|
class armatak_attribute_unit_role_value_rto {
|
||||||
|
name = "Radio Telephone Operator";
|
||||||
|
value = "RTO";
|
||||||
|
};
|
||||||
|
class armatak_attribute_unit_role_value_k9 {
|
||||||
|
name = "K9 Operator";
|
||||||
|
value = "K9";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
expression = "_this setVariable ['%s',_value];";
|
||||||
|
unique = 0;
|
||||||
|
condition = "objectBrain";
|
||||||
|
};
|
||||||
|
class armatak_attribute_marker_callsign {
|
||||||
|
displayName = "Marker Callsign";
|
||||||
|
tooltip = "Marker Callsign on TAK";
|
||||||
|
property = "armatak_attribute_marker_callsign";
|
||||||
|
control = "Edit";
|
||||||
|
expression = "_this setVariable ['armatak_attribute_marker_callsign',_value]";
|
||||||
|
defaultValue = "''";
|
||||||
|
condition = "objectVehicle";
|
||||||
|
typeName = "STRING";
|
||||||
|
};
|
||||||
|
class armatak_attribute_marker_type {
|
||||||
|
displayName = "Marker Type";
|
||||||
|
tooltip = "Marker type on TAK";
|
||||||
|
property = "armatak_attribute_marker_type";
|
||||||
|
control = "Edit";
|
||||||
|
expression = "_this setVariable ['armatak_attribute_marker_type',_value]";
|
||||||
|
defaultValue = "''";
|
||||||
|
condition = "objectVehicle";
|
||||||
|
typeName = "STRING";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class Group {
|
||||||
|
class AttributeCategories {
|
||||||
|
class armatak_3den_group_attributes {
|
||||||
|
displayName = "ARMA Team Awareness Kit";
|
||||||
|
class Attributes {
|
||||||
|
class armatak_attribute_group_color {
|
||||||
|
displayName = "Color";
|
||||||
|
tooltip = "Group on TAK";
|
||||||
|
property = "armatak_attribute_group_color";
|
||||||
|
control = "Combo";
|
||||||
|
class Values {
|
||||||
|
class armatak_attribute_group_color_value_white {
|
||||||
|
name = "White";
|
||||||
|
value = "White";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_yellow {
|
||||||
|
name = "Yellow";
|
||||||
|
value = "Yellow";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_orange {
|
||||||
|
name = "Orange";
|
||||||
|
value = "Orange";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_magenta {
|
||||||
|
name = "Magenta";
|
||||||
|
value = "Magenta";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_red {
|
||||||
|
name = "Red";
|
||||||
|
value = "Red";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_maroon {
|
||||||
|
name = "Maroon";
|
||||||
|
value = "Maroon";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_purple {
|
||||||
|
name = "Purple";
|
||||||
|
value = "Purple";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_darkblue {
|
||||||
|
name = "Dark Blue";
|
||||||
|
value = "DarkBlue";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_blue {
|
||||||
|
name = "Blue";
|
||||||
|
value = "Blue";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_cyan {
|
||||||
|
name = "Cyan";
|
||||||
|
value = "Cyan";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_teal {
|
||||||
|
name = "Teal";
|
||||||
|
value = "Teal";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_green {
|
||||||
|
name = "Green";
|
||||||
|
value = "Green";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_darkgreen {
|
||||||
|
name = "Dark Green";
|
||||||
|
value = "DarkGreen";
|
||||||
|
};
|
||||||
|
class armatak_attribute_group_color_value_brown {
|
||||||
|
name = "Brown";
|
||||||
|
value = "Brown";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
expression = "_this setVariable ['%s',_value];";
|
||||||
|
unique = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
17
addons/main/CfgEventHandlers.hpp
Normal file
17
addons/main/CfgEventHandlers.hpp
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
class Extended_PreStart_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_PreInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_PostInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -1,100 +1,91 @@
|
|||||||
class CfgFunctions {
|
class CfgFunctions {
|
||||||
class armatak {
|
class armatak {
|
||||||
class functions {
|
class functions {
|
||||||
class init {
|
|
||||||
file = "\armatak\armatak\armatak_main\functions\fn_init.sqf";
|
|
||||||
};
|
|
||||||
class video_init {
|
|
||||||
file = "\armatak\armatak\armatak_main\functions\fn_video_init.sqf";
|
|
||||||
};
|
|
||||||
class log_message {
|
|
||||||
file = "\armatak\armatak\armatak_main\functions\fn_log_message.sqf";
|
|
||||||
};
|
|
||||||
class send_digital_pointer_cot {
|
class send_digital_pointer_cot {
|
||||||
file = "\armatak\armatak\armatak_main\functions\api\fn_send_digital_pointer_cot.sqf";
|
file = "\armatak\armatak\addons\main\functions\api\fn_send_digital_pointer_cot.sqf";
|
||||||
};
|
};
|
||||||
class send_drone_cot {
|
class send_drone_cot {
|
||||||
file = "\armatak\armatak\armatak_main\functions\api\fn_send_drone_cot.sqf";
|
file = "\armatak\armatak\addons\main\functions\api\fn_send_drone_cot.sqf";
|
||||||
};
|
};
|
||||||
class send_group_cots {
|
class send_group_cots {
|
||||||
file = "\armatak\armatak\armatak_main\functions\api\fn_send_group_cots.sqf";
|
file = "\armatak\armatak\addons\main\functions\api\fn_send_group_cots.sqf";
|
||||||
};
|
};
|
||||||
class send_human_cot {
|
class send_eud_cot {
|
||||||
file = "\armatak\armatak\armatak_main\functions\api\fn_send_human_cot.sqf";
|
file = "\armatak\armatak\addons\main\functions\api\fn_send_eud_cot.sqf";
|
||||||
};
|
};
|
||||||
class send_marker_cot {
|
class send_marker_cot {
|
||||||
file = "\armatak\armatak\armatak_main\functions\api\fn_send_marker_cot.sqf";
|
file = "\armatak\armatak\addons\main\functions\api\fn_send_marker_cot.sqf";
|
||||||
};
|
};
|
||||||
class send_message_cot {
|
class stop_tcp_socket {
|
||||||
file = "\armatak\armatak\armatak_main\functions\api\fn_send_marker_cot.sqf";
|
file = "\armatak\armatak\addons\main\functions\api\fn_stop_tcp_socket.sqf";
|
||||||
};
|
|
||||||
class extract_callsign {
|
|
||||||
file = "\armatak\armatak\armatak_main\functions\extract_data\fn_extract_callsign.sqf";
|
|
||||||
};
|
};
|
||||||
class extract_group_color {
|
class extract_group_color {
|
||||||
file = "\armatak\armatak\armatak_main\functions\extract_data\fn_extract_group_color.sqf";
|
file = "\armatak\armatak\addons\main\functions\extract_data\fn_extract_group_color.sqf";
|
||||||
};
|
};
|
||||||
class extract_group_role {
|
class extract_group_role {
|
||||||
file = "\armatak\armatak\armatak_main\functions\extract_data\fn_extract_group_role.sqf";
|
file = "\armatak\armatak\addons\main\functions\extract_data\fn_extract_group_role.sqf";
|
||||||
|
};
|
||||||
|
class extract_marker_callsign {
|
||||||
|
file = "\armatak\armatak\addons\main\functions\extract_data\fn_extract_marker_callsign.sqf";
|
||||||
};
|
};
|
||||||
class extract_role {
|
class extract_role {
|
||||||
file = "\armatak\armatak\armatak_main\functions\extract_data\fn_extract_role.sqf";
|
file = "\armatak\armatak\addons\main\functions\extract_data\fn_extract_role.sqf";
|
||||||
};
|
};
|
||||||
class extract_position {
|
class extract_unit_callsign {
|
||||||
file = "\armatak\armatak\armatak_main\functions\extract_data\fn_extract_position.sqf";
|
file = "\armatak\armatak\addons\main\functions\extract_data\fn_extract_unit_callsign.sqf";
|
||||||
};
|
};
|
||||||
class extract_uuid {
|
class extract_uuid {
|
||||||
file = "\armatak\armatak\armatak_main\functions\extract_data\fn_extract_uuid.sqf";
|
file = "\armatak\armatak\addons\main\functions\extract_data\fn_extract_uuid.sqf";
|
||||||
};
|
};
|
||||||
class shorten_name {
|
class shorten_name {
|
||||||
file = "\armatak\armatak\armatak_main\functions\extract_data\fn_shorten_name.sqf";
|
file = "\armatak\armatak\addons\main\functions\extract_data\fn_shorten_name.sqf";
|
||||||
};
|
};
|
||||||
|
|
||||||
class convert_location {
|
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_location.sqf";
|
|
||||||
};
|
|
||||||
class convert_to_altis {
|
class convert_to_altis {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_altis.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_altis.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_bukovina {
|
class convert_to_bukovina {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_bukovina.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_bukovina.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_bystrika {
|
class convert_to_bystrika {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_bystrika.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_bystrika.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_chernarus {
|
class convert_to_chernarus {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_chernarus.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_chernarus.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_cucui {
|
class convert_to_cucui {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_cucui.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_cucui.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_kunduz {
|
class convert_to_kunduz {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_kunduz.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_kunduz.sqf";
|
||||||
|
};
|
||||||
|
class convert_to_kunduz_valley {
|
||||||
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_kunduz_valley.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_livonia {
|
class convert_to_livonia {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_livonia.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_livonia.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_malden {
|
class convert_to_malden {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_malden.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_malden.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_southen_sahrani {
|
class convert_to_southen_sahrani {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_southen_sahrani.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_southen_sahrani.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_stratis {
|
class convert_to_stratis {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_stratis.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_stratis.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_takistan_montains {
|
class convert_to_takistan_montains {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_takistan_montains.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_takistan_montains.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_tanoa {
|
class convert_to_tanoa {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_tanoa.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_tanoa.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_united_sahrani {
|
class convert_to_united_sahrani {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_united_sahrani.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_united_sahrani.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_vr {
|
class convert_to_vr {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_vr.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_vr.sqf";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,172 +0,0 @@
|
|||||||
class CfgFactionClasses {
|
|
||||||
class NO_CATEGORY;
|
|
||||||
class armatak_module_category: NO_CATEGORY {
|
|
||||||
displayName = "Team Awareness Kit";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class CfgVehicles {
|
|
||||||
class Logic;
|
|
||||||
class Module_F : Logic
|
|
||||||
{
|
|
||||||
class AttributesBase
|
|
||||||
{
|
|
||||||
class Default;
|
|
||||||
class Edit; // Default edit box (i.e. text input field)
|
|
||||||
class Combo; // Default combo box (i.e. drop-down menu)
|
|
||||||
class Checkbox; // Default checkbox (returned value is Boolean)
|
|
||||||
class CheckboxNumber; // Default checkbox (returned value is Number)
|
|
||||||
class ModuleDescription; // Module description
|
|
||||||
class Units; // Selection of units on which the module is applied
|
|
||||||
};
|
|
||||||
|
|
||||||
class ModuleDescription
|
|
||||||
{
|
|
||||||
class AnyBrain;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
class armatak_module_core: Module_F {
|
|
||||||
scope = 2;
|
|
||||||
displayname = "ARMATAK CoT Router";
|
|
||||||
icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa";
|
|
||||||
category = "armatak_module_category";
|
|
||||||
function = "armatak_fnc_init";
|
|
||||||
functionPriority = 1;
|
|
||||||
isGlobal = 0;
|
|
||||||
isTriggerActivated = 0;
|
|
||||||
isDisposable = 1;
|
|
||||||
is3den = 0;
|
|
||||||
curatorCanAttach = 0;
|
|
||||||
curatorInfoType = "RscDisplayAttributeModuleNuke";
|
|
||||||
|
|
||||||
canSetArea = 0;
|
|
||||||
canSetAreaShape = 0;
|
|
||||||
canSetAreaHeight = 0;
|
|
||||||
|
|
||||||
class AttributesValues {
|
|
||||||
size3[] = { 1, 1, -1 };
|
|
||||||
isRectangle = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Attributes: AttributesBase {
|
|
||||||
class armatak_module_tak_server_instance_address: Edit {
|
|
||||||
property = "armatak_module_tak_server_instance_address";
|
|
||||||
displayname = "TAK Server Address";
|
|
||||||
tooltip = "TAK Server Instance Address";
|
|
||||||
typeName = "STRING";
|
|
||||||
defaultValue = "localhost";
|
|
||||||
};
|
|
||||||
class armatak_module_tak_server_instance_port: Edit {
|
|
||||||
property = "armatak_module_tak_server_instance_port";
|
|
||||||
displayname = "TAK Server TCP Port";
|
|
||||||
tooltip = "TAK Server instance Port for TCP connection";
|
|
||||||
typeName = "NUMBER";
|
|
||||||
defaultValue = "8088";
|
|
||||||
};
|
|
||||||
class ModuleDescription: ModuleDescription {};
|
|
||||||
};
|
|
||||||
|
|
||||||
class ModuleDescription: ModuleDescription {
|
|
||||||
description = "Generate the initial ARMATAK configuration, syncronizing all players to the TAK server instance";
|
|
||||||
sync[] = {"LocationArea_F"};
|
|
||||||
|
|
||||||
class LocationArea_F {
|
|
||||||
description[] = {
|
|
||||||
"First line",
|
|
||||||
"Second line"
|
|
||||||
};
|
|
||||||
position = 1;
|
|
||||||
direction = 1;
|
|
||||||
optional = 1;
|
|
||||||
duplicate = 1;
|
|
||||||
synced[] = { "BluforUnit", "AnyBrain" };
|
|
||||||
};
|
|
||||||
class BluforUnit
|
|
||||||
{
|
|
||||||
description = "Short description";
|
|
||||||
displayName = "Any BLUFOR unit";
|
|
||||||
icon = "iconMan";
|
|
||||||
side = 1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
class armatak_module_video_stream_core: armatak_module_core {
|
|
||||||
scope = 2;
|
|
||||||
displayname = "ARMATAK MediaMTX Video Feed Parser";
|
|
||||||
icon = "\a3\Modules_F_Curator\Data\iconcuratorsetcamera_ca.paa";
|
|
||||||
category = "armatak_module_category";
|
|
||||||
function = "armatak_fnc_video_init";
|
|
||||||
functionPriority = 1;
|
|
||||||
isGlobal = 0;
|
|
||||||
isTriggerActivated = 0;
|
|
||||||
isDisposable = 1;
|
|
||||||
is3den = 0;
|
|
||||||
curatorCanAttach = 0;
|
|
||||||
curatorInfoType = "RscDisplayAttributeModuleNuke";
|
|
||||||
|
|
||||||
canSetArea = 0;
|
|
||||||
canSetAreaShape = 0;
|
|
||||||
canSetAreaHeight = 0;
|
|
||||||
|
|
||||||
class AttributesValues {
|
|
||||||
size3[] = { 1, 1, -1 };
|
|
||||||
isRectangle = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Attributes: AttributesBase {
|
|
||||||
class armatak_module_mediamtx_video_stream_instance_address: Edit {
|
|
||||||
property = "armatak_module_mediamtx_video_stream_instance_address";
|
|
||||||
displayname = "MediaMTX Provider Address";
|
|
||||||
tooltip = "MediaMTX Provider Instance Address";
|
|
||||||
typeName = "STRING";
|
|
||||||
defaultValue = "localhost";
|
|
||||||
};
|
|
||||||
class armatak_module_mediamtx_video_stream_instance_port: Edit {
|
|
||||||
property = "armatak_module_mediamtx_video_stream_instance_port";
|
|
||||||
displayname = "MediaMTX Provider Port";
|
|
||||||
tooltip = "MediaMTX Provider Port for handling video streams";
|
|
||||||
typeName = "STRING";
|
|
||||||
defaultValue = "8554";
|
|
||||||
};
|
|
||||||
class armatak_module_mediamtx_video_stream_instance_auth_user: Edit {
|
|
||||||
property = "armatak_module_mediamtx_video_stream_instance_auth_user";
|
|
||||||
displayname = "MediaMTX Provider Username";
|
|
||||||
tooltip = "MediaMTX Provider Instance Username";
|
|
||||||
typeName = "STRING";
|
|
||||||
defaultValue = "administrator";
|
|
||||||
};
|
|
||||||
class armatak_module_mediamtx_video_stream_instance_auth_pass: Edit {
|
|
||||||
property = "armatak_module_mediamtx_video_stream_instance_auth_pass";
|
|
||||||
displayname = "MediaMTX Provider Password";
|
|
||||||
tooltip = "MediaMTX Provider Instance Password";
|
|
||||||
typeName = "STRING";
|
|
||||||
defaultValue = "password";
|
|
||||||
};
|
|
||||||
class ModuleDescription: ModuleDescription {};
|
|
||||||
};
|
|
||||||
|
|
||||||
class ModuleDescription: ModuleDescription {
|
|
||||||
description = "Generate the initial ARMATAK configuration, syncronizing all players to the TAK server instance";
|
|
||||||
sync[] = {"LocationArea_F"};
|
|
||||||
|
|
||||||
class LocationArea_F {
|
|
||||||
description[] = {
|
|
||||||
"First line",
|
|
||||||
"Second line"
|
|
||||||
};
|
|
||||||
position = 1;
|
|
||||||
direction = 1;
|
|
||||||
optional = 1;
|
|
||||||
duplicate = 1;
|
|
||||||
synced[] = { "BluforUnit", "AnyBrain" };
|
|
||||||
};
|
|
||||||
class BluforUnit
|
|
||||||
{
|
|
||||||
description = "Short description";
|
|
||||||
displayName = "Any BLUFOR unit";
|
|
||||||
icon = "iconMan";
|
|
||||||
side = 1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
2
addons/main/XEH_PREP.hpp
Normal file
2
addons/main/XEH_PREP.hpp
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
PREP(logMessage);
|
||||||
|
PREP(notify);
|
||||||
56
addons/main/XEH_postInit.sqf
Normal file
56
addons/main/XEH_postInit.sqf
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
addMissionEventHandler ["ExtensionCallback", {
|
||||||
|
params ["_name", "_function", "_data"];
|
||||||
|
|
||||||
|
switch (_name) do {
|
||||||
|
case "UDP SOCKET": {
|
||||||
|
[_function, "success", _name] call FUNC(notify);
|
||||||
|
|
||||||
|
switch (_function) do {
|
||||||
|
case "EUD Connected": {
|
||||||
|
SETVAR(player,EGVAR(client,eudConnected),true);
|
||||||
|
};
|
||||||
|
case "EUD Disconnected": {
|
||||||
|
SETVAR(player,EGVAR(client,eudConnected),false);
|
||||||
|
};
|
||||||
|
default {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
case "UDP SOCKET WARNING": {
|
||||||
|
[_function, "warning", "UDP Socket"] call FUNC(notify);
|
||||||
|
};
|
||||||
|
case "UDP SOCKET ERROR": {
|
||||||
|
[_function, "error", _name] call FUNC(notify);
|
||||||
|
|
||||||
|
if (_function == "UDP Socket is not running") then {
|
||||||
|
SETVAR(player,EGVAR(client,eudConnected),false);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_function == "failed to bind UDP socket") then {
|
||||||
|
SETVAR(player,EGVAR(client,eudConnected),false);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
case "TCP SOCKET": {
|
||||||
|
[_function, "success", _name] call FUNC(notify);
|
||||||
|
};
|
||||||
|
case "TCP SOCKET ERROR": {
|
||||||
|
[_function, "error", _name] call FUNC(notify);
|
||||||
|
};
|
||||||
|
case "VIDEO": {
|
||||||
|
[_function, "success", _name] call FUNC(notify);
|
||||||
|
};
|
||||||
|
case "VIDEO ERROR": {
|
||||||
|
[_function, "error", _name] call FUNC(notify);
|
||||||
|
|
||||||
|
SETVAR(player,EGVAR(video,isStreaming),false);
|
||||||
|
};
|
||||||
|
default {
|
||||||
|
"armatak" callExtension ["log",["error", (_name + _function + _data)]];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
|
||||||
|
GVAR(group_colors) = ["White", "Yellow", "Orange", "Magenta", "Red", "Maroon", "Purple", "DarkBlue", "Blue", "Cyan", "Teal", "Green", "DarkGreen", "Brown"];
|
||||||
|
|
||||||
|
missionNamespace setVariable [QGVAR(group_colors), GVAR(group_colors)];
|
||||||
9
addons/main/XEH_preInit.sqf
Normal file
9
addons/main/XEH_preInit.sqf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
ADDON = false;
|
||||||
|
|
||||||
|
PREP_RECOMPILE_START;
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
|
PREP_RECOMPILE_END;
|
||||||
|
|
||||||
|
ADDON = true;
|
||||||
3
addons/main/XEH_preStart.sqf
Normal file
3
addons/main/XEH_preStart.sqf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
@@ -1,26 +1,46 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
class CfgPatches {
|
class CfgPatches {
|
||||||
class armatak_main {
|
class ADDON {
|
||||||
units[] = {
|
name = COMPONENT_NAME;
|
||||||
"armatak_module_core",
|
units[] = {};
|
||||||
"armatak_module_callsign"
|
weapons[] = {};
|
||||||
};
|
requiredAddons[] = {
|
||||||
weapons[] = {""};
|
|
||||||
author = "Valmo";
|
|
||||||
url = "https://github.com/valmojr/armatak";
|
|
||||||
requiredAddons[] =
|
|
||||||
{
|
|
||||||
"cba_main",
|
"cba_main",
|
||||||
"ace_main"
|
"ace_main"
|
||||||
};
|
};
|
||||||
requiredVersion = 2.06;
|
requiredVersion = REQUIRED_VERSION;
|
||||||
|
author = PROJECT_AUTHOR;
|
||||||
|
url = "https://github.com/valmojr/armatak";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Extended_PostInit_EventHandlers {
|
class CfgMods {
|
||||||
class armatak_main {
|
class PREFIX {
|
||||||
init = "call compileScript ['\armatak\armatak\armatak_main\initPlayerLocal.sqf']";
|
name = "Arma Team Awareness Kit";
|
||||||
|
author = PROJECT_AUTHOR;
|
||||||
|
logo = "logo_ca.paa";
|
||||||
|
logoOver = "logo_hover_ca.paa";
|
||||||
|
tooltip = "ARMATAK";
|
||||||
|
tooltipOwned = "ARMATAK";
|
||||||
|
picture = "picture.paa";
|
||||||
|
actionName = "GitHub";
|
||||||
|
action = "https://github.com/valmojr/armatak";
|
||||||
|
overview = "ARMATAK Addons allows Arma 3 sessions to be parsed to TAK Clients";
|
||||||
|
hideName = 0;
|
||||||
|
hidePicture = 0;
|
||||||
|
dlcColor[] = { 0.23, 0.39, 0.30, 1 };
|
||||||
|
logoSmall = "logo_small_ca.paa";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class CfgFactionClasses {
|
||||||
|
class NO_CATEGORY;
|
||||||
|
class GVAR(moduleCategory): NO_CATEGORY {
|
||||||
|
displayName = "Team Awareness Kit";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "CfgEventHandlers.hpp"
|
||||||
#include "CfgFunctions.hpp"
|
#include "CfgFunctions.hpp"
|
||||||
#include "CfgVehicles.hpp"
|
#include "Cfg3den.hpp"
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ params ["_unit"];
|
|||||||
_digitalPointer = laserTarget _unit;
|
_digitalPointer = laserTarget _unit;
|
||||||
|
|
||||||
if (!isNull _digitalPointer) then {
|
if (!isNull _digitalPointer) then {
|
||||||
_digitalPointerPosition = _digitalPointer call armatak_fnc_extract_position;
|
_digitalPointerPosition = _digitalPointer call armatak_client_fnc_extractClientPosition;
|
||||||
|
|
||||||
_link_uid = [_unit] call armatak_fnc_extract_uuid;
|
_link_uid = [_unit] call armatak_fnc_extract_uuid;
|
||||||
_contact_callsign = ([player] call armatak_fnc_extract_callsign) + ".DP1";
|
_contact_callsign = ([player] call armatak_fnc_extract_unit_callsign) + ".DP1";
|
||||||
|
|
||||||
_dpCot = [_link_uid, _contact_callsign, _digitalPointerPosition select 0, _digitalPointerPosition select 1, _digitalPointerPosition select 2];
|
_dpCot = [_link_uid, _contact_callsign, _digitalPointerPosition select 0, _digitalPointerPosition select 1, _digitalPointerPosition select 2];
|
||||||
|
|
||||||
"armatak" callExtension ["cot_router:send_digital_pointer_cot", [_dpCot]];
|
"armatak" callExtension ["tcp_socket:send_digital_pointer_cot", [_dpCot]];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
params["_drone"];
|
params["_drone"];
|
||||||
|
|
||||||
private _atak_role = "a-f-A";
|
private _atak_role = "a-f-A";
|
||||||
private _atak_callsign = [_unit] call armatak_fnc_extract_callsign;
|
private _atak_callsign = [_unit] call armatak_fnc_extract_unit_callsign;
|
||||||
|
|
||||||
switch (side _drone) do {
|
switch (side _drone) do {
|
||||||
case "WEST": {
|
case "WEST": {
|
||||||
@@ -25,4 +25,4 @@ switch (side _drone) do {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_cot = [_drone, _atak_role, _atak_callsign] call armatak_fnc_send_marker_cot;
|
_cot = [_drone, _atak_role, _atak_callsign] call armatak_fnc_send_marker_cot;
|
||||||
|
|||||||
13
addons/main/functions/api/fn_send_eud_cot.sqf
Normal file
13
addons/main/functions/api/fn_send_eud_cot.sqf
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// function name: armatak_fnc_extract_eud_cot_info
|
||||||
|
// function author: Valmo
|
||||||
|
// function description: Gets the information necessary for generating the EUD Cursor Over Time
|
||||||
|
|
||||||
|
params ["_unit", "_callsign", "_group_name", "_group_role"];
|
||||||
|
|
||||||
|
_position = _unit call armatak_client_fnc_extractClientPosition;
|
||||||
|
|
||||||
|
_uuid = _unit call armatak_fnc_extract_uuid;
|
||||||
|
|
||||||
|
_eud_cot = [_uuid, _position select 0, _position select 1, _position select 2, _callsign, _group_name, _group_role, _position select 3, speed player / 3.6];
|
||||||
|
|
||||||
|
"armatak" callExtension ["tcp_socket:send_eud_cot", [_eud_cot]];
|
||||||
@@ -5,9 +5,9 @@
|
|||||||
params["_group"];
|
params["_group"];
|
||||||
|
|
||||||
{
|
{
|
||||||
_callsign = [_x] call armatak_fnc_extract_callsign;
|
_callsign = [_x] call armatak_fnc_extract_unit_callsign;
|
||||||
_group_name = [_group] call armatak_fnc_extract_group_color;
|
_group_name = [_group] call armatak_fnc_extract_group_color;
|
||||||
_group_role = [_x] call armatak_fnc_extract_group_role;
|
_group_role = [_x] call armatak_fnc_extract_group_role;
|
||||||
|
|
||||||
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_human_cot;
|
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot;
|
||||||
} forEach (units _group);
|
} forEach (units _group);
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
// function name: armatak_fnc_extract_human_cot_info
|
|
||||||
// function author: Valmo
|
|
||||||
// function description: Gets the information necessary for generating the Human Cursor Over Time
|
|
||||||
|
|
||||||
params ["_unit", "_callsign", "_group_name", "_group_role"];
|
|
||||||
|
|
||||||
_position = _unit call armatak_fnc_extract_position;
|
|
||||||
_uuid = _unit call armatak_fnc_extract_uuid;
|
|
||||||
|
|
||||||
_human_cot = [_uuid, _position select 0, _position select 1, _position select 2, _callsign, _group_name, _group_role, _position select 3, speed player / 3.6];
|
|
||||||
|
|
||||||
"armatak" callExtension ["cot_router:send_human_cot", [_human_cot]];
|
|
||||||
@@ -4,9 +4,10 @@
|
|||||||
|
|
||||||
params ["_unit", "_type", "_callsign"];
|
params ["_unit", "_type", "_callsign"];
|
||||||
|
|
||||||
_unit_position = _unit call armatak_fnc_extract_position;
|
_unit_position = _unit call armatak_client_fnc_extractClientPosition;
|
||||||
|
|
||||||
_uuid = _unit call armatak_fnc_extract_uuid;
|
_uuid = _unit call armatak_fnc_extract_uuid;
|
||||||
|
|
||||||
_marker_cot = [_uuid, _type, _unit_position select 0, _unit_position select 1, _unit_position select 2, _callsign, _unit_position select 3, speed _unit / 3.6];
|
_marker_cot = [_uuid, _type, _unit_position select 0, _unit_position select 1, _unit_position select 2, _callsign, _unit_position select 3, speed _unit / 3.6];
|
||||||
|
|
||||||
"armatak" callExtension ["cot_router:send_marker_cot", [_marker_cot]];
|
"armatak" callExtension ["tcp_socket:send_marker_cot", [_marker_cot]];
|
||||||
|
|||||||
10
addons/main/functions/api/fn_stop_tcp_socket.sqf
Normal file
10
addons/main/functions/api/fn_stop_tcp_socket.sqf
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
_armatak_tcp_socket_is_running = missionNamespace getVariable "armatak_tcp_socket_is_running";
|
||||||
|
|
||||||
|
if (_armatak_tcp_socket_is_running) then {
|
||||||
|
missionNamespace setVariable ["armatak_tcp_socket_is_running", false];
|
||||||
|
|
||||||
|
"armatak" callExtension ["tcp_socket:stop", []];
|
||||||
|
} else {
|
||||||
|
_warning = format ["<t color='#FF0021'>ARMATAK</t><br/> %1", "There is no TCP Socket running to be stopped"];
|
||||||
|
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||||
|
};
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
|
#include "..\..\script_component.hpp"
|
||||||
|
|
||||||
params["_group"];
|
params["_group"];
|
||||||
|
|
||||||
_group_name = _group getVariable "_atak_group_name";
|
_group_name = _group getVariable QGVAR(group_name);
|
||||||
|
|
||||||
if (isNil "_group_name") then {
|
if (isNil "_group_name") then {
|
||||||
_group_colors = missionNamespace getVariable "_group_colors";
|
_group_colors = missionNamespace getVariable QGVAR(group_colors);
|
||||||
_group_name = selectRandom _group_colors;
|
_group_name = selectRandom _group_colors;
|
||||||
|
|
||||||
if (count _group_colors > 0) then {
|
if (count _group_colors > 0) then {
|
||||||
@@ -14,12 +16,12 @@ if (isNil "_group_name") then {
|
|||||||
_group_colors deleteAt _randomIndex;
|
_group_colors deleteAt _randomIndex;
|
||||||
|
|
||||||
_group_name = _selectedColor;
|
_group_name = _selectedColor;
|
||||||
_group setVariable ["_atak_group_name", _group_name];
|
_group setVariable [QGVAR(group_name), _group_name];
|
||||||
missionNamespace setVariable ["_group_colors", _group_colors]
|
missionNamespace setVariable [QGVAR(group_colors), _group_colors]
|
||||||
} else {
|
} else {
|
||||||
_group_name = "Red";
|
_group_name = "Red";
|
||||||
_group setVariable ["_atak_group_name", _group_name];
|
_group setVariable [QGVAR(group_name), _group_name];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_group_name
|
_group_name
|
||||||
|
|||||||
@@ -37,4 +37,4 @@ if (!isNil "_pre_defined_role") then {
|
|||||||
_callsign = _pre_defined_callsign;
|
_callsign = _pre_defined_callsign;
|
||||||
};
|
};
|
||||||
|
|
||||||
_group_role
|
_group_role
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
// function name: armatak_fnc_extract_callsign
|
// function name: armatak_fnc_extract_marker_callsign
|
||||||
// function author: Valmo
|
// function author: Valmo
|
||||||
// function description: Gets the unit name or classname to be used as TAK callsign
|
// function description: Gets the unit name or classname to be used as TAK callsign in a Marker
|
||||||
|
|
||||||
params["_unit"];
|
params["_unit"];
|
||||||
|
|
||||||
private _callsign = "";
|
private _callsign = "";
|
||||||
|
|
||||||
if (roleDescription _unit != "") then {
|
|
||||||
_callsign = ([name _unit] call armatak_fnc_shorten_name) + " | " + roleDescription _unit;
|
|
||||||
} else {
|
|
||||||
_callsign = name _unit;
|
|
||||||
|
|
||||||
if (_callsign == "Error: No unit") then {
|
|
||||||
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
if ((([_unit] call BIS_fnc_objectType) select 0) == "Vehicle") then {
|
if ((([_unit] call BIS_fnc_objectType) select 0) == "Vehicle") then {
|
||||||
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
||||||
|
|
||||||
@@ -34,10 +24,10 @@ if (unitIsUAV _unit) then {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_atak_pre_defined_callsign = _unit getVariable "_atak_callsign";
|
armatak_attribute_marker_callsign = _unit getVariable "armatak_attribute_marker_callsign";
|
||||||
|
|
||||||
if (!isNil "_atak_pre_defined_callsign") then {
|
if (!isNil "armatak_attribute_marker_callsign" or armatak_attribute_marker_callsign != '') then {
|
||||||
_callsign = _atak_pre_defined_callsign;
|
_callsign = armatak_attribute_marker_callsign;
|
||||||
};
|
};
|
||||||
|
|
||||||
_callsign
|
_callsign
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
// function name: armatak_fnc_extract_position
|
|
||||||
// function author: Valmo
|
|
||||||
// function description: Receives a player's unit as param and return the information array for SIMTAK
|
|
||||||
|
|
||||||
params["_unit"];
|
|
||||||
|
|
||||||
private _location = (getPos _unit) call armatak_fnc_convert_location;
|
|
||||||
|
|
||||||
private _atak_latitude = _location select 0;
|
|
||||||
private _atak_longitude = _location select 1;
|
|
||||||
private _atak_altitude = _location select 2;
|
|
||||||
private _atak_bearing = parseNumber ((getDir _unit) toFixed 0);
|
|
||||||
|
|
||||||
_unit_info = [_atak_latitude,_atak_longitude,_atak_altitude,_atak_bearing];
|
|
||||||
|
|
||||||
_unit_info
|
|
||||||
@@ -110,4 +110,11 @@ if ((typeOf (vehicle _unit) != typeOf _unit) or ((_unit_type select 0) == "Vehic
|
|||||||
|
|
||||||
_role = "a-" + _affiliation + "-" + _type;
|
_role = "a-" + _affiliation + "-" + _type;
|
||||||
|
|
||||||
_role
|
|
||||||
|
armatak_attribute_marker_type = _unit getVariable "armatak_attribute_marker_type";
|
||||||
|
|
||||||
|
if (!isNil "armatak_attribute_marker_type" or armatak_attribute_marker_type != '') then {
|
||||||
|
_role = armatak_attribute_marker_type;
|
||||||
|
};
|
||||||
|
|
||||||
|
_role
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// function name: armatak_fnc_extract_unit_callsign
|
||||||
|
// function author: Valmo
|
||||||
|
// function description: Gets the unit name or classname to be used as TAK callsign from a unit
|
||||||
|
|
||||||
|
params["_unit"];
|
||||||
|
|
||||||
|
private _callsign = "";
|
||||||
|
|
||||||
|
if (roleDescription _unit != "") then {
|
||||||
|
_callsign = ([name _unit] call armatak_fnc_shorten_name) + " | " + roleDescription _unit;
|
||||||
|
} else {
|
||||||
|
_callsign = name _unit;
|
||||||
|
|
||||||
|
if (_callsign == "Error: No unit") then {
|
||||||
|
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
armatak_attribute_unit_callsign = _unit getVariable "armatak_attribute_unit_callsign";
|
||||||
|
|
||||||
|
if (!isNil "armatak_attribute_unit_callsign" or armatak_attribute_unit_callsign != '') then {
|
||||||
|
_callsign = armatak_attribute_unit_callsign;
|
||||||
|
};
|
||||||
|
|
||||||
|
_callsign
|
||||||
@@ -11,4 +11,4 @@ if (isNil "_uuid") then {
|
|||||||
_unit setVariable ["_atak_uid", _uuid];
|
_unit setVariable ["_atak_uid", _uuid];
|
||||||
};
|
};
|
||||||
|
|
||||||
_uuid
|
_uuid
|
||||||
|
|||||||
@@ -14,4 +14,4 @@ if (_nameCount == 1) then {
|
|||||||
} else {
|
} else {
|
||||||
format ["%1 %2", _firstName select [0, 1], _lastName]
|
format ["%1 %2", _firstName select [0, 1], _lastName]
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
params [
|
|
||||||
["_logic", objNull, [objNull]],
|
|
||||||
["_units", [], [[]]],
|
|
||||||
["_activated", true, [true]]
|
|
||||||
];
|
|
||||||
|
|
||||||
if (isServer) exitWith {
|
|
||||||
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Connecting to TAK Server TCP Socket..."];
|
|
||||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
|
||||||
|
|
||||||
addMissionEventHandler ["ExtensionCallback", {
|
|
||||||
params ["_name", "_function", "_data"];
|
|
||||||
|
|
||||||
if (_name == "armatak_tcp_socket") then {
|
|
||||||
_warning = format ["<t color='#00FF21'>ARMATAK</t><br/> %1", _function];
|
|
||||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (_name == "armatak_tcp_socket_error") then {
|
|
||||||
_warning = format ["<t color='#FF0021'>ARMATAK</t><br/> %1", _function];
|
|
||||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (_name == "armatak_video") then {
|
|
||||||
_warning = format ["<t color='#00FF21'>ARMATAK</t><br/> %1", _function];
|
|
||||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (_name == "armatak_video_error") then {
|
|
||||||
_warning = format ["<t color='#FF0021'>ARMATAK</t><br/> %1", _function];
|
|
||||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
|
||||||
};
|
|
||||||
}];
|
|
||||||
|
|
||||||
_tak_server_instance_address = _logic getVariable "armatak_module_tak_server_instance_address";
|
|
||||||
_tak_server_instance_port = _logic getVariable "armatak_module_tak_server_instance_port";
|
|
||||||
|
|
||||||
_tak_server_fulladdress = _tak_server_instance_address + ":" + (str _tak_server_instance_port);
|
|
||||||
|
|
||||||
missionNamespace setVariable ["_atak_server_instance", _tak_server_fulladdress];
|
|
||||||
missionNamespace setVariable ["_group_colors", ["White", "Yellow", "Orange", "Magenta", "Red", "Maroon", "Purple", "DarkBlue", "Blue", "Cyan", "Teal", "Green", "DarkGreen", "Brown"]];
|
|
||||||
|
|
||||||
"armatak" callExtension ["cot_router:start", [_tak_server_fulladdress]];
|
|
||||||
|
|
||||||
_syncUnits = synchronizedObjects _logic;
|
|
||||||
|
|
||||||
missionNamespace setVariable ["_armatak_marked_units", _syncUnits];
|
|
||||||
|
|
||||||
_syncedUnits = missionNamespace getVariable "_armatak_marked_units";
|
|
||||||
|
|
||||||
[{
|
|
||||||
_syncedUnits = missionNamespace getVariable "_armatak_marked_units";
|
|
||||||
|
|
||||||
{
|
|
||||||
_objectType = _x call BIS_fnc_objectType;
|
|
||||||
if ((_objectType select 0) == "Soldier") then {
|
|
||||||
_callsign = [_x] call armatak_fnc_extract_callsign;
|
|
||||||
_group_name = [group _x] call armatak_fnc_extract_group_color;
|
|
||||||
_group_role = [_x] call armatak_fnc_extract_group_role;
|
|
||||||
|
|
||||||
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_human_cot;
|
|
||||||
[_x] call armatak_fnc_send_digital_pointer_cot;
|
|
||||||
};
|
|
||||||
if ((_objectType select 0) == "Vehicle") then {
|
|
||||||
_atak_type = [_x] call armatak_fnc_extract_role;
|
|
||||||
_callsign = [_x] call armatak_fnc_extract_callsign;
|
|
||||||
|
|
||||||
[_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot;
|
|
||||||
};
|
|
||||||
if (unitIsUAV _x) then {
|
|
||||||
[_x] call armatak_fnc_send_drone_cot;
|
|
||||||
[_x] call armatak_fnc_send_digital_pointer_cot;
|
|
||||||
};
|
|
||||||
} forEach _syncedUnits;
|
|
||||||
}, 2, []] call CBA_fnc_addPerFrameHandler;
|
|
||||||
};
|
|
||||||
|
|
||||||
true;
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
params[_type, _message];
|
|
||||||
|
|
||||||
"armatak" callExtension ["log", [_type, _message]]
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
params [
|
|
||||||
["_logic", objNull, [objNull]],
|
|
||||||
["_units", [], [[]]],
|
|
||||||
["_activated", true, [true]]
|
|
||||||
];
|
|
||||||
|
|
||||||
if (isServer) exitWith {
|
|
||||||
armatak_module_mediamtx_video_stream_instance_address = _logic getVariable "armatak_module_mediamtx_video_stream_instance_address";
|
|
||||||
armatak_module_mediamtx_video_stream_instance_port = _logic getVariable "armatak_module_mediamtx_video_stream_instance_port";
|
|
||||||
armatak_module_mediamtx_video_stream_instance_auth_user = _logic getVariable "armatak_module_mediamtx_video_stream_instance_auth_user";
|
|
||||||
armatak_module_mediamtx_video_stream_instance_auth_pass = _logic getVariable "armatak_module_mediamtx_video_stream_instance_auth_pass";
|
|
||||||
|
|
||||||
missionNamespace setVariable ["armatak_mediamtx_video_stream_instance_address", armatak_module_mediamtx_video_stream_instance_address];
|
|
||||||
missionNamespace setVariable ["armatak_mediamtx_video_stream_instance_port", armatak_module_mediamtx_video_stream_instance_port];
|
|
||||||
missionNamespace setVariable ["armatak_mediamtx_video_stream_instance_auth_user", armatak_module_mediamtx_video_stream_instance_auth_user];
|
|
||||||
missionNamespace setVariable ["armatak_mediamtx_video_stream_instance_auth_pass", armatak_module_mediamtx_video_stream_instance_auth_pass];
|
|
||||||
|
|
||||||
_startAction = [
|
|
||||||
"ArmatakStartStream",
|
|
||||||
"Start Video Feed",
|
|
||||||
"",
|
|
||||||
{
|
|
||||||
_uuid = (_this select 0) call armatak_fnc_extract_uuid;
|
|
||||||
|
|
||||||
_uuid = (_this select 0) call armatak_fnc_extract_uuid;
|
|
||||||
_uuid_short = _uuid select [0, 8];
|
|
||||||
_role = roleDescription (_this select 0);
|
|
||||||
_name = name (_this select 0);
|
|
||||||
|
|
||||||
_role = [_role] call BIS_fnc_filterString;
|
|
||||||
_name = [_name] call BIS_fnc_filterString;
|
|
||||||
|
|
||||||
_stream_path = _name + "_" + _role + "_" + _uuid_short;
|
|
||||||
|
|
||||||
armatak_mediamtx_video_stream_instance_address = missionNamespace getVariable "armatak_mediamtx_video_stream_instance_address";
|
|
||||||
armatak_mediamtx_video_stream_instance_port = missionNamespace getVariable "armatak_mediamtx_video_stream_instance_port";
|
|
||||||
armatak_mediamtx_video_stream_instance_auth_user = missionNamespace getVariable "armatak_mediamtx_video_stream_instance_auth_user";
|
|
||||||
armatak_mediamtx_video_stream_instance_auth_pass = missionNamespace getVariable "armatak_mediamtx_video_stream_instance_auth_pass";
|
|
||||||
|
|
||||||
"armatak" callExtension ["video_stream:start", [armatak_mediamtx_video_stream_instance_address, armatak_mediamtx_video_stream_instance_port, _uuid, armatak_mediamtx_video_stream_instance_auth_user, armatak_mediamtx_video_stream_instance_auth_pass]];
|
|
||||||
(_this select 0) setVariable ["armatak_video_feed_is_streaming", true];
|
|
||||||
},
|
|
||||||
{
|
|
||||||
(_this select 0) getVariable "armatak_video_feed_is_streaming" == false
|
|
||||||
}
|
|
||||||
] call ace_interact_menu_fnc_createAction;
|
|
||||||
[
|
|
||||||
"Man",
|
|
||||||
1,
|
|
||||||
["ACE_SelfActions"],
|
|
||||||
_startAction,
|
|
||||||
true
|
|
||||||
] call ace_interact_menu_fnc_addActionToClass;
|
|
||||||
|
|
||||||
_stopAction = [
|
|
||||||
"ArmatakStopStream",
|
|
||||||
"Stop Video Feed",
|
|
||||||
"",
|
|
||||||
{
|
|
||||||
"armatak" callExtension ["video_stream:stop", []];
|
|
||||||
(_this select 0) setVariable ["armatak_video_feed_is_streaming", false];
|
|
||||||
},
|
|
||||||
{
|
|
||||||
(_this select 0) getVariable "armatak_video_feed_is_streaming"
|
|
||||||
}
|
|
||||||
] call ace_interact_menu_fnc_createAction;
|
|
||||||
[
|
|
||||||
"Man",
|
|
||||||
1,
|
|
||||||
["ACE_SelfActions"],
|
|
||||||
_stopAction,
|
|
||||||
true
|
|
||||||
] call ace_interact_menu_fnc_addActionToClass;
|
|
||||||
if (isMultiplayer) then {
|
|
||||||
{
|
|
||||||
_x setVariable ["armatak_video_feed_is_streaming", false];
|
|
||||||
} forEach playableUnits;
|
|
||||||
} else {
|
|
||||||
player setVariable ["armatak_video_feed_is_streaming", false];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
true;
|
|
||||||
3
addons/main/functions/fnc_logMessage.sqf
Normal file
3
addons/main/functions/fnc_logMessage.sqf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
params[_type, _message];
|
||||||
|
|
||||||
|
"armatak" callExtension ["log", [_type, _message]]
|
||||||
21
addons/main/functions/fnc_notify.sqf
Normal file
21
addons/main/functions/fnc_notify.sqf
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
|
params ["_message", "_type", ["_title", "ARMATAK"]];
|
||||||
|
|
||||||
|
switch (_type) do {
|
||||||
|
case "success": {
|
||||||
|
_warning = format ["<t color='#00FF21'>ARMATAK - %1</t><br/> %2", _title, _message];
|
||||||
|
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||||
|
};
|
||||||
|
case "warning": {
|
||||||
|
_warning = format ["<t color='#ffff16'>ARMATAK - %1</t><br/> %2", _title, _message];
|
||||||
|
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||||
|
};
|
||||||
|
case "error": {
|
||||||
|
_warning = format ["<t color='#FF0021'>ARMATAK - %1</t><br/> %2", _title, _message];
|
||||||
|
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||||
|
};
|
||||||
|
default {
|
||||||
|
systemChat format ["%1 - %2", _title, _message];
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
@@ -4,16 +4,16 @@ private _mapWidth = 5120;
|
|||||||
private _mapHeight = 5120;
|
private _mapHeight = 5120;
|
||||||
|
|
||||||
// SW corner (used as origin)
|
// SW corner (used as origin)
|
||||||
private _SW_lat = 36.588437;
|
private _SW_lat = 36.581566;
|
||||||
private _SW_lon = 68.834763;
|
private _SW_lon = 68.839770;
|
||||||
|
|
||||||
// SE corner
|
// SE corner
|
||||||
private _SE_lat = 36.574950;
|
private _SE_lat = 36.581566;
|
||||||
private _SE_lon = 68.899151;
|
private _SE_lon = 68.905867;
|
||||||
|
|
||||||
// NW corner
|
// NW corner
|
||||||
private _NW_lat = 36.640080;
|
private _NW_lat = 36.633309;
|
||||||
private _NW_lon = 68.847941;
|
private _NW_lon = 68.839770;
|
||||||
|
|
||||||
private _edgeSE_lat = _SE_lat - _SW_lat;
|
private _edgeSE_lat = _SE_lat - _SW_lat;
|
||||||
private _edgeSE_lon = _SE_lon - _SW_lon;
|
private _edgeSE_lon = _SE_lon - _SW_lon;
|
||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
30
addons/main/functions/map/fn_convert_to_kunduz_valley.sqf
Normal file
30
addons/main/functions/map/fn_convert_to_kunduz_valley.sqf
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
params ["_longitudeInGame", "_latitudeInGame", "_altitude"];
|
||||||
|
|
||||||
|
private _mapWidth = 10240;
|
||||||
|
private _mapHeight = 10240;
|
||||||
|
|
||||||
|
// SW corner (used as origin)
|
||||||
|
private _SW_lat = 36.547662;
|
||||||
|
private _SW_lon = 68.802314;
|
||||||
|
|
||||||
|
// SE corner
|
||||||
|
private _SE_lat = 36.547662;
|
||||||
|
private _SE_lon = 68.916671;
|
||||||
|
|
||||||
|
// NW corner
|
||||||
|
private _NW_lat = 36.639935;
|
||||||
|
private _NW_lon = 68.802314;
|
||||||
|
|
||||||
|
private _edgeSE_lat = _SE_lat - _SW_lat;
|
||||||
|
private _edgeSE_lon = _SE_lon - _SW_lon;
|
||||||
|
|
||||||
|
private _edgeNW_lat = _NW_lat - _SW_lat;
|
||||||
|
private _edgeNW_lon = _NW_lon - _SW_lon;
|
||||||
|
|
||||||
|
private _fx = _longitudeInGame / _mapWidth;
|
||||||
|
private _fy = _latitudeInGame / _mapHeight;
|
||||||
|
|
||||||
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
|
[_realLat, _realLon, _altitude]
|
||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ _LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
|
|||||||
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
||||||
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
||||||
|
|
||||||
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ _LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
|
|||||||
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
||||||
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
||||||
|
|
||||||
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ private _fy = _latitudeInGame / _mapHeight;
|
|||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
[_realLat, _realLon, _altitude]
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
if (!hasInterface) exitWith {};
|
|
||||||
|
|
||||||
_local_address = "armatak" callExtension ["local_ip", []] select 0;
|
|
||||||
|
|
||||||
player setVariable ["localAddress", _local_address];
|
|
||||||
|
|
||||||
player addEventHandler ["Respawn", {
|
|
||||||
params["_unit", "_corpse"];
|
|
||||||
[{
|
|
||||||
if (alive _this) then {
|
|
||||||
"armatak" callExtension ["websocket:location", [player call armatak_fnc_extract_position]];
|
|
||||||
};
|
|
||||||
}, 1, []] call CBA_fnc_addPerFrameHandler;
|
|
||||||
}];
|
|
||||||
|
|
||||||
[{
|
|
||||||
"armatak" callExtension ["websocket:location", [player call armatak_fnc_extract_position]];
|
|
||||||
}, 1, []] call CBA_fnc_addPerFrameHandler;
|
|
||||||
17
addons/main/script_component.hpp
Normal file
17
addons/main/script_component.hpp
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#define COMPONENT main
|
||||||
|
#define COMPONENT_BEAUTIFIED Main
|
||||||
|
#include "\armatak\armatak\addons\main\script_mod.hpp"
|
||||||
|
|
||||||
|
// #define DEBUG_MODE_FULL
|
||||||
|
// #define DISABLE_COMPILE_CACHE
|
||||||
|
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||||
|
|
||||||
|
#ifdef DEBUG_ENABLED_MAIN
|
||||||
|
#define DEBUG_MODE_FULL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_SETTINGS_MAIN
|
||||||
|
#define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "\z\ace\addons\main\script_macros.hpp"
|
||||||
32
addons/main/script_mod.hpp
Normal file
32
addons/main/script_mod.hpp
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
// COMPONENT should be defined in the script_component.hpp and included BEFORE this hpp
|
||||||
|
|
||||||
|
#define MAINPREFIX armatak
|
||||||
|
#define PREFIX armatak
|
||||||
|
|
||||||
|
#include "script_version.hpp"
|
||||||
|
|
||||||
|
#define VERSION MAJOR.MINOR
|
||||||
|
#define VERSION_STR MAJOR.MINOR.PATCHLVL.BUILD
|
||||||
|
#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD
|
||||||
|
|
||||||
|
#define PROJECT_AUTHOR QUOTE(Valmo Trindade)
|
||||||
|
|
||||||
|
// MINIMAL required version for the Mod. Components can specify others..
|
||||||
|
#define REQUIRED_VERSION 2.18
|
||||||
|
#define REQUIRED_CBA_VERSION {3,18,2}
|
||||||
|
|
||||||
|
#ifndef COMPONENT_BEAUTIFIED
|
||||||
|
#define COMPONENT_BEAUTIFIED COMPONENT
|
||||||
|
#endif
|
||||||
|
#ifdef SUBCOMPONENT_BEAUTIFIED
|
||||||
|
#define COMPONENT_NAME QUOTE(ARMATAK - COMPONENT_BEAUTIFIED - SUBCOMPONENT_BEAUTIFIED)
|
||||||
|
#else
|
||||||
|
#define COMPONENT_NAME QUOTE(ARMATAK - COMPONENT_BEAUTIFIED)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Custom ARMATAK MACRO defines
|
||||||
|
|
||||||
|
#define EXTENSION_NAME QUOTE(armatak)
|
||||||
|
|
||||||
|
#define CALLEXT(var) EXTENSION_NAME callExtension [QUOTE(var),[]]
|
||||||
|
#define CALLEXTP(var1, var2) EXTENSION_NAME callExtension [QUOTE(var1), var2] select 0
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#define build 0
|
#define build 0
|
||||||
#define major 1
|
#define major 1
|
||||||
#define minor 0
|
#define minor 1
|
||||||
#define patch 0
|
#define patch 0
|
||||||
|
|||||||
1
addons/server/$PBOPREFIX$
Normal file
1
addons/server/$PBOPREFIX$
Normal file
@@ -0,0 +1 @@
|
|||||||
|
armatak\armatak\addons\server
|
||||||
11
addons/server/CfgEventHandlers.hpp
Normal file
11
addons/server/CfgEventHandlers.hpp
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class Extended_PreStart_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_PreInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));
|
||||||
|
};
|
||||||
|
};
|
||||||
90
addons/server/CfgVehicles.hpp
Normal file
90
addons/server/CfgVehicles.hpp
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
class CfgVehicles {
|
||||||
|
class Logic;
|
||||||
|
class Module_F : Logic
|
||||||
|
{
|
||||||
|
class AttributesBase
|
||||||
|
{
|
||||||
|
class Default;
|
||||||
|
class Edit;
|
||||||
|
class Combo;
|
||||||
|
class Checkbox;
|
||||||
|
class CheckboxNumber;
|
||||||
|
class ModuleDescription;
|
||||||
|
class Units;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ModuleDescription
|
||||||
|
{
|
||||||
|
class AnyBrain;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class GVAR(moduleBase): Module_F {
|
||||||
|
author = PROJECT_AUTHOR;
|
||||||
|
category = QEGVAR(main,moduleCategory);
|
||||||
|
function = QUOTE({});
|
||||||
|
functionPriority = 1;
|
||||||
|
isGlobal = 1;
|
||||||
|
isTriggerActivated = 0;
|
||||||
|
scope = 1;
|
||||||
|
scopeCurator = 2;
|
||||||
|
};
|
||||||
|
|
||||||
|
class GVAR(coreModule): GVAR(moduleBase) {
|
||||||
|
scope = 2;
|
||||||
|
scopeCurator = 0;
|
||||||
|
displayname = "CoT Router";
|
||||||
|
icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa";
|
||||||
|
category = QEGVAR(main,moduleCategory);
|
||||||
|
function = QFUNC(3denCoreModuleConfig);
|
||||||
|
functionPriority = 1;
|
||||||
|
isGlobal = 0;
|
||||||
|
isTriggerActivated = 1;
|
||||||
|
isDisposable = 1;
|
||||||
|
is3den = 0;
|
||||||
|
curatorCanAttach = 0;
|
||||||
|
curatorInfoType = "RscDisplayAttributeModuleNuke";
|
||||||
|
canSetArea = 0;
|
||||||
|
canSetAreaShape = 0;
|
||||||
|
canSetAreaHeight = 0;
|
||||||
|
|
||||||
|
class Attributes: AttributesBase {
|
||||||
|
class GVAR(moduleInstanceAddress): Edit {
|
||||||
|
property = QGVAR(moduleInstanceAddress);
|
||||||
|
displayname = "TAK Server Address";
|
||||||
|
tooltip = "TAK Server Instance Address";
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "localhost";
|
||||||
|
};
|
||||||
|
class GVAR(moduleInstancePort): Edit {
|
||||||
|
property = QGVAR(moduleInstancePort);
|
||||||
|
displayname = "TAK Server TCP Port";
|
||||||
|
tooltip = "TAK Server instance Port for TCP connection";
|
||||||
|
typeName = "NUMBER";
|
||||||
|
defaultValue = "8088";
|
||||||
|
};
|
||||||
|
class ModuleDescription: ModuleDescription {};
|
||||||
|
};
|
||||||
|
|
||||||
|
class ModuleDescription: ModuleDescription {
|
||||||
|
description = "Generate the initial ARMATAK configuration, syncronizing all players to the TAK server instance";
|
||||||
|
sync[] = {"LocationArea_F"};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class GVAR(coreModuleCurator): GVAR(coreModule) {
|
||||||
|
scope = 1;
|
||||||
|
scopeCurator = 2;
|
||||||
|
function = "";
|
||||||
|
displayName = "CoT Router (Zeus)";
|
||||||
|
curatorInfoType = "armatak_zeus_core_module_dialog";
|
||||||
|
};
|
||||||
|
|
||||||
|
class GVAR(markEntity): GVAR(moduleBase) {
|
||||||
|
curatorCanAttach = 1;
|
||||||
|
category = QEGVAR(main,moduleCategory);
|
||||||
|
displayname = "Mark Entity";
|
||||||
|
function = QFUNC(routerEntityAdd);
|
||||||
|
icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa";
|
||||||
|
};
|
||||||
|
};
|
||||||
4
addons/server/XEH_PREP.hpp
Normal file
4
addons/server/XEH_PREP.hpp
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
PREP(3denCoreModuleConfig);
|
||||||
|
PREP(routerEntityAdd);
|
||||||
|
PREP(routerEntityRemove);
|
||||||
|
PREP(ZeusCoreModuleConfig);
|
||||||
9
addons/server/XEH_preInit.sqf
Normal file
9
addons/server/XEH_preInit.sqf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
ADDON = false;
|
||||||
|
|
||||||
|
PREP_RECOMPILE_START;
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
|
PREP_RECOMPILE_END;
|
||||||
|
|
||||||
|
ADDON = true;
|
||||||
3
addons/server/XEH_preStart.sqf
Normal file
3
addons/server/XEH_preStart.sqf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
25
addons/server/config.cpp
Normal file
25
addons/server/config.cpp
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
class CfgPatches {
|
||||||
|
class ADDON {
|
||||||
|
name = COMPONENT_NAME;
|
||||||
|
units[] = {
|
||||||
|
QGVAR(coreModule),
|
||||||
|
QGVAR(coreModuleCurator),
|
||||||
|
QGVAR(markEntity)
|
||||||
|
};
|
||||||
|
weapons[] = {};
|
||||||
|
requiredAddons[] = {
|
||||||
|
"cba_main",
|
||||||
|
"ace_main",
|
||||||
|
"armatak_main"
|
||||||
|
};
|
||||||
|
requiredVersion = REQUIRED_VERSION;
|
||||||
|
author = PROJECT_AUTHOR;
|
||||||
|
url = "https://github.com/valmojr/armatak";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "CfgEventHandlers.hpp"
|
||||||
|
#include "dialog.hpp"
|
||||||
|
#include "CfgVehicles.hpp"
|
||||||
141
addons/server/dialog.hpp
Normal file
141
addons/server/dialog.hpp
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
class RscText;
|
||||||
|
class RscBackground;
|
||||||
|
class RscButton;
|
||||||
|
class RscEdit;
|
||||||
|
|
||||||
|
class armatak_zeus_core_module_dialog {
|
||||||
|
idd = 999991;
|
||||||
|
movingEnable = 0;
|
||||||
|
class ControlsBackground {
|
||||||
|
class armatak_gui_module_zeus_core_dialog_main_frame: RscBackground {
|
||||||
|
idc = 1800;
|
||||||
|
x = "0.386562 * safezoneW + safezoneX";
|
||||||
|
y = "0.401 * safezoneH + safezoneY";
|
||||||
|
w = "0.216563 * safezoneW";
|
||||||
|
h = "0.242 * safezoneH";
|
||||||
|
colorBackground[]={0,0,0,0.45};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class Controls {
|
||||||
|
class armatak_gui_module_zeus_core_dialog_address_edit: RscEdit {
|
||||||
|
idc = 14000;
|
||||||
|
text = "localhost";
|
||||||
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
|
y = "0.445 * safezoneH + safezoneY";
|
||||||
|
w = "0.20625 * safezoneW";
|
||||||
|
h = "0.044 * safezoneH";
|
||||||
|
colorBackground[]={0,0,0,0.5};
|
||||||
|
};
|
||||||
|
class armatak_gui_module_zeus_core_dialog_address_port_edit: RscEdit {
|
||||||
|
idc = 14001;
|
||||||
|
text = "8088";
|
||||||
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
|
y = "0.522 * safezoneH + safezoneY";
|
||||||
|
w = "0.20625 * safezoneW";
|
||||||
|
h = "0.044 * safezoneH";
|
||||||
|
colorBackground[]={0,0,0,0.5};
|
||||||
|
};
|
||||||
|
class armatak_gui_module_zeus_core_dialog_address_text: RscText {
|
||||||
|
idc = 1000;
|
||||||
|
text = "TAK Server Address";
|
||||||
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
|
y = "0.412 * safezoneH + safezoneY";
|
||||||
|
w = "0.20625 * safezoneW";
|
||||||
|
h = "0.033 * safezoneH";
|
||||||
|
};
|
||||||
|
class armatak_gui_module_zeus_core_dialog_address_port_text: RscText {
|
||||||
|
idc = 1001;
|
||||||
|
text = "TAK Server Port";
|
||||||
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
|
y = "0.489 * safezoneH + safezoneY";
|
||||||
|
w = "0.20625 * safezoneW";
|
||||||
|
h = "0.033 * safezoneH";
|
||||||
|
};
|
||||||
|
class armatak_gui_module_zeus_core_dialog_address_button_cancel: RscButton {
|
||||||
|
idc = 1601;
|
||||||
|
text = "Cancel";
|
||||||
|
action = "closeDialog 2;";
|
||||||
|
x = "0.551563 * safezoneW + safezoneX";
|
||||||
|
y = "0.577 * safezoneH + safezoneY";
|
||||||
|
w = "0.0464063 * safezoneW";
|
||||||
|
h = "0.055 * safezoneH";
|
||||||
|
};
|
||||||
|
class armatak_gui_module_zeus_core_dialog_address_button_ok: RscButton {
|
||||||
|
idc = 1600;
|
||||||
|
text = "Ok";
|
||||||
|
action = QUOTE(call FUNC(zeusCoreModuleConfig));
|
||||||
|
x = "0.5 * safezoneW + safezoneX";
|
||||||
|
y = "0.577 * safezoneH + safezoneY";
|
||||||
|
w = "0.0464063 * safezoneW";
|
||||||
|
h = "0.055 * safezoneH";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class armatak_zeus_custom_marker_dialog {
|
||||||
|
idd = 990991;
|
||||||
|
movingEnable = 0;
|
||||||
|
|
||||||
|
class Controls {
|
||||||
|
class RscFrame_1800: RscBackground
|
||||||
|
{
|
||||||
|
idc = 1800;
|
||||||
|
x = "0.37625 * safezoneW + safezoneX";
|
||||||
|
y = "0.357 * safezoneH + safezoneY";
|
||||||
|
w = "0.237187 * safezoneW";
|
||||||
|
h = "0.275 * safezoneH";
|
||||||
|
};
|
||||||
|
class RscEdit_1400: RscEdit
|
||||||
|
{
|
||||||
|
idc = 1400;
|
||||||
|
x = "0.386562 * safezoneW + safezoneX";
|
||||||
|
y = "0.423 * safezoneH + safezoneY";
|
||||||
|
w = "0.216563 * safezoneW";
|
||||||
|
h = "0.044 * safezoneH";
|
||||||
|
};
|
||||||
|
class RscText_1000: RscText
|
||||||
|
{
|
||||||
|
idc = 1000;
|
||||||
|
text = "Entity Callsign";
|
||||||
|
x = "0.386562 * safezoneW + safezoneX";
|
||||||
|
y = "0.379 * safezoneH + safezoneY";
|
||||||
|
w = "0.216563 * safezoneW";
|
||||||
|
h = "0.044 * safezoneH";
|
||||||
|
};
|
||||||
|
class RscText_1001: RscText
|
||||||
|
{
|
||||||
|
idc = 1001;
|
||||||
|
text = "Entity Type (only for vehicles)";
|
||||||
|
x = "0.386562 * safezoneW + safezoneX";
|
||||||
|
y = "0.467 * safezoneH + safezoneY";
|
||||||
|
w = "0.216563 * safezoneW";
|
||||||
|
h = "0.044 * safezoneH";
|
||||||
|
};
|
||||||
|
class RscEdit_1401: RscEdit
|
||||||
|
{
|
||||||
|
idc = 1401;
|
||||||
|
x = "0.386562 * safezoneW + safezoneX";
|
||||||
|
y = "0.511 * safezoneH + safezoneY";
|
||||||
|
w = "0.216563 * safezoneW";
|
||||||
|
h = "0.044 * safezoneH";
|
||||||
|
};
|
||||||
|
class RscButton_1600: RscButton
|
||||||
|
{
|
||||||
|
idc = 1600;
|
||||||
|
text = "Cancel";
|
||||||
|
x = "0.551562 * safezoneW + safezoneX";
|
||||||
|
y = "0.566 * safezoneH + safezoneY";
|
||||||
|
w = "0.0515625 * safezoneW";
|
||||||
|
h = "0.055 * safezoneH";
|
||||||
|
};
|
||||||
|
class RscButton_1601: RscButton
|
||||||
|
{
|
||||||
|
idc = 1601;
|
||||||
|
text = "OK";
|
||||||
|
x = "0.489687 * safezoneW + safezoneX";
|
||||||
|
y = "0.566 * safezoneH + safezoneY";
|
||||||
|
w = "0.0515625 * safezoneW";
|
||||||
|
h = "0.055 * safezoneH";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
57
addons/server/functions/fnc_3denCoreModuleConfig.sqf
Normal file
57
addons/server/functions/fnc_3denCoreModuleConfig.sqf
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
|
params [
|
||||||
|
["_logic", objNull, [objNull]],
|
||||||
|
["_units", [], [[]]],
|
||||||
|
["_activated", true, [true]]
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isServer) exitWith {
|
||||||
|
["Connecting to TCP Socket", "success", "TCP Socket"] call EFUNC(main,notify);
|
||||||
|
|
||||||
|
_tak_server_instance_address = _logic getVariable QGVAR(moduleInstanceAddress);
|
||||||
|
_tak_server_instance_port = _logic getVariable QGVAR(moduleInstancePort);
|
||||||
|
|
||||||
|
_tak_server_fulladdress = _tak_server_instance_address + ":" + (str _tak_server_instance_port);
|
||||||
|
|
||||||
|
missionNamespace setVariable ["armatak_server_instance", _tak_server_fulladdress];
|
||||||
|
missionNamespace setVariable ["armatak_tcp_socket_is_running", true];
|
||||||
|
|
||||||
|
"armatak" callExtension ["tcp_socket:start", [_tak_server_fulladdress]];
|
||||||
|
|
||||||
|
_syncUnits = synchronizedObjects _logic;
|
||||||
|
|
||||||
|
missionNamespace setVariable ["armatak_marked_units", _syncUnits];
|
||||||
|
|
||||||
|
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
||||||
|
|
||||||
|
[{
|
||||||
|
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
||||||
|
|
||||||
|
{
|
||||||
|
_objectType = _x call BIS_fnc_objectType;
|
||||||
|
switch (true) do {
|
||||||
|
case ((_objectType select 0) == "Soldier"): {
|
||||||
|
_callsign = [_x] call armatak_fnc_extract_unit_callsign;
|
||||||
|
_group_name = [group _x] call armatak_fnc_extract_group_color;
|
||||||
|
_group_role = [_x] call armatak_fnc_extract_group_role;
|
||||||
|
|
||||||
|
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot;
|
||||||
|
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||||
|
};
|
||||||
|
case ((_objectType select 0) == "Vehicle"): {
|
||||||
|
_atak_type = [_x] call armatak_fnc_extract_role;
|
||||||
|
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
||||||
|
|
||||||
|
[_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
if (unitIsUAV _x) then {
|
||||||
|
[_x] call armatak_fnc_send_drone_cot;
|
||||||
|
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||||
|
};
|
||||||
|
} forEach GVAR(syncedUnits);
|
||||||
|
}, 2, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
};
|
||||||
|
|
||||||
|
true;
|
||||||
60
addons/server/functions/fnc_ZeusCoreModuleConfig.sqf
Normal file
60
addons/server/functions/fnc_ZeusCoreModuleConfig.sqf
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
|
params ["_logic"];
|
||||||
|
|
||||||
|
_socket_is_running = missionNamespace getVariable ["armatak_tcp_socket_is_running", false];
|
||||||
|
|
||||||
|
if (_socket_is_running) exitWith {
|
||||||
|
["Socket was called twice", "error", "TCP Socket"] call EFUNC(main,notify);
|
||||||
|
closeDialog 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
disableSerialization;
|
||||||
|
|
||||||
|
["Connecting to TCP Socket", "success", "TCP Socket"] call EFUNC(main,notify);
|
||||||
|
|
||||||
|
_tak_server_instance_address = ctrlText 14000;
|
||||||
|
_tak_server_instance_port = ctrlText 14001;
|
||||||
|
|
||||||
|
_tak_server_fulladdress = ((_tak_server_instance_address) + ":" + (_tak_server_instance_port));
|
||||||
|
|
||||||
|
missionNamespace setVariable ["armatak_server_instance", _tak_server_fulladdress];
|
||||||
|
missionNamespace setVariable ["armatak_tcp_socket_is_running", true];
|
||||||
|
|
||||||
|
"armatak" callExtension ["tcp_socket:start", [_tak_server_fulladdress]];
|
||||||
|
|
||||||
|
_syncUnits = [];
|
||||||
|
|
||||||
|
missionNamespace setVariable ["armatak_marked_units", _syncUnits];
|
||||||
|
|
||||||
|
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
||||||
|
|
||||||
|
[{
|
||||||
|
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
||||||
|
|
||||||
|
{
|
||||||
|
_objectType = _x call BIS_fnc_objectType;
|
||||||
|
switch (true) do {
|
||||||
|
case ((_objectType select 0) == "Soldier"): {
|
||||||
|
_callsign = [_x] call armatak_fnc_extract_unit_callsign;
|
||||||
|
_group_name = [group _x] call armatak_fnc_extract_group_color;
|
||||||
|
_group_role = [_x] call armatak_fnc_extract_group_role;
|
||||||
|
|
||||||
|
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot;
|
||||||
|
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||||
|
};
|
||||||
|
case ((_objectType select 0) == "Vehicle"): {
|
||||||
|
_atak_type = [_x] call armatak_fnc_extract_role;
|
||||||
|
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
||||||
|
|
||||||
|
[_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
if (unitIsUAV _x) then {
|
||||||
|
[_x] call armatak_fnc_send_drone_cot;
|
||||||
|
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||||
|
};
|
||||||
|
} forEach GVAR(syncedUnits);
|
||||||
|
}, 2, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
deleteVehicle _logic;
|
||||||
|
closeDialog 1;
|
||||||
44
addons/server/functions/fnc_routerEntityAdd.sqf
Normal file
44
addons/server/functions/fnc_routerEntityAdd.sqf
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: Valmo
|
||||||
|
* Adds a unit into the global marked units array.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: The module logic <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [LOGIC] call armatak_server_fnc_routerEntityAdd;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
|
||||||
|
params ["_logic"];
|
||||||
|
|
||||||
|
if (!local _logic) exitWith {};
|
||||||
|
|
||||||
|
private _unit = attachedTo _logic;
|
||||||
|
|
||||||
|
switch (false) do {
|
||||||
|
case (!isNull _unit): {
|
||||||
|
["Nothing selected", "error", "TCP Socket"] call EFUNC(main,notify);
|
||||||
|
deleteVehicle _logic;
|
||||||
|
};
|
||||||
|
default {
|
||||||
|
if (_unit in (missionNamespace getVariable ["armatak_marked_units", []])) exitWith {
|
||||||
|
["Unit already marked", "warning", "TCP Socket"] call EFUNC(main,notify);
|
||||||
|
deleteVehicle _logic;
|
||||||
|
};
|
||||||
|
|
||||||
|
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
||||||
|
|
||||||
|
GVAR(syncedUnits) pushBack _unit;
|
||||||
|
|
||||||
|
missionNamespace setVariable ["armatak_marked_units", GVAR(syncedUnits)];
|
||||||
|
SETVAR(_unit,GVAR(isRouting),true);
|
||||||
|
|
||||||
|
deleteVehicle _logic;
|
||||||
|
};
|
||||||
|
};
|
||||||
42
addons/server/functions/fnc_routerEntityRemove.sqf
Normal file
42
addons/server/functions/fnc_routerEntityRemove.sqf
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: Valmo
|
||||||
|
* Removes a unit from the global marked units array.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: The module logic <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [LOGIC] call armatak_server_fnc_routerEntityRemove;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
|
||||||
|
params ["_logic"];
|
||||||
|
|
||||||
|
if (!local _logic) exitWith {};
|
||||||
|
|
||||||
|
private _unit = attachedTo _logic;
|
||||||
|
deleteVehicle _logic;
|
||||||
|
|
||||||
|
switch (false) do {
|
||||||
|
case (!isNull _unit): {
|
||||||
|
deleteVehicle _logic;
|
||||||
|
["Nothing selected", "error", "TCP Socket"] call EFUNC(main,notify);
|
||||||
|
};
|
||||||
|
default {
|
||||||
|
{
|
||||||
|
if (_x isEqualTo _unit) then {
|
||||||
|
GVAR(syncedUnits) deleteAt _forEachIndex;
|
||||||
|
};
|
||||||
|
} forEach GVAR(syncedUnits);
|
||||||
|
|
||||||
|
missionNmaespace setVariable ["armatak_marked_units", GVAR(syncedUnits)];
|
||||||
|
SETVAR(_unit,GVAR(isRouting),false);
|
||||||
|
|
||||||
|
deleteVehicle _logic;
|
||||||
|
};
|
||||||
|
};
|
||||||
17
addons/server/script_component.hpp
Normal file
17
addons/server/script_component.hpp
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#define COMPONENT server
|
||||||
|
#define COMPONENT_BEAUTIFIED TCP Socket Client
|
||||||
|
#include "\armatak\armatak\addons\main\script_mod.hpp"
|
||||||
|
|
||||||
|
// #define DEBUG_MODE_FULL
|
||||||
|
// #define DISABLE_COMPILE_CACHE
|
||||||
|
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||||
|
|
||||||
|
#ifdef DEBUG_ENABLED_CLIENT
|
||||||
|
#define DEBUG_MODE_FULL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_SETTINGS_CLIENT
|
||||||
|
#define DEBUG_SETTINGS DEBUG_SETTINGS_CLIENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "\z\ace\addons\main\script_macros.hpp"
|
||||||
1
addons/video/$PBOPREFIX$
Normal file
1
addons/video/$PBOPREFIX$
Normal file
@@ -0,0 +1 @@
|
|||||||
|
armatak\armatak\addons\video
|
||||||
11
addons/video/CfgEventHandlers.hpp
Normal file
11
addons/video/CfgEventHandlers.hpp
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class Extended_PreStart_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_PreInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));
|
||||||
|
};
|
||||||
|
};
|
||||||
73
addons/video/CfgVehicles.hpp
Normal file
73
addons/video/CfgVehicles.hpp
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
class CfgVehicles {
|
||||||
|
class Logic;
|
||||||
|
|
||||||
|
class Module_F : Logic
|
||||||
|
{
|
||||||
|
class AttributesBase
|
||||||
|
{
|
||||||
|
class Default;
|
||||||
|
class Edit;
|
||||||
|
class Combo;
|
||||||
|
class Checkbox;
|
||||||
|
class CheckboxNumber;
|
||||||
|
class ModuleDescription;
|
||||||
|
class Units;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ModuleDescription
|
||||||
|
{
|
||||||
|
class AnyBrain;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class EGVAR(server,moduleBase);
|
||||||
|
class GVAR(videoModule): EGVAR(server,moduleBase) {
|
||||||
|
scope = 2;
|
||||||
|
scopeCurator = 0;
|
||||||
|
displayname = "Video Streaming Handler";
|
||||||
|
icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa";
|
||||||
|
category = QEGVAR(main,moduleCategory);
|
||||||
|
function = QFUNC(videoParser);
|
||||||
|
functionPriority = 1;
|
||||||
|
isGlobal = 0;
|
||||||
|
isTriggerActivated = 1;
|
||||||
|
isDisposable = 1;
|
||||||
|
is3den = 0;
|
||||||
|
curatorCanAttach = 0;
|
||||||
|
curatorInfoType = "RscDisplayAttributeModuleNuke";
|
||||||
|
canSetArea = 0;
|
||||||
|
canSetAreaShape = 0;
|
||||||
|
canSetAreaHeight = 0;
|
||||||
|
/*
|
||||||
|
class Attributes: AttributesBase {
|
||||||
|
class GVAR(instanceAddress): Edit {
|
||||||
|
property = QGVAR(instanceAddress);
|
||||||
|
displayname = "MediaMTX Provider Address";
|
||||||
|
tooltip = "MediaMTX Provider Instance Address";
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "localhost";
|
||||||
|
};
|
||||||
|
class GVAR(instancePort): Edit {
|
||||||
|
property = QGVAR(instancePort);
|
||||||
|
displayname = QUOTE(MediaMTX Provider Port);
|
||||||
|
tooltip = QUOTE(MediaMTX Provider Port for handling video streams);
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "8554";
|
||||||
|
};
|
||||||
|
class GVAR(instanceAuthUser): Edit {
|
||||||
|
property = QGVAR(instanceAuthUser);
|
||||||
|
displayname = QUOTE(MediaMTX Provider Username);
|
||||||
|
tooltip = QUOTE(MediaMTX Provider Instance Username);
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "administrator";
|
||||||
|
};
|
||||||
|
class GVAR(instanceAuthPassword): Edit {
|
||||||
|
property = QGVAR(instanceAuthPassword);
|
||||||
|
displayname = QUOTE(MediaMTX Provider Password);
|
||||||
|
tooltip = QUOTE(MediaMTX Provider Instance Password);
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "password";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
};
|
||||||
1
addons/video/XEH_PREP.hpp
Normal file
1
addons/video/XEH_PREP.hpp
Normal file
@@ -0,0 +1 @@
|
|||||||
|
PREP(videoParser);
|
||||||
9
addons/video/XEH_preInit.sqf
Normal file
9
addons/video/XEH_preInit.sqf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
ADDON = false;
|
||||||
|
|
||||||
|
PREP_RECOMPILE_START;
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
|
PREP_RECOMPILE_END;
|
||||||
|
|
||||||
|
ADDON = true;
|
||||||
3
addons/video/XEH_preStart.sqf
Normal file
3
addons/video/XEH_preStart.sqf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
23
addons/video/config.cpp
Normal file
23
addons/video/config.cpp
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
class CfgPatches {
|
||||||
|
class ADDON {
|
||||||
|
name = COMPONENT_NAME;
|
||||||
|
units[] = {
|
||||||
|
QGVAR(videoModule)
|
||||||
|
};
|
||||||
|
weapons[] = {};
|
||||||
|
requiredAddons[] = {
|
||||||
|
"cba_main",
|
||||||
|
"ace_main",
|
||||||
|
"armatak_main",
|
||||||
|
"armatak_server"
|
||||||
|
};
|
||||||
|
requiredVersion = REQUIRED_VERSION;
|
||||||
|
author = PROJECT_AUTHOR;
|
||||||
|
url = "https://github.com/valmojr/armatak";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "CfgEventHandlers.hpp"
|
||||||
|
//#include "CfgVehicles.hpp"
|
||||||
83
addons/video/functions/fnc_videoParser.sqf
Normal file
83
addons/video/functions/fnc_videoParser.sqf
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
|
params [
|
||||||
|
["_logic", objNull, [objNull]],
|
||||||
|
["_units", [], [[]]],
|
||||||
|
["_activated", true, [true]]
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isServer) exitWith {
|
||||||
|
private _instance_address = GETVAR(_logic,GVAR(instanceAddress),false);
|
||||||
|
private _instance_port = GETVAR(_logic,GVAR(instancePort),false);
|
||||||
|
private _instance_auth_user = GETVAR(_logic,GVAR(instanceAuthUser),false);
|
||||||
|
private _instance_auth_pass = GETVAR(_logic,GVAR(instanceAuthPassword),false);
|
||||||
|
|
||||||
|
SETMVAR(GVAR(instanceAddress),_instance_address);
|
||||||
|
SETMVAR(GVAR(instancePort),_instance_port);
|
||||||
|
SETMVAR(GVAR(instanceAuthUser),_instance_auth_user);
|
||||||
|
SETMVAR(GVAR(instanceAuthPassword),_instance_auth_pass);
|
||||||
|
|
||||||
|
_startAction = [
|
||||||
|
QGVAR(startStream),
|
||||||
|
"Start Video Feed",
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
_uuid = (_this select 0) call armatak_fnc_extract_uuid;
|
||||||
|
_uuid_short = _uuid select [0, 8];
|
||||||
|
_role = roleDescription (_this select 0);
|
||||||
|
_name = name (_this select 0);
|
||||||
|
|
||||||
|
_role = [_role] call BIS_fnc_filterString;
|
||||||
|
_name = [_name] call BIS_fnc_filterString;
|
||||||
|
|
||||||
|
_stream_path = _name + "_" + _role + "_" + _uuid_short;
|
||||||
|
|
||||||
|
armatak_mediamtx_video_stream_instance_address = GETMVAR(instance_address,false);
|
||||||
|
armatak_mediamtx_video_stream_instance_port = missionNamespace getVariable "instance_port";
|
||||||
|
armatak_mediamtx_video_stream_instance_auth_user = missionNamespace getVariable "instance_auth_user";
|
||||||
|
armatak_mediamtx_video_stream_instance_auth_pass = missionNamespace getVariable "instance_auth_pass";
|
||||||
|
|
||||||
|
"armatak" callExtension ["video_stream:start", [armatak_mediamtx_video_stream_instance_address, armatak_mediamtx_video_stream_instance_port, _stream_path, armatak_mediamtx_video_stream_instance_auth_user, armatak_mediamtx_video_stream_instance_auth_pass]];
|
||||||
|
(_this select 0) setVariable ["armatak_video_feed_is_streaming", true];
|
||||||
|
},
|
||||||
|
{
|
||||||
|
(_this select 0) getVariable "armatak_video_feed_is_streaming" == false
|
||||||
|
}
|
||||||
|
] call ace_interact_menu_fnc_createAction;
|
||||||
|
[
|
||||||
|
"Man",
|
||||||
|
1,
|
||||||
|
["ACE_SelfActions"],
|
||||||
|
_startAction,
|
||||||
|
true
|
||||||
|
] call ace_interact_menu_fnc_addActionToClass;
|
||||||
|
|
||||||
|
_stopAction = [
|
||||||
|
"ArmatakStopStream",
|
||||||
|
"Stop Video Feed",
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"armatak" callExtension ["video_stream:stop", []];
|
||||||
|
SETVAR(_this select 0,GVAR(isStreaming),false);
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GETVAR((this select 0),GVAR(isStreaming),false)
|
||||||
|
}
|
||||||
|
] call ace_interact_menu_fnc_createAction;
|
||||||
|
[
|
||||||
|
"Man",
|
||||||
|
1,
|
||||||
|
["ACE_SelfActions"],
|
||||||
|
_stopAction,
|
||||||
|
true
|
||||||
|
] call ace_interact_menu_fnc_addActionToClass;
|
||||||
|
if (isMultiplayer) then {
|
||||||
|
{
|
||||||
|
SETVAR(_x,GVAR(isStreaming),false);
|
||||||
|
} forEach playableUnits;
|
||||||
|
} else {
|
||||||
|
SETVAR(player,GVAR(isStreaming),false);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
true;
|
||||||
17
addons/video/script_component.hpp
Normal file
17
addons/video/script_component.hpp
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#define COMPONENT video
|
||||||
|
#define COMPONENT_BEAUTIFIED Video Streaming
|
||||||
|
#include "\armatak\armatak\addons\main\script_mod.hpp"
|
||||||
|
|
||||||
|
// #define DEBUG_MODE_FULL
|
||||||
|
// #define DISABLE_COMPILE_CACHE
|
||||||
|
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||||
|
|
||||||
|
#ifdef DEBUG_ENABLED_MAIN
|
||||||
|
#define DEBUG_MODE_FULL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_SETTINGS_MAIN
|
||||||
|
#define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "\z\ace\addons\main\script_macros.hpp"
|
||||||
1
app/.gitignore
vendored
1
app/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
/build
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
plugins {
|
|
||||||
alias(libs.plugins.android.application)
|
|
||||||
alias(libs.plugins.jetbrains.kotlin.android)
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
namespace = "com.armatak.simtak"
|
|
||||||
compileSdk = 34
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
applicationId = "com.armatak.simtak"
|
|
||||||
minSdk = 29
|
|
||||||
targetSdk = 34
|
|
||||||
versionCode = 1
|
|
||||||
versionName = "1.0"
|
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
isMinifyEnabled = false
|
|
||||||
proguardFiles(
|
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
||||||
"proguard-rules.pro"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
|
||||||
}
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "1.8"
|
|
||||||
}
|
|
||||||
viewBinding {
|
|
||||||
enable = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
|
|
||||||
implementation(libs.androidx.core.ktx)
|
|
||||||
implementation(libs.androidx.appcompat)
|
|
||||||
implementation(libs.material)
|
|
||||||
implementation(libs.androidx.activity)
|
|
||||||
implementation(libs.androidx.constraintlayout)
|
|
||||||
|
|
||||||
implementation(libs.okhttp)
|
|
||||||
//Vision - Qr/BarCodeScanner
|
|
||||||
implementation(libs.play.services.vision)
|
|
||||||
testImplementation(libs.junit)
|
|
||||||
androidTestImplementation(libs.androidx.junit)
|
|
||||||
androidTestImplementation(libs.androidx.espresso.core)
|
|
||||||
}
|
|
||||||
21
app/proguard-rules.pro
vendored
21
app/proguard-rules.pro
vendored
@@ -1,21 +0,0 @@
|
|||||||
# Add project specific ProGuard rules here.
|
|
||||||
# You can control the set of applied configuration files using the
|
|
||||||
# proguardFiles setting in build.gradle.
|
|
||||||
#
|
|
||||||
# For more details, see
|
|
||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
||||||
|
|
||||||
# If your project uses WebView with JS, uncomment the following
|
|
||||||
# and specify the fully qualified class name to the JavaScript interface
|
|
||||||
# class:
|
|
||||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
||||||
# public *;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Uncomment this to preserve the line number information for
|
|
||||||
# debugging stack traces.
|
|
||||||
#-keepattributes SourceFile,LineNumberTable
|
|
||||||
|
|
||||||
# If you keep the line number information, uncomment this to
|
|
||||||
# hide the original source file name.
|
|
||||||
#-renamesourcefileattribute SourceFile
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package com.armatak.simtak
|
|
||||||
|
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
|
||||||
|
|
||||||
import org.junit.Test
|
|
||||||
import org.junit.runner.RunWith
|
|
||||||
|
|
||||||
import org.junit.Assert.*
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* See [testing documentation](http://d.android.com/tools/testing).
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4::class)
|
|
||||||
class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
fun useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
|
||||||
assertEquals("com.armatak.simtak", appContext.packageName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"
|
|
||||||
tools:ignore="ProtectedPermissions" />
|
|
||||||
</manifest>
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
|
|
||||||
<uses-feature
|
|
||||||
android:name="android.hardware.camera"
|
|
||||||
android:required="true" />
|
|
||||||
<uses-feature android:name="android.hardware.camera.autofocus"
|
|
||||||
android:required="false"/>
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION"/>
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
|
||||||
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:allowBackup="true"
|
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
|
||||||
android:fullBackupContent="@xml/backup_rules"
|
|
||||||
android:icon="@drawable/appicon_simtak"
|
|
||||||
android:usesCleartextTraffic="true"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:roundIcon="@drawable/appicon_simtak"
|
|
||||||
android:supportsRtl="true"
|
|
||||||
android:theme="@style/Theme.SIMTAK"
|
|
||||||
tools:targetApi="31">
|
|
||||||
<activity
|
|
||||||
android:name=".trackerLog.TrackerLogActivity"
|
|
||||||
android:screenOrientation="portrait"
|
|
||||||
android:exported="false"
|
|
||||||
tools:ignore="LockedOrientationActivity" />
|
|
||||||
<activity
|
|
||||||
android:name=".ScannerActivity"
|
|
||||||
android:screenOrientation="portrait"
|
|
||||||
android:exported="false"
|
|
||||||
tools:ignore="LockedOrientationActivity" />
|
|
||||||
<activity
|
|
||||||
android:name=".HomeActivity"
|
|
||||||
android:screenOrientation="portrait"
|
|
||||||
tools:ignore="LockedOrientationActivity"
|
|
||||||
android:exported="true">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<service
|
|
||||||
android:name=".LocationSimulationService"
|
|
||||||
android:exported="true"
|
|
||||||
android:foregroundServiceType="location"
|
|
||||||
android:permission="android.permission.ACCESS_MOCK_LOCATION">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</service>
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
||||||
@@ -1,182 +0,0 @@
|
|||||||
package com.armatak.simtak
|
|
||||||
|
|
||||||
import android.Manifest
|
|
||||||
import android.app.Dialog
|
|
||||||
import android.content.Intent
|
|
||||||
import android.content.pm.PackageManager
|
|
||||||
import android.graphics.Color
|
|
||||||
import android.graphics.drawable.ColorDrawable
|
|
||||||
import android.net.Uri
|
|
||||||
import android.os.Build
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.provider.Settings
|
|
||||||
import android.view.Window
|
|
||||||
import android.widget.Button
|
|
||||||
import android.widget.TextView
|
|
||||||
import android.widget.Toast
|
|
||||||
import androidx.activity.enableEdgeToEdge
|
|
||||||
import androidx.activity.result.ActivityResultLauncher
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
|
||||||
import androidx.core.content.ContextCompat
|
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.WindowInsetsCompat
|
|
||||||
import com.armatak.simtak.databinding.ActivityHomeBinding
|
|
||||||
import com.armatak.simtak.trackerLog.TrackerLogActivity
|
|
||||||
|
|
||||||
class HomeActivity : AppCompatActivity() {
|
|
||||||
private lateinit var binding: ActivityHomeBinding
|
|
||||||
private var requestCamera: ActivityResultLauncher<String>? = null
|
|
||||||
private var requestPermissionLauncher: ActivityResultLauncher<String>? = null
|
|
||||||
private var requested = false
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
binding = ActivityHomeBinding.inflate(layoutInflater)
|
|
||||||
setContentView(binding.root)
|
|
||||||
enableEdgeToEdge()
|
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, insets ->
|
|
||||||
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
|
||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
|
||||||
insets
|
|
||||||
}
|
|
||||||
|
|
||||||
requestCamera = registerForActivityResult(ActivityResultContracts.RequestPermission()) {
|
|
||||||
if (it) {
|
|
||||||
initScan()
|
|
||||||
} else {
|
|
||||||
Toast.makeText(
|
|
||||||
this,
|
|
||||||
"Sem permissão para acessar a camera. Permita o acesso para continuar",
|
|
||||||
Toast.LENGTH_LONG
|
|
||||||
).show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
requestPermissionLauncher = registerForActivityResult(
|
|
||||||
ActivityResultContracts.RequestPermission(),
|
|
||||||
) { isGranted: Boolean ->
|
|
||||||
if (isGranted) {
|
|
||||||
Toast.makeText(baseContext, "Notificações Habilitadas", Toast.LENGTH_SHORT).show()
|
|
||||||
requestCamera?.launch(Manifest.permission.CAMERA)
|
|
||||||
} else {
|
|
||||||
Toast.makeText(
|
|
||||||
baseContext,
|
|
||||||
"Por favor confirme a permissão",
|
|
||||||
Toast.LENGTH_SHORT
|
|
||||||
).show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
initUI()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun validateUrl() {
|
|
||||||
val etServerAddressLayout = binding.etServerAddressLayout
|
|
||||||
val etServerAddress = binding.etServerAddress
|
|
||||||
val serverAddress = etServerAddress.text.toString()
|
|
||||||
|
|
||||||
val regexPatterns = listOf(
|
|
||||||
"^ws://\\b(?:(?:2(?:[0-4][0-9]|5[0-5])|[0-1]?[0-9]?[0-9])\\.){3}(?:(?:2([0-4][0-9]|5[0-5])|[0-1]?[0-9]?[0-9]))\\b:[0-9]+\$",
|
|
||||||
"^ws://([A-Za-z0-9]+(\\.[A-Za-z0-9]+)+)\$"
|
|
||||||
)
|
|
||||||
|
|
||||||
val allowed = regexPatterns.any { patterns ->
|
|
||||||
Regex(patterns).matches(serverAddress)
|
|
||||||
}
|
|
||||||
|
|
||||||
if(allowed) {
|
|
||||||
requested = false
|
|
||||||
val intent = Intent(this, TrackerLogActivity::class.java)
|
|
||||||
intent.putExtra("webSocketUrl", serverAddress)
|
|
||||||
startActivity(intent)
|
|
||||||
} else {
|
|
||||||
requested = false
|
|
||||||
etServerAddressLayout.error = "Server Address need to be a valid URL"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun initScan() {
|
|
||||||
startActivity(Intent(this, ScannerActivity::class.java))
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private fun initUI() {
|
|
||||||
binding.btnScanQrCode.setOnClickListener {
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
if (ContextCompat.checkSelfPermission(
|
|
||||||
this,
|
|
||||||
Manifest.permission.POST_NOTIFICATIONS
|
|
||||||
) ==
|
|
||||||
PackageManager.PERMISSION_GRANTED
|
|
||||||
) {
|
|
||||||
requestCamera?.launch(Manifest.permission.CAMERA)
|
|
||||||
} else if (shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)) {
|
|
||||||
requestNotificationByDialog()
|
|
||||||
} else {
|
|
||||||
requestPermissionLauncher?.launch(Manifest.permission.POST_NOTIFICATIONS)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.btnConnectToServer.setOnClickListener {
|
|
||||||
val serverAddress = binding.etServerAddress.text.toString()
|
|
||||||
if (!requested && serverAddress.isNotBlank()){
|
|
||||||
validateUrl()
|
|
||||||
} else {
|
|
||||||
binding.etServerAddressLayout.error = "This Input cannot be blank"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
configureFooterLinks()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private fun requestNotificationByDialog() {
|
|
||||||
val dialog = Dialog(this)
|
|
||||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
|
||||||
dialog.setContentView(R.layout.dialog_alert)
|
|
||||||
dialog.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
|
||||||
|
|
||||||
val tvTitle: TextView = dialog.findViewById(R.id.title)
|
|
||||||
val tvMessage: TextView = dialog.findViewById(R.id.message)
|
|
||||||
val btnCancel: Button = dialog.findViewById(R.id.btnCancel)
|
|
||||||
val btnAccept: Button = dialog.findViewById(R.id.btnAccept)
|
|
||||||
|
|
||||||
btnCancel.text = getString(R.string.cancel)
|
|
||||||
btnCancel.setOnClickListener {
|
|
||||||
dialog.dismiss()
|
|
||||||
}
|
|
||||||
tvTitle.text = getString(R.string.allowNotificationsPermission)
|
|
||||||
tvMessage.text = getString(R.string.needNotificationsPermissionMessage)
|
|
||||||
btnAccept.text = getString(R.string.goToSettings)
|
|
||||||
btnAccept.setOnClickListener {
|
|
||||||
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
|
|
||||||
intent.putExtra(Settings.EXTRA_APP_PACKAGE, this.packageName)
|
|
||||||
startActivity(intent)
|
|
||||||
dialog.dismiss()
|
|
||||||
}
|
|
||||||
dialog.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun configureFooterLinks() {
|
|
||||||
binding.btnGithubProject.setOnClickListener {
|
|
||||||
openLink(getString(R.string.githubProjectUrl))
|
|
||||||
}
|
|
||||||
binding.btnWiki.setOnClickListener {
|
|
||||||
openLink(getString(R.string.wikiUrl))
|
|
||||||
}
|
|
||||||
binding.btnDiscord.setOnClickListener {
|
|
||||||
openLink(getString(R.string.discordUrl))
|
|
||||||
}
|
|
||||||
binding.btnSteamProject.setOnClickListener {
|
|
||||||
openLink(getString(R.string.steamUrl))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun openLink(url: String) {
|
|
||||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
|
||||||
startActivity(intent)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,237 +0,0 @@
|
|||||||
package com.armatak.simtak
|
|
||||||
|
|
||||||
import android.app.NotificationManager
|
|
||||||
import android.app.Service
|
|
||||||
import android.content.Intent
|
|
||||||
import android.location.Location
|
|
||||||
import android.location.LocationManager
|
|
||||||
import android.location.provider.ProviderProperties
|
|
||||||
import android.os.Binder
|
|
||||||
import android.os.Build
|
|
||||||
import android.os.Handler
|
|
||||||
import android.os.IBinder
|
|
||||||
import android.os.Looper
|
|
||||||
import android.os.SystemClock
|
|
||||||
import android.util.Log
|
|
||||||
import com.armatak.simtak.core.Util.createNotificationChannel
|
|
||||||
import com.armatak.simtak.core.Util.getActualTime
|
|
||||||
import com.armatak.simtak.core.Util.getMockLocationStoppedNotification
|
|
||||||
import com.armatak.simtak.core.Util.getNeedReconnectNotification
|
|
||||||
import com.armatak.simtak.core.Util.getRunningNotification
|
|
||||||
import com.armatak.simtak.core.Util.getServiceDestroyedNotification
|
|
||||||
import com.armatak.simtak.core.Util.getStartedServiceNotification
|
|
||||||
import com.armatak.simtak.trackerLog.data.models.ConnectionStatus
|
|
||||||
import com.armatak.simtak.trackerLog.data.models.LogModel
|
|
||||||
import com.armatak.simtak.trackerLog.data.models.LogTypes
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
|
||||||
import kotlinx.coroutines.flow.StateFlow
|
|
||||||
import kotlinx.coroutines.flow.collectLatest
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import org.json.JSONObject
|
|
||||||
|
|
||||||
private const val TAG = "LocationSimulationService"
|
|
||||||
|
|
||||||
class LocationSimulationService : Service() {
|
|
||||||
private val binder = LocationMockBinder()
|
|
||||||
private lateinit var webSocketClient: WebSocketClient
|
|
||||||
|
|
||||||
private var logTrackerMutableList = mutableListOf<LogModel>()
|
|
||||||
private var lastLineId = 0
|
|
||||||
|
|
||||||
private var connectionAttemps = 0
|
|
||||||
|
|
||||||
private val _connectionStatus = MutableStateFlow<ConnectionStatus>(ConnectionStatus.InitialValue)
|
|
||||||
private val connectionStatus : StateFlow<ConnectionStatus> = _connectionStatus
|
|
||||||
private val _logTracker = MutableStateFlow(emptyList<LogModel>())
|
|
||||||
private val logTracker : StateFlow<List<LogModel>> = _logTracker
|
|
||||||
|
|
||||||
init {
|
|
||||||
Log.d(TAG, "$TAG, initialized")
|
|
||||||
}
|
|
||||||
|
|
||||||
private val socketListener = object : WebSocketClient.SocketListener {
|
|
||||||
override fun onMessage(message: String) {
|
|
||||||
try {
|
|
||||||
if (message[0] == '{') {
|
|
||||||
val jsonObject = JSONObject(message)
|
|
||||||
val latitude = jsonObject.getDouble("latitude")
|
|
||||||
val longitude = jsonObject.getDouble("longitude")
|
|
||||||
val bearing = jsonObject.getDouble("bearing")
|
|
||||||
simulateLocation(latitude, longitude, bearing)
|
|
||||||
addEntryToLog(message, LogTypes.Normal)
|
|
||||||
} else {
|
|
||||||
Log.e(TAG, "Non an JsonObject, text: $message")
|
|
||||||
addEntryToLog("Non an JsonObject, text: $message", LogTypes.Warning)
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Log.e(TAG, e.localizedMessage, e)
|
|
||||||
addEntryToLog(e.localizedMessage, LogTypes.Error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fun addEntryToLog(message: String?, type: LogTypes) {
|
|
||||||
lastLineId += 1
|
|
||||||
logTrackerMutableList.add(
|
|
||||||
LogModel(
|
|
||||||
lastLineId,
|
|
||||||
getActualTime(),
|
|
||||||
message?:"null",
|
|
||||||
type
|
|
||||||
)
|
|
||||||
)
|
|
||||||
val newList = logTrackerMutableList.toList()
|
|
||||||
_logTracker.value = newList
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getLog(): StateFlow<List<LogModel>> {
|
|
||||||
return logTracker
|
|
||||||
}
|
|
||||||
fun getConnectionStatus(): StateFlow<ConnectionStatus> {
|
|
||||||
return connectionStatus
|
|
||||||
}
|
|
||||||
|
|
||||||
fun connectToServer(url: String){
|
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
|
||||||
try {
|
|
||||||
connectionAttemps ++
|
|
||||||
webSocketClient = WebSocketClient.getInstance()
|
|
||||||
addEntryToLog("Server Address: $url", LogTypes.NetworkOperation)
|
|
||||||
webSocketClient.setSocketUrl(url)
|
|
||||||
webSocketClient.setListener(socketListener)
|
|
||||||
webSocketClient.connect()
|
|
||||||
_connectionStatus.value = ConnectionStatus.Connected
|
|
||||||
addEntryToLog("Connection Server Success", LogTypes.NetworkOperation)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
Log.e(TAG, e.localizedMessage, e)
|
|
||||||
when (e.localizedMessage){
|
|
||||||
"Expected URL scheme 'http' or 'https' but no scheme was found for test u..." -> {
|
|
||||||
addEntryToLog("Expected ws:// or wss:// scheme, this is only for debug", LogTypes.Warning)
|
|
||||||
_connectionStatus.value = ConnectionStatus.Disconnected
|
|
||||||
}
|
|
||||||
else -> {
|
|
||||||
if (connectionAttemps < 6){
|
|
||||||
addEntryToLog("Attemp: $connectionAttemps \nError:${e.localizedMessage}", LogTypes.Warning)
|
|
||||||
_connectionStatus.value = ConnectionStatus.OnReconnect
|
|
||||||
Handler(Looper.getMainLooper()).postDelayed({
|
|
||||||
connectToServer(url)
|
|
||||||
}, 1500)
|
|
||||||
} else {
|
|
||||||
addEntryToLog("Exceed Connection Attemps", LogTypes.Error)
|
|
||||||
connectionAttemps = -1
|
|
||||||
_connectionStatus.value = ConnectionStatus.Awaiting
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onBind(intent: Intent): IBinder {
|
|
||||||
return binder
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private fun simulateLocation(latitude: Double, longitude: Double, bearing: Double) {
|
|
||||||
val locationManager = baseContext.getSystemService(LOCATION_SERVICE) as LocationManager
|
|
||||||
// Create a Location Object
|
|
||||||
val location = Location(LocationManager.GPS_PROVIDER)
|
|
||||||
location.latitude = latitude
|
|
||||||
location.longitude = longitude
|
|
||||||
location.accuracy = 3f
|
|
||||||
location.altitude = 0.0
|
|
||||||
location.time = System.currentTimeMillis()
|
|
||||||
location.bearing = bearing.toFloat()
|
|
||||||
location.setBearingAccuracyDegrees(0.1F)
|
|
||||||
location.setVerticalAccuracyMeters(0.1F)
|
|
||||||
location.setSpeedAccuracyMetersPerSecond(0.01F)
|
|
||||||
location.elapsedRealtimeNanos = SystemClock.elapsedRealtimeNanos()
|
|
||||||
var powerUsage = 3
|
|
||||||
var accuracy = 5
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S){
|
|
||||||
powerUsage = ProviderProperties.POWER_USAGE_LOW
|
|
||||||
accuracy = ProviderProperties.ACCURACY_COARSE
|
|
||||||
}
|
|
||||||
//Create Test Provider
|
|
||||||
locationManager.addTestProvider(
|
|
||||||
LocationManager.GPS_PROVIDER,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
powerUsage,
|
|
||||||
accuracy
|
|
||||||
)
|
|
||||||
// Enable Mock Provider
|
|
||||||
locationManager.setTestProviderEnabled(LocationManager.GPS_PROVIDER, true)
|
|
||||||
|
|
||||||
// Mock Location on System
|
|
||||||
locationManager.setTestProviderLocation(LocationManager.GPS_PROVIDER, location)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun stopByActivity() {
|
|
||||||
webSocketClient.disconnect()
|
|
||||||
_connectionStatus.value = ConnectionStatus.Disconnected
|
|
||||||
addEntryToLog("Connection Stopped", LogTypes.NetworkOperation)
|
|
||||||
val locationManager = baseContext.getSystemService(LOCATION_SERVICE) as LocationManager
|
|
||||||
locationManager.removeTestProvider(LocationManager.GPS_PROVIDER)
|
|
||||||
addEntryToLog("MockLocation Stopped", LogTypes.Warning)
|
|
||||||
this.stopSelf()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
super.onCreate()
|
|
||||||
val manager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
|
||||||
createNotificationChannel(manager)
|
|
||||||
CoroutineScope(Dispatchers.Default).launch{
|
|
||||||
notifyStatusByPushNotification()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
|
||||||
val notification = getStartedServiceNotification(this)
|
|
||||||
startForeground(5142, notification)
|
|
||||||
return START_STICKY
|
|
||||||
}
|
|
||||||
|
|
||||||
private suspend fun notifyStatusByPushNotification(){
|
|
||||||
getConnectionStatus().collectLatest { status ->
|
|
||||||
when(status){
|
|
||||||
ConnectionStatus.Awaiting -> {
|
|
||||||
val notification = getNeedReconnectNotification(this)
|
|
||||||
val manager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
|
||||||
manager.notify(5142, notification)
|
|
||||||
}
|
|
||||||
ConnectionStatus.Connected -> {
|
|
||||||
val notification = getRunningNotification(this)
|
|
||||||
val manager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
|
||||||
manager.notify(5142, notification)
|
|
||||||
}
|
|
||||||
ConnectionStatus.Disconnected -> {
|
|
||||||
val notification = getMockLocationStoppedNotification(this)
|
|
||||||
val manager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
|
||||||
manager.notify(5142, notification)
|
|
||||||
}
|
|
||||||
else -> {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroy() {
|
|
||||||
super.onDestroy()
|
|
||||||
val notification = getServiceDestroyedNotification(this)
|
|
||||||
val manager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
|
||||||
manager.notify(5142, notification)
|
|
||||||
Log.e(TAG, "Service destroyed")
|
|
||||||
}
|
|
||||||
|
|
||||||
inner class LocationMockBinder: Binder(){
|
|
||||||
fun getService() = this@LocationSimulationService
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user