mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Compare commits
394 Commits
v0.4.13-al
...
v1-archive
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
182fe294de | ||
|
|
95db9b5d38 | ||
|
|
a6e28e9064 | ||
|
|
116d4fa894 | ||
|
|
8b5df691ec | ||
|
|
f00fce7fe7 | ||
|
|
6bb150a41c | ||
|
|
2cadebcabd | ||
|
|
b61289d996 | ||
|
|
89051c3e85 | ||
|
|
064c24e023 | ||
|
|
e273203629 | ||
|
|
17b10bebd5 | ||
|
|
5e5ee30b8f | ||
|
|
5cd566c7ca | ||
|
|
119a6f620c | ||
|
|
3e22247f76 | ||
|
|
854bef15e0 | ||
|
|
aacf6d99bc | ||
|
|
a8595a97d8 | ||
|
|
c630fe3045 | ||
|
|
05c7d8166b | ||
|
|
1d3d8ca705 | ||
|
|
97a11d6873 | ||
|
|
15e23564c2 | ||
|
|
42782c60a4 | ||
|
|
62b2b13d75 | ||
|
|
8bf2048d4d | ||
|
|
0fee5c8e7f | ||
|
|
b5e47fdbe6 | ||
|
|
c85e923899 | ||
|
|
a897401975 | ||
|
|
2f43a84224 | ||
|
|
274c16851e | ||
|
|
e77356cb61 | ||
|
|
f4e77b1f5b | ||
|
|
95247062a3 | ||
|
|
959b083a60 | ||
|
|
395409ecae | ||
|
|
5a2b050104 | ||
|
|
732b837a46 | ||
|
|
d60d2e78ef | ||
|
|
a15d2e2ec7 | ||
|
|
df1839cee0 | ||
|
|
1b4d3dd832 | ||
|
|
0e414850bd | ||
|
|
40e984982b | ||
|
|
d7c278b034 | ||
|
|
4e679344d0 | ||
|
|
b0ab0ae8cf | ||
|
|
6edcd8a5ce | ||
|
|
aa0cca67a1 | ||
|
|
c477dcd065 | ||
|
|
6db4455d5a | ||
|
|
54bf19d410 | ||
|
|
52833cadee | ||
|
|
6a45bc9e79 | ||
|
|
88d17d1cb3 | ||
|
|
8c27fdb53c | ||
|
|
e7777a2a48 | ||
|
|
fa4a0ccecb | ||
|
|
b54aa45377 | ||
|
|
eecdcad8e7 | ||
|
|
d68ac6cf2b | ||
|
|
e39b6b5eea | ||
|
|
4eb1b3ef6d | ||
|
|
4204a4b150 | ||
|
|
b64d336922 | ||
|
|
19c1ae82a2 | ||
|
|
61dc9c8b31 | ||
|
|
d078105eb7 | ||
|
|
7ee9946f49 | ||
|
|
5507bca68d | ||
|
|
535b95242c | ||
|
|
e40b79d2c4 | ||
|
|
ecd0581942 | ||
|
|
4f7c3988a0 | ||
|
|
5b7e63b02d | ||
|
|
ef99c21380 | ||
|
|
e0ad679b57 | ||
|
|
61fb80d67f | ||
|
|
a9a0332465 | ||
|
|
4494a5ccbb | ||
|
|
f0c4b10084 | ||
|
|
0bdf362174 | ||
|
|
a53cca8dda | ||
|
|
9aad81588a | ||
|
|
5ba1498802 | ||
|
|
539b183da8 | ||
|
|
396c061a3e | ||
|
|
8c7f6abb1c | ||
|
|
5cc42dd9cf | ||
|
|
f52b5f419e | ||
|
|
3b38ca5920 | ||
|
|
86cfb4fb2f | ||
|
|
166631d618 | ||
|
|
013546a45b | ||
|
|
a2c8563adf | ||
|
|
0c8de2dcf3 | ||
|
|
4f3491062b | ||
|
|
cc8c25a283 | ||
|
|
70740233a9 | ||
|
|
f2d4f0b0ca | ||
|
|
153ca01b96 | ||
|
|
f667410a56 | ||
|
|
f13545eae9 | ||
|
|
7ee24b1c7c | ||
|
|
29784310fc | ||
|
|
3427fcea7e | ||
|
|
c99b5ed19f | ||
|
|
2118ded496 | ||
|
|
4401261446 | ||
|
|
a6ec3a8cd0 | ||
|
|
6e6da64c51 | ||
|
|
a84e190548 | ||
|
|
e0238c2680 | ||
|
|
a60f2e7b62 | ||
|
|
4782596e3c | ||
|
|
832568aa00 | ||
|
|
05e0cc393a | ||
|
|
c74258e3ad | ||
|
|
2e1c3ec4b9 | ||
|
|
9a571132c8 | ||
|
|
acb55044d1 | ||
|
|
14679bd7d8 | ||
|
|
3c9af59051 | ||
|
|
8390a25c50 | ||
|
|
97b277edda | ||
|
|
462fa53c80 | ||
|
|
945c45803b | ||
|
|
20917da437 | ||
|
|
cd25509d3d | ||
|
|
4c3f80d7d7 | ||
|
|
fac32476d4 | ||
|
|
3fa88f3cdf | ||
|
|
46135f7ae0 | ||
|
|
f6e9503045 | ||
|
|
39c28ffb04 | ||
|
|
6373fd300d | ||
|
|
04f281db56 | ||
|
|
5f2fb60e1f | ||
|
|
4efd48c4b9 | ||
|
|
fb6ac40af8 | ||
|
|
9daa683b42 | ||
|
|
baffc9af49 | ||
|
|
bc6c70928f | ||
|
|
9e1503c106 | ||
|
|
57a700d2d2 | ||
|
|
5ca6c97cbe | ||
|
|
55f3bd5adb | ||
|
|
bf7c4beccd | ||
|
|
14d44babe7 | ||
|
|
30a90a96d8 | ||
|
|
c621b5dd85 | ||
|
|
63bdf44e17 | ||
|
|
029decf969 | ||
|
|
b5c7eaf36e | ||
|
|
99de17a858 | ||
|
|
5765ade7f8 | ||
|
|
59a8fba14d | ||
|
|
965b67b8ab | ||
|
|
0ef3abbffa | ||
|
|
2124e9cd42 | ||
|
|
2f1a0ad7d3 | ||
|
|
24e6c219f5 | ||
|
|
daec6dab5b | ||
|
|
3708d4150c | ||
|
|
11518485de | ||
|
|
29118e1ea1 | ||
|
|
aa5b62c1d2 | ||
|
|
f320cb122c | ||
|
|
bb7738724f | ||
|
|
df7eebed39 | ||
|
|
21040da195 | ||
|
|
be625fdca9 | ||
|
|
7ee3fb883b | ||
|
|
c2f6edfd74 | ||
|
|
4f5023b45c | ||
|
|
f0ab43d320 | ||
|
|
d2e803ab82 | ||
|
|
ca45b8b906 | ||
|
|
ec020f7b5d | ||
|
|
f2161da162 | ||
|
|
613aed2d2b | ||
|
|
1d38bd6fea | ||
|
|
6f7b251094 | ||
|
|
a9d873a05f | ||
|
|
05f98b2738 | ||
|
|
1568c65492 | ||
|
|
4a5c4ed7d7 | ||
|
|
ff7385cf49 | ||
|
|
a0de159234 | ||
|
|
d56a95cfa3 | ||
|
|
497f718e4b | ||
|
|
9942ff476b | ||
|
|
c042d2b6f5 | ||
|
|
b9201d583c | ||
|
|
3f67125f20 | ||
|
|
4f72f10642 | ||
|
|
89fb0a9da1 | ||
|
|
0e9b249bba | ||
|
|
0f0ba4c725 | ||
|
|
5542109daf | ||
|
|
ec91b597c8 | ||
|
|
d0f85ae977 | ||
|
|
7d6930fba9 | ||
|
|
2232a114b7 | ||
|
|
33ce537993 | ||
|
|
1ab8e9a16f | ||
|
|
73b1714191 | ||
|
|
cb793e9d0f | ||
|
|
7686a60bfd | ||
|
|
38027b6ff3 | ||
|
|
a512b0e405 | ||
|
|
46fb6a98d5 | ||
|
|
1a8a19ae5c | ||
|
|
8865ded4bd | ||
|
|
7adfe9cce4 | ||
|
|
85e5a6a309 | ||
|
|
d681d3cee0 | ||
|
|
c5650ba29a | ||
|
|
ef0a2d2ddc | ||
|
|
f143e8d874 | ||
|
|
89c1660988 | ||
|
|
4e7c8ef856 | ||
|
|
8024db9579 | ||
|
|
a0634a7f99 | ||
|
|
7bf6c1bb23 | ||
|
|
a62ae4e21e | ||
|
|
6c466a8bb8 | ||
|
|
36f828acb1 | ||
|
|
046e096b9e | ||
|
|
82df3cb316 | ||
|
|
1ba16f82e7 | ||
|
|
72c6bb0086 | ||
|
|
8bb4334187 | ||
|
|
59a9069d4b | ||
|
|
ba534f1786 | ||
|
|
72bb54bde0 | ||
|
|
cb3f46303c | ||
|
|
57f021f995 | ||
|
|
bf4b2272e4 | ||
|
|
31999ec00c | ||
|
|
086b6736b0 | ||
|
|
bf93b8e90a | ||
|
|
4d6bd6c6e9 | ||
|
|
c9dc5eb2f5 | ||
|
|
5fdb704d68 | ||
|
|
6d18e25232 | ||
|
|
7391006a2f | ||
|
|
9207585f5b | ||
|
|
cb53da3a71 | ||
|
|
d2ac5aeff8 | ||
|
|
b646087026 | ||
|
|
82e60cd2cf | ||
|
|
9d46a1c73f | ||
|
|
955057183d | ||
|
|
0396d6bf9c | ||
|
|
ee1d89007c | ||
|
|
4245927a6c | ||
|
|
f585828936 | ||
|
|
7450c9e506 | ||
|
|
d957cd6655 | ||
|
|
ef91f840ae | ||
|
|
17c74fbe91 | ||
|
|
17a7a1889e | ||
|
|
24ed96b348 | ||
|
|
15e8c9e791 | ||
|
|
de14f6c738 | ||
|
|
92b1a46e8a | ||
|
|
cbaadb6fc9 | ||
|
|
44295673dc | ||
|
|
8bf0f403e2 | ||
|
|
917a0d10e5 | ||
|
|
9c65411733 | ||
|
|
6c315d89e1 | ||
|
|
b5f1a459c2 | ||
|
|
6b12000979 | ||
|
|
1aec7f8081 | ||
|
|
5f0e96e2e6 | ||
|
|
678a8585a9 | ||
|
|
e632e379b6 | ||
|
|
1a7d2b5028 | ||
|
|
ce28d49510 | ||
|
|
0ac632cc9b | ||
|
|
47e4757b6e | ||
|
|
d21ee2a7b6 | ||
|
|
0cec61afea | ||
|
|
ff04364178 | ||
|
|
0cf2733d55 | ||
|
|
f5319ed654 | ||
|
|
cfef9f4bc4 | ||
|
|
6abf7f059a | ||
|
|
c0c1ff6e17 | ||
|
|
856dba83a5 | ||
|
|
2f37916595 | ||
|
|
f36a29570b | ||
|
|
62a3719163 | ||
|
|
e9511e9233 | ||
|
|
51cf15b8cc | ||
|
|
278d0bdd3c | ||
|
|
0a07f85fcf | ||
|
|
7face05e12 | ||
|
|
22ad5d5972 | ||
|
|
2e194d557a | ||
|
|
1a76df2056 | ||
|
|
787bf13f3c | ||
|
|
10f1c6a862 | ||
|
|
0366cc38e2 | ||
|
|
603018d1ef | ||
|
|
66ae06056b | ||
|
|
17486ab40c | ||
|
|
6cae91b06f | ||
|
|
9c055e0d71 | ||
|
|
db4aeca47d | ||
|
|
c29a368e5a | ||
|
|
dbe2442bb7 | ||
|
|
2108fc4b26 | ||
|
|
48f962ca4b | ||
|
|
e80a5e8ca1 | ||
|
|
fb2ecc75eb | ||
|
|
ee95291418 | ||
|
|
46796fce13 | ||
|
|
ee08f57abe | ||
|
|
eb86d8dfca | ||
|
|
c75e20e58f | ||
|
|
2c403a9283 | ||
|
|
27c78d6a67 | ||
|
|
e0d33760e0 | ||
|
|
2d339d7161 | ||
|
|
243f58ecf3 | ||
|
|
378dbfc085 | ||
|
|
cee6839b5d | ||
|
|
f1a836c222 | ||
|
|
cbf4b56ecb | ||
|
|
e2e3da6a0f | ||
|
|
3a96808aa5 | ||
|
|
d1ccccae18 | ||
|
|
d31242124f | ||
|
|
8c4996f466 | ||
|
|
59b89dc638 | ||
|
|
f54ac5c3d8 | ||
|
|
666b3e0383 | ||
|
|
d8893e21a1 | ||
|
|
5391b567b9 | ||
|
|
ad7ea014f2 | ||
|
|
ceb00a239f | ||
|
|
81ab1aa05d | ||
|
|
7bf232f146 | ||
|
|
3f07271931 | ||
|
|
1c30bb006b | ||
|
|
34594ac836 | ||
|
|
cee58800e1 | ||
|
|
ab3b487024 | ||
|
|
91b393eb35 | ||
|
|
edb4ddc287 | ||
|
|
f9fd5caa9f | ||
|
|
d5653a9b1d | ||
|
|
ec5ff1bf0c | ||
|
|
41912d1057 | ||
|
|
228452fd17 | ||
|
|
484d3dd28f | ||
|
|
a52e7e7b1a | ||
|
|
92a08f6278 | ||
|
|
8e3da65433 | ||
|
|
3f625c03b9 | ||
|
|
4423d5f3d5 | ||
|
|
d0fc286c43 | ||
|
|
b5443ab0a8 | ||
|
|
e6c34306c9 | ||
|
|
532a83fe91 | ||
|
|
293b928764 | ||
|
|
38d62df75d | ||
|
|
fbd42ade6e | ||
|
|
9af1cffe08 | ||
|
|
b0d92906e5 | ||
|
|
0329e27713 | ||
|
|
2d39862b1b | ||
|
|
5c1782ec7f | ||
|
|
6c6117aee3 | ||
|
|
1798e62315 | ||
|
|
2b2ed76aa3 | ||
|
|
38d72a5cd0 | ||
|
|
14ec4a8610 | ||
|
|
bdc7a5bb46 | ||
|
|
131f30405c | ||
|
|
dbf21e0af9 | ||
|
|
9094f8fdc6 | ||
|
|
aa0b0a585c | ||
|
|
ad61037452 | ||
|
|
66ed1a99e0 | ||
|
|
d7dc5769a8 | ||
|
|
b0ee653bff | ||
|
|
5a950e22ce |
45
.github/workflows/build_package.yml
vendored
Normal file
45
.github/workflows/build_package.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Build & package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "release-candidate" ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Add MSBuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1.0.2
|
||||
|
||||
- name: Setup vcpkg
|
||||
run: |
|
||||
bootstrap-vcpkg
|
||||
vcpkg integrate install
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
|
||||
- name: Build
|
||||
working-directory: .
|
||||
run: "./build_package.bat"
|
||||
shell: cmd
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v3.1.3
|
||||
with:
|
||||
name: development_build_not_a_release
|
||||
path: ./package
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v3.1.3
|
||||
with:
|
||||
name: zip_only_package
|
||||
path: ./zip
|
||||
|
||||
|
||||
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
@@ -1,33 +0,0 @@
|
||||
# ci.yml file for GitHub Actions
|
||||
name: CI
|
||||
|
||||
on: [push]
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
build_docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: ./client
|
||||
|
||||
- name: Create the docs directory locally in CI
|
||||
run: npx typedoc --out ../docs/client @types/*.d.ts src/**/*.ts
|
||||
working-directory: ./client
|
||||
|
||||
- name: Deploy 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
with:
|
||||
folder: docs
|
||||
49
.gitignore
vendored
49
.gitignore
vendored
@@ -1,21 +1,42 @@
|
||||
bin
|
||||
/scripts/old
|
||||
/scripts/python/configurator/dist
|
||||
/scripts/python/configurator/build
|
||||
/scripts/python/configurator/venv
|
||||
.vs
|
||||
x64
|
||||
core.user
|
||||
core.vcxproj.user
|
||||
*.user
|
||||
Output
|
||||
node_modules
|
||||
/client/TODO.txt
|
||||
/client/public/javascripts/bundle.js
|
||||
!client/bin
|
||||
/client/public/plugins
|
||||
/client/plugins/controltips/index.js
|
||||
hgt
|
||||
/client/public/databases/units/old
|
||||
/client/plugins/databasemanager/index.js
|
||||
|
||||
/backend/vcpkg_installed
|
||||
|
||||
/frontend/server/TODO.txt
|
||||
/frontend/server/public/javascripts/bundle.js
|
||||
/frontend/server/public/plugins
|
||||
/frontend/server/plugins/controltips/index.js
|
||||
/frontend/server/public/databases/units/old
|
||||
/frontend/server/plugins/databasemanager/index.js
|
||||
|
||||
/src/html
|
||||
/src/latex
|
||||
|
||||
/package
|
||||
/build
|
||||
/DCS Olympus backups
|
||||
/zip
|
||||
|
||||
*.user
|
||||
*.aps
|
||||
|
||||
L.Path.Drag.js
|
||||
leaflet-gesture-handling.css
|
||||
leaflet.nauticscale.js
|
||||
leaflet.css
|
||||
package-lock.json
|
||||
|
||||
!frontend/server/bin
|
||||
/mock-dcs
|
||||
/frontend/setup
|
||||
frontend/server/public/plugins/controltipsplugin/index.js
|
||||
frontend/website/plugins/controltips/index.js
|
||||
/frontend/server/public/maps
|
||||
*.pyc
|
||||
/scripts/**/*.jpg
|
||||
manager/manager.log
|
||||
|
||||
BIN
DCS Olympus Manager.lnk
Normal file
BIN
DCS Olympus Manager.lnk
Normal file
Binary file not shown.
59
INSTRUCTIONS.txt
Normal file
59
INSTRUCTIONS.txt
Normal file
@@ -0,0 +1,59 @@
|
||||
_____ _____ _____ ____ _
|
||||
| __ \ / ____|/ ____| / __ \| |
|
||||
| | | | | | (___ | | | | |_ _ _ __ ___ _ __ _ _ ___
|
||||
| | | | | \___ \ | | | | | | | | '_ ` _ \| '_ \| | | / __|
|
||||
| |__| | |____ ____) | | |__| | | |_| | | | | | | |_) | |_| \__ \
|
||||
|_____/ \_____|_____/ \____/|_|\__, |_| |_| |_| .__/ \__,_|___/
|
||||
__/ | | |
|
||||
|___/ |_|
|
||||
|
||||
{{OLYMPUS_VERSION_NUMBER}}
|
||||
|
||||
==========================================
|
||||
INSTALLATION INSTRUCTIONS
|
||||
|
||||
1) Close any applications which may interfere with installation, including Digital Combat Simulator (DCS) and previous versions of Olympus.
|
||||
|
||||
2) If you DO NOT have Olympus already installed, SKIP THIS STEP. If you have already installed Olympus, do the following:
|
||||
NOTE: If you made any changes to your unit databases or mods.lua file (e.g. to support a third party mod) make a backup of the edited files before proceeding or changes will be lost;
|
||||
a) If you installed DCS Olympus v1.0.3 using the installer, simply remove it using Windows's "Add or remove programs" application.
|
||||
b) If you installed DCS Olympus v1.0.3 using the archived version, remove it by deleting the "...<DCS Saved Games folder>\Mods\Services\Olympus" folder. Do this for every DCS instance you installed Olympus in.
|
||||
Remember to delete any shortcuts you created. Don't worry, they will be created automatically again by the installation script provided in this package.
|
||||
|
||||
3) Create a folder named "DCS Olympus" in your "Saved Games" directory and extract all the contents of the downloaded package into it.
|
||||
NOTE:
|
||||
a) Do not extract the contents of the package directly in your Saved Games folder or in your DCS Saved Games folder.
|
||||
b) Unlike previous version of Olympus, it is no longer necessary to copy the packaged files into each DCS instance folder.
|
||||
|
||||
4) Execute the "installer.bat" script by double-clicking on it. It is located in the folder you created in step 3. Wait for the installation script to complete. Installation may take a couple of minutes, after which the Manager will start automatically.
|
||||
NOTE: depending on your Windows configuration, the script may be called "installer" (without .bat at the end).
|
||||
|
||||
5) The Olympus Manager will open. This will allow you to add/remove Olympus to individual DCS instances.
|
||||
Use the Olympus Manager and follow the instructions to install and setup Olympus.
|
||||
|
||||
6) Start DCS and run a mission. Make sure it is UNPAUSED.
|
||||
|
||||
7) Open Olympus via the shortcut and login using any username and the Game Master password set using the Manager. (NOTE: not your DCS server password).
|
||||
Local installation: run the client from the provided desktop shortcut or start it using the "View and manage instances" page of the Manager.
|
||||
Dedicated server: users must first start the Olympus server from the provided desktop shortcut or using the "View and manage instances" page of the Manager.
|
||||
Then log in using any browser and visiting "http:\\<server IP>:<frontend port>" (frontend port is 3000 by default, but can be edited using the Manager)
|
||||
|
||||
8) You can use the manager at any time to change the ports and/or passwords. If you do, REMEMBER TO RESTART OLYMPUS AND DCS.
|
||||
|
||||
|
||||
NOTES:
|
||||
a) when launching the Manager you will be prompted to allow Electron to create a firewall rule. This is optional and can be denied without effect on the operation of the Manager;
|
||||
b) if you are using Olympus on a dedicated server with a router, you must enable port forwarding on the frontend port (3000 by default);
|
||||
c) unlike Olympus v1.0.3, running the netsh command is no longer required. It is also no longer required to create firewall rules or port forwarding for the backend port. (Optional) If you already performed this steps in the past you can delete the firewall and netsh rules.
|
||||
|
||||
|
||||
==========================================
|
||||
UPDATING INSTRUCTIONS
|
||||
|
||||
IF YOU ARE UPDATING FROM DCS OLYMPUS v1.0.3, FOLLOW THE "INSTALLATION INSTRUCTIONS".
|
||||
|
||||
To update your Olympus installation you have two options:
|
||||
a) download the new package from the GitHub releases page, delete the old unpacked package folder, then follow the INSTALLATION INSTRUCTIONS;
|
||||
b) run the Olympus Manager. If an update is available you will be given the option to automatically update Olympus from there.
|
||||
|
||||
For either options a) or b), remember to close any applications which may interfere with installation, including Digital Combat Simulator (DCS) and previous versions of Olympus.
|
||||
47
README.md
47
README.md
@@ -1,9 +1,13 @@
|
||||
# Important note: DCS Olympus is in alpha state. No official release has been produced yet. The first public version is planned for mid december 2023.
|
||||
<img align="left" width="30" src="https://github.com/Pax1601/DCSOlympus/assets/103559271/0ecff279-a87c-4e2d-a4c7-da98c74adf38">
|
||||
|
||||
[**Join our Discord**](https://discord.gg/kNAQkhUHnQ)
|
||||
|
||||
<img align="left" width="30" src="https://github.com/Pax1601/DCSOlympus/assets/103559271/1c0dd3fd-339c-4b03-94da-3e5215b0358a">
|
||||
|
||||
[**YouTube**](https://www.youtube.com/@DCSOlympus)
|
||||
|
||||
|
||||
# DCS Olympus
|
||||
*A real-time web interface to spawn and control units in DCS World*
|
||||
|
||||

|
||||
|
||||
### What is this?
|
||||
DCS: Olympus is a free and open-source mod for DCS that enables dynamic real-time control through a map interface. The user is able to spawn units/groups, deploy a variety of effects such as smoke, flares, or explosions, and waypoints/tasks can be given to AI units in real-time in a way similar to a classic RTS game.
|
||||
@@ -17,18 +21,30 @@ Even better it requires no client mods be installed if used on a server
|
||||
The full feature list is simply too long to enumerate in a short summary but needless to say Olympus offers up a lot of unique gameplay that has previously not existed, and enhances many other elements of DCS in exciting ways
|
||||
|
||||
### Installing DCS Olympus
|
||||
A prebuilt installer will soon be released and available here
|
||||
Check the [Wiki](https://github.com/Pax1601/DCSOlympus/wiki) for installation instructions
|
||||
|
||||
# Frequently Asked Questions
|
||||
### Can I join up and help out with the project? ###
|
||||
We are currently running towards first release in the very near future so we are not looking to add more people to the core team for the moment. However that does not mean we are not open to collaborations and help going forward, if you want to help for now we are committed to the free and open source model so feel free to check out the github, familiarize yourself with the project and maybe even start submitting pull requests for open issues.
|
||||
|
||||
Post-release we will be more interested in developing partnerships/collaborations with other teams/projects and potentially bringing in more team members, we will update this after release on how that will be managed!
|
||||
### I need troubleshooting guidance, please help? ###
|
||||
Read through the [Installation Guide](https://github.com/Pax1601/DCSOlympus/wiki) to ensure you have setup Olympus correctly.
|
||||
|
||||
Read through [Setup Troubleshooting](https://github.com/Pax1601/DCSOlympus/wiki/Setup-Troubleshooting) for common issues and solutions.
|
||||
|
||||
Read through the [Olympus User Guide](https://github.com/Pax1601/DCSOlympus/wiki/2.-User-Guide) to learn how to use Olympus.
|
||||
|
||||
If you're still having issues after trying the steps above, please post in the community-support channel with the following:
|
||||
|
||||
A detailed description of your issue
|
||||
Your Olympus log file \user home folder\AppData\Local\Temp\Olympus_log.txt for some it might be in \DCS Saved Games folder\Logs\Olympus_log.txt
|
||||
Your DCS log file \DCS Saved Games folder\Logs\dcs.log
|
||||
|
||||
Screenshots of any relevant screens or issues and any other pertinent information.
|
||||
|
||||
### Can I join up and help out with the project? ###
|
||||
Absolutely, join the discord and ping any of the developers to get briefed.
|
||||
|
||||
### Can I be a beta/alpha-tester? ###
|
||||
With first public release planned for the very-near future we are fully committed to the final sprint, as such we will not be formally recruiting more people to test pre-release.
|
||||
|
||||
Post-release we will be eager to hear feedback of all forms and take in bug-reports, at this time after release we will begin considering bringing in more team members to test in development versions as we go.
|
||||
Same as above!
|
||||
|
||||
### Do you have a roadmap? ###
|
||||
We do not have a roadmap no, we have a laundry list of things we are hoping to do.
|
||||
@@ -44,8 +60,7 @@ However we cannot commit to specific features, feature release order, or timelin
|
||||
|
||||
### Does Olympus support mods? ###
|
||||
Generally OIympus will not have any issues with other mods, however you may need to tell olympus about modded units in order to be able to dynamically spawn them etc
|
||||
|
||||
Keep in mind that any mods you do choose to spawn your players will need to have, some mod unit just appear as a su27 or leo2 etc. when a player is missing them, others can cause client crashes. So be smart about how you use them
|
||||
Keep in mind that any mods you do choose to spawn your players will need to have, some mod unit just appear as a su27 or leo2 etc. When a player is missing them, others can cause client crashes. So be smart about how you use them.
|
||||
|
||||
### Is Olympus compatible with mission scripts? ###
|
||||
We have tried hard to keep Olympus from interfering with other scripts, we have tested with a variety of new and old mission scripts and generally expect it will not be an issue.
|
||||
@@ -54,9 +69,7 @@ However we cannot foresee everything people come up with so we suggest testing w
|
||||
|
||||
### How does it work? ###
|
||||
The quick answer is magic.
|
||||
|
||||
The long answer is well all the code is there for you to read.
|
||||
|
||||
The middle answer is a bit like SRS does. Olympus consists of two parts.
|
||||
|
||||
(A) Olympus back end: A dll, run by DCS, that sends data out and gets commands in via a REST API;
|
||||
@@ -68,9 +81,5 @@ A and B never communicate when you connect the client you download the web page
|
||||
Olympus by itself should not have a noticeable impact on server performance, however the ability for the user to spawn arbitrary units and command engagements means Olympus can be used in such a way that brings the game to it's knees.
|
||||
|
||||
Be cognizant of how you play, whether it's done through Olympus or the mission editor 500 MLRS units firing at once is not going to go over well with most servers
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
12
backend/DCSOlympus.props
Normal file
12
backend/DCSOlympus.props
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Label="Vcpkg">
|
||||
<VcpkgEnableManifest>true</VcpkgEnableManifest>
|
||||
<VcpkgAutoLink>true</VcpkgAutoLink>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup />
|
||||
<ItemGroup />
|
||||
</Project>
|
||||
110
backend/core/core.rc
Normal file
110
backend/core/core.rc
Normal file
@@ -0,0 +1,110 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Italian (Italy) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA)
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
|
||||
#pragma code_page(1252)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Italian (Italy) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (United Kingdom) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,4,0
|
||||
PRODUCTVERSION 1,0,3,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "DCS Olympus"
|
||||
VALUE "FileDescription", "DCS Olympus"
|
||||
VALUE "FileVersion", "1.0.4.0"
|
||||
VALUE "InternalName", "core.dll"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2023"
|
||||
VALUE "OriginalFilename", "core.dll"
|
||||
VALUE "ProductName", "DCS Olympus"
|
||||
VALUE "ProductVersion", "1.0.4.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (United Kingdom) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
<ClInclude Include="include\unitsmanager.h" />
|
||||
<ClInclude Include="include\weapon.h" />
|
||||
<ClInclude Include="include\weaponsmanager.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\aircraft.cpp" />
|
||||
@@ -65,6 +66,9 @@
|
||||
<ClCompile Include="src\weapon.cpp" />
|
||||
<ClCompile Include="src\weaponsmanager.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="core.rc" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
@@ -106,22 +110,26 @@
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>.\..\..\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>.\..\..\bin\</OutDir>
|
||||
<OutDir>.\..\..\build\backend\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
@@ -174,6 +182,7 @@
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>lua.lib; GeographicLib-i.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\third-party\lua</AdditionalLibraryDirectories>
|
||||
<Version>{{OLYMPUS_VERSION_NUMBER}}.{{OLYMPUS_COMMIT_HASH}}</Version>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
@@ -51,6 +51,7 @@
|
||||
<ClInclude Include="include\weaponsmanager.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\aircraft.cpp">
|
||||
@@ -99,4 +100,7 @@
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="core.rc" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -13,6 +13,7 @@ namespace DataIndex {
|
||||
country,
|
||||
name,
|
||||
unitName,
|
||||
callsign,
|
||||
groupName,
|
||||
state,
|
||||
task,
|
||||
@@ -152,6 +153,7 @@ struct SpawnOptions {
|
||||
string unitType;
|
||||
Coords location;
|
||||
string loadout;
|
||||
string skill;
|
||||
string liveryID;
|
||||
};
|
||||
|
||||
@@ -19,12 +19,12 @@ public:
|
||||
~Unit();
|
||||
|
||||
/********** Methods **********/
|
||||
void initialize(json::value json);
|
||||
virtual void initialize(json::value json) final;
|
||||
virtual void setDefaults(bool force = false);
|
||||
|
||||
void runAILoop();
|
||||
|
||||
void update(json::value json, double dt);
|
||||
virtual void update(json::value json, double dt) final;
|
||||
void refreshLeaderData(unsigned long long time);
|
||||
|
||||
unsigned int getID() { return ID; }
|
||||
@@ -71,6 +71,7 @@ public:
|
||||
virtual void setCountry(unsigned char newValue) { updateValue(country, newValue, DataIndex::country); }
|
||||
virtual void setName(string newValue) { updateValue(name, newValue, DataIndex::name); }
|
||||
virtual void setUnitName(string newValue) { updateValue(unitName, newValue, DataIndex::unitName); }
|
||||
virtual void setCallsign(string newValue) { updateValue(callsign, newValue, DataIndex::callsign); }
|
||||
virtual void setGroupName(string newValue) { updateValue(groupName, newValue, DataIndex::groupName); }
|
||||
virtual void setState(unsigned char newValue) { updateValue(state, newValue, DataIndex::state); };
|
||||
virtual void setTask(string newValue) { updateValue(task, newValue, DataIndex::task); }
|
||||
@@ -117,6 +118,7 @@ public:
|
||||
virtual unsigned char getCoalition() { return coalition; }
|
||||
virtual unsigned char getCountry() { return country; }
|
||||
virtual string getName() { return name; }
|
||||
virtual string getCallsign() { return callsign; }
|
||||
virtual string getUnitName() { return unitName; }
|
||||
virtual string getGroupName() { return groupName; }
|
||||
virtual unsigned char getState() { return state; }
|
||||
@@ -167,6 +169,7 @@ protected:
|
||||
unsigned char country = NULL;
|
||||
string name = "";
|
||||
string unitName = "";
|
||||
string callsign = "";
|
||||
string groupName = "";
|
||||
unsigned char state = State::NONE;
|
||||
string task = "";
|
||||
14
backend/core/resource.h
Normal file
14
backend/core/resource.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by core.rc
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@@ -40,6 +40,8 @@ void AirUnit::setDefaults(bool force)
|
||||
|
||||
void AirUnit::setState(unsigned char newState)
|
||||
{
|
||||
Coords currentTargetPosition = getTargetPosition();
|
||||
|
||||
/************ Perform any action required when LEAVING a state ************/
|
||||
if (newState != state) {
|
||||
switch (state) {
|
||||
@@ -119,19 +121,10 @@ void AirUnit::setState(unsigned char newState)
|
||||
resetActiveDestination();
|
||||
break;
|
||||
}
|
||||
case State::BOMB_POINT: {
|
||||
setEnableTaskCheckFailed(true);
|
||||
clearActivePath();
|
||||
resetActiveDestination();
|
||||
break;
|
||||
}
|
||||
case State::CARPET_BOMB: {
|
||||
setEnableTaskCheckFailed(true);
|
||||
clearActivePath();
|
||||
resetActiveDestination();
|
||||
break;
|
||||
}
|
||||
case State::BOMB_POINT:
|
||||
case State::CARPET_BOMB:
|
||||
case State::BOMB_BUILDING: {
|
||||
setTargetPosition(currentTargetPosition);
|
||||
setEnableTaskCheckFailed(true);
|
||||
clearActivePath();
|
||||
resetActiveDestination();
|
||||
@@ -159,6 +152,8 @@ void AirUnit::setState(unsigned char newState)
|
||||
|
||||
void AirUnit::AIloop()
|
||||
{
|
||||
srand(static_cast<unsigned int>(time(NULL)) + ID);
|
||||
|
||||
/* State machine */
|
||||
switch (state) {
|
||||
case State::IDLE: {
|
||||
@@ -46,7 +46,9 @@ string SpawnGroundUnits::getString()
|
||||
<< "unitType = " << "\"" << spawnOptions[i].unitType << "\"" << ", "
|
||||
<< "lat = " << spawnOptions[i].location.lat << ", "
|
||||
<< "lng = " << spawnOptions[i].location.lng << ", "
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << " }, ";
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
|
||||
|
||||
}
|
||||
|
||||
std::ostringstream commandSS;
|
||||
@@ -70,7 +72,8 @@ string SpawnNavyUnits::getString()
|
||||
<< "unitType = " << "\"" << spawnOptions[i].unitType << "\"" << ", "
|
||||
<< "lat = " << spawnOptions[i].location.lat << ", "
|
||||
<< "lng = " << spawnOptions[i].location.lng << ", "
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << " }, ";
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
|
||||
}
|
||||
|
||||
std::ostringstream commandSS;
|
||||
@@ -95,7 +98,8 @@ string SpawnAircrafts::getString()
|
||||
<< "lng = " << spawnOptions[i].location.lng << ", "
|
||||
<< "alt = " << spawnOptions[i].location.alt << ", "
|
||||
<< "loadout = \"" << spawnOptions[i].loadout << "\"" << ", "
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << " }, ";
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
|
||||
}
|
||||
|
||||
std::ostringstream commandSS;
|
||||
@@ -122,7 +126,8 @@ string SpawnHelicopters::getString()
|
||||
<< "lng = " << spawnOptions[i].location.lng << ", "
|
||||
<< "alt = " << spawnOptions[i].location.alt << ", "
|
||||
<< "loadout = \"" << spawnOptions[i].loadout << "\"" << ", "
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << " }, ";
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
|
||||
}
|
||||
|
||||
std::ostringstream commandSS;
|
||||
@@ -88,7 +88,7 @@ extern "C" DllExport int coreFrame(lua_State* L)
|
||||
frameCounter++;
|
||||
|
||||
const std::chrono::duration<double> executionDuration = std::chrono::system_clock::now() - lastExecution;
|
||||
if (executionDuration.count() > FRAMERATE_TIME_INTERVAL) {
|
||||
if (executionDuration.count() > (20 * FRAMERATE_TIME_INTERVAL)) {
|
||||
if (executionDuration.count() > 0) {
|
||||
scheduler->setFrameRate(frameCounter / executionDuration.count());
|
||||
frameCounter = 0;
|
||||
@@ -53,6 +53,8 @@ void GroundUnit::setDefaults(bool force)
|
||||
|
||||
void GroundUnit::setState(unsigned char newState)
|
||||
{
|
||||
Coords currentTargetPosition = getTargetPosition();
|
||||
|
||||
/************ Perform any action required when LEAVING a state ************/
|
||||
if (newState != state) {
|
||||
switch (state) {
|
||||
@@ -66,18 +68,9 @@ void GroundUnit::setState(unsigned char newState)
|
||||
setTargetID(NULL);
|
||||
break;
|
||||
}
|
||||
case State::FIRE_AT_AREA: {
|
||||
setTargetPosition(Coords(NULL));
|
||||
break;
|
||||
}
|
||||
case State::SIMULATE_FIRE_FIGHT: {
|
||||
setTargetPosition(Coords(NULL));
|
||||
break;
|
||||
}
|
||||
case State::SCENIC_AAA: {
|
||||
setTargetPosition(Coords(NULL));
|
||||
break;
|
||||
}
|
||||
case State::FIRE_AT_AREA:
|
||||
case State::SIMULATE_FIRE_FIGHT:
|
||||
case State::SCENIC_AAA:
|
||||
case State::MISS_ON_PURPOSE: {
|
||||
setTargetPosition(Coords(NULL));
|
||||
break;
|
||||
@@ -107,13 +100,15 @@ void GroundUnit::setState(unsigned char newState)
|
||||
break;
|
||||
}
|
||||
case State::FIRE_AT_AREA: {
|
||||
setTargetPosition(currentTargetPosition);
|
||||
setEnableTaskCheckFailed(true);
|
||||
clearActivePath();
|
||||
resetActiveDestination();
|
||||
break;
|
||||
}
|
||||
case State::SIMULATE_FIRE_FIGHT: {
|
||||
setEnableTaskCheckFailed(true);
|
||||
setTargetPosition(currentTargetPosition);
|
||||
setEnableTaskCheckFailed(false);
|
||||
clearActivePath();
|
||||
resetActiveDestination();
|
||||
break;
|
||||
@@ -147,6 +142,8 @@ void GroundUnit::setState(unsigned char newState)
|
||||
|
||||
void GroundUnit::AIloop()
|
||||
{
|
||||
srand(static_cast<unsigned int>(time(NULL)) + ID);
|
||||
|
||||
switch (state) {
|
||||
case State::IDLE: {
|
||||
setTask("Idle");
|
||||
@@ -219,7 +216,7 @@ void GroundUnit::AIloop()
|
||||
case State::SIMULATE_FIRE_FIGHT: {
|
||||
setTask("Simulating fire fight");
|
||||
|
||||
if (internalCounter == 0 && targetPosition != Coords(NULL) && scheduler->getLoad() == 0) {
|
||||
if (internalCounter == 0 && targetPosition != Coords(NULL) && scheduler->getLoad() < 30) {
|
||||
/* Get the distance and bearing to the target */
|
||||
Coords scatteredTargetPosition = targetPosition;
|
||||
double distance;
|
||||
@@ -232,10 +229,13 @@ void GroundUnit::AIloop()
|
||||
Geodesic::WGS84().Direct(scatteredTargetPosition.lat, scatteredTargetPosition.lng, bearing1 + 90, scatterDistance, scatteredTargetPosition.lat, scatteredTargetPosition.lng);
|
||||
|
||||
/* Recover the data from the database */
|
||||
double aimTime = 2; /* s */
|
||||
bool indirectFire = false;
|
||||
double shotsBaseInterval = 15; /* s */
|
||||
if (database.has_object_field(to_wstring(name))) {
|
||||
json::value databaseEntry = database[to_wstring(name)];
|
||||
if (databaseEntry.has_number_field(L"aimTime"))
|
||||
aimTime = databaseEntry[L"aimTime"].as_number().to_double();
|
||||
if (databaseEntry.has_boolean_field(L"indirectFire"))
|
||||
indirectFire = databaseEntry[L"indirectFire"].as_bool();
|
||||
if (databaseEntry.has_number_field(L"shotsBaseInterval"))
|
||||
@@ -259,7 +259,7 @@ void GroundUnit::AIloop()
|
||||
}
|
||||
|
||||
/* Wait an amout of time depending on the shots intensity */
|
||||
internalCounter = static_cast<unsigned int>(((ShotsIntensity::HIGH - shotsIntensity) * shotsBaseInterval + 2) / FRAMERATE_TIME_INTERVAL);
|
||||
internalCounter = static_cast<unsigned int>(((ShotsIntensity::HIGH - shotsIntensity) * shotsBaseInterval + aimTime) / FRAMERATE_TIME_INTERVAL);
|
||||
}
|
||||
|
||||
if (targetPosition == Coords(NULL))
|
||||
@@ -267,7 +267,7 @@ void GroundUnit::AIloop()
|
||||
|
||||
/* Fallback if something went wrong */
|
||||
if (internalCounter == 0)
|
||||
internalCounter = static_cast<unsigned int>(20 / FRAMERATE_TIME_INTERVAL);
|
||||
internalCounter = static_cast<unsigned int>(3 / FRAMERATE_TIME_INTERVAL);
|
||||
internalCounter--;
|
||||
|
||||
break;
|
||||
@@ -276,12 +276,23 @@ void GroundUnit::AIloop()
|
||||
setTask("Scenic AAA");
|
||||
|
||||
/* Only perform scenic functions when the scheduler is "free" */
|
||||
if (((!getHasTask() && scheduler->getLoad() == 0) || internalCounter == 0)) {
|
||||
if (((!getHasTask() && scheduler->getLoad() < 30) || internalCounter == 0)) {
|
||||
double distance = 0;
|
||||
unsigned char unitCoalition = coalition == 0 ? getOperateAs() : coalition;
|
||||
unsigned char targetCoalition = unitCoalition == 2 ? 1 : 2;
|
||||
Unit* target = unitsManager->getClosestUnit(this, targetCoalition, { "Aircraft", "Helicopter" }, distance);
|
||||
|
||||
/* Recover the data from the database */
|
||||
double aimTime = 2; /* s */
|
||||
double shotsBaseInterval = 15; /* s */
|
||||
if (database.has_object_field(to_wstring(name))) {
|
||||
json::value databaseEntry = database[to_wstring(name)];
|
||||
if (databaseEntry.has_number_field(L"aimTime"))
|
||||
aimTime = databaseEntry[L"aimTime"].as_number().to_double();
|
||||
if (databaseEntry.has_number_field(L"shotsBaseInterval"))
|
||||
shotsBaseInterval = databaseEntry[L"shotsBaseInterval"].as_number().to_double();
|
||||
}
|
||||
|
||||
/* Only run if an enemy air unit is closer than 20km to avoid useless load */
|
||||
if (target != nullptr && distance < 20000 /* m */) {
|
||||
double r = 15; /* m */
|
||||
@@ -298,11 +309,14 @@ void GroundUnit::AIloop()
|
||||
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
|
||||
scheduler->appendCommand(command);
|
||||
setHasTask(true);
|
||||
|
||||
/* Wait an amout of time depending on the shots intensity */
|
||||
internalCounter = static_cast<unsigned int>(((ShotsIntensity::HIGH - shotsIntensity) * shotsBaseInterval + aimTime) / FRAMERATE_TIME_INTERVAL);
|
||||
}
|
||||
}
|
||||
|
||||
if (internalCounter == 0)
|
||||
internalCounter = static_cast<unsigned int>(20 / FRAMERATE_TIME_INTERVAL);
|
||||
internalCounter = static_cast<unsigned int>(3 / FRAMERATE_TIME_INTERVAL);
|
||||
internalCounter--;
|
||||
|
||||
break;
|
||||
@@ -321,7 +335,7 @@ void GroundUnit::AIloop()
|
||||
if (canAAA) {
|
||||
/* Only perform scenic functions when the scheduler is "free" */
|
||||
/* Only run this when the internal counter reaches 0 to avoid excessive computations when no nearby target */
|
||||
if (scheduler->getLoad() == 0 && internalCounter == 0) {
|
||||
if (scheduler->getLoad() < 30 && internalCounter == 0) {
|
||||
double distance = 0;
|
||||
unsigned char unitCoalition = coalition == 0 ? getOperateAs() : coalition;
|
||||
unsigned char targetCoalition = unitCoalition == 2 ? 1 : 2;
|
||||
@@ -50,6 +50,8 @@ void NavyUnit::setDefaults(bool force)
|
||||
|
||||
void NavyUnit::setState(unsigned char newState)
|
||||
{
|
||||
Coords currentTargetPosition = getTargetPosition();
|
||||
|
||||
/************ Perform any action required when LEAVING a state ************/
|
||||
if (newState != state) {
|
||||
switch (state) {
|
||||
@@ -63,11 +65,10 @@ void NavyUnit::setState(unsigned char newState)
|
||||
setTargetID(NULL);
|
||||
break;
|
||||
}
|
||||
case State::FIRE_AT_AREA: {
|
||||
setTargetPosition(Coords(NULL));
|
||||
break;
|
||||
}
|
||||
case State::SIMULATE_FIRE_FIGHT: {
|
||||
case State::FIRE_AT_AREA:
|
||||
case State::SIMULATE_FIRE_FIGHT:
|
||||
case State::SCENIC_AAA:
|
||||
case State::MISS_ON_PURPOSE: {
|
||||
setTargetPosition(Coords(NULL));
|
||||
break;
|
||||
}
|
||||
@@ -96,13 +97,27 @@ void NavyUnit::setState(unsigned char newState)
|
||||
break;
|
||||
}
|
||||
case State::FIRE_AT_AREA: {
|
||||
setTargetPosition(currentTargetPosition);
|
||||
setEnableTaskCheckFailed(true);
|
||||
clearActivePath();
|
||||
resetActiveDestination();
|
||||
break;
|
||||
}
|
||||
case State::SIMULATE_FIRE_FIGHT: {
|
||||
setEnableTaskCheckFailed(true);
|
||||
setTargetPosition(currentTargetPosition);
|
||||
setEnableTaskCheckFailed(false);
|
||||
clearActivePath();
|
||||
resetActiveDestination();
|
||||
break;
|
||||
}
|
||||
case State::SCENIC_AAA: {
|
||||
setEnableTaskCheckFailed(false);
|
||||
clearActivePath();
|
||||
resetActiveDestination();
|
||||
break;
|
||||
}
|
||||
case State::MISS_ON_PURPOSE: {
|
||||
setEnableTaskCheckFailed(false);
|
||||
clearActivePath();
|
||||
resetActiveDestination();
|
||||
break;
|
||||
@@ -124,6 +139,8 @@ void NavyUnit::setState(unsigned char newState)
|
||||
|
||||
void NavyUnit::AIloop()
|
||||
{
|
||||
srand(static_cast<unsigned int>(time(NULL)) + ID);
|
||||
|
||||
switch (state) {
|
||||
case State::IDLE: {
|
||||
setTask("Idle");
|
||||
@@ -150,6 +167,7 @@ void NavyUnit::AIloop()
|
||||
setState(State::IDLE);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case State::ATTACK: {
|
||||
@@ -170,6 +188,8 @@ void NavyUnit::AIloop()
|
||||
else {
|
||||
setState(State::IDLE);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case State::FIRE_AT_AREA: {
|
||||
setTask("Firing at area");
|
||||
@@ -183,6 +203,8 @@ void NavyUnit::AIloop()
|
||||
scheduler->appendCommand(command);
|
||||
setHasTask(true);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case State::SIMULATE_FIRE_FIGHT: {
|
||||
setTask("Simulating fire fight");
|
||||
@@ -190,6 +212,7 @@ void NavyUnit::AIloop()
|
||||
// TODO
|
||||
|
||||
setState(State::IDLE);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
@@ -192,6 +192,7 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
string airbaseName = to_string(value[L"airbaseName"]);
|
||||
string country = to_string(value[L"country"]);
|
||||
|
||||
|
||||
int spawnPoints = value[L"spawnPoints"].as_number().to_int32();
|
||||
if (!checkSpawnPoints(spawnPoints, coalition)) return;
|
||||
|
||||
@@ -204,9 +205,10 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
Coords location; location.lat = lat; location.lng = lng; location.alt = alt;
|
||||
string loadout = to_string(unit[L"loadout"]);
|
||||
string liveryID = to_string(unit[L"liveryID"]);
|
||||
string skill = to_string(unit[L"skill"]);
|
||||
|
||||
spawnOptions.push_back({unitType, location, loadout, liveryID});
|
||||
log(username + " spawned a " + coalition + " " + unitType, true);
|
||||
spawnOptions.push_back({unitType, location, loadout, skill, liveryID});
|
||||
log(username + " spawned a " + coalition + " " + unitType , true);
|
||||
}
|
||||
|
||||
if (key.compare("spawnAircrafts") == 0)
|
||||
@@ -231,8 +233,9 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
double lng = unit[L"location"][L"lng"].as_double();
|
||||
Coords location; location.lat = lat; location.lng = lng;
|
||||
string liveryID = to_string(unit[L"liveryID"]);
|
||||
string skill = to_string(unit[L"skill"]);
|
||||
|
||||
spawnOptions.push_back({ unitType, location, "", liveryID });
|
||||
spawnOptions.push_back({ unitType, location, "", skill, liveryID});
|
||||
log(username + " spawned a " + coalition + " " + unitType, true);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "logger.h"
|
||||
#include "luatools.h"
|
||||
#include "dcstools.h"
|
||||
#include "defines.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -38,9 +39,9 @@ void registerLuaFunctions(lua_State* L)
|
||||
log("protectedCall registered successfully");
|
||||
}
|
||||
|
||||
executeLuaScript(L, instancePath + "..\\Scripts\\mist.lua");
|
||||
executeLuaScript(L, instancePath + "..\\Scripts\\OlympusCommand.lua");
|
||||
executeLuaScript(L, instancePath + "..\\Scripts\\unitPayloads.lua");
|
||||
executeLuaScript(L, instancePath + "..\\Scripts\\templates.lua");
|
||||
executeLuaScript(L, instancePath + "..\\Scripts\\mods.lua");
|
||||
executeLuaScript(L, instancePath + MIST_SCRIPT);
|
||||
executeLuaScript(L, instancePath + OLYMPUS_COMMAND_SCRIPT);
|
||||
executeLuaScript(L, instancePath + UNIT_PAYLOADS_SCRIPT);
|
||||
executeLuaScript(L, instancePath + TEMPLATES_SCRIPT);
|
||||
executeLuaScript(L, instancePath + MODS_SCRIPT);
|
||||
}
|
||||
@@ -296,14 +296,14 @@ void Server::task()
|
||||
ss << ifstream.rdbuf();
|
||||
std::error_code errorCode;
|
||||
json::value config = json::value::parse(ss.str(), errorCode);
|
||||
if (config.is_object() && config.has_object_field(L"server") &&
|
||||
config[L"server"].has_string_field(L"address") && config[L"server"].has_number_field(L"port"))
|
||||
if (config.is_object() && config.has_object_field(L"backend") &&
|
||||
config[L"backend"].has_string_field(L"address") && config[L"backend"].has_number_field(L"port"))
|
||||
{
|
||||
address = "http://" + to_string(config[L"server"][L"address"]) + ":" + to_string(config[L"server"][L"port"].as_number().to_int32());
|
||||
log("Starting server on " + address);
|
||||
address = "http://" + to_string(config[L"backend"][L"address"]) + ":" + to_string(config[L"backend"][L"port"].as_number().to_int32());
|
||||
log("Starting backend on " + address);
|
||||
}
|
||||
else
|
||||
log("Error reading configuration file. Starting server on " + address);
|
||||
log("Error reading configuration file. Starting backend on " + address);
|
||||
|
||||
if (config.is_object() && config.has_object_field(L"authentication"))
|
||||
{
|
||||
@@ -330,7 +330,7 @@ void Server::task()
|
||||
.then([&listener]() {log("RESTServer starting to listen"); })
|
||||
.wait();
|
||||
|
||||
while (runListener);
|
||||
while (runListener) { Sleep(1000); };
|
||||
|
||||
listener.close()
|
||||
.then([&listener]() {log("RESTServer stopping connections"); })
|
||||
@@ -27,6 +27,13 @@ Unit::~Unit()
|
||||
}
|
||||
|
||||
void Unit::initialize(json::value json)
|
||||
{
|
||||
update(json, 0);
|
||||
setDefaults();
|
||||
}
|
||||
|
||||
|
||||
void Unit::update(json::value json, double dt)
|
||||
{
|
||||
if (json.has_string_field(L"name"))
|
||||
setName(to_string(json[L"name"]));
|
||||
@@ -37,23 +44,18 @@ void Unit::initialize(json::value json)
|
||||
if (json.has_string_field(L"groupName"))
|
||||
setGroupName(to_string(json[L"groupName"]));
|
||||
|
||||
if (json.has_string_field(L"callsign"))
|
||||
setCallsign(to_string(json[L"callsign"]));
|
||||
|
||||
if (json.has_number_field(L"coalitionID"))
|
||||
setCoalition(json[L"coalitionID"].as_number().to_int32());
|
||||
|
||||
//if (json.has_number_field(L"Country"))
|
||||
// setCountry(json[L"Country"].as_number().to_int32());
|
||||
|
||||
|
||||
/* All units which contain the name "Olympus" are automatically under AI control */
|
||||
if (getUnitName().find("Olympus") != string::npos)
|
||||
setControlled(true);
|
||||
|
||||
update(json, 0);
|
||||
setDefaults();
|
||||
}
|
||||
|
||||
|
||||
void Unit::update(json::value json, double dt)
|
||||
{
|
||||
if (json.has_object_field(L"position"))
|
||||
{
|
||||
setPosition({
|
||||
@@ -255,6 +257,7 @@ void Unit::getData(stringstream& ss, unsigned long long time)
|
||||
case DataIndex::country: appendNumeric(ss, datumIndex, country); break;
|
||||
case DataIndex::name: appendString(ss, datumIndex, name); break;
|
||||
case DataIndex::unitName: appendString(ss, datumIndex, unitName); break;
|
||||
case DataIndex::callsign: appendString(ss, datumIndex, callsign); break;
|
||||
case DataIndex::groupName: appendString(ss, datumIndex, groupName); break;
|
||||
case DataIndex::state: appendNumeric(ss, datumIndex, state); break;
|
||||
case DataIndex::task: appendString(ss, datumIndex, task); break;
|
||||
110
backend/dcstools/dcstools.rc
Normal file
110
backend/dcstools/dcstools.rc
Normal file
@@ -0,0 +1,110 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Italian (Italy) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA)
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
|
||||
#pragma code_page(1252)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Italian (Italy) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (United Kingdom) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,4,0
|
||||
PRODUCTVERSION 1,0,3,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "DCS Olympus"
|
||||
VALUE "FileDescription", "DCS Olympus"
|
||||
VALUE "FileVersion", "1.0.4.0"
|
||||
VALUE "InternalName", "dcstools.dll"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2023"
|
||||
VALUE "OriginalFilename", "dcstools.dll"
|
||||
VALUE "ProductName", "DCS Olympus"
|
||||
VALUE "ProductVersion", "1.0.4.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (United Kingdom) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\dcstools.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\luatools\luatools.vcxproj">
|
||||
@@ -32,6 +33,9 @@
|
||||
<Project>{b85009ce-4a5c-4a5a-b85d-001b3a2651b2}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="dcstools.rc" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
@@ -73,19 +77,23 @@
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>.\..\..\bin\</OutDir>
|
||||
<OutDir>.\..\..\build\backend\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
@@ -134,6 +142,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<Version>{{OLYMPUS_VERSION_NUMBER}}.{{OLYMPUS_COMMIT_HASH}}</Version>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
@@ -23,5 +23,13 @@
|
||||
<ClInclude Include="include\dcstools.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="dcstools.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
14
backend/dcstools/resource.h
Normal file
14
backend/dcstools/resource.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by dcstools.rc
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
2579
backend/docs
Normal file
2579
backend/docs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include "framework.h"
|
||||
|
||||
void DllExport setLogDirectory(std::string m_dirPath);
|
||||
void DllExport log(const std::string& sMessage, bool addToJSON = false);
|
||||
void DllExport log(const std::wstring& sMessage, bool addToJSON = false);
|
||||
void DllExport getLogsJSON(json::value& json, unsigned long long time);
|
||||
@@ -8,6 +8,7 @@ public:
|
||||
void log(const string& sMessage, bool addToJSON);
|
||||
void log(const wstring& sMessage, bool addToJSON);
|
||||
void toJSON(json::value& json, unsigned long long time);
|
||||
void setDirectory(string newDirPath);
|
||||
|
||||
static Logger* GetLogger();
|
||||
|
||||
@@ -20,9 +21,11 @@ private:
|
||||
static Logger* m_pThis;
|
||||
static ofstream m_Logfile;
|
||||
static std::map<unsigned long long, std::string> m_logs;
|
||||
static string m_dirPath;
|
||||
|
||||
mutex mutexLock;
|
||||
|
||||
void Clear();
|
||||
void Open();
|
||||
void Close();
|
||||
};
|
||||
110
backend/logger/logger.rc
Normal file
110
backend/logger/logger.rc
Normal file
@@ -0,0 +1,110 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Italian (Italy) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA)
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
|
||||
#pragma code_page(1252)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Italian (Italy) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (United Kingdom) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,4,0
|
||||
PRODUCTVERSION 1,0,3,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "DCS Olympus"
|
||||
VALUE "FileDescription", "DCS Olympus"
|
||||
VALUE "FileVersion", "1.0.4.0"
|
||||
VALUE "InternalName", "logger.dll"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2023"
|
||||
VALUE "OriginalFilename", "logger.dll"
|
||||
VALUE "ProductName", "DCS Olympus"
|
||||
VALUE "ProductVersion", "1.0.4.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (United Kingdom) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -25,12 +25,16 @@
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\interface.h" />
|
||||
<ClInclude Include="include\logger.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\utils\utils.vcxproj">
|
||||
<Project>{b85009ce-4a5c-4a5a-b85d-001b3a2651b2}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="logger.rc" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
@@ -72,19 +76,23 @@
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>.\..\..\bin\</OutDir>
|
||||
<OutDir>.\..\..\build\backend\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
@@ -133,6 +141,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<Version>{{OLYMPUS_VERSION_NUMBER}}.{{OLYMPUS_COMMIT_HASH}}</Version>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
@@ -29,5 +29,13 @@
|
||||
<ClInclude Include="include\interface.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="logger.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
14
backend/logger/resource.h
Normal file
14
backend/logger/resource.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by logger.rc
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@@ -4,6 +4,11 @@
|
||||
|
||||
#define LOGGER Logger::GetLogger()
|
||||
|
||||
void setLogDirectory(string m_dirPath)
|
||||
{
|
||||
LOGGER->setDirectory(m_dirPath);
|
||||
}
|
||||
|
||||
void log(const string& message, bool addToJSON)
|
||||
{
|
||||
LOGGER->log(message, addToJSON);
|
||||
@@ -8,25 +8,51 @@ const string Logger::m_sFileName = LOG_NAME;
|
||||
Logger* Logger::m_pThis = NULL;
|
||||
ofstream Logger::m_Logfile;
|
||||
std::map<unsigned long long, std::string> Logger::m_logs;
|
||||
std::string Logger::m_dirPath;
|
||||
|
||||
Logger::Logger()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Logger* Logger::GetLogger()
|
||||
{
|
||||
if (m_pThis == NULL) {
|
||||
m_pThis = new Logger();
|
||||
std::filesystem::path dirPath = std::filesystem::temp_directory_path();
|
||||
m_Logfile.open((dirPath.string() + m_sFileName).c_str(), ios::out);
|
||||
m_pThis->Clear();
|
||||
}
|
||||
return m_pThis;
|
||||
}
|
||||
|
||||
void Logger::setDirectory(string newDirPath)
|
||||
{
|
||||
m_dirPath = newDirPath;
|
||||
Clear();
|
||||
}
|
||||
|
||||
void Logger::Clear()
|
||||
{
|
||||
lock_guard<mutex> guard(mutexLock);
|
||||
try {
|
||||
m_Logfile.open((m_dirPath + m_sFileName).c_str(), ios::out | ios::trunc);
|
||||
}
|
||||
catch (...) {
|
||||
std::filesystem::path m_dirPath = std::filesystem::temp_directory_path();
|
||||
m_Logfile.open((m_dirPath.string() + m_sFileName).c_str(), ios::out | ios::trunc);
|
||||
}
|
||||
m_Logfile << "Creating a new log instance\n";
|
||||
m_pThis->Close();
|
||||
}
|
||||
|
||||
void Logger::Open()
|
||||
{
|
||||
std::filesystem::path dirPath = std::filesystem::temp_directory_path();
|
||||
m_Logfile.open((dirPath.string() + m_sFileName).c_str(), ios::out | ios::app);
|
||||
try {
|
||||
m_Logfile.open((m_dirPath + m_sFileName).c_str(), ios::out | std::ios::app);
|
||||
}
|
||||
catch (...) {
|
||||
std::filesystem::path m_dirPath = std::filesystem::temp_directory_path();
|
||||
m_Logfile.open((m_dirPath.string() + m_sFileName).c_str(), ios::out | std::ios::app);
|
||||
}
|
||||
}
|
||||
|
||||
void Logger::Close()
|
||||
110
backend/luatools/luatools.rc
Normal file
110
backend/luatools/luatools.rc
Normal file
@@ -0,0 +1,110 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Italian (Italy) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA)
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
|
||||
#pragma code_page(1252)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Italian (Italy) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (United Kingdom) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,4,0
|
||||
PRODUCTVERSION 1,0,3,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "DCS Olympus"
|
||||
VALUE "FileDescription", "DCS Olympus"
|
||||
VALUE "FileVersion", "1.0.4.0"
|
||||
VALUE "InternalName", "luatools.dll"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2023"
|
||||
VALUE "OriginalFilename", "luatools.dll"
|
||||
VALUE "ProductName", "DCS Olympus"
|
||||
VALUE "ProductVersion", "1.0.4.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (United Kingdom) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -60,19 +60,23 @@
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>.\..\..\bin\</OutDir>
|
||||
<OutDir>.\..\..\build\backend\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
@@ -121,6 +125,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<Version>{{OLYMPUS_VERSION_NUMBER}}.{{OLYMPUS_COMMIT_HASH}}</Version>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
@@ -160,6 +165,10 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\luatools.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="luatools.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
@@ -23,5 +23,13 @@
|
||||
<ClInclude Include="include\luatools.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="luatools.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
14
backend/luatools/resource.h
Normal file
14
backend/luatools/resource.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by luatools.rc
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
110
backend/olympus/olympus.rc
Normal file
110
backend/olympus/olympus.rc
Normal file
@@ -0,0 +1,110 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Italian (Italy) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA)
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
|
||||
#pragma code_page(1252)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Italian (Italy) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (United Kingdom) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,4,0
|
||||
PRODUCTVERSION 1,0,3,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "DCS Olympus"
|
||||
VALUE "FileDescription", "DCS Olympus"
|
||||
VALUE "FileVersion", "1.0.4.0"
|
||||
VALUE "InternalName", "olympus.dll"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2023"
|
||||
VALUE "OriginalFilename", "olympus.dll"
|
||||
VALUE "ProductName", "DCS Olympus"
|
||||
VALUE "ProductVersion", "1.0.4.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (United Kingdom) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
<Project>{b85009ce-4a5c-4a5a-b85d-001b3a2651b2}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="olympus.rc" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
@@ -56,9 +62,11 @@
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
@@ -67,10 +75,7 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>.\..\..\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg">
|
||||
<VcpkgAutoLink>true</VcpkgAutoLink>
|
||||
<OutDir>.\..\..\build\backend\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
@@ -90,6 +95,7 @@
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>lua.lib</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\third-party\lua</AdditionalLibraryDirectories>
|
||||
<Version>{{OLYMPUS_VERSION_NUMBER}}.{{OLYMPUS_COMMIT_HASH}}</Version>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
@@ -13,4 +13,10 @@
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="olympus.rc" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
14
backend/olympus/resource.h
Normal file
14
backend/olympus/resource.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by olympus.rc
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@@ -20,8 +20,38 @@ f_coreMissionData coreMissionData = nullptr;
|
||||
|
||||
string modPath;
|
||||
|
||||
//Returns the last Win32 error, in string format. Returns an empty string if there is no error.
|
||||
std::string GetLastErrorAsString()
|
||||
{
|
||||
//Get the error message ID, if any.
|
||||
DWORD errorMessageID = ::GetLastError();
|
||||
if (errorMessageID == 0) {
|
||||
return std::string(); //No error message has been recorded
|
||||
}
|
||||
|
||||
LPSTR messageBuffer = nullptr;
|
||||
|
||||
//Ask Win32 to give us the string version of that message ID.
|
||||
//The parameters we pass in, tell Win32 to create the buffer that holds the message for us (because we don't yet know how long the message string will be).
|
||||
size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, NULL);
|
||||
|
||||
//Copy the error message into a std::string.
|
||||
std::string message(messageBuffer, size);
|
||||
|
||||
//Free the Win32's string's buffer.
|
||||
LocalFree(messageBuffer);
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
static int onSimulationStart(lua_State* L)
|
||||
{
|
||||
LogInfo(L, "Trying to load core.dll from " + modPath);
|
||||
SetDllDirectoryA(modPath.c_str());
|
||||
|
||||
setLogDirectory(modPath);
|
||||
|
||||
log("onSimulationStart callback called successfully");
|
||||
|
||||
string dllLocation = modPath + "\\core.dll";
|
||||
@@ -85,7 +115,7 @@ static int onSimulationStart(lua_State* L)
|
||||
return 0;
|
||||
|
||||
error:
|
||||
LogError(L, "Error while loading module, see Olympus.log in temporary folder for additional details.");
|
||||
LogError(L, "Error while loading module: " + GetLastErrorAsString());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -132,7 +162,7 @@ static int onSimulationStop(lua_State* L)
|
||||
return 0;
|
||||
|
||||
error:
|
||||
LogError(L, "Error while unloading module, see Olympus.log in temporary folder for additional details.");
|
||||
LogError(L, "Error while unloading module: " + GetLastErrorAsString());
|
||||
return 0;
|
||||
}
|
||||
|
||||
28
backend/shared/include/defines.h
Normal file
28
backend/shared/include/defines.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#define VERSION "{{OLYMPUS_VERSION_NUMBER}}.{{OLYMPUS_COMMIT_HASH}}"
|
||||
#define LOG_NAME "..\\..\\..\\..\\Logs\\Olympus_log.txt"
|
||||
|
||||
#define REST_ADDRESS "http://localhost:3001"
|
||||
#define REST_URI "olympus"
|
||||
#define UNITS_URI "units"
|
||||
#define WEAPONS_URI "weapons"
|
||||
#define LOGS_URI "logs"
|
||||
#define AIRBASES_URI "airbases"
|
||||
#define BULLSEYE_URI "bullseyes"
|
||||
#define MISSION_URI "mission"
|
||||
#define COMMANDS_URI "commands"
|
||||
|
||||
#define FRAMERATE_TIME_INTERVAL 0.05
|
||||
|
||||
#define OLYMPUS_JSON_PATH "..\\..\\..\\..\\Config\\olympus.json"
|
||||
#define AIRCRAFT_DATABASE_PATH "..\\databases\\units\\aircraftdatabase.json"
|
||||
#define HELICOPTER_DATABASE_PATH "..\\databases\\units\\helicopterdatabase.json"
|
||||
#define GROUNDUNIT_DATABASE_PATH "..\\databases\\units\\groundunitdatabase.json"
|
||||
#define NAVYUNIT_DATABASE_PATH "..\\databases\\units\\navyunitdatabase.json"
|
||||
|
||||
#define MIST_SCRIPT "..\\Scripts\\mist.lua"
|
||||
#define OLYMPUS_COMMAND_SCRIPT "..\\Scripts\\OlympusCommand.lua"
|
||||
#define UNIT_PAYLOADS_SCRIPT "..\\Scripts\\unitPayloads.lua"
|
||||
#define TEMPLATES_SCRIPT "..\\Scripts\\templates.lua"
|
||||
#define MODS_SCRIPT "..\\Scripts\\mods.lua"
|
||||
14
backend/utils/resource.h
Normal file
14
backend/utils/resource.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by utils.rc
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
110
backend/utils/utils.rc
Normal file
110
backend/utils/utils.rc
Normal file
@@ -0,0 +1,110 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Italian (Italy) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA)
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN
|
||||
#pragma code_page(1252)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Italian (Italy) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (United Kingdom) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,4,0
|
||||
PRODUCTVERSION 1,0,3,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "DCS Olympus"
|
||||
VALUE "FileDescription", "DCS Olympus"
|
||||
VALUE "FileVersion", "1.0.4.0"
|
||||
VALUE "InternalName", "utils.dll"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2023"
|
||||
VALUE "OriginalFilename", "utils.dll"
|
||||
VALUE "ProductName", "TODO: <Product name>"
|
||||
VALUE "ProductVersion", "1.0.4.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (United Kingdom) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -20,10 +20,14 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\utils.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\utils.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="utils.rc" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
@@ -65,19 +69,23 @@
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\DCSOlympus.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>.\..\..\bin\</OutDir>
|
||||
<OutDir>.\..\..\build\backend\bin\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>.\..\..\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
@@ -14,10 +14,16 @@
|
||||
<ClInclude Include="include\utils.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\utils.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="utils.rc" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
14
backend/vcpkg-configuration.json
Normal file
14
backend/vcpkg-configuration.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"default-registry": {
|
||||
"kind": "git",
|
||||
"baseline": "7f9f0e44db287e8e67c0e888141bfa200ab45121",
|
||||
"repository": "https://github.com/microsoft/vcpkg"
|
||||
},
|
||||
"registries": [
|
||||
{
|
||||
"kind": "artifact",
|
||||
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
|
||||
"name": "microsoft"
|
||||
}
|
||||
]
|
||||
}
|
||||
6
backend/vcpkg.json
Normal file
6
backend/vcpkg.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"dependencies": [
|
||||
"cpprestsdk",
|
||||
"geographiclib"
|
||||
]
|
||||
}
|
||||
28
build.bat
28
build.bat
@@ -1,28 +0,0 @@
|
||||
call git clean -fx
|
||||
|
||||
cd src
|
||||
msbuild olympus.sln /t:Rebuild /p:Configuration=Release
|
||||
cd ..
|
||||
|
||||
cd scripts/python/configurator
|
||||
call build_configurator.bat
|
||||
cd ../../..
|
||||
|
||||
cd client
|
||||
rmdir /s /q "hgt"
|
||||
call npm install
|
||||
call npm run emit-declarations
|
||||
call npm run build-release
|
||||
|
||||
cd "plugins\controltips"
|
||||
call npm install
|
||||
call npm run build-release
|
||||
cd "..\.."
|
||||
|
||||
cd "plugins\databasemanager"
|
||||
call npm install
|
||||
call npm run build-release
|
||||
cd "..\.."
|
||||
|
||||
call npm prune --production
|
||||
cd ..
|
||||
@@ -1,2 +1,2 @@
|
||||
call build.bat
|
||||
call "C:\Program Files (x86)\Inno Setup 6\iscc.exe" "installer\olympus.iss"
|
||||
call .\scripts\batch\build.bat
|
||||
call .\scripts\batch\package.bat
|
||||
2
client/.vscode/settings.json
vendored
2
client/.vscode/settings.json
vendored
@@ -1,2 +0,0 @@
|
||||
{
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
var express = require('express');
|
||||
var path = require('path');
|
||||
var cookieParser = require('cookie-parser');
|
||||
var logger = require('morgan');
|
||||
var fs = require('fs');
|
||||
var bodyParser = require('body-parser');
|
||||
|
||||
var atcRouter = require('./routes/api/atc');
|
||||
var airbasesRouter = require('./routes/api/airbases');
|
||||
var elevationRouter = require('./routes/api/elevation');
|
||||
var databasesRouter = require('./routes/api/databases');
|
||||
var indexRouter = require('./routes/index');
|
||||
var uikitRouter = require('./routes/uikit');
|
||||
var usersRouter = require('./routes/users');
|
||||
var resourcesRouter = require('./routes/resources');
|
||||
var pluginsRouter = require('./routes/plugins');
|
||||
|
||||
var app = express();
|
||||
|
||||
app.use(logger('dev'));
|
||||
app.use(bodyParser.json({limit: '50mb'}));
|
||||
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
|
||||
app.use(cookieParser());
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
app.use('/', indexRouter);
|
||||
app.use('/api/atc', atcRouter);
|
||||
app.use('/api/airbases', airbasesRouter);
|
||||
app.use('/api/elevation', elevationRouter);
|
||||
app.use('/api/databases', databasesRouter);
|
||||
app.use('/plugins', pluginsRouter)
|
||||
app.use('/users', usersRouter);
|
||||
app.use('/uikit', uikitRouter);
|
||||
app.use('/resources', resourcesRouter);
|
||||
|
||||
app.set('view engine', 'ejs');
|
||||
|
||||
let rawdata = fs.readFileSync('../olympus.json');
|
||||
let config = JSON.parse(rawdata);
|
||||
if (config["server"] != undefined)
|
||||
app.get('/config', (req, res) => res.send(config["server"]));
|
||||
|
||||
module.exports = app;
|
||||
|
||||
const DemoDataGenerator = require('./demo.js');
|
||||
var demoDataGenerator = new DemoDataGenerator(app, config);
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
copy .\\node_modules\\leaflet\\dist\\leaflet.css .\\public\\stylesheets\\leaflet\\leaflet.css
|
||||
copy .\\node_modules\\leaflet-gesture-handling\\dist\\leaflet-gesture-handling.css .\\public\\stylesheets\\leaflet\\leaflet-gesture-handling.css
|
||||
copy .\\node_modules\\leaflet.nauticscale\\dist\\leaflet.nauticscale.js .\\public\\javascripts\\leaflet.nauticscale.js
|
||||
copy .\\node_modules\\leaflet-path-drag\\dist\\L.Path.Drag.js .\\public\\javascripts\\L.Path.Drag.js
|
||||
@@ -1,2 +0,0 @@
|
||||
start cmd /k "npm run start"
|
||||
start cmd /k "watchify .\src\index.ts --debug -o .\public\javascripts\bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ]
|
||||
514
client/demo.js
514
client/demo.js
@@ -1,514 +0,0 @@
|
||||
const { random } = require('@turf/turf');
|
||||
var basicAuth = require('express-basic-auth')
|
||||
var enc = new TextEncoder();
|
||||
|
||||
const aircraftDatabase = require('./public/databases/units/aircraftDatabase.json');
|
||||
const helicopterDatabase = require('./public/databases/units/helicopterDatabase.json');
|
||||
const groundUnitDatabase = require('./public/databases/units/groundUnitDatabase.json');
|
||||
const navyUnitDatabase = require('./public/databases/units/navyUnitDatabase.json');
|
||||
|
||||
const DEMO_UNIT_DATA = {}
|
||||
|
||||
const DEMO_WEAPONS_DATA = {
|
||||
/*["1001"]:{ category: "Missile", alive: true, coalition: 2, name: "", position: { lat: 37.1, lng: -116, alt: 1000 }, speed: 200, heading: 45 * Math.PI / 180 }, */
|
||||
}
|
||||
|
||||
class DemoDataGenerator {
|
||||
constructor(app, config)
|
||||
{
|
||||
app.get('/demo/units', (req, res) => this.units(req, res));
|
||||
app.get('/demo/weapons', (req, res) => this.weapons(req, res));
|
||||
app.get('/demo/logs', (req, res) => this.logs(req, res));
|
||||
app.get('/demo/bullseyes', (req, res) => this.bullseyes(req, res));
|
||||
app.get('/demo/airbases', (req, res) => this.airbases(req, res));
|
||||
app.get('/demo/mission', (req, res) => this.mission(req, res));
|
||||
app.get('/demo/commands', (req, res) => this.command(req, res));
|
||||
app.put('/demo', (req, res) => this.put(req, res));
|
||||
|
||||
app.use('/demo', basicAuth({
|
||||
users: {
|
||||
'admin': config["authentication"]["gameMasterPassword"],
|
||||
'blue': config["authentication"]["blueCommanderPassword"],
|
||||
'red': config["authentication"]["redCommanderPassword"]
|
||||
},
|
||||
}))
|
||||
|
||||
|
||||
let baseData = { alive: true, human: false, controlled: true, coalition: 2, country: 0, unitName: "Cool guy", groupName: "Cool group 1", state: 13, task: "Being cool!",
|
||||
hasTask: true, position: { lat: 37, lng: -116, alt: 1000 }, speed: 200, horizontalVelocity: 200, verticalVelicity: 0, heading: 45, track: 45, isActiveTanker: false, isActiveAWACS: false, onOff: true, followRoads: false, fuel: 50,
|
||||
desiredSpeed: 300, desiredSpeedType: 1, desiredAltitude: 1000, desiredAltitudeType: 1, leaderID: 0,
|
||||
formationOffset: { x: 0, y: 0, z: 0 },
|
||||
targetID: 0,
|
||||
targetPosition: { lat: 0, lng: 0, alt: 0 },
|
||||
ROE: 1,
|
||||
reactionToThreat: 1,
|
||||
emissionsCountermeasures: 1,
|
||||
TACAN: { isOn: false, XY: 'Y', callsign: 'TKR', channel: 40 },
|
||||
radio: { frequency: 124000000, callsign: 1, callsignNumber: 1 },
|
||||
generalSettings: { prohibitAA: false, prohibitAfterburner: false, prohibitAG: false, prohibitAirWpn: false, prohibitJettison: false },
|
||||
ammo: [],
|
||||
contacts: [],
|
||||
activePath: [],
|
||||
isLeader: true
|
||||
}
|
||||
|
||||
|
||||
|
||||
// UNCOMMENT TO TEST ALL UNITS ****************
|
||||
/*
|
||||
var databases = Object.assign({}, aircraftDatabase, helicopterDatabase, groundUnitDatabase, navyUnitDatabase);
|
||||
var t = Object.keys(databases).length;
|
||||
var l = Math.floor(Math.sqrt(t));
|
||||
let latIdx = 0;
|
||||
let lngIdx = 0;
|
||||
let idx = 1;
|
||||
console.log(l)
|
||||
for (let name in databases) {
|
||||
if (databases[name].enabled) {
|
||||
DEMO_UNIT_DATA[idx] = JSON.parse(JSON.stringify(baseData));
|
||||
DEMO_UNIT_DATA[idx].name = name;
|
||||
DEMO_UNIT_DATA[idx].groupName = `Group-${idx}`;
|
||||
DEMO_UNIT_DATA[idx].position.lat += latIdx / 5;
|
||||
DEMO_UNIT_DATA[idx].position.lng += lngIdx / 5;
|
||||
DEMO_UNIT_DATA[idx].coalition = Math.floor(Math.random() * 3)
|
||||
|
||||
latIdx += 1;
|
||||
if (latIdx === l) {
|
||||
latIdx = 0;
|
||||
lngIdx += 1;
|
||||
}
|
||||
|
||||
if (name in aircraftDatabase)
|
||||
DEMO_UNIT_DATA[idx].category = "Aircraft";
|
||||
else if (name in helicopterDatabase)
|
||||
DEMO_UNIT_DATA[idx].category = "Helicopter";
|
||||
else if (name in groundUnitDatabase)
|
||||
DEMO_UNIT_DATA[idx].category = "GroundUnit";
|
||||
else if (name in navyUnitDatabase)
|
||||
DEMO_UNIT_DATA[idx].category = "NavyUnit";
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
let idx = 1;
|
||||
DEMO_UNIT_DATA[idx] = JSON.parse(JSON.stringify(baseData));
|
||||
DEMO_UNIT_DATA[idx].name = "S_75M_Volhov";
|
||||
DEMO_UNIT_DATA[idx].groupName = `Group`;
|
||||
DEMO_UNIT_DATA[idx].position.lat += idx / 100;
|
||||
DEMO_UNIT_DATA[idx].category = "GroundUnit";
|
||||
DEMO_UNIT_DATA[idx].isLeader = true;
|
||||
|
||||
idx += 1;
|
||||
DEMO_UNIT_DATA[idx] = JSON.parse(JSON.stringify(baseData));
|
||||
DEMO_UNIT_DATA[idx].name = "SNR_75V";
|
||||
DEMO_UNIT_DATA[idx].groupName = `Group`;
|
||||
DEMO_UNIT_DATA[idx].position.lat += idx / 100;
|
||||
DEMO_UNIT_DATA[idx].category = "GroundUnit";
|
||||
DEMO_UNIT_DATA[idx].isLeader = false;
|
||||
|
||||
idx += 1;
|
||||
DEMO_UNIT_DATA[idx] = JSON.parse(JSON.stringify(baseData));
|
||||
DEMO_UNIT_DATA[idx].name = "Ural-4320 APA-5D";
|
||||
DEMO_UNIT_DATA[idx].groupName = `Group`;
|
||||
DEMO_UNIT_DATA[idx].position.lat += idx / 100;
|
||||
DEMO_UNIT_DATA[idx].category = "GroundUnit";
|
||||
DEMO_UNIT_DATA[idx].isLeader = false;
|
||||
|
||||
|
||||
idx += 1;
|
||||
DEMO_UNIT_DATA[idx] = JSON.parse(JSON.stringify(baseData));
|
||||
DEMO_UNIT_DATA[idx].name = "F-14B";
|
||||
DEMO_UNIT_DATA[idx].groupName = `Group-1`;
|
||||
DEMO_UNIT_DATA[idx].position.lat += idx / 100;
|
||||
DEMO_UNIT_DATA[idx].category = "Aircraft";
|
||||
DEMO_UNIT_DATA[idx].isLeader = false;
|
||||
|
||||
idx += 1;
|
||||
DEMO_UNIT_DATA[idx] = JSON.parse(JSON.stringify(baseData));
|
||||
DEMO_UNIT_DATA[idx].name = "Infantry AK";
|
||||
DEMO_UNIT_DATA[idx].groupName = `Group-2`;
|
||||
DEMO_UNIT_DATA[idx].position.lat += idx / 100;
|
||||
DEMO_UNIT_DATA[idx].category = "GroundUnit";
|
||||
DEMO_UNIT_DATA[idx].isLeader = true;
|
||||
DEMO_UNIT_DATA[idx].coalition = 0;
|
||||
DEMO_UNIT_DATA[idx].operateAs = 2;
|
||||
|
||||
idx += 1;
|
||||
DEMO_UNIT_DATA[idx] = JSON.parse(JSON.stringify(baseData));
|
||||
DEMO_UNIT_DATA[idx].name = "Infantry AK";
|
||||
DEMO_UNIT_DATA[idx].groupName = `Group-3`;
|
||||
DEMO_UNIT_DATA[idx].position.lat += idx / 100;
|
||||
DEMO_UNIT_DATA[idx].category = "GroundUnit";
|
||||
DEMO_UNIT_DATA[idx].isLeader = true;
|
||||
DEMO_UNIT_DATA[idx].coalition = 0;
|
||||
DEMO_UNIT_DATA[idx].operateAs = 1;
|
||||
|
||||
idx += 1;
|
||||
DEMO_UNIT_DATA[idx] = JSON.parse(JSON.stringify(baseData));
|
||||
DEMO_UNIT_DATA[idx].name = "KC-135";
|
||||
DEMO_UNIT_DATA[idx].groupName = `Group-4`;
|
||||
DEMO_UNIT_DATA[idx].position.lat += idx / 100;
|
||||
DEMO_UNIT_DATA[idx].category = "Aircraft";
|
||||
DEMO_UNIT_DATA[idx].isLeader = true;
|
||||
|
||||
|
||||
this.startTime = Date.now();
|
||||
}
|
||||
|
||||
units(req, res){
|
||||
var array = new Uint8Array();
|
||||
var time = Date.now();
|
||||
array = this.concat(array, this.uint64ToByteArray(BigInt(time)));
|
||||
if (req.query["time"] == 0){
|
||||
for (let idx in DEMO_UNIT_DATA) {
|
||||
const unit = DEMO_UNIT_DATA[idx];
|
||||
var dataIndex = 1;
|
||||
array = this.concat(array, this.uint32ToByteArray(idx));
|
||||
array = this.appendString(array, unit.category, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.alive, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.human, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.controlled, dataIndex); dataIndex++;
|
||||
array = this.appendUint16(array, unit.coalition, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.country, dataIndex); dataIndex++;
|
||||
array = this.appendString(array, unit.name, dataIndex); dataIndex++;
|
||||
array = this.appendString(array, unit.unitName, dataIndex); dataIndex++;
|
||||
array = this.appendString(array, unit.groupName, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.state, dataIndex); dataIndex++;
|
||||
array = this.appendString(array, unit.task, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.hasTask, dataIndex); dataIndex++;
|
||||
array = this.appendCoordinates(array, unit.position, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.speed, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.horizontalVelocity, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.verticalVelicity, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.heading, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.track, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.isActiveTanker, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.isActiveAWACS, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.onOff, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.followRoads, dataIndex); dataIndex++;
|
||||
array = this.appendUint16(array, unit.fuel, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.desiredSpeed, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.desiredSpeedType, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.desiredAltitude, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.desiredAltitudeType, dataIndex); dataIndex++;
|
||||
array = this.appendUint32(array, unit.leaderID, dataIndex); dataIndex++;
|
||||
array = this.appendOffset(array, unit.formationOffset, dataIndex); dataIndex++;
|
||||
array = this.appendUint32(array, unit.targetID, dataIndex); dataIndex++;
|
||||
array = this.appendCoordinates(array, unit.targetPosition, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.ROE, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.reactionToThreat, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.emissionsCountermeasures, dataIndex); dataIndex++;
|
||||
array = this.appendTACAN(array, unit.TACAN, dataIndex); dataIndex++;
|
||||
array = this.appendRadio(array, unit.radio, dataIndex); dataIndex++;
|
||||
array = this.appendRadio(array, unit.generalSettings, dataIndex); dataIndex++;
|
||||
array = this.appendAmmo(array, unit.ammo, dataIndex); dataIndex++;
|
||||
array = this.appendContacts(array, unit.contacts, dataIndex); dataIndex++;
|
||||
array = this.appendActivePath(array, unit.activePath, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.isLeader, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.operateAs, dataIndex); dataIndex++;
|
||||
array = this.concat(array, this.uint8ToByteArray(255));
|
||||
}
|
||||
}
|
||||
res.end(Buffer.from(array, 'binary'));
|
||||
};
|
||||
|
||||
weapons(req, res){
|
||||
var array = new Uint8Array();
|
||||
var time = Date.now();
|
||||
array = this.concat(array, this.uint64ToByteArray(BigInt(time)));
|
||||
for (let idx in DEMO_WEAPONS_DATA) {
|
||||
const weapon = DEMO_WEAPONS_DATA[idx];
|
||||
array = this.concat(array, this.uint32ToByteArray(idx));
|
||||
array = this.appendString(array, weapon.category, 1);
|
||||
array = this.appendUint8(array, weapon.alive, 2);
|
||||
array = this.appendUint16(array, weapon.coalition, 5);
|
||||
array = this.appendString(array, weapon.name, 7);
|
||||
array = this.appendCoordinates(array, weapon.position, 13);
|
||||
array = this.appendDouble(array, weapon.speed, 14);
|
||||
array = this.appendDouble(array, weapon.heading, 15);
|
||||
array = this.concat(array, this.uint8ToByteArray(255));
|
||||
}
|
||||
res.end(Buffer.from(array, 'binary'));
|
||||
};
|
||||
|
||||
concat(array1, array2) {
|
||||
var mergedArray = new Uint8Array(array1.length + array2.length);
|
||||
mergedArray.set(array1);
|
||||
mergedArray.set(array2, array1.length);
|
||||
return mergedArray;
|
||||
}
|
||||
|
||||
uint8ToByteArray(number) {
|
||||
var buffer = new ArrayBuffer(1);
|
||||
var longNum = new Uint8Array(buffer);
|
||||
longNum[0] = number;
|
||||
return Array.from(new Uint8Array(buffer));
|
||||
}
|
||||
|
||||
uint16ToByteArray(number) {
|
||||
var buffer = new ArrayBuffer(2);
|
||||
var longNum = new Uint16Array(buffer);
|
||||
longNum[0] = number;
|
||||
return Array.from(new Uint8Array(buffer));
|
||||
}
|
||||
|
||||
uint32ToByteArray(number) {
|
||||
var buffer = new ArrayBuffer(4);
|
||||
var longNum = new Uint32Array(buffer);
|
||||
longNum[0] = number;
|
||||
return Array.from(new Uint8Array(buffer));
|
||||
}
|
||||
|
||||
uint64ToByteArray(number) {
|
||||
var buffer = new ArrayBuffer(8);
|
||||
var longNum = new BigUint64Array(buffer);
|
||||
longNum[0] = number;
|
||||
return Array.from(new Uint8Array(buffer));
|
||||
}
|
||||
|
||||
doubleToByteArray(number) {
|
||||
var buffer = new ArrayBuffer(8);
|
||||
var longNum = new Float64Array(buffer);
|
||||
longNum[0] = number;
|
||||
return Array.from(new Uint8Array(buffer));
|
||||
}
|
||||
|
||||
appendUint8(array, number, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.uint8ToByteArray(number));
|
||||
return array;
|
||||
}
|
||||
|
||||
appendUint16(array, number, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.uint16ToByteArray(number));
|
||||
return array;
|
||||
}
|
||||
|
||||
appendUint32(array, number, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.uint32ToByteArray(number));
|
||||
return array;
|
||||
}
|
||||
|
||||
appendDouble(array, number, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.doubleToByteArray(number));
|
||||
return array;
|
||||
}
|
||||
|
||||
appendCoordinates(array, coordinates, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.doubleToByteArray(coordinates.lat));
|
||||
array = this.concat(array, this.doubleToByteArray(coordinates.lng));
|
||||
array = this.concat(array, this.doubleToByteArray(coordinates.alt));
|
||||
return array;
|
||||
}
|
||||
|
||||
appendOffset(array, offset, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.doubleToByteArray(offset.x));
|
||||
array = this.concat(array, this.doubleToByteArray(offset.y));
|
||||
array = this.concat(array, this.doubleToByteArray(offset.z));
|
||||
return array;
|
||||
}
|
||||
|
||||
appendString(array, string, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.uint16ToByteArray(string.length));
|
||||
array = this.concat(array, enc.encode(string));
|
||||
return array;
|
||||
}
|
||||
|
||||
padString(string, length) {
|
||||
while (string.length < length)
|
||||
string += " ";
|
||||
return string.substring(0, length);
|
||||
}
|
||||
|
||||
appendTACAN(array, TACAN, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.uint8ToByteArray(TACAN.isOn));
|
||||
array = this.concat(array, this.uint8ToByteArray(TACAN.channel));
|
||||
array = this.concat(array, enc.encode(TACAN.XY));
|
||||
array = this.concat(array, enc.encode(this.padString(TACAN.callsign, 4)));
|
||||
return array;
|
||||
}
|
||||
|
||||
appendRadio(array, radio, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.uint32ToByteArray(radio.frequency));
|
||||
array = this.concat(array, this.uint8ToByteArray(radio.callsign));
|
||||
array = this.concat(array, this.uint8ToByteArray(radio.callsignNumber));
|
||||
return array;
|
||||
}
|
||||
|
||||
appendGeneralSettings(array, generalSettings, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.uint8ToByteArray(generalSettings.prohibitAA));
|
||||
array = this.concat(array, this.uint8ToByteArray(generalSettings.prohibitAfterburner));
|
||||
array = this.concat(array, this.uint8ToByteArray(generalSettings.prohibitAG));
|
||||
array = this.concat(array, this.uint8ToByteArray(generalSettings.prohibitAirWpn));
|
||||
array = this.concat(array, this.uint8ToByteArray(generalSettings.prohibitJettison));
|
||||
return array;
|
||||
}
|
||||
|
||||
appendAmmo(array, ammo, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.uint16ToByteArray(ammo.length));
|
||||
ammo.forEach((element) => {
|
||||
array = this.concat(array, this.uint16ToByteArray(element.quantity));
|
||||
array = this.concat(array, enc.encode(this.padString(element.name, 33)));
|
||||
array = this.concat(array, this.uint8ToByteArray(element.guidance));
|
||||
array = this.concat(array, this.uint8ToByteArray(element.category));
|
||||
array = this.concat(array, this.uint8ToByteArray(element.missileCategory));
|
||||
})
|
||||
return array;
|
||||
}
|
||||
|
||||
appendContacts(array, contacts, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.uint16ToByteArray(contacts.length));
|
||||
contacts.forEach((element) => {
|
||||
array = this.concat(array, this.uint32ToByteArray(element.ID));
|
||||
array = this.concat(array, this.uint8ToByteArray(element.detectionMethod));
|
||||
})
|
||||
return array;
|
||||
}
|
||||
|
||||
appendActivePath(array, activePath, datumIndex) {
|
||||
array = this.concat(array, this.uint8ToByteArray(datumIndex));
|
||||
array = this.concat(array, this.uint16ToByteArray(activePath.length));
|
||||
activePath.forEach((element) => {
|
||||
array = this.concat(array, this.doubleToByteArray(element.lat));
|
||||
array = this.concat(array, this.doubleToByteArray(element.lng));
|
||||
array = this.concat(array, this.doubleToByteArray(element.alt));
|
||||
})
|
||||
return array;
|
||||
}
|
||||
|
||||
logs(req, res){
|
||||
var ret = {logs: {"1": "I'm a log!", "2": "I'm a different log!"}};
|
||||
ret.time = Date.now();
|
||||
ret.frameRate = 60;
|
||||
ret.load = 0;
|
||||
res.send(JSON.stringify(ret));
|
||||
};
|
||||
|
||||
airbases(req, res){
|
||||
var ret = {airbases: {
|
||||
["0"]: {
|
||||
callsign: "Nellis",
|
||||
latitude: 37.3,
|
||||
longitude: -115.8,
|
||||
coalition: "neutral"
|
||||
},
|
||||
["1"]: {
|
||||
callsign: "Red",
|
||||
latitude: 37.3,
|
||||
longitude: -115.75,
|
||||
coalition: "red"
|
||||
},
|
||||
["2"]: {
|
||||
callsign: "Blue",
|
||||
latitude: 37.3,
|
||||
longitude: -115.7,
|
||||
coalition: "blue"
|
||||
}
|
||||
}};
|
||||
ret.time = Date.now();
|
||||
res.send(JSON.stringify(ret));
|
||||
};
|
||||
|
||||
bullseyes(req, res){
|
||||
var ret = {bullseyes: {
|
||||
"0": {
|
||||
latitude: 37.25,
|
||||
longitude: -115.8,
|
||||
coalition: "neutral"
|
||||
},
|
||||
"1": {
|
||||
latitude: 37.25,
|
||||
longitude: -115.75,
|
||||
coalition: "red"
|
||||
},
|
||||
"2": {
|
||||
latitude: 37.25,
|
||||
longitude: -115.7,
|
||||
coalition: "blue"
|
||||
}
|
||||
}};
|
||||
ret.time = Date.now();
|
||||
res.send(JSON.stringify(ret));
|
||||
};
|
||||
|
||||
mission(req, res){
|
||||
var ret = {mission: {theatre: "Nevada"}};
|
||||
ret.time = Date.now();
|
||||
|
||||
ret.mission.dateAndTime = {
|
||||
time: { h: 10, m: 15, s: 34 },
|
||||
date: "",
|
||||
elapsedTime: (Date.now() - this.startTime) / 1000,
|
||||
startTime: 0
|
||||
}
|
||||
|
||||
ret.mission.coalitions = {
|
||||
red: [
|
||||
'RUSSIA',
|
||||
'CHINA'
|
||||
],
|
||||
blue: [
|
||||
'UK',
|
||||
'USA'
|
||||
],
|
||||
neutral: [
|
||||
'ITALY'
|
||||
]
|
||||
}
|
||||
|
||||
ret.mission.commandModeOptions = {
|
||||
restrictSpawns: true,
|
||||
restrictToCoalition: true,
|
||||
setupTime: 0,
|
||||
spawnPoints: {
|
||||
red: 400,
|
||||
blue: 400
|
||||
},
|
||||
eras: ["WW2", "Early Cold War", "Late Cold War", "Modern"]
|
||||
}
|
||||
|
||||
var auth = req.get("Authorization");
|
||||
if (auth) {
|
||||
var username = Buffer.from(auth.replace("Basic ", ""), 'base64').toString('binary').split(":")[0];
|
||||
switch (username) {
|
||||
case "admin":
|
||||
ret.mission.commandModeOptions.commandMode = "Game master";
|
||||
break
|
||||
case "blue":
|
||||
ret.mission.commandModeOptions.commandMode = "Blue commander";
|
||||
break;
|
||||
case "red":
|
||||
ret.mission.commandModeOptions.commandMode = "Red commander";
|
||||
break;
|
||||
}
|
||||
}
|
||||
res.send(JSON.stringify(ret));
|
||||
}
|
||||
|
||||
command(req, res) {
|
||||
var ret = {commandExecuted: Math.random() > 0.5};
|
||||
res.send(JSON.stringify(ret));
|
||||
}
|
||||
|
||||
put(req, res) {
|
||||
var ret = {commandHash: Math.random().toString(36).slice(2, 19)}
|
||||
res.send(JSON.stringify(ret));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = DemoDataGenerator;
|
||||
9041
client/package-lock.json
generated
9041
client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,61 +0,0 @@
|
||||
{
|
||||
"name": "DCSOlympus",
|
||||
"node-main": "./bin/www",
|
||||
"main": "http://localhost:3000",
|
||||
"version": "v0.4.13-alpha-rc5",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "browserify .\\src\\index.ts --debug -o .\\public\\javascripts\\bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ] && copy.bat",
|
||||
"build-release": "browserify .\\src\\index.ts -o .\\public\\javascripts\\bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ] && copy.bat",
|
||||
"emit-declarations": "tsc --project tsconfig.json --declaration --emitDeclarationOnly --outfile ./@types/olympus/index.d.ts",
|
||||
"copy": "copy.bat",
|
||||
"start": "node ./bin/www",
|
||||
"debug": "npm run copy & concurrently --kill-others \"npm run watch\" \"nodemon --ignore ./public/databases/ ./bin/www\"",
|
||||
"watch": "watchify .\\src\\index.ts --debug -o .\\public\\javascripts\\bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ]"
|
||||
},
|
||||
"dependencies": {
|
||||
"@turf/turf": "^6.5.0",
|
||||
"body-parser": "^1.20.2",
|
||||
"cookie-parser": "~1.4.4",
|
||||
"debug": "~2.6.9",
|
||||
"ejs": "^3.1.8",
|
||||
"express": "~4.16.1",
|
||||
"express-basic-auth": "^1.2.1",
|
||||
"js-sha256": "^0.10.1",
|
||||
"leaflet-gesture-handling": "^1.2.2",
|
||||
"morgan": "~1.9.1",
|
||||
"save": "^2.9.0",
|
||||
"srtm-elevation": "^2.1.2",
|
||||
"uuid": "^9.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "^7.21.4",
|
||||
"@tanem/svg-injector": "^10.1.68",
|
||||
"@types/formatcoords": "^1.1.0",
|
||||
"@types/geojson": "^7946.0.10",
|
||||
"@types/leaflet": "^1.9.0",
|
||||
"@types/node": "^18.16.1",
|
||||
"@types/sortablejs": "^1.15.0",
|
||||
"@types/svg-injector": "^0.0.29",
|
||||
"babelify": "^10.0.0",
|
||||
"browserify": "^17.0.0",
|
||||
"concurrently": "^7.6.0",
|
||||
"cp": "^0.2.0",
|
||||
"esmify": "^2.1.1",
|
||||
"formatcoords": "^1.1.3",
|
||||
"geodesy": "^1.1.2",
|
||||
"leaflet": "^1.9.3",
|
||||
"leaflet-control-mini-map": "^0.4.0",
|
||||
"leaflet-path-drag": "*",
|
||||
"leaflet.nauticscale": "^1.1.0",
|
||||
"nodemon": "^2.0.20",
|
||||
"requirejs": "^2.3.6",
|
||||
"sortablejs": "^1.15.0",
|
||||
"tinyify": "^4.0.0",
|
||||
"tsify": "^5.0.4",
|
||||
"tslib": "latest",
|
||||
"typescript": "^4.9.4",
|
||||
"usng.js": "^0.4.5",
|
||||
"watchify": "^4.0.0"
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
mkdir .\\..\\DCSOlympus\\client\\public\\plugins\\boilerplateplugin
|
||||
|
||||
copy .\\index.js .\\..\\DCSOlympus\\client\\public\\plugins\\boilerplateplugin\\index.js
|
||||
copy .\\plugin.json .\\..\\DCSOlympus\\client\\public\\plugins\\boilerplateplugin\\plugin.json
|
||||
copy .\\style.css .\\..\\DCSOlympus\\client\\public\\plugins\\boilerplateplugin\\style.css
|
||||
|
||||
mkdir .\\..\\DCSOlympus\\client\\public\\plugins\\boilerplateplugin\\images
|
||||
copy .\\images\\*.* .\\..\\DCSOlympus\\client\\public\\plugins\\boilerplateplugin\\images\\
|
||||
@@ -1,5 +0,0 @@
|
||||
mkdir .\\..\\..\\public\\plugins\\controltipsplugin
|
||||
|
||||
copy .\\index.js .\\..\\..\\public\\plugins\\controltipsplugin\\index.js
|
||||
copy .\\plugin.json .\\..\\..\\public\\plugins\\controltipsplugin\\plugin.json
|
||||
copy .\\style.css .\\..\\..\\public\\plugins\\controltipsplugin\\style.css
|
||||
6317
client/plugins/controltips/package-lock.json
generated
6317
client/plugins/controltips/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +0,0 @@
|
||||
mkdir .\\..\\..\\public\\plugins\\databasemanager
|
||||
|
||||
copy .\\index.js .\\..\\..\\public\\plugins\\databasemanager\\index.js
|
||||
copy .\\plugin.json .\\..\\..\\public\\plugins\\databasemanager\\plugin.json
|
||||
copy .\\style.css .\\..\\..\\public\\plugins\\databasemanager\\style.css
|
||||
6214
client/plugins/databasemanager/package-lock.json
generated
6214
client/plugins/databasemanager/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,38 +0,0 @@
|
||||
L.Control.ScaleNautic = L.Control.Scale.extend({
|
||||
options: {
|
||||
nautic: false
|
||||
},
|
||||
|
||||
_addScales: function(options, className, container) {
|
||||
L.Control.Scale.prototype._addScales.call(this, options, className, container);
|
||||
L.setOptions(options);
|
||||
if (this.options.nautic) {
|
||||
this._nScale = L.DomUtil.create('div', className, container);
|
||||
}
|
||||
},
|
||||
|
||||
_updateScales: function (maxMeters) {
|
||||
L.Control.Scale.prototype._updateScales.call(this, maxMeters);
|
||||
if (this.options.nautic && maxMeters) {
|
||||
this._updateNautic(maxMeters);
|
||||
}
|
||||
},
|
||||
|
||||
_updateNautic: function (maxMeters) {
|
||||
var scale = this._nScale,
|
||||
maxNauticalMiles = maxMeters / 1852, nauticalMiles;
|
||||
|
||||
if(maxMeters >= 1852) {
|
||||
nauticalMiles = L.Control.Scale.prototype._getRoundNum.call(this, maxNauticalMiles);
|
||||
} else {
|
||||
nauticalMiles = maxNauticalMiles > 0.1 ? Math.round(maxNauticalMiles * 10) / 10 : Math.round(maxNauticalMiles * 100) / 100;
|
||||
}
|
||||
|
||||
scale.style.width = Math.round(this.options.maxWidth * (nauticalMiles / maxNauticalMiles)) - 10 + 'px';
|
||||
scale.innerHTML = nauticalMiles + ' nm';
|
||||
}
|
||||
});
|
||||
|
||||
L.control.scalenautic = function (options) {
|
||||
return new L.Control.ScaleNautic(options);
|
||||
};
|
||||
@@ -1,47 +0,0 @@
|
||||
@-webkit-keyframes leaflet-gestures-fadein {
|
||||
0% {
|
||||
opacity: 0; }
|
||||
100% {
|
||||
opacity: 1; } }
|
||||
|
||||
@keyframes leaflet-gestures-fadein {
|
||||
0% {
|
||||
opacity: 0; }
|
||||
100% {
|
||||
opacity: 1; } }
|
||||
|
||||
.leaflet-container:after {
|
||||
-webkit-animation: leaflet-gestures-fadein 0.8s backwards;
|
||||
animation: leaflet-gestures-fadein 0.8s backwards;
|
||||
color: #fff;
|
||||
font-family: "Roboto", Arial, sans-serif;
|
||||
font-size: 22px;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
padding: 15px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: 461;
|
||||
pointer-events: none; }
|
||||
|
||||
.leaflet-gesture-handling-touch-warning:after,
|
||||
.leaflet-gesture-handling-scroll-warning:after {
|
||||
-webkit-animation: leaflet-gestures-fadein 0.8s forwards;
|
||||
animation: leaflet-gestures-fadein 0.8s forwards; }
|
||||
|
||||
.leaflet-gesture-handling-touch-warning:after {
|
||||
content: attr(data-gesture-handling-touch-content); }
|
||||
|
||||
.leaflet-gesture-handling-scroll-warning:after {
|
||||
content: attr(data-gesture-handling-scroll-content); }
|
||||
@@ -1,656 +0,0 @@
|
||||
/* required styles */
|
||||
|
||||
.leaflet-pane,
|
||||
.leaflet-tile,
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow,
|
||||
.leaflet-tile-container,
|
||||
.leaflet-pane > svg,
|
||||
.leaflet-pane > canvas,
|
||||
.leaflet-zoom-box,
|
||||
.leaflet-image-layer,
|
||||
.leaflet-layer {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.leaflet-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
.leaflet-tile,
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-user-drag: none;
|
||||
}
|
||||
/* Prevents IE11 from highlighting tiles in blue */
|
||||
.leaflet-tile::selection {
|
||||
background: transparent;
|
||||
}
|
||||
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
|
||||
.leaflet-safari .leaflet-tile {
|
||||
image-rendering: -webkit-optimize-contrast;
|
||||
}
|
||||
/* hack that prevents hw layers "stretching" when loading new tiles */
|
||||
.leaflet-safari .leaflet-tile-container {
|
||||
width: 1600px;
|
||||
height: 1600px;
|
||||
-webkit-transform-origin: 0 0;
|
||||
}
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow {
|
||||
display: block;
|
||||
}
|
||||
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
|
||||
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
|
||||
.leaflet-container .leaflet-overlay-pane svg {
|
||||
max-width: none !important;
|
||||
max-height: none !important;
|
||||
}
|
||||
.leaflet-container .leaflet-marker-pane img,
|
||||
.leaflet-container .leaflet-shadow-pane img,
|
||||
.leaflet-container .leaflet-tile-pane img,
|
||||
.leaflet-container img.leaflet-image-layer,
|
||||
.leaflet-container .leaflet-tile {
|
||||
max-width: none !important;
|
||||
max-height: none !important;
|
||||
width: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.leaflet-container.leaflet-touch-zoom {
|
||||
-ms-touch-action: pan-x pan-y;
|
||||
touch-action: pan-x pan-y;
|
||||
}
|
||||
.leaflet-container.leaflet-touch-drag {
|
||||
-ms-touch-action: pinch-zoom;
|
||||
/* Fallback for FF which doesn't support pinch-zoom */
|
||||
touch-action: none;
|
||||
touch-action: pinch-zoom;
|
||||
}
|
||||
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
.leaflet-container {
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.leaflet-container a {
|
||||
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
|
||||
}
|
||||
.leaflet-tile {
|
||||
filter: inherit;
|
||||
visibility: hidden;
|
||||
}
|
||||
.leaflet-tile-loaded {
|
||||
visibility: inherit;
|
||||
}
|
||||
.leaflet-zoom-box {
|
||||
width: 0;
|
||||
height: 0;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
z-index: 800;
|
||||
}
|
||||
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
|
||||
.leaflet-overlay-pane svg {
|
||||
-moz-user-select: none;
|
||||
}
|
||||
|
||||
.leaflet-pane { z-index: 400; }
|
||||
|
||||
.leaflet-tile-pane { z-index: 200; }
|
||||
.leaflet-overlay-pane { z-index: 400; }
|
||||
.leaflet-shadow-pane { z-index: 500; }
|
||||
.leaflet-marker-pane { z-index: 600; }
|
||||
.leaflet-tooltip-pane { z-index: 650; }
|
||||
.leaflet-popup-pane { z-index: 700; }
|
||||
|
||||
.leaflet-map-pane canvas { z-index: 100; }
|
||||
.leaflet-map-pane svg { z-index: 200; }
|
||||
|
||||
.leaflet-vml-shape {
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
}
|
||||
.lvml {
|
||||
behavior: url(#default#VML);
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
||||
/* control positioning */
|
||||
|
||||
.leaflet-control {
|
||||
position: relative;
|
||||
z-index: 800;
|
||||
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
|
||||
pointer-events: auto;
|
||||
}
|
||||
.leaflet-top,
|
||||
.leaflet-bottom {
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
pointer-events: none;
|
||||
}
|
||||
.leaflet-top {
|
||||
top: 0;
|
||||
}
|
||||
.leaflet-right {
|
||||
right: 0;
|
||||
}
|
||||
.leaflet-bottom {
|
||||
bottom: 0;
|
||||
}
|
||||
.leaflet-left {
|
||||
left: 0;
|
||||
}
|
||||
.leaflet-control {
|
||||
float: left;
|
||||
clear: both;
|
||||
}
|
||||
.leaflet-right .leaflet-control {
|
||||
float: right;
|
||||
}
|
||||
.leaflet-top .leaflet-control {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.leaflet-bottom .leaflet-control {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.leaflet-left .leaflet-control {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.leaflet-right .leaflet-control {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
|
||||
/* zoom and fade animations */
|
||||
|
||||
.leaflet-fade-anim .leaflet-popup {
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.2s linear;
|
||||
-moz-transition: opacity 0.2s linear;
|
||||
transition: opacity 0.2s linear;
|
||||
}
|
||||
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
|
||||
opacity: 1;
|
||||
}
|
||||
.leaflet-zoom-animated {
|
||||
-webkit-transform-origin: 0 0;
|
||||
-ms-transform-origin: 0 0;
|
||||
transform-origin: 0 0;
|
||||
}
|
||||
svg.leaflet-zoom-animated {
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.leaflet-zoom-anim .leaflet-zoom-animated {
|
||||
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
}
|
||||
.leaflet-zoom-anim .leaflet-tile,
|
||||
.leaflet-pan-anim .leaflet-tile {
|
||||
-webkit-transition: none;
|
||||
-moz-transition: none;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.leaflet-zoom-anim .leaflet-zoom-hide {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
/* cursors */
|
||||
|
||||
.leaflet-interactive {
|
||||
cursor: pointer;
|
||||
}
|
||||
.leaflet-grab {
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: grab;
|
||||
}
|
||||
.leaflet-crosshair,
|
||||
.leaflet-crosshair .leaflet-interactive {
|
||||
cursor: crosshair;
|
||||
}
|
||||
.leaflet-popup-pane,
|
||||
.leaflet-control {
|
||||
cursor: auto;
|
||||
}
|
||||
.leaflet-dragging .leaflet-grab,
|
||||
.leaflet-dragging .leaflet-grab .leaflet-interactive,
|
||||
.leaflet-dragging .leaflet-marker-draggable {
|
||||
cursor: move;
|
||||
cursor: -webkit-grabbing;
|
||||
cursor: -moz-grabbing;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
/* marker & overlays interactivity */
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow,
|
||||
.leaflet-image-layer,
|
||||
.leaflet-pane > svg path,
|
||||
.leaflet-tile-container {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.leaflet-marker-icon.leaflet-interactive,
|
||||
.leaflet-image-layer.leaflet-interactive,
|
||||
.leaflet-pane > svg path.leaflet-interactive,
|
||||
svg.leaflet-image-layer.leaflet-interactive path {
|
||||
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
/* visual tweaks */
|
||||
|
||||
.leaflet-container {
|
||||
background: #ddd;
|
||||
outline-offset: 1px;
|
||||
}
|
||||
.leaflet-container a {
|
||||
color: #0078A8;
|
||||
}
|
||||
.leaflet-zoom-box {
|
||||
border: 2px dotted #38f;
|
||||
background: rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
|
||||
/* general typography */
|
||||
.leaflet-container {
|
||||
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
font-size: 0.75rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
|
||||
/* general toolbar styles */
|
||||
|
||||
.leaflet-bar {
|
||||
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.leaflet-bar a {
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #ccc;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
.leaflet-bar a,
|
||||
.leaflet-control-layers-toggle {
|
||||
background-position: 50% 50%;
|
||||
background-repeat: no-repeat;
|
||||
display: block;
|
||||
}
|
||||
.leaflet-bar a:hover,
|
||||
.leaflet-bar a:focus {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
.leaflet-bar a:first-child {
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
.leaflet-bar a:last-child {
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom: none;
|
||||
}
|
||||
.leaflet-bar a.leaflet-disabled {
|
||||
cursor: default;
|
||||
background-color: #f4f4f4;
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-bar a {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
.leaflet-touch .leaflet-bar a:first-child {
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
}
|
||||
.leaflet-touch .leaflet-bar a:last-child {
|
||||
border-bottom-left-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
}
|
||||
|
||||
/* zoom control */
|
||||
|
||||
.leaflet-control-zoom-in,
|
||||
.leaflet-control-zoom-out {
|
||||
font: bold 18px 'Lucida Console', Monaco, monospace;
|
||||
text-indent: 1px;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
|
||||
/* layers control */
|
||||
|
||||
.leaflet-control-layers {
|
||||
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.leaflet-control-layers-toggle {
|
||||
background-image: url(images/layers.png);
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
.leaflet-retina .leaflet-control-layers-toggle {
|
||||
background-image: url(images/layers-2x.png);
|
||||
background-size: 26px 26px;
|
||||
}
|
||||
.leaflet-touch .leaflet-control-layers-toggle {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
}
|
||||
.leaflet-control-layers .leaflet-control-layers-list,
|
||||
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
|
||||
display: none;
|
||||
}
|
||||
.leaflet-control-layers-expanded .leaflet-control-layers-list {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
.leaflet-control-layers-expanded {
|
||||
padding: 6px 10px 6px 6px;
|
||||
color: #333;
|
||||
background: #fff;
|
||||
}
|
||||
.leaflet-control-layers-scrollbar {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.leaflet-control-layers-selector {
|
||||
margin-top: 2px;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
.leaflet-control-layers label {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
font-size: 1.08333em;
|
||||
}
|
||||
.leaflet-control-layers-separator {
|
||||
height: 0;
|
||||
border-top: 1px solid #ddd;
|
||||
margin: 5px -10px 5px -6px;
|
||||
}
|
||||
|
||||
/* Default icon URLs */
|
||||
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
|
||||
background-image: url(images/marker-icon.png);
|
||||
}
|
||||
|
||||
|
||||
/* attribution and scale controls */
|
||||
|
||||
.leaflet-container .leaflet-control-attribution {
|
||||
background: #fff;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
margin: 0;
|
||||
}
|
||||
.leaflet-control-attribution,
|
||||
.leaflet-control-scale-line {
|
||||
padding: 0 5px;
|
||||
color: #333;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.leaflet-control-attribution a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.leaflet-control-attribution a:hover,
|
||||
.leaflet-control-attribution a:focus {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.leaflet-attribution-flag {
|
||||
display: inline !important;
|
||||
vertical-align: baseline !important;
|
||||
width: 1em;
|
||||
height: 0.6669em;
|
||||
}
|
||||
.leaflet-left .leaflet-control-scale {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.leaflet-bottom .leaflet-control-scale {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.leaflet-control-scale-line {
|
||||
border: 2px solid #777;
|
||||
border-top: none;
|
||||
line-height: 1.1;
|
||||
padding: 2px 5px 1px;
|
||||
white-space: nowrap;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
text-shadow: 1px 1px #fff;
|
||||
}
|
||||
.leaflet-control-scale-line:not(:first-child) {
|
||||
border-top: 2px solid #777;
|
||||
border-bottom: none;
|
||||
margin-top: -2px;
|
||||
}
|
||||
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
|
||||
border-bottom: 2px solid #777;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-control-attribution,
|
||||
.leaflet-touch .leaflet-control-layers,
|
||||
.leaflet-touch .leaflet-bar {
|
||||
box-shadow: none;
|
||||
}
|
||||
.leaflet-touch .leaflet-control-layers,
|
||||
.leaflet-touch .leaflet-bar {
|
||||
border: 2px solid rgba(0,0,0,0.2);
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
|
||||
/* popup */
|
||||
|
||||
.leaflet-popup {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.leaflet-popup-content-wrapper {
|
||||
padding: 1px;
|
||||
text-align: left;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.leaflet-popup-content {
|
||||
margin: 13px 24px 13px 20px;
|
||||
line-height: 1.3;
|
||||
font-size: 13px;
|
||||
font-size: 1.08333em;
|
||||
min-height: 1px;
|
||||
}
|
||||
.leaflet-popup-content p {
|
||||
margin: 17px 0;
|
||||
margin: 1.3em 0;
|
||||
}
|
||||
.leaflet-popup-tip-container {
|
||||
width: 40px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-top: -1px;
|
||||
margin-left: -20px;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
.leaflet-popup-tip {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
padding: 1px;
|
||||
|
||||
margin: -10px auto 0;
|
||||
pointer-events: auto;
|
||||
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
.leaflet-popup-content-wrapper,
|
||||
.leaflet-popup-tip {
|
||||
background: white;
|
||||
color: #333;
|
||||
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
|
||||
}
|
||||
.leaflet-container a.leaflet-popup-close-button {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
border: none;
|
||||
text-align: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
font: 16px/24px Tahoma, Verdana, sans-serif;
|
||||
color: #757575;
|
||||
text-decoration: none;
|
||||
background: transparent;
|
||||
}
|
||||
.leaflet-container a.leaflet-popup-close-button:hover,
|
||||
.leaflet-container a.leaflet-popup-close-button:focus {
|
||||
color: #585858;
|
||||
}
|
||||
.leaflet-popup-scrolled {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.leaflet-oldie .leaflet-popup-content-wrapper {
|
||||
-ms-zoom: 1;
|
||||
}
|
||||
.leaflet-oldie .leaflet-popup-tip {
|
||||
width: 24px;
|
||||
margin: 0 auto;
|
||||
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
|
||||
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
|
||||
}
|
||||
|
||||
.leaflet-oldie .leaflet-control-zoom,
|
||||
.leaflet-oldie .leaflet-control-layers,
|
||||
.leaflet-oldie .leaflet-popup-content-wrapper,
|
||||
.leaflet-oldie .leaflet-popup-tip {
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
|
||||
/* div icon */
|
||||
|
||||
.leaflet-div-icon {
|
||||
background: #fff;
|
||||
border: 1px solid #666;
|
||||
}
|
||||
|
||||
|
||||
/* Tooltip */
|
||||
/* Base styles for the element that has a tooltip */
|
||||
.leaflet-tooltip {
|
||||
position: absolute;
|
||||
padding: 6px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 3px;
|
||||
color: #222;
|
||||
white-space: nowrap;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
|
||||
}
|
||||
.leaflet-tooltip.leaflet-interactive {
|
||||
cursor: pointer;
|
||||
pointer-events: auto;
|
||||
}
|
||||
.leaflet-tooltip-top:before,
|
||||
.leaflet-tooltip-bottom:before,
|
||||
.leaflet-tooltip-left:before,
|
||||
.leaflet-tooltip-right:before {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
border: 6px solid transparent;
|
||||
background: transparent;
|
||||
content: "";
|
||||
}
|
||||
|
||||
/* Directions */
|
||||
|
||||
.leaflet-tooltip-bottom {
|
||||
margin-top: 6px;
|
||||
}
|
||||
.leaflet-tooltip-top {
|
||||
margin-top: -6px;
|
||||
}
|
||||
.leaflet-tooltip-bottom:before,
|
||||
.leaflet-tooltip-top:before {
|
||||
left: 50%;
|
||||
margin-left: -6px;
|
||||
}
|
||||
.leaflet-tooltip-top:before {
|
||||
bottom: 0;
|
||||
margin-bottom: -12px;
|
||||
border-top-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-bottom:before {
|
||||
top: 0;
|
||||
margin-top: -12px;
|
||||
margin-left: -6px;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-left {
|
||||
margin-left: -6px;
|
||||
}
|
||||
.leaflet-tooltip-right {
|
||||
margin-left: 6px;
|
||||
}
|
||||
.leaflet-tooltip-left:before,
|
||||
.leaflet-tooltip-right:before {
|
||||
top: 50%;
|
||||
margin-top: -6px;
|
||||
}
|
||||
.leaflet-tooltip-left:before {
|
||||
right: 0;
|
||||
margin-right: -12px;
|
||||
border-left-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-right:before {
|
||||
left: 0;
|
||||
margin-left: -12px;
|
||||
border-right-color: #fff;
|
||||
}
|
||||
|
||||
/* Printing */
|
||||
|
||||
@media print {
|
||||
/* Prevent printers from removing background-images of controls. */
|
||||
.leaflet-control {
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.--><path d="M0 224.2C0 100.6 100.2 0 224 0h24c95.2 0 181.2 69.3 197.3 160.2c2.3 13 6.8 25.7 15.1 36l42 52.6c6.2 7.8 9.6 17.4 9.6 27.4c0 24.2-19.6 43.8-43.8 43.8H448v64c0 35.3-28.7 64-64 64H320v32c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V407.3c0-16.7-6.9-32.5-17.1-45.8C16.6 322.4 0 274.1 0 224.2zM224 64c-8.8 0-16 7.2-16 16c0 33-39.9 49.5-63.2 26.2c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6C145.5 152.1 129 192 96 192c-8.8 0-16 7.2-16 16s7.2 16 16 16c33 0 49.5 39.9 26.2 63.2c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0C168.1 286.5 208 303 208 336c0 8.8 7.2 16 16 16s16-7.2 16-16c0-33 39.9-49.5 63.2-26.2c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6C302.5 263.9 319 224 352 224c8.8 0 16-7.2 16-16s-7.2-16-16-16c-33 0-49.5-39.9-26.2-63.2c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0C279.9 129.5 240 113 240 80c0-8.8-7.2-16-16-16zm-24 96a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm40 80a16 16 0 1 1 32 0 16 16 0 1 1 -32 0z"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user