877 Commits

Author SHA1 Message Date
Pax1601
119a6f620c Merge pull request #901 from Pax1601/main
Main
2024-07-23 18:34:26 +02:00
Pax1601
3e22247f76 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2024-07-23 18:31:49 +02:00
Pax1601
854bef15e0 Update OlympusCameraControl.lua 2024-07-23 18:31:48 +02:00
Pax1601
aacf6d99bc Merge pull request #900 from Pax1601/release-candidate
Added background arcigs layer
2024-07-23 09:57:59 +02:00
Davide Passoni
a8595a97d8 Added default background arcgis layer 2024-07-23 09:57:01 +02:00
Pax1601
c630fe3045 Update logger.cpp 2024-07-22 18:46:20 +02:00
Pax1601
05c7d8166b Merge pull request #899 from Pax1601/main
Main
2024-07-22 18:35:09 +02:00
Pax1601
1d3d8ca705 Update logger.cpp 2024-07-22 18:34:39 +02:00
Pax1601
97a11d6873 Merge pull request #898 from Pax1601/release-candidate
Fixed error logger clearing file at all logs
2024-07-22 18:04:18 +02:00
Pax1601
15e23564c2 Fixed error logger clearing file at all logs 2024-07-22 17:57:16 +02:00
Pax1601
42782c60a4 Merge pull request #897 from Pax1601/release-candidate
Manager error fix
2024-07-22 16:53:19 +02:00
Pax1601
62b2b13d75 Fixed error of manager downloading wrong version 2024-07-22 16:51:59 +02:00
Pax1601
8bf2048d4d Merge pull request #896 from Pax1601/main
Main
2024-07-22 15:48:19 +02:00
Pax1601
0fee5c8e7f Update version.json 2024-07-22 15:47:57 +02:00
Pax1601
b5e47fdbe6 Merge pull request #895 from Pax1601/release-candidate
Merge release candidate to main for v1.0.4 release
2024-07-22 15:47:29 +02:00
Pax1601
c85e923899 Removed documentation workflow 2024-07-22 15:36:12 +02:00
Pax1601
a897401975 Log is truncated and no longer appended, decrease camera link status check update 2024-07-22 15:31:55 +02:00
Pax1601
2f43a84224 Update version.json 2024-07-18 12:45:46 +02:00
Pax1601
274c16851e Minor update to export scripts and added Kiowa 2024-07-18 10:57:41 +02:00
Pax1601
e77356cb61 Added Afghanistan map 2024-07-18 10:02:17 +02:00
Pax1601
f4e77b1f5b Merge pull request #894 from Pax1601/release-candidate
v1.0.4
2024-07-17 16:58:13 +02:00
Pax1601
95247062a3 Merge branch 'release-candidate' of https://github.com/Pax1601/DCSOlympus into release-candidate 2024-07-17 16:49:26 +02:00
Pax1601
959b083a60 Added auto installation of VS Redists 2024-07-17 16:49:21 +02:00
Pax1601
395409ecae Update README.md 2024-07-17 15:51:11 +02:00
Pax1601
5a2b050104 Merge pull request #892 from Pax1601/bobprofisker-patch-1
Update README.md
2024-07-17 15:50:40 +02:00
Pax1601
732b837a46 Update README.md 2024-07-17 15:44:55 +02:00
Pax1601
d60d2e78ef Update README.md 2024-07-17 15:43:50 +02:00
Davide Passoni
a15d2e2ec7 Fixed incorrect removal of airbases on map when changing layer 2024-06-27 11:40:47 +02:00
bobprofisker
df1839cee0 Update README.md 2024-06-23 23:22:16 +01:00
Pax1601
1b4d3dd832 Added configuration parameters for vcpkg 2024-06-17 17:56:33 +02:00
Davide Passoni
0e414850bd All map layers and mirrors moved to config (THANKS WIRTS) 2024-06-13 16:26:12 +02:00
Pax1601
40e984982b Merge branch 'release-candidate' of https://github.com/Pax1601/DCSOlympus into release-candidate 2024-06-11 17:55:47 +02:00
Pax1601
d7c278b034 Minor bugfix in map creator scripts 2024-06-11 17:55:44 +02:00
Pax1601
4e679344d0 Merge pull request #891 from Pax1601/automatic-map-config
Added automatic read of config file to setup map layers
2024-06-06 12:08:55 +02:00
Davide Passoni
b0ab0ae8cf Added automatic read of config file to setup map layers 2024-06-06 12:08:34 +02:00
Pax1601
6edcd8a5ce Merge pull request #889 from Pax1601/db-updates
Db updates
2024-05-29 16:12:07 +02:00
Pax1601
aa0cca67a1 Added HB F-4 to databases 2024-05-29 16:05:57 +02:00
Pax1601
c477dcd065 Updated python scripts 2024-05-29 15:49:37 +02:00
Pax1601
6db4455d5a Tony's update to unit databases 2024-05-29 09:20:37 +02:00
Pax1601
54bf19d410 Merge pull request #888 from Pax1601/kola-map
Kola map
2024-05-29 09:01:08 +02:00
Pax1601
52833cadee Added configuraiton files for caucasus 2024-05-26 19:27:52 +02:00
Davide Passoni
6a45bc9e79 Added configuration files for syria and caucasus 2024-05-26 19:15:41 +02:00
Pax1601
88d17d1cb3 Merge branch 'release-candidate' of https://github.com/Pax1601/DCSOlympus into release-candidate 2024-05-23 20:21:12 +02:00
Pax1601
8c27fdb53c Improvements in map generator script 2024-05-23 20:21:09 +02:00
Davide Passoni
e7777a2a48 Added configuration files for different maps 2024-05-23 20:17:25 +02:00
bobprofisker
fa4a0ccecb add constant.ts kola map
add constant.ts kola map
2024-05-19 13:49:06 +01:00
bobprofisker
b54aa45377 kola.json add airbases list
added the kola.json airbase list of information for runways, ils, tacan etc
2024-05-19 13:42:31 +01:00
bobprofisker
eecdcad8e7 airbases.js add kola
addedd kola theatre
2024-05-19 13:39:09 +01:00
bobprofisker
d68ac6cf2b index.d.ts kola
added kola to index
2024-05-19 13:11:42 +01:00
Pax1601
e39b6b5eea Update .gitignore 2024-05-18 17:51:59 +02:00
Pax1601
4eb1b3ef6d Update README.md 2024-05-14 21:02:03 +02:00
Pax1601
4204a4b150 Merge pull request #887 from Pax1601/Pax1601-patch-1
Update README.md
2024-05-14 21:00:16 +02:00
Pax1601
b64d336922 Update README.md 2024-05-14 21:00:05 +02:00
Pax1601
19c1ae82a2 Configurable wait period added 2024-04-06 15:47:27 +02:00
Pax1601
61dc9c8b31 Added compression step to image generation 2024-03-23 13:18:00 +01:00
Pax1601
d078105eb7 Merge pull request #886 from Pax1601/740-ships-might-not-be-able-to-shoot-at-points-anymore-ie-tomahawk-stuff
Fixed bug that stopped ships from firing at area
2024-03-20 16:58:57 +01:00
Pax1601
7ee9946f49 Fixed bug that stopped ships from firing at area 2024-03-20 16:56:25 +01:00
Pax1601
5507bca68d Merge pull request #885 from Pax1601/857-file-import-fails-if-alt-value-present-in-targetposition-entry
857 file import fails if alt value present in targetposition entry
2024-03-20 16:43:13 +01:00
Pax1601
535b95242c Made separation larger for ships 2024-03-20 16:42:46 +01:00
Pax1601
e40b79d2c4 Added fix for navy units too 2024-03-20 16:34:50 +01:00
Pax1601
ecd0581942 When spawning multiple ground units they are now arranged in square, and no longer one on top of the other 2024-03-20 16:33:51 +01:00
Pax1601
4f7c3988a0 Merge pull request #884 from Pax1601/857-file-import-fails-if-alt-value-present-in-targetposition-entry
Made target position optionally vec2 or vec3
2024-03-20 16:04:08 +01:00
Pax1601
5b7e63b02d Made target position optionally vec2 or vec3 2024-03-20 16:03:39 +01:00
Pax1601
ef99c21380 Merge pull request #883 from Pax1601/862-iads-creator-not-spawning-units
Added missing default values for skill of ground units in IADS generator
2024-03-18 08:34:23 +01:00
Pax1601
e0ad679b57 Added missing default values for skill of ground units in IADS generator 2024-03-18 08:33:57 +01:00
Pax1601
61fb80d67f Merge pull request #882 from Pax1601/856-camera-control-produces-jerky-movement-on-browsers-different-from-chrome
Fixed camera control on Firefox, added slider to control zoom level, …
2024-03-17 15:58:24 +01:00
Pax1601
a9a0332465 Fixed camera control on Firefox, added slider to control zoom level, and other improvements 2024-03-17 15:58:05 +01:00
Pax1601
4494a5ccbb Merge pull request #879 from Pax1601/https-test
Added ability to enable https in express
2024-03-13 15:06:05 +01:00
Davide Passoni
f0c4b10084 Added ability to enable https in express 2024-03-13 15:05:30 +01:00
Pax1601
0bdf362174 Improved and generalized DCS maps handling 2024-03-13 15:01:35 +01:00
Pax1601
a53cca8dda Merge pull request #877 from Pax1601/manager-improvements
Multiple manager improvements and bug fixes
2024-03-11 17:26:01 +01:00
Davide Passoni
9aad81588a Minor manager bugfixes 2024-03-11 17:25:35 +01:00
Davide Passoni
5ba1498802 Map generation improvements 2024-03-11 16:57:50 +01:00
Davide Passoni
539b183da8 Merge branch 'release-candidate' of https://github.com/Pax1601/DCSOlympus into release-candidate 2024-03-11 15:37:21 +01:00
Pax1601
396c061a3e Multiple manager improvements and bug fixes 2024-03-10 18:38:55 +01:00
Pax1601
8c7f6abb1c Added more configurability to map generator 2024-03-10 13:43:09 +01:00
Pax1601
5cc42dd9cf Embedded DCS maps directly into website 2024-03-10 10:13:25 +01:00
Pax1601
f52b5f419e Merge pull request #861 from Pax1601/855-map-generator-fails-when-a-single-put-request-is-dropped
855 map generator fails when a single put request is dropped
2024-03-08 16:28:08 +01:00
Pax1601
3b38ca5920 Merge pull request #860 from Pax1601/853-proxy-middleware-reroutes-to-address-if-backend-api-is-enabled
If address is *, proxy middleware reroutes to localhost
2024-03-08 16:27:42 +01:00
Pax1601
86cfb4fb2f Merge pull request #859 from Pax1601/858-export-to-file-files-nothing-happens-when-the-button-is-clicked
Fixed checkbox not working in export screen
2024-03-08 16:26:55 +01:00
Davide Passoni
166631d618 Increased pixel sweep when calibrating 2024-03-08 16:23:59 +01:00
Davide Passoni
013546a45b Fixed checkbox not working in export screen 2024-03-08 16:22:30 +01:00
Davide Passoni
a2c8563adf Added argpars for better control of script execution 2024-03-08 16:04:55 +01:00
Davide Passoni
0c8de2dcf3 Added retry algorithm for put request and timestamps 2024-03-08 09:24:52 +01:00
Davide Passoni
4f3491062b If address is *, proxy middleware reroutes to localhost 2024-03-07 17:36:50 +01:00
Pax1601
cc8c25a283 Merge pull request #852 from Pax1601/advanced-map-layers
Advanced map layers
2024-03-07 17:21:46 +01:00
Davide Passoni
70740233a9 Create map_generation.md 2024-03-07 13:14:50 +01:00
Pax1601
f2d4f0b0ca Fixed layer resolution 2024-03-06 16:42:58 +01:00
Davide Passoni
153ca01b96 Merge branch 'release-candidate' of https://github.com/Pax1601/DCSOlympus into release-candidate 2024-03-05 15:16:18 +01:00
Pax1601
f667410a56 Merge branch 'release-candidate' of https://github.com/Pax1601/DCSOlympus into release-candidate 2024-03-05 00:28:03 +01:00
Pax1601
f13545eae9 Edited installation message, fixed dev environment for server 2024-03-05 00:27:35 +01:00
Davide Passoni
7ee24b1c7c More work on docs 2024-03-04 18:08:06 +01:00
Davide Passoni
29784310fc Started updating docs 2024-03-04 17:38:34 +01:00
Davide Passoni
3427fcea7e Removed unnecessary dependency 2024-03-04 11:09:10 +01:00
Pax1601
c99b5ed19f Added calibration to map generator 2024-03-04 08:41:24 +01:00
Davide Passoni
2118ded496 More general handling of zoom levels 2024-02-29 17:22:29 +01:00
Davide Passoni
4401261446 Merge branch 'release-candidate' into advanced-map-layers 2024-02-29 17:11:04 +01:00
Davide Passoni
a6ec3a8cd0 Fixed error in updater code 2024-02-29 16:06:03 +01:00
Davide Passoni
6e6da64c51 Added ability to define map layers 2024-02-29 16:05:21 +01:00
Pax1601
a84e190548 Merge pull request #851 from Pax1601/camera-control
Implemented camera control from Olympus to DCS
2024-02-29 12:22:45 +01:00
Davide Passoni
e0238c2680 Removed DCS map from default json 2024-02-29 12:12:34 +01:00
Davide Passoni
a60f2e7b62 Modified website to keep camera link if dropped 2024-02-29 12:11:11 +01:00
Davide Passoni
4782596e3c Added installation/deletion of camera control plugin from manager 2024-02-29 10:54:52 +01:00
Pax1601
832568aa00 Completed camera control server in lua and more work on merging algorithm 2024-02-28 18:58:40 +01:00
Davide Passoni
05e0cc393a Complete camera control UI 2024-02-27 16:46:11 +01:00
Pax1601
c74258e3ad Completed automatic algorithm 2024-02-26 08:55:03 +01:00
Davide Passoni
2e1c3ec4b9 Added ability to add more map sources 2024-02-23 16:25:19 +01:00
Davide Passoni
9a571132c8 Refined automatic map generation script 2024-02-23 15:54:49 +01:00
Davide Passoni
acb55044d1 More work on automatic map creation 2024-02-22 17:46:34 +01:00
Pax1601
14679bd7d8 Added code for map creation and camera control 2024-02-22 08:01:13 +01:00
Pax1601
3c9af59051 Merge pull request #849 from Pax1601/848-add-zip-only-release-folder
Added script to produce zip only version
2024-02-20 11:41:20 +01:00
Davide Passoni
8390a25c50 Fixed error in elevation routes
Was hardcoded to load relative config file
2024-02-20 11:38:02 +01:00
Davide Passoni
97b277edda Added script to produce zip only version 2024-02-20 11:23:48 +01:00
Pax1601
462fa53c80 Merge pull request #847 from Pax1601/745-script-error-on-getpayload
Update mist.lua
2024-02-20 10:26:25 +01:00
Davide Passoni
945c45803b Update mist.lua 2024-02-20 10:25:49 +01:00
Pax1601
20917da437 Merge pull request #844 from Pax1601/713-number-of-selected-units
Number of selected units now shown
2024-02-20 09:36:21 +01:00
Davide Passoni
cd25509d3d Merge branch 'release-candidate' into 713-number-of-selected-units 2024-02-20 09:35:32 +01:00
Pax1601
4c3f80d7d7 Merge pull request #837 from Pax1601/673-status-bar-hit-box
Rapid controls' box now overflows un-obstructively
2024-02-20 09:35:02 +01:00
Davide Passoni
fac32476d4 Merge branch 'release-candidate' into 673-status-bar-hit-box 2024-02-20 09:33:35 +01:00
Davide Passoni
3fa88f3cdf Update .gitignore 2024-02-20 09:31:07 +01:00
Pax1601
46135f7ae0 Merge pull request #846 from Pax1601/separate-client
Separate client
2024-02-19 19:29:31 +01:00
Pax1601
f6e9503045 Removed test script 2024-02-19 18:54:25 +01:00
Davide Passoni
39c28ffb04 Added problem matchers 2024-02-19 16:45:55 +01:00
Davide Passoni
6373fd300d Fixed output for build debug 2024-02-19 15:52:20 +01:00
Davide Passoni
04f281db56 Fixed babel preset-env 2024-02-19 15:48:26 +01:00
Davide Passoni
5f2fb60e1f Added build debug step in check_setup 2024-02-19 15:41:40 +01:00
Davide Passoni
4efd48c4b9 Added check on correct setup of the environment 2024-02-19 15:34:39 +01:00
PeekabooSteam
fb6ac40af8 Number of selected units now shown 2024-02-11 15:55:13 +00:00
PeekabooSteam
9daa683b42 Rapid controls' box now overflows unobsctrutively 2024-02-11 12:58:32 +00:00
Pax1601
baffc9af49 Merge pull request #826 from Pax1601/813-fix-last-details-of-the-manager
Fixed broken guide links
2024-02-10 10:29:15 +01:00
Pax1601
bc6c70928f Updated plugin scripts to new structure
Fixed copy scripts for plugins
2024-02-08 22:55:44 +01:00
Pax1601
9e1503c106 Renamed server->backend in configuration files 2024-02-08 22:29:26 +01:00
Pax1601
57a700d2d2 Renamed client -> frontend in configuration files
Completed renaming client -> frontend
2024-02-08 22:26:36 +01:00
Pax1601
5ca6c97cbe Split client into frontend website and server 2024-02-08 22:04:23 +01:00
Pax1601
55f3bd5adb Merge pull request #823 from WoodyXP/Fix-Semicolumn-Skill
Fix semicolumn skill
2024-02-08 08:45:11 +01:00
Stefan Arsic
bf7c4beccd Update OlympusCommand.lua 2024-02-08 00:19:47 +01:00
Stefan Arsic
14d44babe7 Added missing semicolumn 2024-02-08 00:16:09 +01:00
Stefan Arsic
30a90a96d8 Merge branch 'Fix-Semicolumn-Skill' of https://github.com/WoodyXP/DCSOlympus into Fix-Semicolumn-Skill 2024-02-08 00:15:11 +01:00
Stefan Arsic
c621b5dd85 Added missing semicolumn1 2024-02-08 00:13:42 +01:00
Pax1601
63bdf44e17 Merge pull request #821 from WoodyXP/681_newest_changes_skill
681 newest changes skill
2024-02-07 18:12:11 +01:00
Pax1601
029decf969 Merge pull request #819 from Pax1601/PeekabooSteam-patch-1
Update index.ejs
2024-02-07 08:56:50 +01:00
WoodyXP
b5c7eaf36e Change the name of default livery 2024-02-06 13:36:22 +01:00
WoodyXP
99de17a858 Merge branch '681_newest_changes_skill' of https://github.com/WoodyXP/DCSOlympus into 681_newest_changes_skill 2024-02-06 11:11:40 +01:00
WoodyXP
5765ade7f8 Change the location of the skill select 2024-02-06 11:11:16 +01:00
Stefan Arsic
59a8fba14d Made unit.skill instead of just skill 2024-02-06 09:43:24 +01:00
WoodyXP
965b67b8ab Sort SkillDropdown by Skill level 2024-02-06 09:27:55 +01:00
Stefan Arsic
0ef3abbffa Merge branch 'Pax1601:release-candidate' into 681_newest_changes_skill 2024-02-03 22:42:28 +01:00
Stefan Arsic
2124e9cd42 Fixed setting skill level 2024-02-03 22:29:26 +01:00
PeekabooSteam
2f1a0ad7d3 Update index.ejs 2024-01-31 15:50:47 +00:00
Pax1601
24e6c219f5 Fixed broken guide links 2024-01-31 16:41:28 +01:00
Pax1601
daec6dab5b Merge pull request #818 from Pax1601/813-fix-last-details-of-the-manager
Fixed missing sleep in popup callback
2024-01-31 15:42:38 +01:00
Pax1601
3708d4150c Fixed missing sleep in popup callback 2024-01-31 15:40:31 +01:00
Pax1601
11518485de Merge pull request #817 from Pax1601/813-fix-last-details-of-the-manager
Fixed error in port detection and default radio buttons values
2024-01-31 14:51:59 +01:00
Pax1601
29118e1ea1 Fixed error in port detection and default radio buttons values 2024-01-31 14:51:42 +01:00
Pax1601
aa5b62c1d2 Merge pull request #816 from Pax1601/813-fix-last-details-of-the-manager
Finished manager bugfix
2024-01-31 13:00:40 +01:00
Pax1601
f320cb122c Finished manager bugfix 2024-01-31 12:59:46 +01:00
Pax1601
bb7738724f Merge pull request #815 from Pax1601/813-fix-last-details-of-the-manager
813 fix last details of the manager
2024-01-30 18:56:59 +01:00
Pax1601
df7eebed39 Added temporary message if no instances detected 2024-01-30 18:56:37 +01:00
Pax1601
21040da195 Added expert settings mode 2024-01-30 17:45:25 +01:00
Pax1601
be625fdca9 Removed autoselection of radio buttons in wizard 2024-01-29 17:52:33 +01:00
Pax1601
7ee3fb883b Added success/failure banner and fixed instance status 2024-01-29 13:24:09 +01:00
Pax1601
c2f6edfd74 Minor refactoring of css, fixed graphical inconsistencies 2024-01-28 16:37:29 +01:00
Pax1601
4f5023b45c Added fade transition between pages 2024-01-28 15:14:30 +01:00
Pax1601
f0ab43d320 Merge pull request #812 from Pax1601/manager-wizard
Bugfixing on manager
2024-01-28 10:22:19 +01:00
Pax1601
d2e803ab82 Bugfixing on manager 2024-01-28 10:21:12 +01:00
Pax1601
ca45b8b906 Merge pull request #808 from Pax1601/807-stop-search-engines-indexing-servers
Added noindex
2024-01-26 17:35:30 +01:00
Pax1601
ec020f7b5d Merge pull request #811 from Pax1601/manager-wizard
Manager wizard
2024-01-26 17:34:51 +01:00
Pax1601
f2161da162 Completed basic functionality development 2024-01-26 17:31:36 +01:00
Pax1601
613aed2d2b Added config page and loading bars 2024-01-25 17:42:16 +01:00
Pax1601
1d38bd6fea Added folder selection page and port availability checks 2024-01-24 19:08:42 +01:00
Pax1601
6f7b251094 Readded dashboard to manager 2024-01-23 08:01:34 +01:00
PeekabooSteam
a9d873a05f Added noindex 2024-01-18 06:30:56 +00:00
Pax1601
05f98b2738 Work on result page 2024-01-17 20:14:22 +01:00
Pax1601
1568c65492 Implement more wizard page, result page still wip 2024-01-17 17:51:27 +01:00
Pax1601
4a5c4ed7d7 Merge branch 'manager-wizard' of https://github.com/Pax1601/DCSOlympus into manager-wizard 2024-01-17 08:08:33 +01:00
Pax1601
ff7385cf49 Update tasks.json 2024-01-17 08:08:29 +01:00
Pax1601
a0de159234 More work on new manager design 2024-01-16 17:45:52 +01:00
Pax1601
d56a95cfa3 Added distinction between basic and advanced mode 2024-01-13 10:01:30 +01:00
Stefan Arsic
497f718e4b Added option for ground units to change skill 2024-01-12 22:33:43 +01:00
Stefan Arsic
9942ff476b Made the skill work 2024-01-11 19:41:04 +01:00
WoodyXP
c042d2b6f5 Changes 2024-01-11 17:37:28 +01:00
WoodyXP
b9201d583c Added tiny fixed 2024-01-11 14:16:19 +01:00
Pax1601
3f67125f20 Fixed missed call to copy.bat 2024-01-11 09:55:48 +01:00
WoodyXP
4f72f10642 Commiting uncommited files 2024-01-11 09:28:39 +01:00
WoodyXP
89fb0a9da1 Hopefully added something that can make the flight skill change 2024-01-11 09:10:35 +01:00
Pax1601
0e9b249bba Merge pull request #804 from Pax1601/manager-wizard
Manager wizard
2024-01-10 11:30:20 +01:00
Pax1601
0f0ba4c725 Added spinner when starting Olympus 2024-01-10 11:29:18 +01:00
Pax1601
5542109daf Merged view and update pages according to new design 2024-01-09 17:33:20 +01:00
Pax1601
ec91b597c8 Update dcsinstance.js 2024-01-04 17:11:46 +01:00
Pax1601
d0f85ae977 Merge pull request #803 from Pax1601/manager-wizard
Made instructions clearer and removed folder deletion on update
2024-01-04 16:04:22 +01:00
Pax1601
7d6930fba9 Made instructions clearer and removed folder deletion on update 2024-01-04 16:03:38 +01:00
Pax1601
2232a114b7 Merge pull request #802 from Pax1601/manager-wizard
Version is now checked on manager startup
2024-01-04 14:53:39 +01:00
Pax1601
33ce537993 Version is now checked on manager startup 2024-01-04 14:53:03 +01:00
Pax1601
1ab8e9a16f Merge pull request #801 from Pax1601/manager-wizard
Manager wizard
2024-01-04 13:04:10 +01:00
Pax1601
73b1714191 Merge branch 'release-candidate' into manager-wizard 2024-01-04 13:03:44 +01:00
Pax1601
cb793e9d0f Fixed debug scripts for client 2024-01-04 13:02:03 +01:00
Pax1601
7686a60bfd Added log file 2024-01-04 12:10:01 +01:00
Pax1601
38027b6ff3 Added debug options in package folder for manager 2024-01-04 11:05:47 +01:00
Pax1601
a512b0e405 Update package.json 2024-01-04 10:26:34 +01:00
Pax1601
46fb6a98d5 Increased version in dlls rc files 2024-01-04 10:14:46 +01:00
Pax1601
1a8a19ae5c Added ability to retain user-editable files 2024-01-04 10:13:34 +01:00
Pax1601
8865ded4bd Split increase_version file to work with build folder 2024-01-04 09:51:43 +01:00
Pax1601
7adfe9cce4 Update INSTRUCTIONS.txt 2024-01-04 09:40:23 +01:00
Pax1601
85e5a6a309 Fixed wrong url for databases api call 2024-01-03 18:50:16 +01:00
Pax1601
d681d3cee0 Fixed error in database api 2024-01-03 18:44:06 +01:00
Pax1601
c5650ba29a Moved location of databases 2024-01-03 18:20:51 +01:00
Pax1601
ef0a2d2ddc Modified increase_version.js to operate on build folder 2024-01-03 18:08:16 +01:00
Pax1601
f143e8d874 Update build_package.bat 2024-01-03 18:06:01 +01:00
Pax1601
89c1660988 Fixed errors in build scripts 2024-01-03 18:05:16 +01:00
Pax1601
4e7c8ef856 Refactoring of building scripts 2024-01-03 17:48:38 +01:00
Pax1601
8024db9579 Renamed src to backend 2024-01-03 16:19:16 +01:00
Pax1601
a0634a7f99 Documented manager code 2024-01-03 15:08:06 +01:00
Pax1601
7bf6c1bb23 Update preload.js 2024-01-03 13:33:58 +01:00
Pax1601
a62ae4e21e Added check on github api for latest release 2024-01-03 13:25:27 +01:00
Pax1601
6c466a8bb8 Implemented automatic updating 2024-01-03 13:12:04 +01:00
Pax1601
36f828acb1 Merge pull request #797 from Pax1601/manager-wizard
Added package url to version.json for autoupdate
2024-01-03 10:07:46 +01:00
Pax1601
046e096b9e Added package url to version.json for autoupdate 2024-01-03 09:44:12 +01:00
Pax1601
82df3cb316 Delete duplicate build CI step 2024-01-03 09:27:24 +01:00
Pax1601
1ba16f82e7 Merge pull request #796 from Pax1601/main
Main
2024-01-03 09:23:02 +01:00
Pax1601
72c6bb0086 Merge pull request #776 from Pax1601/739-spawn-history
739 spawn history
2024-01-03 09:19:42 +01:00
Pax1601
8bb4334187 Delete package-lock.json 2024-01-03 09:19:27 +01:00
Pax1601
59a9069d4b Merge pull request #734 from Dahlgren/feature/docker
Basic Docker image for client app
2024-01-03 09:18:28 +01:00
Pax1601
ba534f1786 Merge pull request #737 from Dahlgren/ci/github-actions-client
CI workflow for client build on PRs
2024-01-03 09:17:45 +01:00
Pax1601
72bb54bde0 Merge pull request #785 from Pax1601/722-unit-eras-in-alphabetical-order-instead-of-chronological-order
Set ordering of eras in command mode settings
2024-01-03 09:14:15 +01:00
Pax1601
cb3f46303c Merge pull request #788 from Pax1601/779-add-json-validation
779 add json validation
2024-01-03 09:13:38 +01:00
Pax1601
57f021f995 Merge pull request #790 from Pax1601/786-disable-command-mode-settings-until-enabled
Disabled options and applied faded styling
2024-01-03 09:11:10 +01:00
Pax1601
bf4b2272e4 Merge pull request #789 from SevFle/725-configurator-different-passwords
725 Add check for duplicate passwords in configurator
2024-01-01 22:05:03 +01:00
Pax1601
31999ec00c Merge pull request #793 from Pax1601/manager-wizard
Manager wizard
2024-01-01 22:03:07 +01:00
Pax1601
086b6736b0 Added desktop shortcuts 2024-01-01 18:48:31 +01:00
Pax1601
bf93b8e90a Added simplified mode and disabled not useful buttons 2024-01-01 18:19:56 +01:00
PeekabooSteam
4d6bd6c6e9 Disabled options and applied faded styling 2023-12-31 14:04:54 +00:00
Pax1601
c9dc5eb2f5 Added ability to start/stop client 2023-12-31 12:02:24 +01:00
SevFle
5fdb704d68 Add check for duplicate passwords 2023-12-30 10:43:51 +01:00
Pax1601
6d18e25232 Merge pull request #787 from Pax1601/manager-wizard
Modified manager to new design
2023-12-29 11:29:30 +01:00
Pax1601
7391006a2f Modified manager to new design 2023-12-29 11:28:28 +01:00
PeekabooSteam
9207585f5b Set ordering of eras in command mode settings 2023-12-28 17:45:21 +00:00
PeekabooSteam
cb53da3a71 More style tweakage 2023-12-28 16:56:29 +00:00
PeekabooSteam
d2ac5aeff8 Tweaked tab position to be a pinch lower 2023-12-28 16:27:28 +00:00
PeekabooSteam
b646087026 Buttons now have cute icons ^_^ 2023-12-28 16:07:04 +00:00
PeekabooSteam
82e60cd2cf Added more info for when enums aren't matched 2023-12-28 14:10:51 +00:00
Björn Dahlgren
9d46a1c73f Basic Docker image for client app 2023-12-27 23:49:54 +01:00
PeekabooSteam
955057183d Added JSON validation for imports. 2023-12-27 16:26:31 +00:00
Pax1601
0396d6bf9c Update README.md 2023-12-23 16:01:12 +01:00
Pax1601
ee1d89007c Update README.md 2023-12-23 15:59:26 +01:00
Pax1601
4245927a6c Update build_package.yml 2023-12-23 08:27:02 +01:00
Pax1601
f585828936 Merge pull request #782 from Pax1601/manager-wizard
Manager wizard
2023-12-22 21:28:47 +01:00
Pax1601
7450c9e506 Update install.bat 2023-12-22 21:28:26 +01:00
Pax1601
d957cd6655 Merge branch 'manager-wizard' of https://github.com/Pax1601/DCSOlympus into manager-wizard 2023-12-22 21:26:17 +01:00
Pax1601
ef91f840ae Update package.json 2023-12-22 21:26:12 +01:00
Pax1601
17c74fbe91 Merge pull request #781 from Pax1601/manager-wizard
Manager wizard
2023-12-22 19:23:35 +01:00
Pax1601
17a7a1889e Merge branch 'release-candidate' into manager-wizard 2023-12-22 19:23:25 +01:00
Pax1601
24ed96b348 Manager installation process completed 2023-12-22 19:22:49 +01:00
Pax1601
15e8c9e791 Completed installation procedure on wizard 2023-12-22 18:44:31 +01:00
PeekabooSteam
de14f6c738 Airbase data being validated 2023-12-22 15:11:59 +00:00
Pax1601
92b1a46e8a Started wizard implementation 2023-12-21 18:06:59 +01:00
Pax1601
cbaadb6fc9 Added fallback if powershell not installed 2023-12-21 15:33:28 +01:00
Pax1601
44295673dc Fixed typo and uninstallation error 2023-12-21 15:13:20 +01:00
Pax1601
8bf0f403e2 Updated instructions 2023-12-21 12:00:40 +01:00
Pax1601
917a0d10e5 Update package.bat 2023-12-21 11:44:58 +01:00
Pax1601
9c65411733 Updated installation method, remove installer 2023-12-21 11:44:11 +01:00
PeekabooSteam
6c315d89e1 Finished styling; menu closes on click 2023-12-20 17:08:04 +00:00
Pax1601
b5f1a459c2 Update preload.js 2023-12-20 18:05:14 +01:00
Pax1601
6b12000979 Removed wrong await 2023-12-20 18:02:05 +01:00
Pax1601
1aec7f8081 Updated copy step during compilation 2023-12-20 17:39:25 +01:00
Pax1601
5f0e96e2e6 Update version.json 2023-12-20 17:25:25 +01:00
Pax1601
678a8585a9 Update build_package.yml 2023-12-20 17:24:32 +01:00
Pax1601
e632e379b6 Merge pull request #773 from Pax1601/Pax1601-patch-1
Update documentation.yml
2023-12-20 17:03:24 +01:00
Pax1601
1a7d2b5028 Update documentation.yml 2023-12-20 17:03:16 +01:00
Pax1601
ce28d49510 Merge pull request #763 from Pax1601/747-improve-configurator-for-automatic-saved-games-folder-detection
747 improve configurator for automatic saved games folder detection
2023-12-20 16:58:32 +01:00
Pax1601
0ac632cc9b Merge branch 'main' into 747-improve-configurator-for-automatic-saved-games-folder-detection 2023-12-20 16:58:24 +01:00
Pax1601
47e4757b6e Update defines.h 2023-12-20 16:57:14 +01:00
Pax1601
d21ee2a7b6 Update olympus.vcxproj 2023-12-20 16:56:43 +01:00
Pax1601
0cec61afea Update luatools.vcxproj 2023-12-20 16:56:23 +01:00
Pax1601
ff04364178 Update logger.vcxproj 2023-12-20 16:55:20 +01:00
Pax1601
0cf2733d55 Update dcstools.vcxproj 2023-12-20 16:54:32 +01:00
Pax1601
f5319ed654 Update core.vcxproj 2023-12-20 16:52:41 +01:00
Pax1601
cfef9f4bc4 Minor refactoring 2023-12-20 16:42:30 +01:00
Pax1601
6abf7f059a Merge pull request #738 from Dahlgren/ci/build-documentation-main
Only build documentation for main branch push
2023-12-20 16:32:04 +01:00
Pax1601
c0c1ff6e17 Merge pull request #752 from Pax1601/726-flight-level-is-three-digits-should-include-leading-zeros
FL now has three digits
2023-12-20 16:31:29 +01:00
Pax1601
856dba83a5 Merge pull request #753 from Pax1601/Shredmetal-patch-1
Shredmetal patch 1
2023-12-20 16:31:06 +01:00
Pax1601
2f37916595 Merge pull request #735 from LethalsLoaded/adapt-nomenclature
Fix login screen nomenclature
2023-12-20 16:30:44 +01:00
Pax1601
f36a29570b Merge pull request #731 from Dahlgren/bugfix/case-sensitive-fs-paths
Fix wrong file paths for databases on case sensitive fs
2023-12-20 16:30:14 +01:00
Pax1601
62a3719163 Update package.json 2023-12-20 16:26:15 +01:00
Pax1601
e9511e9233 Update increase_version.js 2023-12-20 16:19:01 +01:00
Pax1601
51cf15b8cc Update notes.txt 2023-12-20 15:35:40 +01:00
Pax1601
278d0bdd3c Updated manager to allow updating 2023-12-20 15:34:55 +01:00
Pax1601
0a07f85fcf Added release notes file 2023-12-20 14:15:40 +01:00
Pax1601
7face05e12 Update logger.cpp 2023-12-20 14:08:49 +01:00
Pax1601
22ad5d5972 Small updates and moved log location to Log folder
Fixed logger error
2023-12-20 14:07:59 +01:00
Pax1601
2e194d557a Updated installations process 2023-12-20 12:41:05 +01:00
Pax1601
1a76df2056 Update increase_version.js 2023-12-20 12:35:01 +01:00
Pax1601
787bf13f3c Completed manager and moved client to common folder 2023-12-20 12:33:46 +01:00
Shredmetal
10f1c6a862 Added realistic Hornet Cap loadouts, formatted lua
Added: 2*AIM-9X, 2*AIM-120, 1*XT; 2*AIM-9X, 6*AIM-120, 2*XT.

Added indentations to lua file for readability
2023-12-20 15:36:52 +08:00
Shredmetal
0366cc38e2 Added realistic AA hornet loadouts to db
Added: 2*AIM-9X, 2*AIM-120, 1*XT; 2*AIM-9X, 6*AIM-120, 2*XT.
2023-12-20 15:35:32 +08:00
Pax1601
603018d1ef Added argument to vbs script 2023-12-19 18:39:35 +01:00
Pax1601
66ae06056b Created client app with electronc 2023-12-19 18:20:07 +01:00
Pax1601
17486ab40c Update increase_version.js
Update increase_version.js

Replaced back version
2023-12-19 14:49:32 +01:00
Pax1601
6cae91b06f Installer modified to not required DCS folder 2023-12-19 14:27:11 +01:00
Pax1601
9c055e0d71 Added olympus manager 2023-12-19 13:21:19 +01:00
Shredmetal
db4aeca47d Update mod_ac_loadout_puller.py
removed extraneous comment
2023-12-19 18:48:13 +08:00
Shredmetal
c29a368e5a Update mod_ac_loadout_puller.py 2023-12-19 18:44:01 +08:00
PeekabooSteam
dbe2442bb7 Added data, set list size limit 2023-12-18 20:52:15 +00:00
Shredmetal
2108fc4b26 mod aircraft loadout puller
python script to pull out loadouts from all installed mod aircraft into a lua file understandable by Olympus
2023-12-18 22:54:59 +08:00
PeekabooSteam
48f962ca4b Spawn history is functional 2023-12-18 12:57:44 +00:00
Pax1601
e80a5e8ca1 Added proxy middleware and demo backend app 2023-12-18 12:44:56 +01:00
PeekabooSteam
fb2ecc75eb FL now has three digits 2023-12-17 19:42:30 +00:00
Björn Dahlgren
ee95291418 Only build documentation for main branch push 2023-12-17 19:49:25 +01:00
Björn Dahlgren
46796fce13 CI workflow for client build on PRs 2023-12-17 19:46:32 +01:00
Andrzej Odwald
ee08f57abe - Fix nomenclature 2023-12-17 17:27:16 +00:00
Björn Dahlgren
eb86d8dfca Fix wrong file paths for databases on case sensitive fs 2023-12-17 17:28:57 +01:00
Pax1601
c75e20e58f Update README.md 2023-12-17 08:58:05 +01:00
Pax1601
2c403a9283 Fixed versioning tag 2023-12-14 17:39:42 +01:00
Pax1601
27c78d6a67 Update increase_version.js
Update increase_version.js

Update increase_version.js
2023-12-14 11:24:40 +01:00
Pax1601
e0d33760e0 Update increase_version.js 2023-12-14 11:11:16 +01:00
Pax1601
2d339d7161 Added version tag
Update increase_version.js

Update increase_version.js

Update increase_version.js

Create increase_version.js

Updated workflows

Update .gitignore

Update build.bat

Change hash string

Update increase_version.js

Added commit hash

v1.0.3
2023-12-14 11:04:22 +01:00
Pax1601
243f58ecf3 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-13 22:07:09 +01:00
Pax1601
378dbfc085 Fixed excessively high CPU load 2023-12-13 22:06:51 +01:00
Pax1601
cee6839b5d Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-13 17:47:24 +01:00
Pax1601
f1a836c222 Update olympus.iss 2023-12-13 17:47:13 +01:00
Pax1601
cbf4b56ecb Update msbuild.yml 2023-12-13 17:39:18 +01:00
Pax1601
e2e3da6a0f Update msbuild.yml 2023-12-13 17:37:11 +01:00
Pax1601
3a96808aa5 Update msbuild.yml 2023-12-13 17:36:05 +01:00
Pax1601
d1ccccae18 Update package.bat 2023-12-13 17:35:55 +01:00
Pax1601
d31242124f Update msbuild.yml 2023-12-13 17:14:37 +01:00
Pax1601
8c4996f466 Update msbuild.yml 2023-12-13 17:02:09 +01:00
Pax1601
59b89dc638 Update msbuild.yml 2023-12-13 16:54:56 +01:00
Pax1601
f54ac5c3d8 Update msbuild.yml 2023-12-13 16:53:02 +01:00
Pax1601
666b3e0383 Update msbuild.yml 2023-12-13 16:47:32 +01:00
Pax1601
d8893e21a1 Update msbuild.yml 2023-12-13 16:45:43 +01:00
Pax1601
5391b567b9 Updated workflows 2023-12-13 16:37:37 +01:00
Pax1601
ad7ea014f2 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-13 16:36:04 +01:00
Pax1601
ceb00a239f Added vcpkg manifest 2023-12-13 16:35:42 +01:00
Pax1601
81ab1aa05d Update msbuild.yml 2023-12-13 16:13:19 +01:00
Pax1601
7bf232f146 Update msbuild.yml 2023-12-13 16:10:21 +01:00
Pax1601
3f07271931 Update msbuild.yml 2023-12-13 16:07:54 +01:00
Pax1601
1c30bb006b Merge pull request #711 from Pax1601/CI-tests
Create msbuild.yml
2023-12-13 16:04:45 +01:00
Pax1601
34594ac836 Create msbuild.yml 2023-12-13 16:02:53 +01:00
Pax1601
cee58800e1 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-13 15:18:32 +01:00
Pax1601
ab3b487024 Added doxygen info 2023-12-13 15:18:23 +01:00
Pax1601
91b393eb35 Update ci.yml 2023-12-13 15:00:21 +01:00
Pax1601
edb4ddc287 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-13 15:00:11 +01:00
Pax1601
f9fd5caa9f Updated Doxygen config 2023-12-13 14:59:48 +01:00
Pax1601
d5653a9b1d Added doxygen config file 2023-12-13 14:51:31 +01:00
Pax1601
ec5ff1bf0c Merge pull request #710 from Pax1601/change-LEGAL-extension
Rename LEGAL to LEGAL.txt
2023-12-13 14:47:21 +01:00
Shredmetal
41912d1057 Rename LEGAL to LEGAL.txt 2023-12-13 02:45:30 +08:00
Pax1601
228452fd17 More installer upgrades 2023-12-12 17:34:43 +01:00
Pax1601
484d3dd28f Removed node bundling 2023-12-12 15:02:39 +01:00
Pax1601
a52e7e7b1a Added resource files 2023-12-12 11:39:28 +01:00
Pax1601
92a08f6278 Updated installer 2023-12-12 11:35:15 +01:00
Pax1601
8e3da65433 Added missing bat 2023-12-12 11:04:02 +01:00
Pax1601
3f625c03b9 Compilation scripts updated 2023-12-12 10:45:44 +01:00
Pax1601
4423d5f3d5 v1.0.2 2023-12-12 10:34:25 +01:00
Pax1601
d0fc286c43 v1.0.1 2023-12-11 20:28:38 +01:00
Pax1601
b5443ab0a8 Removed python configurator 2023-12-11 19:48:19 +01:00
Pax1601
e6c34306c9 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-11 19:45:03 +01:00
Pax1601
532a83fe91 Added c++ configurator 2023-12-11 19:44:58 +01:00
Pax1601
293b928764 Update README.md 2023-12-11 10:23:35 +01:00
Pax1601
38d62df75d Update README.md 2023-12-11 10:22:53 +01:00
Pax1601
fbd42ade6e Added window icon 2023-12-10 20:56:19 +01:00
Pax1601
9af1cffe08 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-10 20:36:33 +01:00
Pax1601
b0d92906e5 Fixed incorrect target management for mop and sff 2023-12-10 20:36:28 +01:00
Pax1601
0329e27713 Added ability to force coalition unit in IADS spawner 2023-12-10 20:33:13 +01:00
Pax1601
2d39862b1b Merge pull request #702 from Pax1601/691-pg-missing-airbase-data
691 pg missing airbase data
2023-12-10 20:26:06 +01:00
PeekabooSteam
5c1782ec7f Airbase tweaks, added thechannel.json 2023-12-10 17:53:23 +00:00
Pax1601
6c6117aee3 Fixed minor UI problems 2023-12-10 18:36:25 +01:00
Pax1601
1798e62315 v1.0.0 2023-12-10 18:36:03 +01:00
Pax1601
2b2ed76aa3 Updated databases 2023-12-10 18:35:23 +01:00
PeekabooSteam
38d72a5cd0 Allowed new theatres in API 2023-12-10 17:25:52 +00:00
PeekabooSteam
14ec4a8610 Added Normandy. 2023-12-10 17:23:39 +00:00
PeekabooSteam
bdc7a5bb46 Added Falklands map and Sinaimap map. 2023-12-10 16:29:47 +00:00
Pax1601
131f30405c Merge pull request #693 from Pax1601/ArtificialDogma-patch-1
Update README.md
2023-12-10 11:07:49 +01:00
Pax1601
dbf21e0af9 Merge pull request #694 from Pax1601/684-add-the-spitfire-and-loadouts
684 add the spitfire and loadouts
2023-12-10 11:07:27 +01:00
bobprofisker
9094f8fdc6 forgot to remove stupid wing colour BF-109 2023-12-09 20:49:17 +00:00
bobprofisker
aa0b0a585c Updated databases for spitfire, misc units and helos
Updated databases for spitfire, misc units and helos
2023-12-09 20:34:10 +00:00
bobprofisker
ad61037452 New unit payloads for spit
New unit payloads for spit, also includes clipped wing version
2023-12-09 20:32:52 +00:00
PeekabooSteam
66ed1a99e0 Corrected airbase names for PG 2023-12-09 19:52:00 +00:00
Pax1601
d7dc5769a8 Bugfixing, switched to human name for humans 2023-12-09 18:06:47 +01:00
Pax1601
b0ee653bff Fixed unabled to copy humans 2023-12-09 15:51:16 +01:00
Dogma
5a950e22ce Update README.md 2023-12-09 21:24:34 +11:00
Pax1601
0459d5c625 v0.4.13-alpha-rc5 2023-12-08 15:38:56 +01:00
Pax1601
43d28ebe19 Removed notify and added warning follow roads 2023-12-08 14:27:16 +01:00
Pax1601
187b9be57a Added ability to add mods 2023-12-08 11:54:12 +01:00
Pax1601
564a650403 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-07 15:49:31 +01:00
Pax1601
0e403e8b74 v0.4.12-alpha-rc4 2023-12-07 15:49:27 +01:00
Pax1601
840cdd9049 Update README.md 2023-12-07 15:39:48 +01:00
Pax1601
e5e7e9be14 Added increased load for onRoad movement 2023-12-07 15:22:59 +01:00
Pax1601
e677968ba7 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-07 15:08:01 +01:00
Pax1601
d24b955d52 Multiple bugfixes 2023-12-07 15:07:57 +01:00
Pax1601
48860ff514 Merge pull request #677 from Pax1601/674-airbases-visibility-button-still-dark-when-off
Fixed incorrect colour
2023-12-06 20:39:37 +01:00
PeekabooSteam
0e78b7559b Robots are no longer considered for waypoints 2023-12-06 15:27:05 +00:00
PeekabooSteam
25edfc45e5 Added coalition visibility tooltips 2023-12-06 15:03:15 +00:00
PeekabooSteam
885825e5cc Fixed incorrect colour 2023-12-06 14:54:36 +00:00
Pax1601
344413ae74 Undone wrong change in pcall 2023-12-06 13:08:52 +01:00
Pax1601
fa0643987b Remove need for path variable 2023-12-06 12:37:59 +01:00
Pax1601
dcff462b32 v0.4.11-alpha-rc3 2023-12-06 09:15:44 +01:00
Pax1601
fa04e5f8bb Merge pull request #670 from Pax1601/650-robots-can-be-sent-to-refuel-while-protected
Added extra protection for robots
2023-12-06 08:17:21 +01:00
Pax1601
c8d5f9ce0e Formatted file 2023-12-06 08:17:01 +01:00
Pax1601
55642a89b1 Merge pull request #671 from Pax1601/651-control-tips-quick-options-shown-but-nothing-happens
Removed Quick Options option
2023-12-06 08:12:00 +01:00
PeekabooSteam
f305aa3929 Removed Quick Options option 2023-12-05 21:51:32 +00:00
PeekabooSteam
47ee88c339 Added extra protection for robots 2023-12-05 20:44:26 +00:00
Pax1601
022e041f68 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-05 19:30:50 +01:00
Pax1601
0cc53890c1 v0.4.10-alpha-rc2 2023-12-05 19:30:34 +01:00
Pax1601
e37f7a4977 v0.4.10-alpha-rc1 2023-12-05 19:18:37 +01:00
Pax1601
8d03c6a767 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-05 15:59:25 +01:00
Pax1601
e29fdfd8c7 Fixed typo in map attribution 2023-12-05 15:59:19 +01:00
Pax1601
af619c3687 Merge pull request #666 from Pax1601/rc1-fixes
Rc1 fixes
2023-12-05 15:44:29 +01:00
Pax1601
6afb6682ea Fixed IADS creation, no longer clogs the server 2023-12-05 15:43:48 +01:00
Pax1601
9c2c7f45c6 Demo mode disabled 2023-12-05 11:35:10 +01:00
Pax1601
7fbc19e90a Merge pull request #665 from Pax1601/rc1-fixes
RC1 fixes
2023-12-05 11:31:14 +01:00
Pax1601
8f2f73dc0e RC1 fixes 2023-12-05 11:26:18 +01:00
Pax1601
24a1681337 Merge pull request #663 from Pax1601/task-optimization
Task optimization
2023-12-05 10:07:09 +01:00
Pax1601
304e8ba3a0 Fixed compilation warnings 2023-12-05 10:06:47 +01:00
Pax1601
45b840fa72 Changed default multiplier value 2023-12-05 09:24:13 +01:00
Pax1601
82704f042b Added check on negative speed 2023-12-05 09:22:22 +01:00
Pax1601
87d71da55e Small tweak to multiplier 2023-12-05 09:14:06 +01:00
Pax1601
71cf7c67f7 Fixed change altitude and speed for helicopters 2023-12-05 09:11:36 +01:00
Pax1601
62142ed976 Version 2 of tasking optimization 2023-12-04 21:06:13 +01:00
Pax1601
f56bd514dc Fixed tab order in installer 2023-12-03 21:30:16 +01:00
Pax1601
e30f161d1d Removed unnecessary file 2023-12-03 21:11:14 +01:00
Pax1601
720bfb3118 Added git clean command 2023-12-03 21:06:05 +01:00
Pax1601
4100a3cc67 v0.4.9-alpha-rc1 2023-12-03 21:04:19 +01:00
Pax1601
942993ff6d Added ranges for SAM Sites 2023-12-03 21:00:32 +01:00
Pax1601
fbf435c799 Added missing images, changed mop to da aaa 2023-12-03 20:46:26 +01:00
Pax1601
8fdb0d82e8 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-03 19:54:36 +01:00
Pax1601
dcbebab61b Updated databases 2023-12-03 19:54:33 +01:00
Pax1601
7b10afae43 Merge pull request #644 from Pax1601/639-create-boilerplate-plugin
Added boilerplate plugin
2023-12-03 19:51:32 +01:00
PeekabooSteam
81d8a88abd Removed old definition file 2023-12-03 18:48:51 +00:00
Pax1601
cb14158a0f Merge pull request #645 from WoodyXP/main
Example script to set airbase to a certain coalition
2023-12-03 19:32:13 +01:00
PeekabooSteam
38fc60352a Fixed typo 2023-12-03 18:12:18 +00:00
PeekabooSteam
3748f0d6e3 Added extensive documentation. 2023-12-03 14:23:08 +00:00
Stefan Arsic
edd626d5e5 Example script to set airbase to a certain coalition 2023-12-03 14:38:58 +01:00
PeekabooSteam
f785e75686 Corrected package name 2023-12-03 12:28:19 +00:00
PeekabooSteam
9a46ed70b7 Added boilerplate plugin 2023-12-03 12:24:52 +00:00
Pax1601
532c09a815 Fixed merge error 2023-12-03 11:49:39 +01:00
Pax1601
e430d38c63 Merge pull request #643 from Pax1601/525-ships-spawn-with-0-health-indicated
Health correctly computed for ships too
2023-12-03 11:35:55 +01:00
Pax1601
289b36de6d Health correctly computed for ships too 2023-12-03 11:35:37 +01:00
Pax1601
7e01f40e5c Merge pull request #642 from Pax1601/537-cannot-copy-paste-robots
It's now possible to copy robots
2023-12-03 11:10:17 +01:00
Pax1601
cac4bb5f13 It's now possible to copy robots
Know limitation: it's not possible to copy payloads of units spawned by other scripts. They must be in the .miz file. Don't think we can do much about this.
2023-12-03 11:09:50 +01:00
Pax1601
c8bb041887 Merge pull request #635 from Pax1601/633-unable-to-hide-olympus-controlled-units
633 unable to hide olympus controlled units
2023-12-02 18:32:40 +01:00
PeekabooSteam
9302c5c6d1 Merge branch '633-unable-to-hide-olympus-controlled-units' of https://github.com/Pax1601/DCSOlympus into 633-unable-to-hide-olympus-controlled-units 2023-12-02 16:05:51 +00:00
PeekabooSteam
84a3313f2c TS declarations 2023-12-02 16:04:12 +00:00
PeekabooSteam
1eb3beeb2e Merge branch 'main' into 633-unable-to-hide-olympus-controlled-units 2023-12-02 15:58:37 +00:00
PeekabooSteam
d0e6ef8c6c Changed order 2023-12-02 12:57:58 +00:00
PeekabooSteam
5da1df7e20 Added Olympus unit toggle 2023-12-02 12:47:00 +00:00
Pax1601
16fa6d9805 Updated databases 2023-12-02 13:25:46 +01:00
Pax1601
0ca7766689 Merge pull request #634 from Pax1601/minor-refactoring
Minor refactoring
2023-12-02 12:37:55 +01:00
Pax1601
4342575418 Merge pull request #632 from Pax1601/631-alignment-of-second-bar-in-visibility-options-is-too-tall
Fixed bar height
2023-12-02 12:37:41 +01:00
Pax1601
4cdb73a60d Fixed error in address for configuration 2023-12-02 12:36:42 +01:00
PeekabooSteam
a23c53bcb8 Fixed bar height 2023-12-02 11:04:37 +00:00
Pax1601
19ac4f92e0 Merge branch 'main' into minor-refactoring 2023-12-02 11:20:38 +01:00
Pax1601
0b8f48b4fd Merge pull request #615 from Pax1601/602-attack-mode-not-working-on-ground-and-navy-units
Added ATTACK state for ground and navy units
2023-12-02 11:19:05 +01:00
Pax1601
d2fa94a6cb Minor graphical tweak 2023-12-02 11:17:30 +01:00
Pax1601
da1c674911 Merge branch 'main' into 602-attack-mode-not-working-on-ground-and-navy-units 2023-12-02 10:53:24 +01:00
Pax1601
7184bc1eb2 Merge branch 'main' into 602-attack-mode-not-working-on-ground-and-navy-units 2023-12-02 10:49:28 +01:00
Pax1601
37f30a0f1a Merge pull request #629 from Pax1601/Shredmetal-patch-1
Update LEGAL
2023-12-02 10:48:43 +01:00
Pax1601
04f4b3e78a Merge pull request #626 from Pax1601/609-update-top-menu-ui
Styled top bar, fixed IADS toggle.
2023-12-02 10:48:12 +01:00
Pax1601
dbdc162fae Merge pull request #630 from Pax1601/read-config-location-with-lfs.writedir()
Read config location with lfs.writedir()
2023-12-02 10:47:33 +01:00
Pax1601
563f673fb3 Minor tweak 2023-12-02 10:46:59 +01:00
Pax1601
423e799a82 Completed reading from current instance 2023-12-02 10:40:03 +01:00
Shredmetal
4734b89414 Update LEGAL
Amended unilateral modification term to state explicitly that parties agree to be bound by such terms as modified from time to time
2023-12-02 14:33:27 +08:00
Shredmetal
6f708e7733 update LEGAL
added unilateral modification term so we can change the agreement at will without informing users beyond updating the repo
2023-12-02 14:21:38 +08:00
PeekabooSteam
f0c3f95189 Merge and fix conflict 2023-12-01 16:55:14 +00:00
Pax1601
93ca0e3f22 Added read from lfs 2023-12-01 17:44:03 +01:00
PeekabooSteam
d94432636f Styled top bar, fixed IADS toggle. 2023-12-01 15:51:02 +00:00
Pax1601
60fca35d80 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-12-01 14:12:50 +01:00
Pax1601
db71462d1c Update sample.png 2023-12-01 14:12:10 +01:00
Pax1601
86f522176a Update README.md 2023-12-01 14:08:41 +01:00
Pax1601
94ee71c48f A couple of comments 2023-12-01 13:02:18 +01:00
Pax1601
fda0b21fb0 Minor refactoring 2023-12-01 13:00:02 +01:00
Pax1601
775148cec8 Merge pull request #621 from Pax1601/610-update-spawn-menu-ui
Unit spawn menu restyled
2023-11-30 17:29:30 +01:00
Pax1601
f2dc4a1a00 Unit spawn menu restyled 2023-11-30 17:29:11 +01:00
Pax1601
eda5723a3c Merge pull request #620 from Pax1601/617-check-iads-respects-requested-units-and-add-unit-preview-on-spawn
617 check iads respects requested units and add unit preview on spawn
2023-11-30 15:55:36 +01:00
Pax1601
b044d9a6c0 Minor comments 2023-11-30 15:46:48 +01:00
Pax1601
125d5396b9 Fixed IADS creation
It now also considers airbases when creating the IADS. Fixed styling and unit types. Currently SAM Sites ranges are incorrect but will be fixed when database is updated
2023-11-30 15:36:31 +01:00
Pax1601
17b8b35a43 Added ATTACK state for ground and navy units 2023-11-30 13:08:43 +01:00
Pax1601
4bd017e3c7 Merge pull request #612 from Pax1601/542-spawn-menu-dropdowns-overlap-menu
Alignment fixed, spelling corrected
2023-11-30 11:12:52 +01:00
Pax1601
37447a7fd3 Merge pull request #613 from Pax1601/592-detect-if-installing-olympus-again-and-dont-prompt-to-set-olympusjson-properties
592 detect if installing olympus again and dont prompt to set olympusjson properties
2023-11-30 11:09:34 +01:00
Pax1601
1ed1dec65e Added full stop for Peekaboo 2023-11-30 11:08:48 +01:00
Pax1601
5e2e465813 Installer updated to allow preservation of old config 2023-11-30 11:01:45 +01:00
PeekabooSteam
335655406e Alignment fixed, spelling corrected 2023-11-30 09:41:43 +00:00
Pax1601
bf12d6330c Merge pull request #606 from Pax1601/566-ground-and-naval-units-have-roe-only-designated-option
Added a warning message for ground and navy units ROE
2023-11-29 12:57:41 +01:00
Pax1601
3cca3187ad Added a warning message for ground and navy units ROE 2023-11-29 12:57:17 +01:00
Pax1601
f4388a2cff Merge pull request #605 from Pax1601/594-bounds-for-normandy-map-are-missing
Bounds added for Normandy theatre
2023-11-29 11:54:33 +01:00
Pax1601
7cf5d324eb Bounds added for Normandy theatre 2023-11-29 11:54:16 +01:00
Pax1601
ec9ef2b0fb Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-11-29 11:06:34 +01:00
Pax1601
6c852d93a9 Minor tweak on splash screen when screen is very small 2023-11-29 11:06:31 +01:00
Pax1601
290067932e Merge pull request #604 from Pax1601/596-add-a-way-for-users-to-know-there-is-a-new-version-available
Added latest version number
2023-11-29 10:49:04 +01:00
Pax1601
4aa3a43604 Added latest version number
It pulses if a newer version is available
2023-11-29 10:46:43 +01:00
Pax1601
3c33696452 Create version.json
Added version file
2023-11-29 09:58:16 +01:00
Pax1601
3ea1ab8f30 Added link to wiki 2023-11-28 17:36:55 +01:00
Pax1601
76801f773d Merge pull request #601 from Pax1601/412-improve-importexport
412 improve importexport
2023-11-28 17:31:34 +01:00
Pax1601
de7eeec94a Completed import/export page 2023-11-28 17:30:59 +01:00
Pax1601
0723a3ab95 Merge branch 'main' into 412-improve-importexport 2023-11-28 17:15:41 +01:00
Pax1601
8ef48ad977 Implemented filename selector 2023-11-28 16:59:23 +01:00
Pax1601
ed24d1af60 Merge pull request #600 from Pax1601/fix-aim-errors
Fixed error in lead calculation code
2023-11-28 16:42:45 +01:00
Pax1601
e3dffb8245 Fixed error in lead calculation code 2023-11-28 16:41:43 +01:00
Pax1601
74310a5ad3 Fixed installation prompt about passwords 2023-11-27 21:26:48 +01:00
Pax1601
a2223165e8 Merge branch 'main' into 412-improve-importexport 2023-11-26 21:13:24 +01:00
Pax1601
a879761dc2 Installation fixes 2023-11-24 21:38:55 +01:00
Pax1601
124b909aa4 v0.4.8 2023-11-24 19:43:24 +01:00
Pax1601
858e9eb066 Merge pull request #591 from Pax1601/584-add-state-icon-for-scenic-aaa-functions
Added state icons for scenic functions
2023-11-24 17:53:02 +01:00
Pax1601
7415e0cb97 Added state icons for scenic functions
And fixed dropdowns in case of duplicate labels
2023-11-24 17:52:48 +01:00
Pax1601
915020ddc3 Merge pull request #590 from Pax1601/532-stop-any-previous-connection-requests-before-connecting-again
Added code to clear any previous connection attempt
2023-11-24 11:50:32 +01:00
Pax1601
95915489b2 Added code to clear any previous connection attempt 2023-11-24 11:49:09 +01:00
Pax1601
3e39c3351a Merge pull request #589 from Pax1601/520-south-atlantic-initial-viewpoint
Added bounds for South Atlantic map
2023-11-24 11:43:41 +01:00
Pax1601
244d32e7d2 Added bounds for South Atlantic map 2023-11-24 11:43:26 +01:00
Pax1601
16a79827b7 Merge pull request #588 from Pax1601/586-spawn-toggle-background-missing
Fixed toggles
2023-11-24 10:05:13 +01:00
Pax1601
bd6a36e9ea Merge pull request #587 from Pax1601/487-improve-simulated-firefights
Added indirect fire mode
2023-11-23 23:45:20 +01:00
Pax1601
771695af59 Added indirect fire mode 2023-11-23 23:45:00 +01:00
PeekabooSteam
e811c7bd46 Fixed toggles 2023-11-23 22:44:24 +00:00
Pax1601
20f99c287f Minor change in unit label dropdown
It now expands to fill the space, but it still overflows with long unit names as per #542
2023-11-23 20:32:42 +01:00
Pax1601
f464c9ae76 Merge pull request #585 from Pax1601/511-jf-17-isnt-assigned-to-any-roles-other-than-cap
Added JF-17 loadouts
2023-11-23 20:12:27 +01:00
Pax1601
15ccb3dc04 Added JF-17 loadouts 2023-11-23 20:11:54 +01:00
Pax1601
defe40d48f Merge pull request #583 from Pax1601/miss-on-purpose-tweaks
Added effect of acquisition range to wake units up
2023-11-23 20:09:43 +01:00
Pax1601
0f2622e821 Merge pull request #560 from Pax1601/524-units-will-not-perform-scenic-aaa-until-the-operate-as-toggle-is-toggled
Fixed missing reset of expected value of operateAs toggle
2023-11-23 20:09:09 +01:00
Pax1601
b442d238cd Fixed error in getUnitsVariable function 2023-11-23 20:08:37 +01:00
Pax1601
00f2a3c19d Merge branch 'main' into 524-units-will-not-perform-scenic-aaa-until-the-operate-as-toggle-is-toggled 2023-11-23 19:57:09 +01:00
Pax1601
dcbfdf8666 Added effect of acquisition range to wake units up
Note: alertness time constant suppressed
2023-11-23 16:40:18 +01:00
Pax1601
6e84423032 Merge pull request #577 from Pax1601/576-toggles-gone-walkabout
Fixed UCP toggles, added copy-paste control for plugins
2023-11-23 10:29:23 +01:00
PeekabooSteam
912ab75a96 Moved Database Manager Link 2023-11-22 17:55:39 +00:00
PeekabooSteam
1022fc2f0c Fixed UCP toggles, added copy-paste control for plugins 2023-11-22 17:15:23 +00:00
Pax1601
65edce855b Merge pull request #568 from Pax1601/loading-screen
Loading screen
2023-11-22 15:13:11 +01:00
Pax1601
0ba05d5795 Merge pull request #572 from Pax1601/540-grouped-units-cant-be-selected
Grouped units can be deleted now
2023-11-22 15:13:02 +01:00
Pax1601
1b17e17290 Added some TODO comments
And very minor refactoring
2023-11-22 15:12:28 +01:00
Pax1601
87957df1fb Fixed incorrect behaviour when rotating unit destinations
And a minor map code refactoring
2023-11-22 15:04:09 +01:00
Pax1601
d3f8d4eff7 Grouped units can be deleted now
Also added some performance optimizations on drawing of selected units and removed destination preview icon for single unit selection
2023-11-22 13:12:35 +01:00
Pax1601
3ffeed3b39 Merge pull request #569 from Pax1601/533-allow-users-to-edit-the-config-json-during-the-installation-process
533 allow users to edit the config json during the installation process
2023-11-22 11:35:06 +01:00
Pax1601
4197e4402c Relative paths for nwjs and node folders 2023-11-22 11:33:13 +01:00
Pax1601
1cfe6f5583 Added simple loading screen 2023-11-22 11:32:13 +01:00
Pax1601
ad5cb83abf Completed server version 2023-11-21 17:35:09 +01:00
Pax1601
f4a4882dbc Merge pull request #564 from Pax1601/563-map-icon-disappears-after-changing-map-type
We no longer LOSE the icon
2023-11-21 14:38:34 +01:00
Pax1601
ecb2cf182a Merge pull request #561 from Pax1601/Shredmetal-patch-1
Update LEGAL
2023-11-21 14:38:20 +01:00
Pax1601
6aea839e04 Added configurator GUI 2023-11-21 14:34:51 +01:00
PeekabooSteam
e20d2fa95a We no longer LOSE the icon 2023-11-20 20:33:41 +00:00
Pax1601
806d0cc52f Added ability for users to edit configuration during installation 2023-11-20 18:19:41 +01:00
Shredmetal
2a2baaf324 Update LEGAL 2023-11-21 01:02:03 +08:00
Pax1601
74989ec015 Fixed missing reset of expected value of operateAs toggle 2023-11-20 12:30:44 +01:00
Pax1601
31af3a53ce Merge pull request #559 from Pax1601/528-unknown-units-have-no-icons
Added default marker for unkown units
2023-11-20 11:43:42 +01:00
Pax1601
361d51b55d Merge pull request #545 from Pax1601/531-november-ui-cleanup
531 november UI cleanup
2023-11-20 09:45:36 +01:00
Pax1601
a12c09eba5 Minor refactoring 2023-11-20 09:44:59 +01:00
Pax1601
bcfe0653bd Merge pull request #544 from Pax1601/543-duplicated-categories-due-to-misspelling
Fixed typos
2023-11-20 09:35:10 +01:00
PeekabooSteam
c43bc763f3 Fixed typos 2023-11-19 13:47:24 +00:00
PeekabooSteam
85325c17ac More styling, added pulse to scenic actions from (?) 2023-11-19 11:17:00 +00:00
PeekabooSteam
178706f8de Finalised styling for UCP 2023-11-18 22:02:59 +00:00
Pax1601
51defbb8b2 Added default marker for unkown units 2023-11-18 19:01:47 +01:00
PeekabooSteam
84cf9aa27a More changes from the list 2023-11-17 22:44:15 +00:00
PeekabooSteam
a66098e080 Merge branch 'main' into 531-november-ui-cleanup 2023-11-17 21:46:58 +00:00
Pax1601
283b9e682e v0.4.7 2023-11-17 22:04:21 +01:00
Pax1601
8b5956e76b Merge pull request #536 from Pax1601/489-show-all-the-action-options-of-the-selected-units-even-if-some-units-dont-have-them
489 show all the action options of the selected units even if some units dont have them
2023-11-17 22:02:51 +01:00
Pax1601
017a89b945 getDesc().category reimplemented
unit:getCategory() reports "Airplane" for Helicopters
2023-11-17 22:02:32 +01:00
Pax1601
5bc685182b Merge branch 'main' into 489-show-all-the-action-options-of-the-selected-units-even-if-some-units-dont-have-them 2023-11-17 21:40:09 +01:00
Pax1601
f47fc2fb19 Merge pull request #535 from Pax1601/534-olympus-not-sending-data-with-dcs-open-beta-29148111
Changed unit:getCategory to Object.getCategory(unit)
2023-11-17 21:35:20 +01:00
Pax1601
11d6f25606 Changed unit:getCategory to Object.getCategory(unit)
And added some isExist guards
2023-11-17 21:34:50 +01:00
Pax1601
331692e3d3 Merge branch '489-show-all-the-action-options-of-the-selected-units-even-if-some-units-dont-have-them' of https://github.com/Pax1601/DCSOlympus into 489-show-all-the-action-options-of-the-selected-units-even-if-some-units-dont-have-them 2023-11-17 21:10:49 +01:00
Pax1601
7483225e0d Small tweak to login page 2023-11-17 21:10:46 +01:00
PeekabooSteam
f00df5ca3f Some changes done 2023-11-17 17:07:56 +00:00
Pax1601
22ae882032 Unit gets forcefully deselected when hidden 2023-11-17 17:45:10 +01:00
Pax1601
fbab82e4de Merge branch 'main' into 489-show-all-the-action-options-of-the-selected-units-even-if-some-units-dont-have-them 2023-11-17 17:26:56 +01:00
Pax1601
ca81d1c4ce Merge pull request #530 from Pax1601/529-add-favicon
Favicons
2023-11-17 17:24:03 +01:00
Pax1601
a1884ab19f Merge pull request #527 from Pax1601/522-flashpulse-robot-lock-when-trying-to-give-orders-to-protected-units
Lock flashes on protected robot interaction
2023-11-17 17:23:18 +01:00
Pax1601
8905cd5e85 Merge pull request #526 from Pax1601/523-selected-units-dont-get-hidden
Selected units now hidden on request
2023-11-17 17:22:36 +01:00
PeekabooSteam
8d5ed33ad8 Favicons 2023-11-17 11:35:55 +00:00
Pax1601
b747752b76 Fixed error in follow command 2023-11-17 07:59:04 +01:00
PeekabooSteam
4e13daa270 Lock flashes on protected robot interaction 2023-11-16 23:08:01 +00:00
PeekabooSteam
c00096bd9a Selected units now hidden on request 2023-11-16 22:26:09 +00:00
PeekabooSteam
210c1fbecf Added a selective interface for import and export 2023-11-16 21:44:40 +00:00
Pax1601
4a54011aac Large rework of context menus for units and map 2023-11-16 15:31:07 +01:00
PeekabooSteam
b89c5142b6 Merge and fix 2023-11-16 11:28:32 +00:00
PeekabooSteam
0421f6b8fe Fixed regex undefined 2023-11-16 11:16:54 +00:00
Pax1601
0c50141be6 v0.4.6 2023-11-15 16:42:24 +01:00
Pax1601
a71b8806e7 Update groundunitdatabase.json 2023-11-15 16:06:52 +01:00
Pax1601
e0a27c574f Merge pull request #519 from Pax1601/493-for-ground-units-add-marker-symbol-in-database
493 for ground units add marker symbol in database
2023-11-15 15:38:59 +01:00
Pax1601
8d7a49a31f Created group handlers 2023-11-15 15:38:16 +01:00
Pax1601
25e2c50438 Added unit marker to database and implemented better grouping 2023-11-14 17:43:24 +01:00
Pax1601
e3423ea9a3 Merged new databases 2023-11-14 07:53:01 +01:00
Pax1601
812112858c Merge branch 'main' into 493-for-ground-units-add-marker-symbol-in-database 2023-11-13 19:27:41 +01:00
Pax1601
8db1357904 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-11-13 18:55:19 +01:00
Pax1601
bba0aa9f52 Fixed databasemanager overflow 2023-11-13 18:54:11 +01:00
Pax1601
1cc549b24a Added entry to databases 2023-11-13 18:02:08 +01:00
Pax1601
7cafeb73ca Added tags to unit spawn menu 2023-11-13 16:04:53 +01:00
Pax1601
772f082913 Tweaked installer message 2023-11-13 09:08:40 +01:00
Pax1601
9f7efe3018 Merge pull request #517 from Pax1601/437-f-14b-not-spawning-with-weapons
Fixed errors in loadouts scripts
2023-11-12 18:44:18 +01:00
Pax1601
a28584b08b Fixed errors in loadouts scripts 2023-11-12 18:43:49 +01:00
Pax1601
5cba46a482 Merge pull request #516 from Pax1601/437-f-14b-not-spawning-with-weapons
Fixed loadout generator adding exceptions for Tomcats
2023-11-12 17:43:37 +01:00
Pax1601
a15b7620eb Fixed loadout generator adding exceptions for Tomcats 2023-11-12 17:42:54 +01:00
PeekabooSteam
9ef6efa3e0 Mid-way commit 2023-11-12 16:18:31 +00:00
Pax1601
49bff88c4e Radio and TACAN frequencies are now clamped 2023-11-12 17:18:18 +01:00
Pax1601
80af34fa3e Merge pull request #515 from Pax1601/265-cloning-a-dead-unit-fails
Dead units can now be cloned
2023-11-12 16:36:04 +01:00
Pax1601
1d6f2644aa Dead units can now be cloned 2023-11-12 16:35:31 +01:00
Pax1601
dc61d364d1 Merge pull request #514 from Pax1601/448-on-chrome-fps-drops-to-single-digits-when-zoomed-in
Implemented custom fast renderer for range circles
2023-11-12 15:50:44 +01:00
Pax1601
78de9dd538 Implemented custom fast renderer for range circles
It's a bit hacky since I had to override a default leaflet renderer function. Works well but may be injected in a more elegant way.
2023-11-12 15:49:46 +01:00
Pax1601
ccaea5b9d1 Better unit explosion buttons design 2023-11-12 14:08:10 +01:00
Pax1601
e02e9de55d Updated databases 2023-11-09 19:27:32 +01:00
Pax1601
40da192dbb Merge pull request #512 from Pax1601/486-add-more-advanced-effects
486 add more advanced effects
2023-11-09 08:27:06 +01:00
Pax1601
c8254238c7 Scrollable unit control panel tweak 2023-11-09 08:26:43 +01:00
Pax1601
9caee0c77c Implemented buttons to apply advanced controls directly to units 2023-11-08 23:33:27 +01:00
Pax1601
b9830f0190 Merge branch 'main' into 486-add-more-advanced-effects 2023-11-08 22:04:52 +01:00
Pax1601
02a0a9b783 Merge pull request #504 from Pax1601/484-add-life-meter-to-ground-units
484 add life meter to ground units
2023-11-08 21:57:27 +01:00
Pax1601
ea1758a1a9 Added backend code for health display
And fixed the issue of ground units not being deleted correctly
2023-11-08 21:56:39 +01:00
PeekabooSteam
b43afd4e9c Export customisation working - but ugly. 2023-11-08 14:09:35 +00:00
PeekabooSteam
7700aa2030 Merge branch 'main' into 412-improve-importexport 2023-11-08 12:52:27 +00:00
Pax1601
d5d8391f63 Merge pull request #508 from Pax1601/494-make-the-installer-more-clear-specify-that-olympus-must-be-installed-in-savedgames
Changed message and fixed wrong installation folder after user selection
2023-11-08 10:17:40 +01:00
Pax1601
b508d2301b Changed message and fixed wrong installation folder after user selection 2023-11-08 10:16:33 +01:00
Pax1601
01b3336709 Merge pull request #507 from Pax1601/495-make-ui-port-configurable-from-olympusjson
Added port selection to config
2023-11-08 09:59:50 +01:00
Pax1601
6ba37aefd6 Added port selection to config 2023-11-08 09:59:21 +01:00
PeekabooSteam
e68683acb7 Export matrix reads from data 2023-11-07 22:04:09 +00:00
Pax1601
a804904ff5 Merge pull request #506 from Pax1601/dynamic-resizing
Dynamic resizing
2023-11-07 19:36:08 +01:00
Pax1601
eacb89176c Completed new resizable design 2023-11-07 17:37:19 +01:00
PeekabooSteam
ec971aa822 Merge branch 'main' into 484-add-life-meter-to-ground-units 2023-11-06 22:29:23 +00:00
PeekabooSteam
e1f404c647 Added some doc comments 2023-11-06 22:28:44 +00:00
PeekabooSteam
5f1e32d610 Conflict fix 2023-11-06 21:51:45 +00:00
PeekabooSteam
732ee2bbb9 Added + for naval and ground units 2023-11-06 21:49:54 +00:00
Pax1601
1e461250d5 Added advanced effects 2023-11-06 19:26:15 +01:00
Pax1601
f727174044 Testing of dynamic resizing 2023-11-06 18:30:59 +01:00
Pax1601
7edc687f7b Merge pull request #501 from Pax1601/499-spawn-menu-reorganisation
Air defence has its own spawn icon
2023-11-06 11:13:12 +01:00
Pax1601
596fbf0b87 Merge branch 'main' into 499-spawn-menu-reorganisation 2023-11-06 11:12:46 +01:00
PeekabooSteam
8dc48c10c3 Added dialog 2023-11-05 22:35:00 +00:00
PeekabooSteam
5db90e5896 Changed air defence form to extend ground units' form 2023-11-05 19:24:23 +00:00
PeekabooSteam
dd811def07 Added health bar 2023-11-05 19:11:42 +00:00
Pax1601
5273291e9a Merge pull request #503 from Pax1601/485-improve-miss-on-purpose
485 improve miss on purpose
2023-11-05 17:35:03 +01:00
Pax1601
130dbda499 Merge branch 'main' into 485-improve-miss-on-purpose 2023-11-05 17:34:56 +01:00
Pax1601
769aea7e4e Merge pull request #502 from Pax1601/500-log-in-form-needs-to-submit-when-pressing-enterreturn
500 log in form needs to submit when pressing enterreturn
2023-11-05 17:28:42 +01:00
Pax1601
fa3d65bde6 Completed miss on purpose functionality 2023-11-05 17:26:39 +01:00
PeekabooSteam
073281135c Fixed odd 'undefined' bug 2023-11-05 13:15:41 +00:00
PeekabooSteam
4c7f979e56 Merge branch '498-set-ucp-and-uip-toggles-into-olympus-context' into 500-log-in-form-needs-to-submit-when-pressing-enterreturn 2023-11-05 13:08:24 +00:00
PeekabooSteam
a5bfb4f8d2 Form submits on return press 2023-11-05 13:05:46 +00:00
PeekabooSteam
a04780f311 Merge branch 'main' into 500-log-in-form-needs-to-submit-when-pressing-enterreturn 2023-11-05 12:37:36 +00:00
PeekabooSteam
aad0fd22ad Air defence has its own spawn icon 2023-11-05 10:57:53 +00:00
Pax1601
bc1c3994d3 Merge branch 'main' into 485-improve-miss-on-purpose 2023-11-04 10:21:37 +01:00
Pax1601
840033aa6a Merge pull request #496 from Pax1601/468-robot-protection-toggle
468 robot protection toggle
2023-11-04 10:10:09 +01:00
Pax1601
9cc6e9e790 More work on miss on purpose 2023-11-04 09:57:18 +01:00
PeekabooSteam
b1ad2f409e Controlling panels and spawn menu from context 2023-11-03 22:36:35 +00:00
PeekabooSteam
7106646042 Updated landAtPoint logic 2023-11-03 18:28:05 +00:00
PeekabooSteam
31405119f0 Enabled mixed-group actions, fixed some helicopter messages. 2023-11-03 18:17:40 +00:00
PeekabooSteam
2e5ee93361 Tweaked colours. 2023-11-03 14:05:39 +00:00
PeekabooSteam
f981a661d5 Added lock image and tooltip/titles. 2023-11-03 13:29:09 +00:00
Pax1601
7e05bbf5e3 Improved scheduler logging 2023-11-03 11:37:09 +01:00
PeekabooSteam
4465f4a3bb PoC of robot protection 2023-11-02 23:03:17 +00:00
PeekabooSteam
ade4f183cd Commit so I can switch to another branch. 2023-11-02 18:22:42 +00:00
Pax1601
99dc61799f Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-11-02 17:24:39 +01:00
Pax1601
a213b94606 Minor fixes 2023-11-02 17:24:35 +01:00
Pax1601
6600ed8cbb Merge pull request #473 from Pax1601/357-map-context-switching
357 map context switching
2023-11-02 09:46:09 +01:00
PeekabooSteam
826bf12bd6 Merge branch 'main' into 357-map-context-switching 2023-10-31 20:30:18 +00:00
Pax1601
528e0db79c Updated demo.js 2023-10-31 17:48:09 +01:00
Pax1601
11a5fec195 Added effect of vertical velocity and of scatter and intensity 2023-10-30 15:56:10 +01:00
Pax1601
c0f3f3a40a Added scatter and intensity selectors in UI 2023-10-30 12:46:49 +01:00
Pax1601
88844db23a Added shots scatter and intensity variables to backend 2023-10-30 10:09:49 +01:00
Pax1601
31710b4e28 Updated legal text 2023-10-30 09:56:07 +01:00
Pax1601
42d2f6400b Merge pull request #476 from Pax1601/edits_legal
Update and rename COPYING to LEGAL
2023-10-28 14:42:03 +02:00
Pax1601
2701d6adc0 Merge pull request #472 from Pax1601/464-proposed-hot-group-behaviour-tweak-to-be-like-lakecraft-shift-+-1-appends-to-group
464 proposed hot group behaviour tweak to be like lakecraft shift + 1 appends to group
2023-10-28 14:40:06 +02:00
Pax1601
5a4b203937 Merge pull request #477 from Pax1601/463-delete-needs-three-buttons
Added new delete method dialog
2023-10-28 14:38:42 +02:00
Pax1601
74cb7877cb Merge pull request #474 from Pax1601/460-sam-threat-rings-appear-when-they-shouldnt
460 sam threat rings appear when they shouldnt
2023-10-28 14:36:24 +02:00
PeekabooSteam
f954338c27 Added new delete method dialog 2023-10-27 17:26:41 +01:00
Shredmetal
cc729b1d25 Update and rename COPYING to LEGAL
Cleaned up the legal text
2023-10-26 16:45:58 +08:00
PeekabooSteam
4a4b1d6b00 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus into main 2023-10-20 11:04:24 +01:00
Pax1601
d14741f3b1 Merge pull request #471 from Pax1601/470-spawn-menu-qty-sorted-alphabetically-not-numerically
Unit spawn qty now sorted numerically.
2023-10-19 01:29:45 +02:00
PeekabooSteam
94684fff9f More spacing tweaking 2023-10-18 13:54:33 +01:00
PeekabooSteam
44deef4a5a Tweaked spacing 2023-10-18 13:23:25 +01:00
PeekabooSteam
67079e1c0b Munitions constrained to a scrollable 2023-10-18 13:20:54 +01:00
PeekabooSteam
005ffc55ce var => let 2023-10-18 12:15:59 +01:00
PeekabooSteam
1691b0b30c Range rings only showing when necessary 2023-10-18 12:13:51 +01:00
PeekabooSteam
e4e55430ca Optimised quantity option generator 2023-10-18 11:17:05 +01:00
PeekabooSteam
4d31d9d748 Unit spawn qty now sorted numerically. 2023-10-18 10:23:50 +01:00
PeekabooSteam
1413f596fb Improved filter logic 2023-10-17 11:27:21 +01:00
PeekabooSteam
c0aee94da5 Hotgroup logic updated 2023-10-16 19:45:51 +01:00
PeekabooSteam
8e545346e6 Exploratory tweaks 2023-10-16 09:13:44 +01:00
PeekabooSteam
2b1272c70d Removed needless [] 2023-10-15 11:53:12 +01:00
PeekabooSteam
121f9b6ec3 Tweaked string functions 2023-10-15 11:51:49 +01:00
PeekabooSteam
6f9722143e Took shift and alt requirements from T key for demo data 2023-10-15 10:59:39 +01:00
PeekabooSteam
5bf62f4b93 Removed needless context.ts ref 2023-10-15 10:24:41 +01:00
PeekabooSteam
79319dd006 Shortcuts can be set to a context 2023-10-15 10:22:03 +01:00
PeekabooSteam
fdcff53697 Shortcuts now settable to a context. 2023-10-15 09:43:26 +01:00
Pax1601
24cd2729db Startup script updated 2023-10-15 09:54:57 +02:00
Pax1601
9ca2703f16 More package build updates 2023-10-14 12:32:24 +02:00
Pax1601
1a579c5755 Build scripts updated 2023-10-14 12:13:32 +02:00
Pax1601
7344c761fe Small bugfixes 2023-10-14 11:07:39 +02:00
Pax1601
203a981fed Merge pull request #459 from Pax1601/small-issues
Modified isTanker and isAWACS to isActiveTanker and isActiveAWACS
2023-10-13 16:35:52 +02:00
Pax1601
d3faf65900 Modified isTanker and isAWACS to isActiveTanker and isActiveAWACS 2023-10-13 16:35:11 +02:00
Pax1601
5efbf81090 Merge pull request #458 from Pax1601/small-issues
Fixed wrong cursor type
2023-10-13 15:23:51 +02:00
Pax1601
9ffab7d531 Fixed wrong cursor type 2023-10-13 15:23:29 +02:00
Pax1601
0886ff1be1 Merge pull request #456 from Pax1601/small-issues
Removed preferCanvas option for map
2023-10-13 12:49:12 +02:00
Pax1601
2893182713 Removed preferCanvas option for map
Which apparently causes Chrome to slow down when zoomed in. More test required to check performance.
2023-10-13 12:48:51 +02:00
Pax1601
478bb18ab2 Updated version number 2023-10-11 18:05:58 +02:00
Pax1601
eae07ca6cc Merge pull request #455 from Pax1601/small-issues
Small issues
2023-10-11 18:01:46 +02:00
Pax1601
2264faabfc Updated databases 2023-10-11 18:01:27 +02:00
Pax1601
4cdf82cb14 Database fixes 2023-10-11 15:20:24 +02:00
Pax1601
5a7e511dac Merge pull request #450 from Pax1601/small-issues
Small issues
2023-10-11 12:56:04 +02:00
Pax1601
a29eb3d343 Added stop command to helicopters 2023-10-11 12:55:41 +02:00
Pax1601
3c65aefe61 Fixed destination preview handle showing incorrectly 2023-10-11 12:49:44 +02:00
Pax1601
867d7697d2 Moved tanker/AWACS button to control panel 2023-10-11 12:37:16 +02:00
Pax1601
ebee6610a3 Added tanker and off state icons 2023-10-11 08:00:43 +02:00
Pax1601
c26691c2fc Merge pull request #449 from Pax1601/small-issues
Added "land at point" state for helicopters
2023-10-10 17:11:05 +02:00
Pax1601
a038d6e999 Added "land at point" state for helicopters 2023-10-10 17:10:29 +02:00
Pax1601
aa1550ca01 Merge pull request #446 from Pax1601/small-issues
TACAN and radio can now be set on carriers
2023-10-10 15:49:15 +02:00
Pax1601
80eaa643c9 TACAN and radio can now be set on carriers 2023-10-10 15:27:42 +02:00
Pax1601
d67d9c1afd Merge pull request #445 from Pax1601/small-issues
Added Strike Eagle
2023-10-10 15:18:43 +02:00
Pax1601
af15fc123d Added Strike Eagle 2023-10-10 15:18:19 +02:00
Pax1601
0ce56e6529 Merge pull request #444 from Pax1601/metadata
Added abilities and description to spawn menu
2023-10-10 14:34:37 +02:00
Pax1601
258164c285 Added abilities and description to spawn menu 2023-10-10 14:34:19 +02:00
Pax1601
746617deb0 Merge pull request #443 from Pax1601/427-toggle-mouse-info-format-latlng-grid-decimals
Can now get LatLng, MGRS and UTM location data
2023-10-09 10:46:15 +02:00
Pax1601
c51d00673d Merge pull request #441 from Pax1601/440-refuelling-misspelled-as-refueling
Missing Ls added
2023-10-09 10:45:32 +02:00
PeekabooSteam
bedd21522a Can now get LatLng, MGRS and UTM location data 2023-10-08 16:44:55 +01:00
PeekabooSteam
382013d0ca Missing Ls added 2023-10-06 16:56:09 +01:00
Pax1601
3794207d97 Added missing button 2023-10-06 16:20:43 +02:00
Pax1601
2805323cfa Merge pull request #439 from Pax1601/small-bugfixes
Small bugfixes
2023-10-06 16:08:38 +02:00
Pax1601
0db2e56e32 Completed range rings 2023-10-06 16:07:54 +02:00
Pax1601
a33ad18322 Merge pull request #438 from Pax1601/432-display-in-game-time-and-elapsed-time
432 display in game time and elapsed time
2023-10-06 14:28:40 +02:00
PeekabooSteam
885ef6b357 Time font weight now bold 2023-10-05 17:59:09 +01:00
PeekabooSteam
2435072b07 'Connected' messaged is now a clock/timer 2023-10-05 15:12:07 +01:00
Pax1601
d462bd16b5 Implemented range rings 2023-10-05 13:51:13 +02:00
Pax1601
b08a3835dc Some database changes, started to add threat rings 2023-10-05 11:02:02 +02:00
Pax1601
ace0908d84 Merge pull request #436 from Pax1601/328-add-simple-miss-on-purpose-mode-for-aaa
328 add simple miss on purpose mode for aaa
2023-10-05 10:04:52 +02:00
Pax1601
5186fffb5e Merge commit 2023-10-05 10:04:40 +02:00
Pax1601
c5160c9baa Modified database editor 2023-10-05 10:02:23 +02:00
Pax1601
63acc94558 Merge pull request #434 from Pax1601/433-remove-scale-tool-replace-with-space-efficient-version-of-server-performance-monitor
433 remove scale tool replace with space efficient version of server performance monitor
2023-10-05 09:11:38 +02:00
PeekabooSteam
fc82407d9a Grammatical update 2023-10-04 20:55:01 +01:00
Pax1601
a0ac9eb285 Merge branch 'main' into 328-add-simple-miss-on-purpose-mode-for-aaa 2023-10-04 21:21:08 +02:00
PeekabooSteam
fc835eaba7 Remove debugger line 2023-10-04 20:11:55 +01:00
PeekabooSteam
f7b3e5bf77 Moved server performance indicators; control tips working again. 2023-10-04 20:07:49 +01:00
Pax1601
e41484186b Merge pull request #431 from Pax1601/422-coalitions-can-see-each-others-bullseye
Bullseyes now coalition-limited
2023-10-04 14:55:02 +02:00
PeekabooSteam
e0bfe6a96c Bullseyes now coalilition limited 2023-10-04 13:14:36 +01:00
Pax1601
228f184548 Merge pull request #430 from Pax1601/423-some-improvements-on-units-list
Improved visuals and truncated unit names
2023-10-04 14:11:44 +02:00
PeekabooSteam
892ce4c453 Improved visuals and truncated unit names 2023-10-03 21:57:51 +01:00
Pax1601
569d45d58a Added "operate as" toggle 2023-10-03 17:31:44 +02:00
Pax1601
ce5f00e075 Added options for miss on purpose and scenic AAA 2023-10-03 15:25:45 +02:00
Pax1601
4da407008e More work on miss on purpose 2023-10-02 21:52:04 +02:00
Pax1601
96e79cc8ae Merge pull request #429 from Pax1601/map-bugfixes
Multiple bugfixes
2023-10-02 17:30:59 +02:00
Pax1601
ee93806e19 Multiple bugfixes 2023-10-02 17:29:54 +02:00
Pax1601
fcb02602a0 Reformatted some files 2023-10-02 10:12:24 +02:00
Pax1601
5d4fdf1e76 Merge pull request #411 from Pax1601/410-update-shortcuts-to-plugin-friendly-format
Converted for plugin use
2023-10-02 09:03:30 +02:00
Pax1601
9af59fb51c Merge pull request #418 from Pax1601/417-unit-list
417 unit list
2023-10-02 09:01:28 +02:00
Pax1601
6493d37b7c Merge pull request #421 from Pax1601/419-server-is-paused
User now alerted when server is paused.
2023-10-02 08:59:48 +02:00
PeekabooSteam
a82c033da0 Timeout much shorter when server is paused to reduce update lag 2023-10-02 07:15:00 +01:00
PeekabooSteam
91484e1c98 Can now toggle unit labels with L 2023-10-01 21:42:23 +01:00
PeekabooSteam
3db5202cdf User now alerted when server is paused. 2023-10-01 20:53:30 +01:00
PeekabooSteam
5a28974027 Added additive hotgroup select 2023-10-01 20:12:36 +01:00
PeekabooSteam
4d694f1f74 Added Escape and no-tab-swap-hotgroups 2023-10-01 20:02:45 +01:00
Pax1601
5035c408e7 Basic scenic and miss on purpose AAA modes 2023-10-01 19:15:56 +02:00
Pax1601
d209f98265 Fixed wrong init of altitude sliders in spawn menu 2023-10-01 15:47:23 +02:00
PeekabooSteam
85b1404321 More sorting, changed keybind to U 2023-10-01 12:00:10 +01:00
PeekabooSteam
72c6e4e94e Using proper add and not being lazy 2023-09-30 22:33:47 +01:00
PeekabooSteam
eb46ed2768 Emitted decs 2023-09-30 22:30:29 +01:00
PeekabooSteam
7f4f01c9e8 Alpha of unit list 2023-09-30 22:19:48 +01:00
Pax1601
691d2746e6 Merge pull request #416 from Pax1601/385-setting-altitude-to-silly-number
Fixed wrong callback call from slider
2023-09-30 19:27:33 +02:00
Pax1601
d41dfc1e0d Fixed wrong callback call from slider 2023-09-30 19:27:16 +02:00
Pax1601
493898bd4a Merge pull request #414 from Pax1601/329-add-basic-automatic-firefight
329 add basic automatic firefight
2023-09-30 19:04:18 +02:00
Pax1601
8ebe427269 Enabled direction randomization 2023-09-30 19:03:59 +02:00
Pax1601
48d4ff97a0 Fixed elevation calculations 2023-09-30 18:53:32 +02:00
PeekabooSteam
83769bf539 Converted for plugin use 2023-09-29 18:09:38 +01:00
Pax1601
0954bf2923 Merge branch 'main' of https://github.com/Pax1601/DCSOlympus 2023-09-29 17:21:58 +02:00
Pax1601
a2f5f82e28 Removed redundant loadout roles 2023-09-29 17:21:53 +02:00
Pax1601
a82af04fca Merge pull request #409 from Pax1601/Pax1601-patch-1
Update ci.yml
2023-09-29 15:35:03 +02:00
Pax1601
a1a876429c Update ci.yml 2023-09-29 15:34:54 +02:00
Pax1601
58830fa53e Update package-lock.json 2023-09-29 15:30:50 +02:00
Pax1601
15c8e32fef Merge pull request #408 from Pax1601/407-create-a-simple-plugin-to-manage-units-database
407 create a simple plugin to manage units database
2023-09-29 15:28:07 +02:00
Pax1601
59c915d8bc Updated lock file for checks 2023-09-29 15:26:06 +02:00
Pax1601
968ff61979 Database editor (almost) completed
Liveries editor still to add, but no one in his right mind would change them manually since we have scripts for that
2023-09-29 15:24:08 +02:00
Pax1601
94901849e6 More work on database editing 2023-09-28 17:33:38 +02:00
Pax1601
ff42126b0e Merge branch '329-add-basic-automatic-firefight' into 407-create-a-simple-plugin-to-manage-units-database 2023-09-28 09:09:02 +02:00
Pax1601
39ddf10ca7 Added code to save edited database to disk 2023-09-27 21:46:05 +02:00
Pax1601
7a24e5d39d More work on database manager 2023-09-27 17:08:15 +02:00
Pax1601
e9100504a0 More work on database manager 2023-09-25 17:35:17 +02:00
Pax1601
099cbfdf75 Added more code to handle loadouts 2023-09-24 20:03:21 +02:00
Pax1601
28afef8847 Merge branch 'main' into 407-create-a-simple-plugin-to-manage-units-database 2023-09-24 10:22:45 +02:00
Pax1601
010b1e1cce Exported definitions and fixed interfaces 2023-09-24 10:21:28 +02:00
Pax1601
274ce76c2b Basic plugin structure 2023-09-22 17:58:37 +02:00
Pax1601
f3155e618b Added target altitude effect to simulated fire fight 2023-09-22 16:05:03 +02:00
Pax1601
18307caab3 Merge branch 'main' into 329-add-basic-automatic-firefight 2023-09-22 15:15:58 +02:00
Pax1601
2e279b8876 Update .gitignore 2023-09-22 15:15:22 +02:00
Pax1601
0da878f50f Merge pull request #396 from Pax1601/391-control-tips-mouseover-option
Tips added for formations
2023-09-22 15:06:33 +02:00
Pax1601
ecfb3644be Merge pull request #403 from Pax1601/388-double-click-select-all-only-on-unselected
Unit doubleclick fixed
2023-09-22 15:05:42 +02:00
Pax1601
c87d18fd8e Merge pull request #406 from Pax1601/394-retrieve-ground-altitude-at-mouse-coordinates-location
394 retrieve ground altitude at mouse coordinates location
2023-09-22 15:03:55 +02:00
Pax1601
5810f9232a Completed ground elevation provider and added to mouse info panel 2023-09-22 15:03:35 +02:00
PeekabooSteam
fb8eb6f357 Unit doubleclick fixed 2023-09-22 08:36:07 +01:00
PeekabooSteam
7eb76ff32d Added hotgroup 2023-09-21 22:54:09 +01:00
PeekabooSteam
c3d3de9984 Conflict 2023-09-21 22:23:47 +01:00
PeekabooSteam
cc2549dbdf Tips added for formations 2023-09-21 22:19:01 +01:00
Pax1601
7efa8eab18 Added api enpoint to retrieve altitude at coordinates 2023-09-21 17:37:13 +02:00
Pax1601
376ae9ec1c Update ci.yml 2023-09-21 15:03:59 +02:00
Pax1601
9882b2999f Update ci.yml 2023-09-21 14:58:54 +02:00
Pax1601
3667a75244 Merge pull request #393 from Pax1601/Pax1601-patch-1
Update ci.yml
2023-09-21 14:53:19 +02:00
Pax1601
4089448b53 Update ci.yml 2023-09-21 14:53:09 +02:00
Pax1601
fec11869a8 Update ci.yml 2023-09-21 13:31:21 +02:00
Pax1601
e7e56d1cdb Removed caching 2023-09-21 13:28:32 +02:00
Pax1601
9db01d6060 Modified deploy 2023-09-21 13:23:39 +02:00
Pax1601
ed38397631 Removed types definitions 2023-09-21 13:17:44 +02:00
Pax1601
b3dddc0570 Added types folder 2023-09-21 13:10:39 +02:00
Pax1601
6fa06de245 Added job needs 2023-09-21 13:06:10 +02:00
Pax1601
834ddde1d0 Merged actions 2023-09-21 13:03:14 +02:00
Pax1601
5d4348f8a7 Create static.yml 2023-09-21 12:54:55 +02:00
Pax1601
36f2917995 Synced lock file 2023-09-21 11:03:03 +02:00
Pax1601
eedbec175d Fixed working directory 2023-09-21 10:58:18 +02:00
Pax1601
344ec86722 Executing workflow in client directory 2023-09-21 10:56:17 +02:00
Pax1601
952d1e5895 Added typescript dependency 2023-09-21 10:51:31 +02:00
Pax1601
a371484f38 Removed wrong workflow steps 2023-09-21 10:48:43 +02:00
Pax1601
1567a6fd27 Workflow test 2023-09-21 10:42:12 +02:00
Pax1601
e0f96b5cca Added package.json 2023-09-21 10:38:51 +02:00
Pax1601
8f6e48642c Added package-lock 2023-09-21 10:34:48 +02:00
Pax1601
0c4c10dc1a Fixed folder typo 2023-09-21 10:27:38 +02:00
Pax1601
de6b78d762 Automatic workflow test 2023-09-21 10:24:15 +02:00
Pax1601
6b77f32548 Merge pull request #392 from Pax1601/391-control-tips-mouseover-option
Can now specify a selector or a mouseover
2023-09-21 10:09:10 +02:00
Pax1601
fd2b7a00e1 Moved gun data into databases jsons, made core read from databases 2023-09-20 18:58:21 +02:00
PeekabooSteam
818886a65e Can now specify a selector or a mouseover 2023-09-20 17:30:58 +01:00
Pax1601
0ca31afc91 Merge branch 'main' into 329-add-basic-automatic-firefight 2023-09-20 17:34:02 +02:00
Pax1601
024a73da63 Merge pull request #384 from Pax1601/poc-plugins-v1
Poc plugins v1
2023-09-20 16:27:29 +02:00
Pax1601
744b0063d8 Merge pull request #390 from Pax1601/308-desired-speed-sliders-dots-not-showing-in-client
Fix issue #308 - remove color-mix and set precomputed css variable value
2023-09-20 16:26:29 +02:00
amouillard
355923f680 Fix issue #308 - remove color-mix and set precomputed css variable value 2023-09-20 16:19:24 +02:00
Pax1601
44332a2004 Moved server code to dedicated ServerManager class 2023-09-18 17:10:14 +02:00
Pax1601
2f125e3d0e Completed plugins framework
More work required to define all interfaces for the useful classes in the @types folder
2023-09-15 23:07:15 +02:00
Pax1601
588228c050 Implemented basic Plugin handling 2023-09-15 17:05:26 +02:00
Pax1601
8977ba9b6d Added basic simulated firefight state 2023-09-15 09:36:27 +02:00
PeekabooSteam
ad06117b78 Refined a bit more. 2023-09-14 21:10:52 +01:00
PeekabooSteam
01b30ccf12 Refined the options a bit. 2023-09-14 20:56:34 +01:00
PeekabooSteam
7f75905d5d Resolved conflicts 2023-09-14 18:59:20 +01:00
PeekabooSteam
798856c649 Nearly final commit of control tips' v1 2023-09-14 17:55:01 +01:00
Pax1601
9acd358080 Merge pull request #383 from Pax1601/374-right-click-drag-error
Fix issue #374
2023-09-13 19:15:27 +02:00
amouillard
31c112157a Fix issue #374 2023-09-13 18:47:24 +02:00
PeekabooSteam
d2e162edbf Removed directory creation. 2023-09-12 19:07:36 +01:00
PeekabooSteam
6aaffe20d9 Plugin (not) work. 2023-09-12 19:04:52 +01:00
Pax1601
6d32b20117 More documentation 2023-09-12 17:54:59 +02:00
Pax1601
bd894704b1 v0.4.4 2023-09-10 17:26:33 +02:00
Pax1601
7af2162b50 Merge pull request #379 from Pax1601/368-spawn-points-can-integer-overflow-on-the-server-side
Switched from unsigned int to int for spawn points
2023-09-09 19:15:34 +02:00
Pax1601
c735d108d4 Merge pull request #378 from Pax1601/refactor
Refactor
2023-09-09 19:08:31 +02:00
Pax1601
6a2ffc936e More bugfixing, set CAS and ASL to be default modes 2023-09-09 19:07:09 +02:00
Pax1601
74d5480587 Minor refactor and bug fixing 2023-09-08 22:41:37 +02:00
Pax1601
89c39c7038 Code documentation and refactoring 2023-09-08 17:40:53 +02:00
Pax1601
61f955cfeb Added copy ability in RTS mode 2023-09-08 16:25:12 +02:00
Pax1601
744adee94c Merge branch 'main' into 345-allow-for-copy-and-paste-in-rts-mode 2023-09-07 16:56:55 +02:00
Pax1601
267c0b037d Merge branch 'main' into 345-allow-for-copy-and-paste-in-rts-mode 2023-09-07 13:03:50 +02:00
Pax1601
860414b7b2 Merge pull request #377 from Pax1601/370-write-better-method-of-determining-if-a-command-has-been-completed
370 write better method of determining if a command has been completed
2023-09-07 13:03:05 +02:00
Pax1601
09bf361d44 Added ability to delete original cloned units
Mostly useful to group units together
2023-09-07 13:02:14 +02:00
Pax1601
e2f80c5788 Fixed table deepcopy 2023-09-06 20:19:47 +02:00
Pax1601
a96a6eb57d Added command hash control 2023-09-05 17:25:32 +02:00
PeekabooSteam
803f9a7fd6 Started working on shurtcuts plugin 2023-09-05 09:43:36 +01:00
Pax1601
71a141e0b8 Merge pull request #373 from Pax1601/372-pan-up-doesnt-work-via-keyboard
Pan up now pans
2023-09-05 09:42:55 +02:00
PeekabooSteam
a99b85e646 More plugin design 2023-09-04 23:56:48 +01:00
PeekabooSteam
333169d18c Pan up now pans 2023-09-04 22:57:32 +01:00
PeekabooSteam
a08eb418a6 Stash commit to open a new branch. 2023-09-04 22:54:01 +01:00
Pax1601
cbb878cf96 Fixed errors in lua clone units 2023-09-04 21:44:22 +02:00
Pax1601
d684f91a5a Merge branch '370-write-better-method-of-determining-if-a-command-has-been-completed' into 345-allow-for-copy-and-paste-in-rts-mode 2023-09-04 19:02:10 +02:00
Pax1601
f2de4cd34c Completed implementation 2023-09-04 19:01:50 +02:00
Pax1601
3d076a605b Merge branch '370-write-better-method-of-determining-if-a-command-has-been-completed' into 345-allow-for-copy-and-paste-in-rts-mode 2023-09-04 17:31:58 +02:00
Pax1601
3607f88e18 Converted clone function to pure lua 2023-09-04 17:27:09 +02:00
Pax1601
a0d2bb11ed Switched from unsigned int to int for spawn points 2023-09-04 16:06:41 +02:00
Pax1601
ede245a37d Implemented executed commands provider 2023-09-04 12:41:54 +02:00
Pax1601
aca1e112d2 Merge pull request #371 from Pax1601/369-coalition-colour-incorrectly-set-on-spawn-menu-in-rts-mode
Minor bugfix
2023-09-04 11:00:46 +02:00
Pax1601
bf5d6dac18 Minor bugfix 2023-09-04 11:00:28 +02:00
Pax1601
182ce4da42 Hotfix 2023-09-03 17:55:58 +02:00
Pax1601
41e2e6fa59 Updated documentation 2023-09-03 16:45:48 +02:00
Pax1601
fe0e964a5a Merge pull request #367 from Pax1601/343-add-ability-to-select-unit-nation-and-livery
v0.4.4
2023-09-03 16:34:34 +02:00
Pax1601
bee35f9ee9 v0.4.4 2023-09-03 16:34:11 +02:00
Pax1601
e66a1bb5b4 Merge pull request #366 from Pax1601/343-add-ability-to-select-unit-nation-and-livery
343 add ability to select unit nation and livery
2023-09-03 16:32:06 +02:00
Pax1601
8490997604 Merge branch 'main' into 343-add-ability-to-select-unit-nation-and-livery 2023-09-03 15:18:35 +02:00
Pax1601
6898d1df6d Completed unit nation selection and new spawn menu 2023-09-03 15:15:11 +02:00
PeekabooSteam
4d863bb894 First commit 2023-09-03 12:08:35 +01:00
Pax1601
a338e5fa26 Added docs folder 2023-09-01 16:44:47 +02:00
Pax1601
695adc8acb More work on units spawn menu and started to add documentation 2023-09-01 16:13:15 +02:00
Pax1601
fab7d26191 More work on scripted spawn menu 2023-08-31 17:25:47 +02:00
Pax1601
3959139dd8 Started conversion to scripted unit spawn menu 2023-08-30 20:01:25 +02:00
Pax1601
1298669f1c Merge pull request #365 from Pax1601/358-right-click-long-press-for-unit-action-context-menu
358 right click long press for unit action context menu
2023-08-30 09:13:13 +02:00
Pax1601
4fe40f5ff7 Merge branch 'main' into 358-right-click-long-press-for-unit-action-context-menu 2023-08-30 09:13:06 +02:00
Pax1601
a10c113c42 Right click long press menu completed 2023-08-30 09:10:42 +02:00
Pax1601
d5f4b5c711 More work on country selection 2023-08-29 19:17:36 +02:00
Pax1601
93707af56b Merge pull request #363 from Pax1601/350-in-rts-mode-helicopters-are-shown-with-a-distinctive-shape-that-allows-to-identify-them
Non visually detected units are now drawn with generic symbol
2023-08-29 14:59:42 +02:00
Pax1601
0ae694c1a8 Non visually detected units are now drawn with generic symbol 2023-08-29 14:59:23 +02:00
Pax1601
0b53fb19b7 Merge pull request #362 from Pax1601/356-add-marker-for-deployed-smoke
Create colored smoke markers
2023-08-29 10:02:50 +02:00
Pax1601
cc386e86b9 Create colored smoke markers 2023-08-29 10:02:18 +02:00
Pax1601
a922d7de31 Merge pull request #361 from Pax1601/349-add-ability-to-hide-units-names
349 add ability to hide units names
2023-08-29 09:39:27 +02:00
Pax1601
8e7d64f0e4 Remove shortcut and added option in dropdown 2023-08-29 09:39:07 +02:00
Pax1601
0bc406538b Merge pull request #360 from Pax1601/351-double-click-on-a-unit-should-select-all-units-of-that-time-on-the-screen
351 double click on a unit should select all units of that time on the screen
2023-08-28 17:14:23 +02:00
Pax1601
9547559e00 Refactoring and merge 2023-08-28 17:14:03 +02:00
Pax1601
70783dc828 Merge branch 'main' into 351-double-click-on-a-unit-should-select-all-units-of-that-time-on-the-screen 2023-08-28 17:05:34 +02:00
Pax1601
85bdd791b8 Implemented long press right click menu 2023-08-28 15:48:46 +02:00
Pax1601
9d7e61556d Added unit country selection 2023-08-27 15:59:50 +02:00
Pax1601
eb80c39b98 Loadouts changes and spawn menu update 2023-08-24 16:16:59 +02:00
PeekabooSteam
07b69fe96f Added dbl-click select but it's buggy AF 2023-08-12 19:31:08 +01:00
PeekabooSteam
e0a3fd1795 Corrected some variable names. 2023-08-12 16:46:37 +01:00
1130 changed files with 200534 additions and 35849 deletions

45
.github/workflows/build_package.yml vendored Normal file
View 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

44
.gitignore vendored
View File

@@ -1,12 +1,42 @@
bin
/scripts/old
.vs
x64
core.user
core.vcxproj.user
*.user
Output
node_modules
/client/TODO.txt
/client/public/javascripts/bundle.js
!client/bin
hgt
/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

Binary file not shown.

59
INSTRUCTIONS.txt Normal file
View 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.

View File

@@ -1,4 +1,34 @@
GNU GENERAL PUBLIC LICENSE
DCS Olympus
A real-time AI unit control mod for DCS World
Copyright (C) 2023 Veltro & Gang (the "DCS Olympus Team" or the
"Rightsholders")
DCS Olympus (the "MATERIAL" or "Software") is provided completely free
to users subject to the it under both the terms of version 3 of the GNU
General Public License ("GPLv3") as published by the Free Software Foundation,
and the additional terms set out below (the "Additional Terms"). In the event
that the terms of GPLv3 conflict with the Additional Terms, the
Additional Terms shall prevail.
The authors and/or copyright holders of the Software have not received any
financial benefit in connection with the Software. In any event, the
Software is provided “as is”, without warranty of any kind, express or
implied, including but not limited to the warranties of merchantability,
fitness for a particular purpose and non-infringement. In no event shall
the authors and/or copyright holders be liable for any claim, damages or
other liability, whether in an action of contract, tort or otherwise,
arising from, out of or in connection with the Software or the use or
other dealings in the Software.
THIS MATERIAL IS NOT MADE OR SUPPORTED BY EAGLE DYNAMICS SA.
Any party making use of the Software in any manner agrees to be bound by
the entirety of this document.
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
@@ -618,57 +648,31 @@ an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
END OF GNU GENERAL PUBLIC LICENCE
How to Apply These Terms to Your New Programs
ADDITIONAL TERMS & CONDITIONS
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
1. Governing Law
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Save where specifically provided for otherwise, the provisions of the
GNU General Public Licence Version 3 above shall be governed by and
interpreted in accordance with English Law and the parties submit to the
exclusive jurisdiction of the English Courts.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
2. Entire Agreement
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The text of this document contains the entire understanding between
you, the licensee, and the authors and/or copyright holders of the
Software with respect to the subject matter to which it pertains.
It supersedes all prior agreements and understandings (if applicable),
oral or written, with respect to such matters.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
3. Unilateral Modification
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
The parties agree that the DCS Olympus Team shall have the right to
unilaterally modify these terms (i.e. the agreement between you and the
DCS Olympus Team for the use of the Software), and that parties shall
be bound by such terms as modified from time to time. The DCS Olympus Team
shall not have an obligation to inform you of such modification, save that
such changes will be published on the DCS Olympus Github Repository located at
https://github.com/Pax1601/DCSOlympus.

103
README.md
View File

@@ -1,40 +1,85 @@
# Important note: DCS Olympus is in alpha state. No official release has been produced yet. The first public version is planned for Q4 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*
![alt text](https://github.com/Pax1601/DCSOlympus/blob/main/client/sample.png?raw=true)
### What is this?
DCS Olympus is a mod for DCS World. It allows users to spawn, control, task, group, and remove units from a DCS World server using a real-time map interface, similarly to Real Time Strategy games. The user interface also provides useful informations units, like loadouts, fuel, tasking, and so on. In the future, more features for DCS World GCI and JTAC will be available.
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.
### Features and how to use it
- Spawn air and ground units, with preset loadouts
- Double click on the map to spawn a blue and red units, both in the air and in the ground, with preset loadouts for air-to-air or air-to-ground tasks;
- Control units
- Select one ore more units to move them around. Hold down ctrl and click to create a route for the unit to follow;
- Attack other units
- After selecting one ore more units, double click on another unit and select "Attack" to attack it, depending on the available weapons.
Additionally Olympus is able to run several effects and unit behaviours beyond the core DCS offerings. This includes such things as napalm and white phosphosous explosions, or setting up AA units to fire at players and miss, and more.
It even includes Red and Blue modes which limit your view and powers to just seeing what your coalition sees, with a spawning budget you could play against your friends even with no-one in the game piloting, or have a Red commander working against a squadron of blue pilots, and/or a blue commander working with them.
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
### Building DCS Olympus
DCS Olympus is comprised of two modules:
# Frequently Asked Questions
A "core" c++ .dll module, which is run by DCS and exposes all the necessary data, and provides endpoints for commands from a REST server. A Visual Studio 2017/2019/2022 solution is provided, and requires no additional configuration. The core dll solution has two dependencies, both can be installed using vcpkg (https://vcpkg.io/en/getting-started.html):
- cpprestsdk: `vcpkg install cpprestsdk:x64-windows`
- geographiclib: `vcpkg install geographiclib:x64-windows`
A "client" node.js typescript web app, which can be hosted on the server using express.js. A Visual Studio Code configuration is provided for debugging. The client requires node.js to be installed for building (https://nodejs.org/en/). After installing node.js, move in the client folder and run the following commands:
- `npm install`
- `npm -g install`
After installing all the necessary dependencies you can start a development server executing the *client/debug.bat* batch file, and visiting http:\\localhost:3000 with any modern browser (tested with updated Chrome, Firefox and Edge). However, it is highly suggested to simply run the `Launch Chrome against localhost` debug configuration in Visual Studio Code.
### 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? ###
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.
These include but are not limited to:
1) Enhancements to helicopter play
2) More features around use of ground units
3) More unique effects and behaviours
4) ATC/AIC features
5) Usability features like unit painters etc
However we cannot commit to specific features, feature release order, or timelines, please remember this isn't our job and we work on it in our free time because we love DCS
### 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.
### 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.
However we cannot foresee everything people come up with so we suggest testing with what you have in mind once olympus releases
### 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;
(B) Webserver exe: The one you start when starting the server via the desktop shortcut.
A and B never communicate when you connect the client you download the web page and some other minor stuff from B, and you get the DCS data from and send commands to A.
### How much does Olympus impact performance? ###
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
View 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
View 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

View File

@@ -37,7 +37,6 @@
<ClInclude Include="include\airunit.h" />
<ClInclude Include="include\commands.h" />
<ClInclude Include="include\datatypes.h" />
<ClInclude Include="include\measure.h" />
<ClInclude Include="include\groundunit.h" />
<ClInclude Include="include\helicopter.h" />
<ClInclude Include="include\navyunit.h" />
@@ -48,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" />
@@ -55,7 +55,6 @@
<ClCompile Include="src\commands.cpp" />
<ClCompile Include="src\core.cpp" />
<ClCompile Include="src\datatypes.cpp" />
<ClCompile Include="src\measure.cpp" />
<ClCompile Include="src\groundunit.cpp" />
<ClCompile Include="src\helicopter.cpp" />
<ClCompile Include="src\navyunit.cpp" />
@@ -67,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>
@@ -108,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>
@@ -176,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'">

View File

@@ -45,15 +45,13 @@
<ClInclude Include="include\weapon.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\measure.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\datatypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\weaponsmanager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\aircraft.cpp">
@@ -95,9 +93,6 @@
<ClCompile Include="src\weapon.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\measure.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\datatypes.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -105,4 +100,7 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="core.rc" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,20 @@
#pragma once
#include "airunit.h"
#define AIRCRAFT_DEST_DIST_THR 2000 // Meters
class Aircraft : public AirUnit
{
public:
Aircraft(json::value json, unsigned int ID);
static void loadDatabase(string path);
virtual void changeSpeed(string change);
virtual void changeAltitude(string change);
virtual double getDestinationReachedThreshold() { return AIRCRAFT_DEST_DIST_THR; }
protected:
static json::value database;
};

View File

@@ -17,6 +17,7 @@ public:
virtual void changeSpeed(string change) = 0;
virtual void changeAltitude(string change) = 0;
virtual double getDestinationReachedThreshold() { return AIR_DEST_DIST_THR; }
protected:
virtual void AIloop();

View File

@@ -3,6 +3,7 @@
#include "luatools.h"
#include "utils.h"
#include "logger.h"
#include "datatypes.h"
namespace CommandPriority {
enum CommandPriorities { LOW, MEDIUM, HIGH, IMMEDIATE };
@@ -94,19 +95,26 @@ namespace ECMUse {
class Command
{
public:
Command(function<void(void)> callback) : callback(callback) {};
unsigned int getPriority() { return priority; }
virtual string getString() = 0;
virtual unsigned int getLoad() = 0;
const string getHash() { return hash; }
void executeCallback() { callback(); }
protected:
unsigned int priority = CommandPriority::LOW;
const string hash = random_string(16);
function<void(void)> callback;
};
/* Simple low priority move command (from user click) */
class Move : public Command
{
public:
Move(string groupName, Coords destination, double speed, string speedType, double altitude, string altitudeType, string taskOptions, string category):
Move(string groupName, Coords destination, double speed, string speedType, double altitude,
string altitudeType, string taskOptions, string category, bool onRoad, function<void(void)> callback = []() {}) :
Command(callback),
groupName(groupName),
destination(destination),
speed(speed),
@@ -114,12 +122,13 @@ public:
altitude(altitude),
altitudeType(altitudeType),
taskOptions(taskOptions),
category(category)
category(category),
onRoad(onRoad)
{
priority = CommandPriority::HIGH;
priority = CommandPriority::MEDIUM;
};
virtual string getString();
virtual unsigned int getLoad() { return 2; }
virtual unsigned int getLoad() { return onRoad? 45: 5; }
private:
const string groupName;
@@ -130,13 +139,15 @@ private:
const string altitudeType;
const string taskOptions;
const string category;
const bool onRoad;
};
/* Smoke command */
class Smoke : public Command
{
public:
Smoke(string color, Coords location) :
Smoke(string color, Coords location, function<void(void)> callback = [](){}) :
Command(callback),
color(color),
location(location)
{
@@ -154,23 +165,22 @@ private:
class SpawnGroundUnits : public Command
{
public:
SpawnGroundUnits(string coalition, vector<string> unitTypes, vector<Coords> locations, vector<string> liveryIDs, bool immediate) :
SpawnGroundUnits(string coalition, vector<SpawnOptions> spawnOptions, string country, bool immediate, function<void(void)> callback = [](){}) :
Command(callback),
coalition(coalition),
unitTypes(unitTypes),
locations(locations),
liveryIDs(liveryIDs),
spawnOptions(spawnOptions),
country(country),
immediate(immediate)
{
priority = immediate? CommandPriority::IMMEDIATE: CommandPriority::LOW;
};
virtual string getString();
virtual unsigned int getLoad() { return immediate? 1: 30; }
virtual unsigned int getLoad() { return immediate? 5: 30; }
private:
const string coalition;
const vector<string> unitTypes;
const vector<Coords> locations;
const vector<string> liveryIDs;
const vector<SpawnOptions> spawnOptions;
const string country;
const bool immediate;
};
@@ -178,23 +188,22 @@ private:
class SpawnNavyUnits : public Command
{
public:
SpawnNavyUnits(string coalition, vector<string> unitTypes, vector<Coords> locations, vector<string> liveryIDs, bool immediate) :
SpawnNavyUnits(string coalition, vector<SpawnOptions> spawnOptions, string country, bool immediate, function<void(void)> callback = [](){}) :
Command(callback),
coalition(coalition),
unitTypes(unitTypes),
locations(locations),
liveryIDs(liveryIDs),
spawnOptions(spawnOptions),
country(country),
immediate(immediate)
{
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
};
virtual string getString();
virtual unsigned int getLoad() { return immediate ? 1 : 30; }
virtual unsigned int getLoad() { return immediate ? 5 : 60; }
private:
const string coalition;
const vector<string> unitTypes;
const vector<Coords> locations;
const vector<string> liveryIDs;
const vector<SpawnOptions> spawnOptions;
const string country;
const bool immediate;
};
@@ -202,56 +211,49 @@ private:
class SpawnAircrafts : public Command
{
public:
SpawnAircrafts(string coalition, vector<string> unitTypes, vector<Coords> locations, vector<string> loadouts, vector<string> liveryIDs, string airbaseName, bool immediate) :
SpawnAircrafts(string coalition, vector<SpawnOptions> spawnOptions, string airbaseName, string country, bool immediate, function<void(void)> callback = [](){}) :
Command(callback),
coalition(coalition),
unitTypes(unitTypes),
locations(locations),
loadouts(loadouts),
liveryIDs(liveryIDs),
spawnOptions(spawnOptions),
airbaseName(airbaseName),
country(country),
immediate(immediate)
{
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
};
virtual string getString();
virtual unsigned int getLoad() { return immediate ? 1 : 30; }
virtual unsigned int getLoad() { return immediate ? 5 : 45; }
private:
const string coalition;
const vector<string> unitTypes;
const vector<Coords> locations;
const vector<string> loadouts;
const vector<string> liveryIDs;
const vector<SpawnOptions> spawnOptions;
const string airbaseName;
const string country;
const bool immediate;
};
/* Spawn helicopter command */
class SpawnHelicopters : public Command
{
public:
SpawnHelicopters(string coalition, vector<string> unitTypes, vector<Coords> locations, vector<string> loadouts, vector<string> liveryIDs, string airbaseName, bool immediate) :
SpawnHelicopters(string coalition, vector<SpawnOptions> spawnOptions, string airbaseName, string country, bool immediate, function<void(void)> callback = [](){}) :
Command(callback),
coalition(coalition),
unitTypes(unitTypes),
locations(locations),
loadouts(loadouts),
liveryIDs(liveryIDs),
spawnOptions(spawnOptions),
airbaseName(airbaseName),
country(country),
immediate(immediate)
{
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
};
virtual string getString();
virtual unsigned int getLoad() { return immediate ? 1 : 30; }
virtual unsigned int getLoad() { return immediate ? 5 : 45; }
private:
const string coalition;
const vector<string> unitTypes;
const vector<Coords> locations;
const vector<string> loadouts;
const vector<string> liveryIDs;
const vector<SpawnOptions> spawnOptions;
const string airbaseName;
const string country;
const bool immediate;
};
@@ -259,9 +261,10 @@ private:
class Clone : public Command
{
public:
Clone(unsigned int ID, Coords location) :
ID(ID),
location(location)
Clone(vector<CloneOptions> cloneOptions, bool deleteOriginal, function<void(void)> callback = [](){}) :
Command(callback),
cloneOptions(cloneOptions),
deleteOriginal(deleteOriginal)
{
priority = CommandPriority::LOW;
};
@@ -269,28 +272,31 @@ public:
virtual unsigned int getLoad() { return 30; }
private:
const unsigned int ID;
const Coords location;
const vector<CloneOptions> cloneOptions;
const bool deleteOriginal;
};
/* Delete unit command */
class Delete : public Command
{
public:
Delete(unsigned int ID, bool explosion, bool immediate ) :
Delete(unsigned int ID, bool explosion, string explosionType, bool immediate, function<void(void)> callback = [](){}) :
Command(callback),
ID(ID),
explosion(explosion),
explosionType(explosionType),
immediate(immediate)
{
priority = CommandPriority::HIGH;
immediate = immediate;
};
virtual string getString();
virtual unsigned int getLoad() { return immediate? 1: 5; }
virtual unsigned int getLoad() { return immediate? 1: 30; }
private:
const unsigned int ID;
const bool explosion;
const string explosionType;
const bool immediate;
};
@@ -298,14 +304,15 @@ private:
class SetTask : public Command
{
public:
SetTask(string groupName, string task) :
SetTask(string groupName, string task, function<void(void)> callback = [](){}) :
Command(callback),
groupName(groupName),
task(task)
{
priority = CommandPriority::MEDIUM;
};
virtual string getString();
virtual unsigned int getLoad() { return 1; }
virtual unsigned int getLoad() { return 5; }
private:
const string groupName;
@@ -316,13 +323,14 @@ private:
class ResetTask : public Command
{
public:
ResetTask(string groupName) :
ResetTask(string groupName, function<void(void)> callback = [](){}) :
Command(callback),
groupName(groupName)
{
priority = CommandPriority::HIGH;
};
virtual string getString();
virtual unsigned int getLoad() { return 1; }
virtual unsigned int getLoad() { return 5; }
private:
const string groupName;
@@ -332,14 +340,15 @@ private:
class SetCommand : public Command
{
public:
SetCommand(string groupName, string command) :
SetCommand(string groupName, string command, function<void(void)> callback = [](){}) :
Command(callback),
groupName(groupName),
command(command)
{
priority = CommandPriority::HIGH;
};
virtual string getString();
virtual unsigned int getLoad() { return 1; }
virtual unsigned int getLoad() { return 5; }
private:
const string groupName;
@@ -350,7 +359,8 @@ private:
class SetOption : public Command
{
public:
SetOption(string groupName, unsigned int optionID, unsigned int optionValue) :
SetOption(string groupName, unsigned int optionID, unsigned int optionValue, function<void(void)> callback = [](){}) :
Command(callback),
groupName(groupName),
optionID(optionID),
optionValue(optionValue),
@@ -360,7 +370,8 @@ public:
priority = CommandPriority::HIGH;
};
SetOption(string groupName, unsigned int optionID, bool optionBool) :
SetOption(string groupName, unsigned int optionID, bool optionBool, function<void(void)> callback = [](){}) :
Command(callback),
groupName(groupName),
optionID(optionID),
optionValue(0),
@@ -370,7 +381,7 @@ public:
priority = CommandPriority::HIGH;
};
virtual string getString();
virtual unsigned int getLoad() { return 1; }
virtual unsigned int getLoad() { return 5; }
private:
const string groupName;
@@ -384,14 +395,15 @@ private:
class SetOnOff : public Command
{
public:
SetOnOff(string groupName, bool onOff) :
SetOnOff(string groupName, bool onOff, function<void(void)> callback = [](){}) :
Command(callback),
groupName(groupName),
onOff(onOff)
{
priority = CommandPriority::HIGH;
};
virtual string getString();
virtual unsigned int getLoad() { return 1; }
virtual unsigned int getLoad() { return 5; }
private:
const string groupName;
@@ -402,16 +414,19 @@ private:
class Explosion : public Command
{
public:
Explosion(unsigned int intensity, Coords location) :
Explosion(unsigned int intensity, string explosionType, Coords location, function<void(void)> callback = [](){}) :
Command(callback),
location(location),
intensity(intensity)
intensity(intensity),
explosionType(explosionType)
{
priority = CommandPriority::MEDIUM;
};
virtual string getString();
virtual unsigned int getLoad() { return 4; }
virtual unsigned int getLoad() { return 5; }
private:
const Coords location;
const unsigned int intensity;
const string explosionType;
};

View File

@@ -1,6 +1,6 @@
#pragma once
#include "framework.h"
#include "utils.h"
namespace DataIndex {
enum DataIndexes {
@@ -19,9 +19,12 @@ namespace DataIndex {
hasTask,
position,
speed,
horizontalVelocity,
verticalVelocity,
heading,
isTanker,
isAWACS,
track,
isActiveTanker,
isActiveAWACS,
onOff,
followRoads,
fuel,
@@ -43,6 +46,10 @@ namespace DataIndex {
contacts,
activePath,
isLeader,
operateAs,
shotsScatter,
shotsIntensity,
health,
lastIndex,
endOfData = 255
};
@@ -64,7 +71,33 @@ namespace State
BOMB_POINT,
CARPET_BOMB,
BOMB_BUILDING,
FIRE_AT_AREA
FIRE_AT_AREA,
SIMULATE_FIRE_FIGHT,
SCENIC_AAA,
MISS_ON_PURPOSE,
LAND_AT_POINT
};
};
namespace ShotsScatter
{
enum ShotsScatters
{
NONE = 0,
HIGH,
MEDIUM,
LOW
};
};
namespace ShotsIntensity
{
enum ShotsIntensities
{
NONE = 0,
LOW,
MEDIUM,
HIGH
};
};
@@ -114,3 +147,16 @@ bool operator==(const DataTypes::Radio& lhs, const DataTypes::Radio& rhs);
bool operator==(const DataTypes::GeneralSettings& lhs, const DataTypes::GeneralSettings& rhs);
bool operator==(const DataTypes::Ammo& lhs, const DataTypes::Ammo& rhs);
bool operator==(const DataTypes::Contact& lhs, const DataTypes::Contact& rhs);
struct SpawnOptions {
string unitType;
Coords location;
string loadout;
string skill;
string liveryID;
};
struct CloneOptions {
unsigned int ID;
Coords location;
};

View File

@@ -1,13 +1,15 @@
#pragma once
#include "unit.h"
#define GROUND_DEST_DIST_THR 100
#define GROUND_DEST_DIST_THR 10
class GroundUnit : public Unit
{
public:
GroundUnit(json::value json, unsigned int ID);
static void loadDatabase(string path);
virtual void setState(unsigned char newState);
virtual void setDefaults(bool force = false);
@@ -15,6 +17,9 @@ public:
virtual void setOnOff(bool newOnOff, bool force = false);
virtual void setFollowRoads(bool newFollowRoads, bool force = false);
void aimAtPoint(Coords aimTarget);
protected:
virtual void AIloop();
static json::value database;
};

View File

@@ -0,0 +1,20 @@
#pragma once
#include "airunit.h"
#define HELICOPTER_DEST_DIST_THR 500 // Meters
class Helicopter : public AirUnit
{
public:
Helicopter(json::value json, unsigned int ID);
static void loadDatabase(string path);
virtual void changeSpeed(string change);
virtual void changeAltitude(string change);
virtual double getDestinationReachedThreshold() { return HELICOPTER_DEST_DIST_THR; }
protected:
static json::value database;
};

View File

@@ -8,6 +8,8 @@ class NavyUnit : public Unit
public:
NavyUnit(json::value json, unsigned int ID);
static void loadDatabase(string path);
virtual void setState(unsigned char newState);
virtual void setDefaults(bool force = false);
@@ -16,5 +18,5 @@ public:
protected:
virtual void AIloop();
static json::value database;
};

View File

@@ -11,38 +11,40 @@ public:
void appendCommand(Command* command);
void execute(lua_State* L);
void handleRequest(string key, json::value value, string username);
void handleRequest(string key, json::value value, string username, json::value& answer);
bool checkSpawnPoints(int spawnPoints, string coalition);
bool isCommandExecuted(string commandHash) { return (find(executedCommandsHashes.begin(), executedCommandsHashes.end(), commandHash) != executedCommandsHashes.end()); }
void setFrameRate(double newFrameRate) { frameRate = newFrameRate; }
void setRestrictSpawns(bool newRestrictSpawns) { restrictSpawns = newRestrictSpawns; }
void setRestrictToCoalition(bool newRestrictToCoalition) { restrictToCoalition = newRestrictToCoalition; }
void setSetupTime(unsigned int newSetupTime) { setupTime = newSetupTime; }
void setBlueSpawnPoints(unsigned int newBlueSpawnPoints) { blueSpawnPoints = newBlueSpawnPoints; }
void setRedSpawnPoints(unsigned int newRedSpawnPoints) { redSpawnPoints = newRedSpawnPoints; }
void setBlueSpawnPoints(int newBlueSpawnPoints) { blueSpawnPoints = newBlueSpawnPoints; }
void setRedSpawnPoints(int newRedSpawnPoints) { redSpawnPoints = newRedSpawnPoints; }
void setEras(vector<string> newEras) { eras = newEras; }
void setCommandModeOptions(json::value newOptions);
int getFrameRate() { return frameRate; };
int getFrameRate() { return static_cast<int>(round(frameRate)); };
int getLoad();
bool getRestrictSpawns() { return restrictSpawns; }
bool getRestrictToCoalition() { return restrictToCoalition; }
unsigned int getSetupTime() { return setupTime; }
unsigned int getBlueSpawnPoints() { return blueSpawnPoints; }
unsigned int getRedSpawnPoints() { return redSpawnPoints; }
int getBlueSpawnPoints() { return blueSpawnPoints; }
int getRedSpawnPoints() { return redSpawnPoints; }
vector<string> getEras() { return eras; }
json::value getCommandModeOptions();
private:
list<Command*> commands;
unsigned int load;
double frameRate;
list<string> executedCommandsHashes;
unsigned int load = 0;
double frameRate = 0;
bool restrictSpawns = false;
bool restrictToCoalition = false;
unsigned int setupTime = 300;
unsigned int blueSpawnPoints = 10000;
unsigned int redSpawnPoints = 10000;
int blueSpawnPoints = 10000;
int redSpawnPoints = 10000;
vector<string> eras = { "WW2", "Early Cold War", "Mid Cold War", "Late Cold War", "Modern" };
};

View File

@@ -5,7 +5,11 @@
function Olympus.protectedCall(...)\n\n \
local status, retval = pcall(...)\n \
if not status then\n \
trigger.action.outText(\"ERROR: \" ..retval, 20)\n \
if Olympus.log ~= nil then\n \
Olympus.log:error(retval)\n \
else\n \
trigger.action.outText(\"Olympus critical error: \" ..retval, 20)\n \
end\n \
end\n \
end\n \
trigger.action.outText(\"Olympus.protectedCall registered successfully\", 10)\n"

View File

@@ -3,7 +3,6 @@
#include "utils.h"
#include "dcstools.h"
#include "luatools.h"
#include "measure.h"
#include "logger.h"
#include "commands.h"
#include "datatypes.h"
@@ -54,6 +53,9 @@ public:
void resetTask();
bool checkTaskFailed();
void resetTaskFailedCounter();
void setHasTaskAssigned(bool newHasTaskAssigned);
void setEnableTaskCheckFailed(bool newEnableTaskCheckFailed) { enableTaskFailedCheck = newEnableTaskCheckFailed; }
bool getEnableTaskCheckFailed() { return enableTaskFailedCheck; }
void triggerUpdate(unsigned char datumIndex);
@@ -72,12 +74,15 @@ public:
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); }
virtual void setHasTask(bool newValue) { updateValue(hasTask, newValue, DataIndex::hasTask); }
virtual void setHasTask(bool newValue);
virtual void setPosition(Coords newValue) { updateValue(position, newValue, DataIndex::position); }
virtual void setSpeed(double newValue) { updateValue(speed, newValue, DataIndex::speed); }
virtual void setHorizontalVelocity(double newValue) { updateValue(horizontalVelocity, newValue, DataIndex::horizontalVelocity); }
virtual void setVerticalVelocity(double newValue) { updateValue(verticalVelocity, newValue, DataIndex::verticalVelocity); }
virtual void setHeading(double newValue) { updateValue(heading, newValue, DataIndex::heading); }
virtual void setIsTanker(bool newValue);
virtual void setIsAWACS(bool newValue);
virtual void setTrack(double newValue) { updateValue(track, newValue, DataIndex::track); }
virtual void setIsActiveTanker(bool newValue);
virtual void setIsActiveAWACS(bool newValue);
virtual void setOnOff(bool newValue, bool force = false) { updateValue(onOff, newValue, DataIndex::onOff); };
virtual void setFollowRoads(bool newValue, bool force = false) { updateValue(followRoads, newValue, DataIndex::followRoads); };
virtual void setFuel(unsigned short newValue) { updateValue(fuel, newValue, DataIndex::fuel); }
@@ -99,6 +104,10 @@ public:
virtual void setContacts(vector<DataTypes::Contact> newValue);
virtual void setActivePath(list<Coords> newValue);
virtual void setIsLeader(bool newValue) { updateValue(isLeader, newValue, DataIndex::isLeader); }
virtual void setOperateAs(unsigned char newValue) { updateValue(operateAs, newValue, DataIndex::operateAs); }
virtual void setShotsScatter(unsigned char newValue) { updateValue(shotsScatter, newValue, DataIndex::shotsScatter); }
virtual void setShotsIntensity(unsigned char newValue) { updateValue(shotsIntensity, newValue, DataIndex::shotsIntensity); }
virtual void setHealth(unsigned char newValue) { updateValue(health, newValue, DataIndex::health); }
/********** Getters **********/
virtual string getCategory() { return category; };
@@ -115,9 +124,12 @@ public:
virtual bool getHasTask() { return hasTask; }
virtual Coords getPosition() { return position; }
virtual double getSpeed() { return speed; }
virtual double getHorizontalVelocity() { return horizontalVelocity; }
virtual double getVerticalVelocity() { return verticalVelocity; }
virtual double getHeading() { return heading; }
virtual bool getIsTanker() { return isTanker; }
virtual bool getIsAWACS() { return isAWACS; }
virtual double getTrack() { return track; }
virtual bool getIsActiveTanker() { return isActiveTanker; }
virtual bool getIsActiveAWACS() { return isActiveAWACS; }
virtual bool getOnOff() { return onOff; };
virtual bool getFollowRoads() { return followRoads; };
virtual unsigned short getFuel() { return fuel; }
@@ -136,9 +148,13 @@ public:
virtual DataTypes::Radio getRadio() { return radio; }
virtual DataTypes::GeneralSettings getGeneralSettings() { return generalSettings; }
virtual vector<DataTypes::Ammo> getAmmo() { return ammo; }
virtual vector<DataTypes::Contact> getTargets() { return contacts; }
virtual vector<DataTypes::Contact> getContacts() { return contacts; }
virtual list<Coords> getActivePath() { return activePath; }
virtual bool getIsLeader() { return isLeader; }
virtual unsigned char getOperateAs() { return operateAs; }
virtual unsigned char getShotsScatter() { return shotsScatter; }
virtual unsigned char getShotsIntensity() { return shotsIntensity; }
virtual unsigned char getHealth() { return health; }
protected:
unsigned int ID;
@@ -157,16 +173,19 @@ protected:
bool hasTask = false;
Coords position = Coords(NULL);
double speed = NULL;
double horizontalVelocity = NULL;
double verticalVelocity = NULL;
double heading = NULL;
bool isTanker = false;
bool isAWACS = false;
double track = NULL;
bool isActiveTanker = false;
bool isActiveAWACS = false;
bool onOff = true;
bool followRoads = false;
unsigned short fuel = 0;
double desiredSpeed = 0;
bool desiredSpeedType = 1;
double desiredAltitude = 0;
bool desiredAltitudeType = 1;
bool desiredSpeedType = 0; /* CAS */
double desiredAltitude = 1;
bool desiredAltitudeType = 0; /* ASL */
unsigned int leaderID = NULL;
Offset formationOffset = Offset(NULL);
unsigned int targetID = NULL;
@@ -181,19 +200,27 @@ protected:
vector<DataTypes::Contact> contacts;
list<Coords> activePath;
bool isLeader = false;
unsigned char operateAs = 2;
Coords activeDestination = Coords(NULL);
unsigned char shotsScatter = 2;
unsigned char shotsIntensity = 2;
unsigned char health = 100;
/********** Other **********/
unsigned int taskCheckCounter = 0;
unsigned int internalCounter = 0;
Unit* missOnPurposeTarget = nullptr;
bool hasTaskAssigned = false;
double initialFuel = 0;
map<unsigned char, unsigned long long> updateTimeMap;
unsigned long long lastLoopTime = 0;
bool enableTaskFailedCheck = false;
/********** Private methods **********/
virtual void AIloop() = 0;
void appendString(stringstream& ss, const unsigned char& datumIndex, const string& datumValue) {
const unsigned short size = datumValue.size();
const unsigned short size = static_cast<unsigned short>(datumValue.size());
ss.write((const char*)&datumIndex, sizeof(unsigned char));
ss.write((const char*)&size, sizeof(unsigned short));
ss << datumValue;
@@ -218,7 +245,7 @@ protected:
template <typename T>
void appendVector(stringstream& ss, const unsigned char& datumIndex, vector<T>& datumValue) {
const unsigned short size = datumValue.size();
const unsigned short size = static_cast<unsigned short>(datumValue.size());
ss.write((const char*)&datumIndex, sizeof(unsigned char));
ss.write((const char*)&size, sizeof(unsigned short));
@@ -228,7 +255,7 @@ protected:
template <typename T>
void appendList(stringstream& ss, const unsigned char& datumIndex, list<T>& datumValue) {
const unsigned short size = datumValue.size();
const unsigned short size = static_cast<unsigned short>(datumValue.size());;
ss.write((const char*)&datumIndex, sizeof(unsigned char));
ss.write((const char*)&size, sizeof(unsigned short));

View File

@@ -20,9 +20,12 @@ public:
void update(json::value& missionData, double dt);
void runAILoop();
void getUnitData(stringstream &ss, unsigned long long time);
void deleteUnit(unsigned int ID, bool explosion, bool immediate);
void deleteUnit(unsigned int ID, bool explosion, string explosionType, bool immediate);
void acquireControl(unsigned int ID);
void loadDatabases();
Unit* getClosestUnit(Unit* unit, unsigned char coalition, vector<string> categories, double &distance);
map<Unit*, double> getUnitsInRange(Unit* unit, unsigned char coalition, vector<string> categories, double range);
private:
map<unsigned int, Unit*> units;
json::value missionDB;

View File

@@ -3,7 +3,6 @@
#include "utils.h"
#include "dcstools.h"
#include "luatools.h"
#include "measure.h"
#include "logger.h"
#include "commands.h"
#include "datatypes.h"
@@ -60,7 +59,7 @@ protected:
/********** Private methods **********/
void appendString(stringstream& ss, const unsigned char& datumIndex, const string& datumValue) {
const unsigned short size = datumValue.size();
const unsigned short size = static_cast<unsigned short>(datumValue.size());
ss.write((const char*)&datumIndex, sizeof(unsigned char));
ss.write((const char*)&size, sizeof(unsigned short));
ss << datumValue;

14
backend/core/resource.h Normal file
View 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

View File

@@ -11,6 +11,20 @@ using namespace GeographicLib;
extern Scheduler* scheduler;
extern UnitsManager* unitsManager;
json::value Aircraft::database = json::value();
extern string instancePath;
void Aircraft::loadDatabase(string path) {
std::ifstream ifstream(instancePath + path);
std::stringstream ss;
ss << ifstream.rdbuf();
std::error_code errorCode;
database = json::value::parse(ss.str(), errorCode);
if (database.is_object())
log("Aircrafts database loaded correctly from " + instancePath + path);
else
log("Error reading Aircrafts database file");
}
/* Aircraft */
Aircraft::Aircraft(json::value json, unsigned int ID) : AirUnit(json, ID)
@@ -20,7 +34,6 @@ Aircraft::Aircraft(json::value json, unsigned int ID) : AirUnit(json, ID)
setCategory("Aircraft");
setDesiredSpeed(knotsToMs(300));
setDesiredAltitude(ftToM(20000));
};
void Aircraft::changeSpeed(string change)
@@ -34,11 +47,6 @@ void Aircraft::changeSpeed(string change)
if (getDesiredSpeed() < knotsToMs(50))
setDesiredSpeed(knotsToMs(50));
if (state == State::IDLE)
resetTask();
else
goToDestination(); /* Send the command to reach the destination */
}
void Aircraft::changeAltitude(string change)
@@ -55,14 +63,9 @@ void Aircraft::changeAltitude(string change)
if (getDesiredAltitude() > 5000)
setDesiredAltitude(getDesiredAltitude() + ftToM(2500));
else if (getDesiredAltitude() >= 0)
setDesiredAltitude(getDesiredAltitude() + ftToM(500));
setDesiredAltitude(getDesiredAltitude() + ftToM(500));
}
if (getDesiredAltitude() < 0)
setDesiredAltitude(0);
if (state == State::IDLE)
resetTask();
else
goToDestination(); /* Send the command to reach the destination */
}

View File

@@ -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) {
@@ -69,6 +71,9 @@ void AirUnit::setState(unsigned char newState)
setTargetPosition(Coords(NULL));
break;
}
case State::LAND_AT_POINT: {
break;
}
default:
break;
}
@@ -77,15 +82,18 @@ void AirUnit::setState(unsigned char newState)
/************ Perform any action required when ENTERING a state ************/
switch (newState) {
case State::IDLE: {
setEnableTaskCheckFailed(false);
clearActivePath();
resetActiveDestination();
break;
}
case State::REACH_DESTINATION: {
setEnableTaskCheckFailed(true);
resetActiveDestination();
break;
}
case State::ATTACK: {
setEnableTaskCheckFailed(true);
if (isTargetAlive()) {
Unit* target = unitsManager->getUnit(targetID);
Coords targetPosition = Coords(target->getPosition().lat, target->getPosition().lng, 0);
@@ -96,67 +104,85 @@ void AirUnit::setState(unsigned char newState)
break;
}
case State::FOLLOW: {
setEnableTaskCheckFailed(true);
clearActivePath();
resetActiveDestination();
break;
}
case State::LAND: {
setEnableTaskCheckFailed(false);
resetActiveDestination();
break;
}
case State::REFUEL: {
setEnableTaskCheckFailed(true);
initialFuel = fuel;
clearActivePath();
resetActiveDestination();
break;
}
case State::BOMB_POINT: {
clearActivePath();
resetActiveDestination();
break;
}
case State::CARPET_BOMB: {
clearActivePath();
resetActiveDestination();
break;
}
case State::BOMB_POINT:
case State::CARPET_BOMB:
case State::BOMB_BUILDING: {
setTargetPosition(currentTargetPosition);
setEnableTaskCheckFailed(true);
clearActivePath();
resetActiveDestination();
break;
}
case State::LAND_AT_POINT: {
setEnableTaskCheckFailed(true);
resetActiveDestination();
break;
}
default:
break;
}
resetTask();
setHasTask(false);
resetTaskFailedCounter();
log(unitName + " setting state from " + to_string(state) + " to " + to_string(newState));
state = newState;
triggerUpdate(DataIndex::state);
AIloop();
}
void AirUnit::AIloop()
{
srand(static_cast<unsigned int>(time(NULL)) + ID);
/* State machine */
switch (state) {
case State::IDLE: {
setTask("Idle");
if (isActiveTanker)
setTask("Tanker racetrack");
else if (isActiveAWACS)
setTask("AWACS racetrack");
else
setTask("Idle");
if (!getHasTask())
{
std::ostringstream taskSS;
if (isTanker) {
taskSS << "{ [1] = { id = 'Tanker' }, [2] = { id = 'Orbit', pattern = 'Race-Track', altitude = " << desiredAltitude << ", speed = " << desiredSpeed << ", altitudeType = '" << desiredAltitudeType << "' } }";
if (isActiveTanker) {
taskSS << "{ [1] = { id = 'Tanker' }, [2] = { id = 'Orbit', pattern = 'Race-Track', altitude = " <<
desiredAltitude << ", speed = " << desiredSpeed << ", altitudeType = '" <<
(desiredAltitudeType ? "AGL" : "ASL") << "', speedType = '" << (desiredSpeedType ? "GS" : "CAS") << "' }}";
}
else if (isAWACS) {
taskSS << "{ [1] = { id = 'AWACS' }, [2] = { id = 'Orbit', pattern = 'Circle', altitude = " << desiredAltitude << ", speed = " << desiredSpeed << ", altitudeType = '" << desiredAltitudeType << "' } }";
else if (isActiveAWACS) {
taskSS << "{ [1] = { id = 'AWACS' }, [2] = { id = 'Orbit', pattern = 'Circle', altitude = " <<
desiredAltitude << ", speed = " << desiredSpeed << ", altitudeType = '" <<
(desiredAltitudeType ? "AGL" : "ASL") << "', speedType = '" << (desiredSpeedType ? "GS" : "CAS") << "' }}";
}
else {
taskSS << "{ id = 'Orbit', pattern = 'Circle', altitude = " << desiredAltitude << ", speed = " << desiredSpeed << ", altitudeType = '" << desiredAltitudeType << "' }";
taskSS << "{ id = 'Orbit', pattern = 'Circle', altitude = " <<
desiredAltitude << ", speed = " << desiredSpeed << ", altitudeType = '" <<
(desiredAltitudeType ? "AGL" : "ASL") << "', speedType = '" << (desiredSpeedType ? "GS" : "CAS") << "'}";
}
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str()));
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
@@ -166,12 +192,12 @@ void AirUnit::AIloop()
string enrouteTask = "";
bool looping = false;
if (isTanker)
if (isActiveTanker)
{
enrouteTask = "{ id = 'Tanker' }";
setTask("Tanker");
}
else if (isAWACS)
else if (isActiveAWACS)
{
enrouteTask = "{ id = 'AWACS' }";
setTask("AWACS");
@@ -190,7 +216,7 @@ void AirUnit::AIloop()
goToDestination(enrouteTask);
}
else {
if (isDestinationReached(AIR_DEST_DIST_THR)) {
if (isDestinationReached(getDestinationReachedThreshold())) {
if (updateActivePath(looping) && setActiveDestination())
goToDestination(enrouteTask);
else
@@ -261,7 +287,7 @@ void AirUnit::AIloop()
<< "z = " << formationOffset.z
<< "},"
<< "}";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str()));
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
@@ -277,7 +303,7 @@ void AirUnit::AIloop()
taskSS << "{"
<< "id = 'Refuel'"
<< "}";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str()));
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
@@ -285,25 +311,31 @@ void AirUnit::AIloop()
setState(State::IDLE);
}
}
break;
}
case State::BOMB_POINT: {
setTask("Bombing point");
if (!getHasTask()) {
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'Bombing', lat = " << targetPosition.lat << ", lng = " << targetPosition.lng << "}";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str()));
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
break;
}
case State::CARPET_BOMB: {
setTask("Carpet bombing");
if (!getHasTask()) {
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'CarpetBombing', lat = " << targetPosition.lat << ", lng = " << targetPosition.lng << "}";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str()));
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
@@ -314,8 +346,28 @@ void AirUnit::AIloop()
if (!getHasTask()) {
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'AttackMapObject', lat = " << targetPosition.lat << ", lng = " << targetPosition.lng << "}";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str()));
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
break;
}
case State::LAND_AT_POINT: {
setTask("Landing at point");
if (!getHasTask()) {
setActiveDestination();
std::ostringstream taskSS;
taskSS.precision(10),
taskSS << "{"
<< "id = 'LandAtPoint', "
<< "lat = " << activeDestination.lat << ", "
<< "lng = " << activeDestination.lng
<< "}";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}

View File

@@ -9,7 +9,6 @@ extern UnitsManager* unitsManager;
/* Move command */
string Move::getString()
{
std::ostringstream commandSS;
commandSS.precision(10);
commandSS << "Olympus.move, "
@@ -40,16 +39,16 @@ string Smoke::getString()
/* Spawn ground units command */
string SpawnGroundUnits::getString()
{
if (unitTypes.size() != locations.size()) return "";
std::ostringstream unitsSS;
unitsSS.precision(10);
for (int i = 0; i < unitTypes.size(); i++) {
for (int i = 0; i < spawnOptions.size(); i++) {
unitsSS << "[" << i + 1 << "] = {"
<< "unitType = " << "\"" << unitTypes[i] << "\"" << ", "
<< "lat = " << locations[i].lat << ", "
<< "lng = " << locations[i].lng << ", "
<< "liveryID = " << "\"" << liveryIDs[i] << "\"" << " }, ";
<< "unitType = " << "\"" << spawnOptions[i].unitType << "\"" << ", "
<< "lat = " << spawnOptions[i].location.lat << ", "
<< "lng = " << spawnOptions[i].location.lng << ", "
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
}
std::ostringstream commandSS;
@@ -57,6 +56,7 @@ string SpawnGroundUnits::getString()
commandSS << "Olympus.spawnUnits, {"
<< "category = " << "\"" << "GroundUnit" << "\"" << ", "
<< "coalition = " << "\"" << coalition << "\"" << ", "
<< "country = \"" << country << "\", "
<< "units = " << "{" << unitsSS.str() << "}" << "}";
return commandSS.str();
}
@@ -65,16 +65,15 @@ string SpawnGroundUnits::getString()
/* Spawn ground units command */
string SpawnNavyUnits::getString()
{
if (unitTypes.size() != locations.size()) return "";
std::ostringstream unitsSS;
unitsSS.precision(10);
for (int i = 0; i < unitTypes.size(); i++) {
for (int i = 0; i < spawnOptions.size(); i++) {
unitsSS << "[" << i + 1 << "] = {"
<< "unitType = " << "\"" << unitTypes[i] << "\"" << ", "
<< "lat = " << locations[i].lat << ", "
<< "lng = " << locations[i].lng << ", "
<< "liveryID = " << "\"" << liveryIDs[i] << "\"" << " }, ";
<< "unitType = " << "\"" << spawnOptions[i].unitType << "\"" << ", "
<< "lat = " << spawnOptions[i].location.lat << ", "
<< "lng = " << spawnOptions[i].location.lng << ", "
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
}
std::ostringstream commandSS;
@@ -82,6 +81,7 @@ string SpawnNavyUnits::getString()
commandSS << "Olympus.spawnUnits, {"
<< "category = " << "\"" << "NavyUnit" << "\"" << ", "
<< "coalition = " << "\"" << coalition << "\"" << ", "
<< "country = \"" << country << "\", "
<< "units = " << "{" << unitsSS.str() << "}" << "}";
return commandSS.str();
}
@@ -89,18 +89,17 @@ string SpawnNavyUnits::getString()
/* Spawn aircrafts command */
string SpawnAircrafts::getString()
{
if (unitTypes.size() != locations.size() || unitTypes.size() != loadouts.size()) return "";
std::ostringstream unitsSS;
unitsSS.precision(10);
for (int i = 0; i < unitTypes.size(); i++) {
for (int i = 0; i < spawnOptions.size(); i++) {
unitsSS << "[" << i + 1 << "] = {"
<< "unitType = " << "\"" << unitTypes[i] << "\"" << ", "
<< "lat = " << locations[i].lat << ", "
<< "lng = " << locations[i].lng << ", "
<< "alt = " << locations[i].alt << ", "
<< "loadout = \"" << loadouts[i] << "\"" << ", "
<< "liveryID = " << "\"" << liveryIDs[i] << "\"" << " }, ";
<< "unitType = " << "\"" << spawnOptions[i].unitType << "\"" << ", "
<< "lat = " << spawnOptions[i].location.lat << ", "
<< "lng = " << spawnOptions[i].location.lng << ", "
<< "alt = " << spawnOptions[i].location.alt << ", "
<< "loadout = \"" << spawnOptions[i].loadout << "\"" << ", "
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
}
std::ostringstream commandSS;
@@ -109,6 +108,7 @@ string SpawnAircrafts::getString()
<< "category = " << "\"" << "Aircraft" << "\"" << ", "
<< "coalition = " << "\"" << coalition << "\"" << ", "
<< "airbaseName = \"" << airbaseName << "\", "
<< "country = \"" << country << "\", "
<< "units = " << "{" << unitsSS.str() << "}" << "}";
return commandSS.str();
}
@@ -117,18 +117,17 @@ string SpawnAircrafts::getString()
/* Spawn helicopters command */
string SpawnHelicopters::getString()
{
if (unitTypes.size() != locations.size() || unitTypes.size() != loadouts.size()) return "";
std::ostringstream unitsSS;
unitsSS.precision(10);
for (int i = 0; i < unitTypes.size(); i++) {
for (int i = 0; i < spawnOptions.size(); i++) {
unitsSS << "[" << i + 1 << "] = {"
<< "unitType = " << "\"" << unitTypes[i] << "\"" << ", "
<< "lat = " << locations[i].lat << ", "
<< "lng = " << locations[i].lng << ", "
<< "alt = " << locations[i].alt << ", "
<< "loadout = \"" << loadouts[i] << "\"" << ", "
<< "liveryID = " << "\"" << liveryIDs[i] << "\"" << " }, ";
<< "unitType = " << "\"" << spawnOptions[i].unitType << "\"" << ", "
<< "lat = " << spawnOptions[i].location.lat << ", "
<< "lng = " << spawnOptions[i].location.lng << ", "
<< "alt = " << spawnOptions[i].location.alt << ", "
<< "loadout = \"" << spawnOptions[i].loadout << "\"" << ", "
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
}
std::ostringstream commandSS;
@@ -137,30 +136,30 @@ string SpawnHelicopters::getString()
<< "category = " << "\"" << "Helicopter" << "\"" << ", "
<< "coalition = " << "\"" << coalition << "\"" << ", "
<< "airbaseName = \"" << airbaseName << "\", "
<< "country = \"" << country << "\", "
<< "units = " << "{" << unitsSS.str() << "}" << "}";
return commandSS.str();
}
/* Clone unit command */
string Clone::getString()
{
Unit* unit = unitsManager->getUnit(ID);
if (unit != nullptr)
{
std::ostringstream commandSS;
commandSS.precision(10);
commandSS << "Olympus.clone, "
<< ID << ", "
<< location.lat << ", "
<< location.lng << ", "
<< "\"" << unit->getCategory() << "\"";
return commandSS.str();
}
else
{
return "";
std::ostringstream unitsSS;
unitsSS.precision(10);
for (int i = 0; i < cloneOptions.size(); i++) {
unitsSS << "[" << i + 1 << "] = {"
<< "ID = " << cloneOptions[i].ID << ", "
<< "lat = " << cloneOptions[i].location.lat << ", "
<< "lng = " << cloneOptions[i].location.lng << " }, ";
}
std::ostringstream commandSS;
commandSS.precision(10);
commandSS << "Olympus.clone, "
<< "{" << unitsSS.str() << "}" << ", "
<< (deleteOriginal ? "true" : "false");
return commandSS.str();
}
/* Delete unit command */
@@ -170,7 +169,8 @@ string Delete::getString()
commandSS.precision(10);
commandSS << "Olympus.delete, "
<< ID << ", "
<< (explosion ? "true" : "false");
<< (explosion ? "true" : "false") << ", "
<< "\"" << explosionType << "\"";
return commandSS.str();
}
@@ -249,6 +249,7 @@ string Explosion::getString()
commandSS.precision(10);
commandSS << "Olympus.explosion, "
<< intensity << ", "
<< "\"" << explosionType << "\"" << ", "
<< location.lat << ", "
<< location.lng;
return commandSS.str();

View File

@@ -25,6 +25,7 @@ json::value missionData = json::value::object();
mutex mutexLock;
string sessionHash;
string instancePath;
bool initialized = false;
@@ -51,9 +52,16 @@ extern "C" DllExport int coreDeinit(lua_State* L)
}
/* Called when DCS simulation starts. All singletons are instantiated, and the custom Lua functions are registered in the Lua state. */
extern "C" DllExport int coreInit(lua_State* L)
extern "C" DllExport int coreInit(lua_State* L, const char* path)
{
instancePath = path;
log("Initializing core.dll with instance path " + instancePath);
sessionHash = random_string(16);
log("Random session hash " + sessionHash);
unitsManager = new UnitsManager(L);
weaponsManager = new WeaponsManager(L);
server = new Server(L);
@@ -63,6 +71,8 @@ extern "C" DllExport int coreInit(lua_State* L)
server->start(L);
unitsManager->loadDatabases();
initialized = true;
return(0);
}
@@ -78,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;

View File

@@ -0,0 +1,566 @@
#include "groundunit.h"
#include "utils.h"
#include "logger.h"
#include "commands.h"
#include "scheduler.h"
#include "defines.h"
#include "unitsmanager.h"
#include <GeographicLib/Geodesic.hpp>
using namespace GeographicLib;
extern Scheduler* scheduler;
extern UnitsManager* unitsManager;
json::value GroundUnit::database = json::value();
extern string instancePath;
#define RANDOM_ZERO_TO_ONE (double)(rand()) / (double)(RAND_MAX)
#define RANDOM_MINUS_ONE_TO_ONE (((double)(rand()) / (double)(RAND_MAX) - 0.5) * 2)
void GroundUnit::loadDatabase(string path) {
std::ifstream ifstream(instancePath + path);
std::stringstream ss;
ss << ifstream.rdbuf();
std::error_code errorCode;
database = json::value::parse(ss.str(), errorCode);
if (database.is_object())
log("GroundUnits database loaded correctly from " + instancePath + path);
else
log("Error reading GroundUnits database file");
}
/* Ground unit */
GroundUnit::GroundUnit(json::value json, unsigned int ID) : Unit(json, ID)
{
log("New Ground Unit created with ID: " + to_string(ID));
setCategory("GroundUnit");
setDesiredSpeed(10);
};
void GroundUnit::setDefaults(bool force)
{
if (!getAlive() || !getControlled() || getHuman() || !getIsLeader()) return;
/* Set the default IDLE state */
setState(State::IDLE);
/* Set the default options */
setROE(ROE::WEAPON_FREE, force);
setOnOff(onOff, force);
setFollowRoads(followRoads, force);
}
void GroundUnit::setState(unsigned char newState)
{
Coords currentTargetPosition = getTargetPosition();
/************ Perform any action required when LEAVING a state ************/
if (newState != state) {
switch (state) {
case State::IDLE: {
break;
}
case State::REACH_DESTINATION: {
break;
}
case State::ATTACK: {
setTargetID(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;
}
default:
break;
}
}
/************ Perform any action required when ENTERING a state ************/
switch (newState) {
case State::IDLE: {
setEnableTaskCheckFailed(false);
clearActivePath();
resetActiveDestination();
break;
}
case State::REACH_DESTINATION: {
setEnableTaskCheckFailed(true);
resetActiveDestination();
break;
}
case State::ATTACK: {
setEnableTaskCheckFailed(true);
clearActivePath();
resetActiveDestination();
break;
}
case State::FIRE_AT_AREA: {
setTargetPosition(currentTargetPosition);
setEnableTaskCheckFailed(true);
clearActivePath();
resetActiveDestination();
break;
}
case State::SIMULATE_FIRE_FIGHT: {
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;
}
default:
break;
}
setHasTask(false);
resetTaskFailedCounter();
log(unitName + " setting state from " + to_string(state) + " to " + to_string(newState));
state = newState;
triggerUpdate(DataIndex::state);
AIloop();
}
void GroundUnit::AIloop()
{
srand(static_cast<unsigned int>(time(NULL)) + ID);
switch (state) {
case State::IDLE: {
setTask("Idle");
if (getHasTask())
resetTask();
break;
}
case State::REACH_DESTINATION: {
setTask("Reaching destination");
string enrouteTask = "";
bool looping = false;
std::ostringstream taskSS;
taskSS << "{ id = 'FollowRoads', value = " << (getFollowRoads() ? "true" : "false") << " }";
enrouteTask = taskSS.str();
if (activeDestination == NULL || !getHasTask())
{
if (!setActiveDestination())
setState(State::IDLE);
else
goToDestination(enrouteTask);
}
else {
if (isDestinationReached(GROUND_DEST_DIST_THR)) {
if (updateActivePath(looping) && setActiveDestination())
goToDestination(enrouteTask);
else
setState(State::IDLE);
}
}
break;
}
case State::ATTACK: {
Unit* target = unitsManager->getUnit(getTargetID());
if (target != nullptr) {
setTask("Attacking " + target->getUnitName());
if (!getHasTask()) {
/* Send the command */
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'AttackUnit', unitID = " << target->getID() << " }";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
}
else {
setState(State::IDLE);
}
break;
}
case State::FIRE_AT_AREA: {
setTask("Firing at area");
if (!getHasTask()) {
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'FireAtPoint', lat = " << targetPosition.lat << ", lng = " << targetPosition.lng << ", radius = 100}";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
break;
}
case State::SIMULATE_FIRE_FIGHT: {
setTask("Simulating fire fight");
if (internalCounter == 0 && targetPosition != Coords(NULL) && scheduler->getLoad() < 30) {
/* Get the distance and bearing to the target */
Coords scatteredTargetPosition = targetPosition;
double distance;
double bearing1;
double bearing2;
Geodesic::WGS84().Inverse(getPosition().lat, getPosition().lng, scatteredTargetPosition.lat, scatteredTargetPosition.lng, distance, bearing1, bearing2);
/* Compute the scattered position applying a random scatter to the shot */
double scatterDistance = distance * tan(10 /* degs */ * (ShotsScatter::LOW - shotsScatter) / 57.29577 + 2 / 57.29577 /* degs */) * RANDOM_MINUS_ONE_TO_ONE;
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"))
shotsBaseInterval = databaseEntry[L"shotsBaseInterval"].as_number().to_double();
}
/* If the unit is of the indirect fire type, like a mortar, simply shoot at the target */
if (indirectFire) {
log(unitName + "(" + name + ")" + " simulating fire fight with indirect fire");
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'FireAtPoint', lat = " << scatteredTargetPosition.lat << ", lng = " << scatteredTargetPosition.lng << ", radius = 100}";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
/* Otherwise use the aim method */
else {
log(unitName + "(" + name + ")" + " simulating fire fight with aim at point method");
aimAtPoint(scatteredTargetPosition);
}
/* Wait an amout of time depending on the shots intensity */
internalCounter = static_cast<unsigned int>(((ShotsIntensity::HIGH - shotsIntensity) * shotsBaseInterval + aimTime) / FRAMERATE_TIME_INTERVAL);
}
if (targetPosition == Coords(NULL))
setState(State::IDLE);
/* Fallback if something went wrong */
if (internalCounter == 0)
internalCounter = static_cast<unsigned int>(3 / FRAMERATE_TIME_INTERVAL);
internalCounter--;
break;
}
case State::SCENIC_AAA: {
setTask("Scenic AAA");
/* Only perform scenic functions when the scheduler is "free" */
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 */
double barrelElevation = r * tan(acos(((double)(rand()) / (double)(RAND_MAX))));
double lat = 0;
double lng = 0;
double randomBearing = ((double)(rand()) / (double)(RAND_MAX)) * 360;
Geodesic::WGS84().Direct(position.lat, position.lng, randomBearing, r, lat, lng);
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'FireAtPoint', lat = " << lat << ", lng = " << lng << ", alt = " << position.alt + barrelElevation << ", radius = 0.001}";
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>(3 / FRAMERATE_TIME_INTERVAL);
internalCounter--;
break;
}
case State::MISS_ON_PURPOSE: {
setTask("Missing on purpose");
/* Check that the unit can perform AAA duties */
bool canAAA = false;
if (database.has_object_field(to_wstring(name))) {
json::value databaseEntry = database[to_wstring(name)];
if (databaseEntry.has_boolean_field(L"canAAA"))
canAAA = databaseEntry[L"canAAA"].as_bool();
}
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() < 30 && internalCounter == 0) {
double distance = 0;
unsigned char unitCoalition = coalition == 0 ? getOperateAs() : coalition;
unsigned char targetCoalition = unitCoalition == 2 ? 1 : 2;
/* Default gun values */
double barrelHeight = 1.0; /* m */
double muzzleVelocity = 860; /* m/s */
double aimTime = 10; /* s */
unsigned int shotsToFire = 10;
double shotsBaseInterval = 15; /* s */
double shotsBaseScatter = 2; /* degs */
double engagementRange = 10000; /* m */
double targetingRange = 0; /* m */
double aimMethodRange = 0; /* m */
double acquisitionRange = 0; /* m */
/* Load gun values from database */
if (database.has_object_field(to_wstring(name))) {
json::value databaseEntry = database[to_wstring(name)];
if (databaseEntry.has_number_field(L"barrelHeight"))
barrelHeight = databaseEntry[L"barrelHeight"].as_number().to_double();
if (databaseEntry.has_number_field(L"muzzleVelocity"))
muzzleVelocity = databaseEntry[L"muzzleVelocity"].as_number().to_double();
if (databaseEntry.has_number_field(L"aimTime"))
aimTime = databaseEntry[L"aimTime"].as_number().to_double();
if (databaseEntry.has_number_field(L"shotsToFire"))
shotsToFire = databaseEntry[L"shotsToFire"].as_number().to_uint32();
if (databaseEntry.has_number_field(L"engagementRange"))
engagementRange = databaseEntry[L"engagementRange"].as_number().to_double();
if (databaseEntry.has_number_field(L"shotsBaseInterval"))
shotsBaseInterval = databaseEntry[L"shotsBaseInterval"].as_number().to_double();
if (databaseEntry.has_number_field(L"shotsBaseScatter"))
shotsBaseScatter = databaseEntry[L"shotsBaseScatter"].as_number().to_double();
if (databaseEntry.has_number_field(L"targetingRange"))
targetingRange = databaseEntry[L"targetingRange"].as_number().to_double();
if (databaseEntry.has_number_field(L"aimMethodRange"))
aimMethodRange = databaseEntry[L"aimMethodRange"].as_number().to_double();
if (databaseEntry.has_number_field(L"acquisitionRange"))
acquisitionRange = databaseEntry[L"acquisitionRange"].as_number().to_double();
}
/* Get all the units in range and select one at random */
double range = max(max(engagementRange, aimMethodRange), acquisitionRange);
map<Unit*, double> targets = unitsManager->getUnitsInRange(this, targetCoalition, { "Aircraft", "Helicopter" }, range);
Unit* target = nullptr;
unsigned int index = static_cast<unsigned int>((RANDOM_ZERO_TO_ONE * (targets.size() - 1)));
for (auto const& p : targets) {
if (index-- == 0) {
target = p.first;
distance = p.second;
}
}
/* Only do if we have a valid target close enough for AAA */
if (target != nullptr) {
/* Approximate the flight time */
if (muzzleVelocity != 0)
aimTime += distance / muzzleVelocity;
/* If the target is in targeting range and we are in highest precision mode, target it */
if (distance < targetingRange && shotsScatter == ShotsScatter::LOW) {
/* Send the command */
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'AttackUnit', unitID = " << target->getID() << " }";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
internalCounter = static_cast<unsigned int>((aimTime + (ShotsIntensity::HIGH - shotsIntensity) * shotsBaseInterval + 2) / FRAMERATE_TIME_INTERVAL);
}
/* Else, do miss on purpose */
else {
/* Compute where the target will be in aimTime seconds, plus the effect of scatter. */
double scatterDistance = distance * tan(shotsBaseScatter * (ShotsScatter::LOW - shotsScatter) / 57.29577) * (RANDOM_ZERO_TO_ONE - 0.1);
double aimDistance = target->getHorizontalVelocity() * aimTime + scatterDistance;
double aimLat = 0;
double aimLng = 0;
Geodesic::WGS84().Direct(target->getPosition().lat, target->getPosition().lng, target->getTrack() * 57.29577, aimDistance, aimLat, aimLng); /* TODO make util to convert degrees and radians function */
double aimAlt = target->getPosition().alt + target->getVerticalVelocity() * aimTime + distance * tan(shotsBaseScatter * (ShotsScatter::LOW - shotsScatter) / 57.29577) * RANDOM_ZERO_TO_ONE; // Force to always miss high never low
/* Send the command */
if (distance < engagementRange) {
/* If the unit is closer than the engagement range, use the fire at point method */
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'FireAtPoint', lat = " << aimLat << ", lng = " << aimLng << ", alt = " << aimAlt << ", radius = 0.001, expendQty = " << shotsToFire << " }";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
setTargetPosition(Coords(aimLat, aimLng, target->getPosition().alt));
internalCounter = static_cast<unsigned int>((aimTime + (ShotsIntensity::HIGH - shotsIntensity) * shotsBaseInterval + 2) / FRAMERATE_TIME_INTERVAL);
}
else if (distance < aimMethodRange) {
/* If the unit is closer than the aim method range, use the aim method range */
aimAtPoint(Coords(aimLat, aimLng, aimAlt));
setTargetPosition(Coords(aimLat, aimLng, target->getPosition().alt));
internalCounter = static_cast<unsigned int>((aimTime + (ShotsIntensity::HIGH - shotsIntensity) * shotsBaseInterval + 2) / FRAMERATE_TIME_INTERVAL);
}
else {
/* Else just wake the unit up with an impossible command */
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'FireAtPoint', lat = " << 0 << ", lng = " << 0 << ", alt = " << 0 << ", radius = 0.001, expendQty = " << 0 << " }";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
setTargetPosition(Coords(NULL));
/* Don't wait too long before checking again */
internalCounter = static_cast<unsigned int>(5 / FRAMERATE_TIME_INTERVAL);
}
}
missOnPurposeTarget = target;
}
else {
if (getHasTask())
resetTask();
}
}
/* If no valid target was detected */
if (internalCounter == 0) {
double alertnessTimeConstant = 10; /* s */
if (database.has_object_field(to_wstring(name))) {
json::value databaseEntry = database[to_wstring(name)];
if (databaseEntry.has_number_field(L"alertnessTimeConstant"))
alertnessTimeConstant = databaseEntry[L"alertnessTimeConstant"].as_number().to_double();
}
internalCounter = static_cast<unsigned int>((5 + RANDOM_ZERO_TO_ONE * alertnessTimeConstant * 0 /* TODO: remove to enable alertness again */) / FRAMERATE_TIME_INTERVAL);
missOnPurposeTarget = nullptr;
setTargetPosition(Coords(NULL));
}
internalCounter--;
}
else {
setState(State::IDLE);
}
break;
}
default:
break;
}
}
void GroundUnit::aimAtPoint(Coords aimTarget) {
double dist;
double bearing1;
double bearing2;
Geodesic::WGS84().Inverse(position.lat, position.lng, aimTarget.lat, aimTarget.lng, dist, bearing1, bearing2);
/* Aim point distance */
double r = 15; /* m */
/* Default gun values */
double barrelHeight = 1.0; /* m */
double muzzleVelocity = 860; /* m/s */
double shotsBaseScatter = 5; /* degs */
if (database.has_object_field(to_wstring(name))) {
json::value databaseEntry = database[to_wstring(name)];
if (databaseEntry.has_number_field(L"barrelHeight") && databaseEntry.has_number_field(L"muzzleVelocity")) {
barrelHeight = databaseEntry[L"barrelHeight"].as_number().to_double();
muzzleVelocity = databaseEntry[L"muzzleVelocity"].as_number().to_double();
}
if (databaseEntry.has_number_field(L"shotsBaseScatter"))
shotsBaseScatter = databaseEntry[L"shotsBaseScatter"].as_number().to_double();
}
/* Compute the elevation angle of the gun*/
double deltaHeight = (aimTarget.alt - (position.alt + barrelHeight));
double alpha = 9.81 / 2 * dist * dist / (muzzleVelocity * muzzleVelocity);
double inner = dist * dist - 4 * alpha * (alpha + deltaHeight);
/* Check we can reach the target*/
if (inner > 0) {
/* Compute elevation and bearing */
double barrelElevation = r * (dist - sqrt(inner)) / (2 * alpha);
double lat = 0;
double lng = 0;
Geodesic::WGS84().Direct(position.lat, position.lng, bearing1, r, lat, lng);
log(unitName + "(" + name + ")" + " shooting with aim at point method. Barrel elevation: " + to_string(barrelElevation * 57.29577) + "°, bearing: " + to_string(bearing1) + "°");
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'FireAtPoint', lat = " << lat << ", lng = " << lng << ", alt = " << position.alt + barrelElevation + barrelHeight << ", radius = 0.001}";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
else {
log("Target out of range for " + unitName + "(" + name + ")");
}
}
void GroundUnit::changeSpeed(string change)
{
if (change.compare("stop") == 0)
setState(State::IDLE);
else if (change.compare("slow") == 0)
setDesiredSpeed(getDesiredSpeed() - knotsToMs(5));
else if (change.compare("fast") == 0)
setDesiredSpeed(getDesiredSpeed() + knotsToMs(5));
if (getDesiredSpeed() < 0)
setDesiredSpeed(0);
}
void GroundUnit::setOnOff(bool newOnOff, bool force)
{
if (newOnOff != onOff || force) {
Unit::setOnOff(newOnOff, force);
Command* command = dynamic_cast<Command*>(new SetOnOff(groupName, onOff));
scheduler->appendCommand(command);
}
}
void GroundUnit::setFollowRoads(bool newFollowRoads, bool force)
{
if (newFollowRoads != followRoads || force) {
Unit::setFollowRoads(newFollowRoads, force);
resetActiveDestination(); /* Reset active destination to apply option*/
}
}

View File

@@ -0,0 +1,71 @@
#include "helicopter.h"
#include "utils.h"
#include "logger.h"
#include "commands.h"
#include "scheduler.h"
#include "defines.h"
#include "unitsManager.h"
#include <GeographicLib/Geodesic.hpp>
using namespace GeographicLib;
extern Scheduler* scheduler;
extern UnitsManager* unitsManager;
json::value Helicopter::database = json::value();
extern string instancePath;
void Helicopter::loadDatabase(string path) {
std::ifstream ifstream(instancePath + path);
std::stringstream ss;
ss << ifstream.rdbuf();
std::error_code errorCode;
database = json::value::parse(ss.str(), errorCode);
if (database.is_object())
log("Helicopters database loaded correctly from " + instancePath + path);
else
log("Error reading Helicopters database file");
}
/* Helicopter */
Helicopter::Helicopter(json::value json, unsigned int ID) : AirUnit(json, ID)
{
log("New Helicopter created with ID: " + to_string(ID));
setCategory("Helicopter");
setDesiredSpeed(knotsToMs(100));
setDesiredAltitude(ftToM(5000));
};
void Helicopter::changeSpeed(string change)
{
if (change.compare("stop") == 0)
setState(State::IDLE);
else if (change.compare("slow") == 0)
setDesiredSpeed(getDesiredSpeed() - knotsToMs(10));
else if (change.compare("fast") == 0)
setDesiredSpeed(getDesiredSpeed() + knotsToMs(10));
if (getDesiredSpeed() < knotsToMs(0))
setDesiredSpeed(knotsToMs(0));
}
void Helicopter::changeAltitude(string change)
{
if (change.compare("descend") == 0)
{
if (getDesiredAltitude() > 100)
setDesiredAltitude(getDesiredAltitude() - ftToM(100));
else if (getDesiredAltitude() > 0)
setDesiredAltitude(getDesiredAltitude() - ftToM(10));
}
else if (change.compare("climb") == 0)
{
if (getDesiredAltitude() > 100)
setDesiredAltitude(getDesiredAltitude() + ftToM(100));
else if (getDesiredAltitude() >= 0)
setDesiredAltitude(getDesiredAltitude() + ftToM(10));
}
if (getDesiredAltitude() < 0)
setDesiredAltitude(0);
}

View File

@@ -11,6 +11,20 @@ using namespace GeographicLib;
extern Scheduler* scheduler;
extern UnitsManager* unitsManager;
json::value NavyUnit::database = json::value();
extern string instancePath;
void NavyUnit::loadDatabase(string path) {
std::ifstream ifstream(instancePath + path);
std::stringstream ss;
ss << ifstream.rdbuf();
std::error_code errorCode;
database = json::value::parse(ss.str(), errorCode);
if (database.is_object())
log("NavyUnits database loaded correctly from " + instancePath + path);
else
log("Error reading NavyUnits database file");
}
/* Navy Unit */
NavyUnit::NavyUnit(json::value json, unsigned int ID) : Unit(json, ID)
@@ -29,13 +43,15 @@ void NavyUnit::setDefaults(bool force)
setState(State::IDLE);
/* Set the default options */
setROE(ROE::OPEN_FIRE_WEAPON_FREE, force);
setROE(ROE::WEAPON_FREE, force);
setOnOff(onOff, force);
setFollowRoads(followRoads, force);
}
void NavyUnit::setState(unsigned char newState)
{
Coords currentTargetPosition = getTargetPosition();
/************ Perform any action required when LEAVING a state ************/
if (newState != state) {
switch (state) {
@@ -45,7 +61,14 @@ void NavyUnit::setState(unsigned char newState)
case State::REACH_DESTINATION: {
break;
}
case State::FIRE_AT_AREA: {
case State::ATTACK: {
setTargetID(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;
}
@@ -57,15 +80,44 @@ void NavyUnit::setState(unsigned char newState)
/************ Perform any action required when ENTERING a state ************/
switch (newState) {
case State::IDLE: {
setEnableTaskCheckFailed(false);
clearActivePath();
resetActiveDestination();
break;
}
case State::REACH_DESTINATION: {
setEnableTaskCheckFailed(true);
resetActiveDestination();
break;
}
case State::ATTACK: {
setEnableTaskCheckFailed(true);
clearActivePath();
resetActiveDestination();
break;
}
case State::FIRE_AT_AREA: {
setTargetPosition(currentTargetPosition);
setEnableTaskCheckFailed(true);
clearActivePath();
resetActiveDestination();
break;
}
case State::SIMULATE_FIRE_FIGHT: {
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;
@@ -74,17 +126,21 @@ void NavyUnit::setState(unsigned char newState)
break;
}
if (newState != state)
resetTask();
setHasTask(false);
resetTaskFailedCounter();
log(unitName + " setting state from " + to_string(state) + " to " + to_string(newState));
state = newState;
triggerUpdate(DataIndex::state);
AIloop();
}
void NavyUnit::AIloop()
{
srand(static_cast<unsigned int>(time(NULL)) + ID);
switch (state) {
case State::IDLE: {
setTask("Idle");
@@ -111,6 +167,28 @@ void NavyUnit::AIloop()
setState(State::IDLE);
}
}
break;
}
case State::ATTACK: {
Unit* target = unitsManager->getUnit(getTargetID());
if (target != nullptr) {
setTask("Attacking " + target->getUnitName());
if (!getHasTask()) {
/* Send the command */
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'AttackUnit', unitID = " << target->getID() << " }";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
}
else {
setState(State::IDLE);
}
break;
}
case State::FIRE_AT_AREA: {
@@ -118,11 +196,23 @@ void NavyUnit::AIloop()
if (!getHasTask()) {
std::ostringstream taskSS;
taskSS.precision(10);
taskSS << "{id = 'FireAtPoint', lat = " << targetPosition.lat << ", lng = " << targetPosition.lng << ", radius = 1000}";
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str()));
Command* command = dynamic_cast<Command*>(new SetTask(groupName, taskSS.str(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
break;
}
case State::SIMULATE_FIRE_FIGHT: {
setTask("Simulating fire fight");
// TODO
setState(State::IDLE);
break;
}
default:
break;

View File

@@ -7,12 +7,9 @@
extern UnitsManager* unitsManager;
Scheduler::Scheduler(lua_State* L) :
load(0)
Scheduler::Scheduler(lua_State* L)
{
LogInfo(L, "Scheduler constructor called successfully");
}
Scheduler::~Scheduler()
@@ -20,6 +17,7 @@ Scheduler::~Scheduler()
}
/* Appends a */
void Scheduler::appendCommand(Command* newCommand)
{
for (auto command : commands) {
@@ -58,8 +56,16 @@ void Scheduler::execute(lua_State* L)
log("Error executing command " + commandString);
else
log("Command '" + commandString + "' executed correctly, current load " + to_string(getLoad()));
load = command->getLoad();
/* Adjust the load depending on the fps */
double fpsMultiplier = 20;
if (getFrameRate() + 3 > 0)
fpsMultiplier = static_cast<unsigned int>(max(1, 60 / (getFrameRate() + 3))); /* Multiplier between 1 and 20 */
load = static_cast<unsigned int>(command->getLoad() * fpsMultiplier);
commands.remove(command);
executedCommandsHashes.push_back(command->getHash());
command->executeCallback(); /* Execute the command callback (this is a lambda function that can be used to execute a function when the command is run) */
delete command;
return;
}
@@ -82,7 +88,7 @@ void Scheduler::setCommandModeOptions(json::value value) {
setRedSpawnPoints(value[L"spawnPoints"][L"red"].as_number().to_int32());
}
if (value.has_array_field(L"eras")) {
int length = value[L"eras"].as_array().size();
int length = static_cast<int>(value[L"eras"].as_array().size());
vector<string> newEras;
for (int idx = 0; idx < length; idx++)
newEras.push_back(to_string(value[L"eras"].as_array().at(idx)));
@@ -132,15 +138,18 @@ bool Scheduler::checkSpawnPoints(int spawnPoints, string coalition)
return false;
}
}
return false;
}
void Scheduler::handleRequest(string key, json::value value, string username)
void Scheduler::handleRequest(string key, json::value value, string username, json::value& answer)
{
Command* command = nullptr;
log("Received request with ID: " + key);
log(L"Incoming command raw value: " + value.serialize());
/************************/
if (key.compare("setPath") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
@@ -148,7 +157,6 @@ void Scheduler::handleRequest(string key, json::value value, string username)
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr)
{
string unitName = unit->getUnitName();
json::value path = value[L"path"];
list<Coords> newPath;
for (unsigned int i = 0; i < path.as_array().size(); i++)
@@ -162,31 +170,33 @@ void Scheduler::handleRequest(string key, json::value value, string username)
unit->setActivePath(newPath);
unit->setState(State::REACH_DESTINATION);
log(username + " updated destination path for unit " + unitName, true);
log(username + " updated destination path for unit " + unit->getUnitName() + "(" + unit->getName() + ")", true);
}
}
/************************/
else if (key.compare("smoke") == 0)
{
string color = to_string(value[L"color"]);
double lat = value[L"location"][L"lat"].as_double();
double lng = value[L"location"][L"lng"].as_double();
log(username + " added a " + color + " smoke at (" + to_string(lat) + ", " + to_string(lng) + ")", true);
Coords loc; loc.lat = lat; loc.lng = lng;
command = dynamic_cast<Command*>(new Smoke(color, loc));
log(username + " added a " + color + " smoke at (" + to_string(lat) + ", " + to_string(lng) + ")", true);
}
else if (key.compare("spawnAircrafts") == 0)
/************************/
else if (key.compare("spawnAircrafts") == 0 || key.compare("spawnHelicopters") == 0)
{
bool immediate = value[L"immediate"].as_bool();
string coalition = to_string(value[L"coalition"]);
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;
vector<string> unitTypes;
vector<Coords> locations;
vector<string> loadouts;
vector<string> liveryIDs;
vector<SpawnOptions> spawnOptions;
for (auto unit : value[L"units"].as_array()) {
string unitType = to_string(unit[L"unitType"]);
double lat = unit[L"location"][L"lat"].as_double();
@@ -195,99 +205,46 @@ void Scheduler::handleRequest(string key, json::value value, string username)
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"]);
unitTypes.push_back(unitType);
locations.push_back(location);
loadouts.push_back(loadout);
liveryIDs.push_back(liveryID);
log(username + " spawned a " + coalition + " " + unitType, true);
spawnOptions.push_back({unitType, location, loadout, skill, liveryID});
log(username + " spawned a " + coalition + " " + unitType , true);
}
command = dynamic_cast<Command*>(new SpawnAircrafts(coalition, unitTypes, locations, loadouts, liveryIDs, airbaseName, immediate));
if (key.compare("spawnAircrafts") == 0)
command = dynamic_cast<Command*>(new SpawnAircrafts(coalition, spawnOptions, airbaseName, country, immediate));
else
command = dynamic_cast<Command*>(new SpawnHelicopters(coalition, spawnOptions, airbaseName, country, immediate));
}
else if (key.compare("spawnHelicopters") == 0)
/************************/
else if (key.compare("spawnGroundUnits") == 0 || key.compare("spawnNavyUnits") == 0)
{
bool immediate = value[L"immediate"].as_bool();
string coalition = to_string(value[L"coalition"]);
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;
vector<string> unitTypes;
vector<Coords> locations;
vector<string> loadouts;
vector<string> liveryIDs;
for (auto unit : value[L"units"].as_array()) {
string unitType = to_string(unit[L"unitType"]);
double lat = unit[L"location"][L"lat"].as_double();
double lng = unit[L"location"][L"lng"].as_double();
double alt = unit[L"altitude"].as_double();
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"]);
unitTypes.push_back(unitType);
locations.push_back(location);
loadouts.push_back(loadout);
liveryIDs.push_back(liveryID);
log(username + " spawned a " + coalition + " " + unitType, true);
}
command = dynamic_cast<Command*>(new SpawnHelicopters(coalition, unitTypes, locations, loadouts, liveryIDs, airbaseName, immediate));
}
else if (key.compare("spawnGroundUnits") == 0)
{
bool immediate = value[L"immediate"].as_bool();
string coalition = to_string(value[L"coalition"]);
int spawnPoints = value[L"spawnPoints"].as_number().to_int32();
if (!checkSpawnPoints(spawnPoints, coalition)) return;
vector<string> unitTypes;
vector<Coords> locations;
vector<string> liveryIDs;
vector<SpawnOptions> spawnOptions;
for (auto unit : value[L"units"].as_array()) {
string unitType = to_string(unit[L"unitType"]);
double lat = unit[L"location"][L"lat"].as_double();
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"]);
unitTypes.push_back(unitType);
locations.push_back(location);
liveryIDs.push_back(liveryID);
spawnOptions.push_back({ unitType, location, "", skill, liveryID});
log(username + " spawned a " + coalition + " " + unitType, true);
}
command = dynamic_cast<Command*>(new SpawnGroundUnits(coalition, unitTypes, locations, liveryIDs, immediate));
}
else if (key.compare("spawnNavyUnits") == 0)
{
bool immediate = value[L"immediate"].as_bool();
string coalition = to_string(value[L"coalition"]);
int spawnPoints = value[L"spawnPoints"].as_number().to_int32();
if (!checkSpawnPoints(spawnPoints, coalition)) return;
vector<string> unitTypes;
vector<Coords> locations;
vector<string> liveryIDs;
for (auto unit : value[L"units"].as_array()) {
string unitType = to_string(unit[L"unitType"]);
double lat = unit[L"location"][L"lat"].as_double();
double lng = unit[L"location"][L"lng"].as_double();
Coords location; location.lat = lat; location.lng = lng;
string liveryID = to_string(unit[L"liveryID"]);
unitTypes.push_back(unitType);
locations.push_back(location);
liveryIDs.push_back(liveryID);
log(username + " spawned a " + coalition + " " + unitType, true);
}
command = dynamic_cast<Command*>(new SpawnNavyUnits(coalition, unitTypes, locations, liveryIDs, immediate));
if (key.compare("spawnGroundUnits") == 0)
command = dynamic_cast<Command*>(new SpawnGroundUnits(coalition, spawnOptions, country, immediate));
else
command = dynamic_cast<Command*>(new SpawnNavyUnits(coalition, spawnOptions, country, immediate));
}
/************************/
else if (key.compare("attackUnit") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
@@ -297,28 +254,18 @@ void Scheduler::handleRequest(string key, json::value value, string username)
Unit* unit = unitsManager->getGroupLeader(ID);
Unit* target = unitsManager->getUnit(targetID);
string unitName;
string targetName;
if (unit != nullptr)
unitName = unit->getUnitName();
else
return;
if (target != nullptr)
targetName = target->getUnitName();
else
return;
log(username + " tasked unit " + unitName + " to attack unit " + targetName, true);
unit->setTargetID(targetID);
unit->setState(State::ATTACK);
if (unit != nullptr && target != nullptr) {
log(username + " tasked unit " + unit->getUnitName() + "(" + unit->getName() + ") to attack unit " + target->getUnitName() + "(" + target->getName() + ")", true);
unit->setTargetID(targetID);
unit->setState(State::ATTACK);
}
}
/************************/
else if (key.compare("followUnit") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
unsigned int leaderID = value[L"targetID"].as_double();
unsigned int leaderID = value[L"targetID"].as_integer();
double offsetX = value[L"offsetX"].as_double();
double offsetY = value[L"offsetY"].as_double();
double offsetZ = value[L"offsetZ"].as_double();
@@ -326,135 +273,172 @@ void Scheduler::handleRequest(string key, json::value value, string username)
Unit* unit = unitsManager->getGroupLeader(ID);
Unit* leader = unitsManager->getUnit(leaderID);
string unitName;
string leaderName;
if (unit != nullptr)
unitName = unit->getUnitName();
else
return;
if (leader != nullptr)
leaderName = leader->getUnitName();
else
return;
log(username + " tasked unit " + unitName + " to follow unit " + leaderName, true);
unit->setFormationOffset(Offset(offsetX, offsetY, offsetZ));
unit->setLeaderID(leaderID);
unit->setState(State::FOLLOW);
if (unit != nullptr && leader != nullptr) {
log(username + " tasked unit " + unit->getUnitName() + "(" + unit->getName() + ") to follow unit " + leader->getUnitName() + "(" + leader->getName() + ")", true);
unit->setFormationOffset(Offset(offsetX, offsetY, offsetZ));
unit->setLeaderID(leaderID);
unit->setState(State::FOLLOW);
}
}
/************************/
else if (key.compare("changeSpeed") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr)
if (unit != nullptr) {
unit->changeSpeed(to_string(value[L"change"]));
log(username + " changed " + unit->getUnitName() + "(" + unit->getName() + ") speed: " + to_string(value[L"change"]), true);
}
}
/************************/
else if (key.compare("changeAltitude") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr)
if (unit != nullptr) {
unit->changeAltitude(to_string(value[L"change"]));
log(username + " changed " + unit->getUnitName() + "(" + unit->getName() + ") altitude: " + to_string(value[L"change"]), true);
}
}
/************************/
else if (key.compare("setSpeed") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr)
if (unit != nullptr) {
unit->setDesiredSpeed(value[L"speed"].as_double());
log(username + " set " + unit->getUnitName() + "(" + unit->getName() + ") speed: " + to_string(value[L"speed"].as_double()), true);
}
}
/************************/
else if (key.compare("setSpeedType") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr)
if (unit != nullptr) {
unit->setDesiredSpeedType(to_string(value[L"speedType"]));
log(username + " set " + unit->getUnitName() + "(" + unit->getName() + ") speed type: " + to_string(value[L"speedType"]), true);
}
}
/************************/
else if (key.compare("setAltitude") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr)
if (unit != nullptr) {
unit->setDesiredAltitude(value[L"altitude"].as_double());
log(username + " set " + unit->getUnitName() + "(" + unit->getName() + ") altitude: " + to_string(value[L"altitude"].as_double()), true);
}
}
/************************/
else if (key.compare("setAltitudeType") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr)
if (unit != nullptr) {
unit->setDesiredAltitudeType(to_string(value[L"altitudeType"]));
log(username + " set " + unit->getUnitName() + "(" + unit->getName() + ") altitude type: " + to_string(value[L"altitudeType"]), true);
}
}
else if (key.compare("cloneUnit") == 0)
/************************/
else if (key.compare("cloneUnits") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
double lat = value[L"location"][L"lat"].as_double();
double lng = value[L"location"][L"lng"].as_double();
Coords loc; loc.lat = lat; loc.lng = lng;
command = dynamic_cast<Command*>(new Clone(ID, loc));
vector<CloneOptions> cloneOptions;
bool deleteOriginal = value[L"deleteOriginal"].as_bool();
for (auto unit : value[L"units"].as_array()) {
unsigned int ID = unit[L"ID"].as_integer();
double lat = unit[L"location"][L"lat"].as_double();
double lng = unit[L"location"][L"lng"].as_double();
Coords location; location.lat = lat; location.lng = lng;
cloneOptions.push_back({ ID, location });
log(username + " cloning unit with ID " + to_string(ID), true);
}
command = dynamic_cast<Command*>(new Clone(cloneOptions, deleteOriginal));
}
/************************/
else if (key.compare("setROE") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
unsigned char ROE = value[L"ROE"].as_number().to_uint32();
unit->setROE(ROE);
log(username + " set unit " + unit->getName() + " ROE to " + to_string(ROE), true);
if (unit != nullptr) {
unsigned char ROE = value[L"ROE"].as_number().to_uint32();
unit->setROE(ROE);
log(username + " set unit " + unit->getUnitName() + "(" + unit->getName() + ") ROE to " + to_string(ROE), true);
}
}
/************************/
else if (key.compare("setReactionToThreat") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
unsigned char reactionToThreat = value[L"reactionToThreat"].as_number().to_uint32();
unit->setReactionToThreat(reactionToThreat);
log(username + " set unit " + unit->getName() + " reaction to threat to " + to_string(reactionToThreat), true);
if (unit != nullptr) {
unsigned char reactionToThreat = value[L"reactionToThreat"].as_number().to_uint32();
unit->setReactionToThreat(reactionToThreat);
log(username + " set unit " + unit->getUnitName() + "(" + unit->getName() + ") reaction to threat to " + to_string(reactionToThreat), true);
}
}
/************************/
else if (key.compare("setEmissionsCountermeasures") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
unsigned char emissionsCountermeasures = value[L"emissionsCountermeasures"].as_number().to_uint32();
unit->setEmissionsCountermeasures(emissionsCountermeasures);
log(username + " set unit " + unit->getName() + " emissions and countermeasures to " + to_string(emissionsCountermeasures), true);
if (unit != nullptr) {
unsigned char emissionsCountermeasures = value[L"emissionsCountermeasures"].as_number().to_uint32();
unit->setEmissionsCountermeasures(emissionsCountermeasures);
log(username + " set unit " + unit->getUnitName() + "(" + unit->getName() + ") emissions and countermeasures to " + to_string(emissionsCountermeasures), true);
}
}
/************************/
else if (key.compare("landAt") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
double lat = value[L"location"][L"lat"].as_double();
double lng = value[L"location"][L"lng"].as_double();
Coords loc; loc.lat = lat; loc.lng = lng;
unit->landAt(loc);
log(username + " tasked unit " + unit->getName() + " to land", true);
if (unit != nullptr) {
double lat = value[L"location"][L"lat"].as_double();
double lng = value[L"location"][L"lng"].as_double();
Coords loc; loc.lat = lat; loc.lng = lng;
unit->landAt(loc);
log(username + " tasked unit " + unit->getUnitName() + "(" + unit->getName() + ") to land", true);
}
}
/************************/
else if (key.compare("deleteUnit") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
bool explosion = value[L"explosion"].as_bool();
string explosionType = to_string(value[L"explosionType"]);
bool immediate = value[L"immediate"].as_bool();
unitsManager->deleteUnit(ID, explosion, immediate);
Unit* unit = unitsManager->getUnit(ID);
log(username + " deleted unit " + unit->getName(), true);
if (unit != nullptr) {
unitsManager->deleteUnit(ID, explosion, explosionType, immediate);
log(username + " deleted unit " + unit->getUnitName() + "(" + unit->getName() + ")", true);
}
}
/************************/
else if (key.compare("refuel") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
unit->setState(State::REFUEL);
log(username + " tasked unit " + unit->getName() + " to refuel", true);
if (unit != nullptr) {
unit->setState(State::REFUEL);
log(username + " tasked unit " + unit->getUnitName() + "(" + unit->getName() + ") to refuel", true);
}
}
/************************/
else if (key.compare("setAdvancedOptions") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
@@ -463,8 +447,8 @@ void Scheduler::handleRequest(string key, json::value value, string username)
if (unit != nullptr)
{
/* Advanced tasking */
unit->setIsTanker(value[L"isTanker"].as_bool());
unit->setIsAWACS(value[L"isAWACS"].as_bool());
unit->setIsActiveTanker(value[L"isActiveTanker"].as_bool());
unit->setIsActiveAWACS(value[L"isActiveAWACS"].as_bool());
/* TACAN Options */
DataTypes::TACAN TACAN;
@@ -494,33 +478,46 @@ void Scheduler::handleRequest(string key, json::value value, string username)
});
unit->resetActiveDestination();
log(username + " updated unit " + unit->getUnitName() + "(" + unit->getName() + ") advancedOptions", true);
}
}
/************************/
else if (key.compare("setFollowRoads") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
bool followRoads = value[L"followRoads"].as_bool();
Unit* unit = unitsManager->getGroupLeader(ID);
unit->setFollowRoads(followRoads);
if (unit != nullptr) {
unit->setFollowRoads(followRoads);
log(username + " set unit " + unit->getUnitName() + "(" + unit->getName() + ") followRoads to: " + (followRoads ? "true" : "false"), true);
}
}
/************************/
else if (key.compare("setOnOff") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
bool onOff = value[L"onOff"].as_bool();
Unit* unit = unitsManager->getGroupLeader(ID);
unit->setOnOff(onOff);
if (unit != nullptr) {
unit->setOnOff(onOff);
log(username + " set unit " + unit->getUnitName() + "(" + unit->getName() + ") onOff to: " + (onOff? "true": "false"), true);
}
}
/************************/
else if (key.compare("explosion") == 0)
{
unsigned int intensity = value[L"intensity"].as_integer();
string explosionType = to_string(value[L"explosionType"]);
double lat = value[L"location"][L"lat"].as_double();
double lng = value[L"location"][L"lng"].as_double();
log("Adding " + to_string(intensity) + " explosion at (" + to_string(lat) + ", " + to_string(lng) + ")");
log("Adding explosion of type " + explosionType + " at (" + to_string(lat) + ", " + to_string(lng) + ")");
Coords loc; loc.lat = lat; loc.lng = lng;
command = dynamic_cast<Command*>(new Explosion(intensity, loc));
command = dynamic_cast<Command*>(new Explosion(intensity, explosionType, loc));
}
/************************/
else if (key.compare("bombPoint") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
@@ -529,10 +526,13 @@ void Scheduler::handleRequest(string key, json::value value, string username)
double lng = value[L"location"][L"lng"].as_double();
Coords loc; loc.lat = lat; loc.lng = lng;
Unit* unit = unitsManager->getGroupLeader(ID);
unit->setState(State::BOMB_POINT);
unit->setTargetPosition(loc);
log(username + " tasked unit " + unit->getName() + " to bomb a point", true);
if (unit != nullptr) {
unit->setTargetPosition(loc);
unit->setState(State::BOMB_POINT);
log(username + " tasked unit " + unit->getUnitName() + "(" + unit->getName() + ") to bomb a point", true);
}
}
/************************/
else if (key.compare("carpetBomb") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
@@ -541,10 +541,14 @@ void Scheduler::handleRequest(string key, json::value value, string username)
double lng = value[L"location"][L"lng"].as_double();
Coords loc; loc.lat = lat; loc.lng = lng;
Unit* unit = unitsManager->getGroupLeader(ID);
unit->setState(State::CARPET_BOMB);
unit->setTargetPosition(loc);
log(username + " tasked unit " + unit->getName() + " to perform carpet bombing", true);
if (unit != nullptr) {
unit->setTargetPosition(loc);
unit->setState(State::CARPET_BOMB);
log(username + " tasked unit " + unit->getUnitName() + "(" + unit->getName() + ") to perform carpet bombing", true);
}
}
/************************/
/* TODO: this command does not appear to be working in DCS and has been disabled */
else if (key.compare("bombBuilding") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
@@ -553,9 +557,12 @@ void Scheduler::handleRequest(string key, json::value value, string username)
double lng = value[L"location"][L"lng"].as_double();
Coords loc; loc.lat = lat; loc.lng = lng;
Unit* unit = unitsManager->getGroupLeader(ID);
unit->setState(State::BOMB_BUILDING);
unit->setTargetPosition(loc);
if (unit != nullptr) {
unit->setTargetPosition(loc);
unit->setState(State::BOMB_BUILDING);
}
}
/************************/
else if (key.compare("fireAtArea") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
@@ -564,14 +571,114 @@ void Scheduler::handleRequest(string key, json::value value, string username)
double lng = value[L"location"][L"lng"].as_double();
Coords loc; loc.lat = lat; loc.lng = lng;
Unit* unit = unitsManager->getGroupLeader(ID);
unit->setState(State::FIRE_AT_AREA);
unit->setTargetPosition(loc);
log(username + " tasked unit " + unit->getName() + " to fire at area", true);
if (unit != nullptr) {
unit->setTargetPosition(loc);
unit->setState(State::FIRE_AT_AREA);
log(username + " tasked unit " + unit->getUnitName() + "(" + unit->getName() + ") to fire at area", true);
}
}
else if (key.compare("setCommandModeOptions") == 0) {
/************************/
else if (key.compare("simulateFireFight") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
double lat = value[L"location"][L"lat"].as_double();
double lng = value[L"location"][L"lng"].as_double();
double alt = value[L"altitude"].as_double();
Coords loc; loc.lat = lat; loc.lng = lng; loc.alt = alt;
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr) {
unit->setTargetPosition(loc);
unit->setState(State::SIMULATE_FIRE_FIGHT);
log(username + " tasked unit " + unit->getUnitName() + "(" + unit->getName() + ") to simulate a fire fight", true);
}
}
/************************/
else if (key.compare("scenicAAA") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr) {
unit->setState(State::SCENIC_AAA);
log(username + " tasked unit " + unit->getUnitName() + "(" + unit->getName() + ") to enter scenic AAA state", true);
}
}
/************************/
else if (key.compare("missOnPurpose") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr) {
unit->setState(State::MISS_ON_PURPOSE);
log(username + " tasked unit " + unit->getUnitName() + "(" + unit->getName() + ") to enter Miss On Purpose state", true);
}
}
/************************/
else if (key.compare("setOperateAs") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
unsigned char operateAs = value[L"operateAs"].as_number().to_uint32();
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr)
unit->setOperateAs(operateAs);
}
/************************/
else if (key.compare("landAtPoint") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
double lat = value[L"location"][L"lat"].as_double();
double lng = value[L"location"][L"lng"].as_double();
Coords loc; loc.lat = lat; loc.lng = lng;
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr) {
list<Coords> newPath;
newPath.push_back(loc);
unit->setActivePath(newPath);
unit->setState(State::LAND_AT_POINT);
log(username + " tasked unit " + unit->getUnitName() + "(" + unit->getName() + ") to land at point", true);
}
}
/************************/
else if (key.compare("setShotsScatter") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr) {
unsigned char shotsScatter = value[L"shotsScatter"].as_number().to_uint32();
unit->setShotsScatter(shotsScatter);
log(username + " set unit " + unit->getUnitName() + "(" + unit->getName() + ") shots scatter to " + to_string(shotsScatter), true);
}
}
/************************/
else if (key.compare("setShotsIntensity") == 0)
{
unsigned int ID = value[L"ID"].as_integer();
unitsManager->acquireControl(ID);
Unit* unit = unitsManager->getGroupLeader(ID);
if (unit != nullptr) {
unsigned char shotsIntensity = value[L"shotsIntensity"].as_number().to_uint32();
unit->setShotsIntensity(shotsIntensity);
log(username + " set unit " + unit->getUnitName() + "(" + unit->getName() + ") shots intensity to " + to_string(shotsIntensity), true);
}
}
/************************/
else if (key.compare("setCommandModeOptions") == 0)
{
setCommandModeOptions(value);
log(username + " updated the Command Mode Options", true);
}
/************************/
else if (key.compare("reloadDatabases") == 0) {
unitsManager->loadDatabases();
}
/************************/
else
{
log("Unknown command: " + key);
@@ -581,6 +688,7 @@ void Scheduler::handleRequest(string key, json::value value, string username)
{
appendCommand(command);
log("New command appended correctly to stack. Current server load: " + to_string(getLoad()));
answer[L"commandHash"] = json::value(to_wstring(command->getHash()));
}
}

View File

@@ -2,9 +2,12 @@
#include "logger.h"
#include "luatools.h"
#include "dcstools.h"
#include "defines.h"
#include <algorithm>
extern string instancePath;
bool executeLuaScript(lua_State* L, string path)
{
replace(path.begin(), path.end(), '\\', '/');
@@ -36,21 +39,9 @@ void registerLuaFunctions(lua_State* L)
log("protectedCall registered successfully");
}
char* buf = nullptr;
size_t sz = 0;
if (_dupenv_s(&buf, &sz, "DCSOLYMPUS_PATH") == 0 && buf != nullptr)
{
modLocation = buf;
free(buf);
}
else
{
log("DCSOLYMPUS_PATH environment variable is missing");
return;
}
executeLuaScript(L, modLocation + "\\Scripts\\mist.lua");
executeLuaScript(L, modLocation + "\\Scripts\\OlympusCommand.lua");
executeLuaScript(L, modLocation + "\\Scripts\\unitPayloads.lua");
executeLuaScript(L, modLocation + "\\Scripts\\templates.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);
}

View File

@@ -19,6 +19,7 @@ extern Scheduler* scheduler;
extern json::value missionData;
extern mutex mutexLock;
extern string sessionHash;
extern string instancePath;
void handle_eptr(std::exception_ptr eptr)
{
@@ -88,7 +89,7 @@ void Server::handle_get(http_request request)
try {
time = stoull((*(query.find(L"time"))).second);
}
catch (const std::exception& e) {
catch (...) {
time = 0;
}
}
@@ -142,6 +143,9 @@ void Server::handle_get(http_request request)
else
answer[L"mission"][L"commandModeOptions"][L"commandMode"] = json::value(L"Observer");
}
else if (URI.compare(COMMANDS_URI) == 0 && query.find(L"commandHash") != query.end()) {
answer[L"commandExecuted"] = json::value(scheduler->isCommandExecuted(to_string(query[L"commandHash"])));
}
/* Common data */
answer[L"time"] = json::value::string(to_wstring(ms.count()));
@@ -222,7 +226,7 @@ void Server::handle_put(http_request request)
std::exception_ptr eptr;
try {
scheduler->handleRequest(to_string(key), value, username);
scheduler->handleRequest(to_string(key), value, username, answer);
}
catch (...) {
eptr = std::current_exception(); // capture
@@ -283,39 +287,32 @@ string Server::extractPassword(http_request& request) {
void Server::task()
{
string address = REST_ADDRESS;
string modLocation;
char* buf = nullptr;
size_t sz = 0;
if (_dupenv_s(&buf, &sz, "DCSOLYMPUS_PATH") == 0 && buf != nullptr)
{
std::ifstream ifstream(string(buf) + "\\olympus.json");
std::stringstream ss;
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"))
{
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);
}
else
log("Error reading configuration file. Starting server on " + address);
string jsonLocation = instancePath + OLYMPUS_JSON_PATH;
if (config.is_object() && config.has_object_field(L"authentication"))
{
if (config[L"authentication"].has_string_field(L"gameMasterPassword")) gameMasterPassword = to_string(config[L"authentication"][L"gameMasterPassword"]);
if (config[L"authentication"].has_string_field(L"blueCommanderPassword")) blueCommanderPassword = to_string(config[L"authentication"][L"blueCommanderPassword"]);
if (config[L"authentication"].has_string_field(L"redCommanderPassword")) redCommanderPassword = to_string(config[L"authentication"][L"redCommanderPassword"]);
}
else
log("Error reading configuration file. No password set.");
free(buf);
log("Reading configuration from " + jsonLocation);
std::ifstream ifstream(jsonLocation);
std::stringstream ss;
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"backend") &&
config[L"backend"].has_string_field(L"address") && config[L"backend"].has_number_field(L"port"))
{
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 backend on " + address);
if (config.is_object() && config.has_object_field(L"authentication"))
{
log("DCSOLYMPUS_PATH environment variable is missing, starting server on " + address);
if (config[L"authentication"].has_string_field(L"gameMasterPassword")) gameMasterPassword = to_string(config[L"authentication"][L"gameMasterPassword"]);
if (config[L"authentication"].has_string_field(L"blueCommanderPassword")) blueCommanderPassword = to_string(config[L"authentication"][L"blueCommanderPassword"]);
if (config[L"authentication"].has_string_field(L"redCommanderPassword")) redCommanderPassword = to_string(config[L"authentication"][L"redCommanderPassword"]);
}
else
log("Error reading configuration file. No password set.");
http_listener listener(to_wstring(address + "/" + REST_URI));
@@ -333,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"); })

View File

@@ -66,9 +66,18 @@ void Unit::update(json::value json, double dt)
if (json.has_number_field(L"heading"))
setHeading(json[L"heading"].as_number().to_double());
if (json.has_number_field(L"track"))
setTrack(json[L"track"].as_number().to_double());
if (json.has_number_field(L"speed"))
setSpeed(json[L"speed"].as_number().to_double());
if (json.has_number_field(L"horizontalVelocity"))
setHorizontalVelocity(json[L"horizontalVelocity"].as_number().to_double());
if (json.has_number_field(L"verticalVelocity"))
setVerticalVelocity(json[L"verticalVelocity"].as_number().to_double());
if (json.has_boolean_field(L"isAlive"))
setAlive(json[L"isAlive"].as_bool());
@@ -131,6 +140,9 @@ void Unit::update(json::value json, double dt)
if (json.has_boolean_field(L"hasTask"))
setHasTask(json[L"hasTask"].as_bool());
if (json.has_number_field(L"health"))
setHealth(static_cast<unsigned char>(json[L"health"].as_number().to_uint32()));
runAILoop();
}
@@ -146,8 +158,10 @@ void Unit::runAILoop() {
/* If the unit is alive, controlled, is the leader of the group and it is not a human, run the AI Loop that performs the requested commands and instructions (moving, attacking, etc) */
if (getAlive() && getControlled() && !getHuman() && getIsLeader()) {
if (checkTaskFailed() && state != State::IDLE && state != State::LAND)
if (getEnableTaskCheckFailed() && checkTaskFailed()) {
log(unitName + " has no task, switching to IDLE state");
setState(State::IDLE);
}
AIloop();
}
@@ -170,8 +184,8 @@ void Unit::refreshLeaderData(unsigned long long time) {
case DataIndex::state: updateValue(state, leader->state, datumIndex); break;
case DataIndex::task: updateValue(task, leader->task, datumIndex); break;
case DataIndex::hasTask: updateValue(hasTask, leader->hasTask, datumIndex); break;
case DataIndex::isTanker: updateValue(isTanker, leader->isTanker, datumIndex); break;
case DataIndex::isAWACS: updateValue(isAWACS, leader->isAWACS, datumIndex); break;
case DataIndex::isActiveTanker: updateValue(isActiveTanker, leader->isActiveTanker, datumIndex); break;
case DataIndex::isActiveAWACS: updateValue(isActiveAWACS, leader->isActiveAWACS, datumIndex); break;
case DataIndex::onOff: updateValue(onOff, leader->onOff, datumIndex); break;
case DataIndex::followRoads: updateValue(followRoads, leader->followRoads, datumIndex); break;
case DataIndex::desiredSpeed: updateValue(desiredSpeed, leader->desiredSpeed, datumIndex); break;
@@ -189,6 +203,9 @@ void Unit::refreshLeaderData(unsigned long long time) {
case DataIndex::radio: updateValue(radio, leader->radio, datumIndex); break;
case DataIndex::generalSettings: updateValue(generalSettings, leader->generalSettings, datumIndex); break;
case DataIndex::activePath: updateValue(activePath, leader->activePath, datumIndex); break;
case DataIndex::operateAs: updateValue(operateAs, leader->operateAs, datumIndex); break;
case DataIndex::shotsScatter: updateValue(shotsScatter, leader->shotsScatter, datumIndex); break;
case DataIndex::shotsIntensity: updateValue(shotsIntensity, leader->shotsIntensity, datumIndex); break;
}
}
}
@@ -230,44 +247,51 @@ void Unit::getData(stringstream& ss, unsigned long long time)
{
if (checkFreshness(datumIndex, time)) {
switch (datumIndex) {
case DataIndex::category: appendString(ss, datumIndex, category); break;
case DataIndex::alive: appendNumeric(ss, datumIndex, alive); break;
case DataIndex::human: appendNumeric(ss, datumIndex, human); break;
case DataIndex::controlled: appendNumeric(ss, datumIndex, controlled); break;
case DataIndex::coalition: appendNumeric(ss, datumIndex, coalition); break;
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::groupName: appendString(ss, datumIndex, groupName); break;
case DataIndex::state: appendNumeric(ss, datumIndex, state); break;
case DataIndex::task: appendString(ss, datumIndex, task); break;
case DataIndex::hasTask: appendNumeric(ss, datumIndex, hasTask); break;
case DataIndex::position: appendNumeric(ss, datumIndex, position); break;
case DataIndex::speed: appendNumeric(ss, datumIndex, speed); break;
case DataIndex::heading: appendNumeric(ss, datumIndex, heading); break;
case DataIndex::isTanker: appendNumeric(ss, datumIndex, isTanker); break;
case DataIndex::isAWACS: appendNumeric(ss, datumIndex, isAWACS); break;
case DataIndex::onOff: appendNumeric(ss, datumIndex, onOff); break;
case DataIndex::followRoads: appendNumeric(ss, datumIndex, followRoads); break;
case DataIndex::fuel: appendNumeric(ss, datumIndex, fuel); break;
case DataIndex::desiredSpeed: appendNumeric(ss, datumIndex, desiredSpeed); break;
case DataIndex::desiredSpeedType: appendNumeric(ss, datumIndex, desiredSpeedType); break;
case DataIndex::desiredAltitude: appendNumeric(ss, datumIndex, desiredAltitude); break;
case DataIndex::desiredAltitudeType: appendNumeric(ss, datumIndex, desiredAltitudeType); break;
case DataIndex::leaderID: appendNumeric(ss, datumIndex, leaderID); break;
case DataIndex::formationOffset: appendNumeric(ss, datumIndex, formationOffset); break;
case DataIndex::targetID: appendNumeric(ss, datumIndex, targetID); break;
case DataIndex::targetPosition: appendNumeric(ss, datumIndex, targetPosition); break;
case DataIndex::ROE: appendNumeric(ss, datumIndex, ROE); break;
case DataIndex::reactionToThreat: appendNumeric(ss, datumIndex, reactionToThreat); break;
case DataIndex::emissionsCountermeasures: appendNumeric(ss, datumIndex, emissionsCountermeasures); break;
case DataIndex::TACAN: appendNumeric(ss, datumIndex, TACAN); break;
case DataIndex::radio: appendNumeric(ss, datumIndex, radio); break;
case DataIndex::generalSettings: appendNumeric(ss, datumIndex, generalSettings); break;
case DataIndex::ammo: appendVector(ss, datumIndex, ammo); break;
case DataIndex::contacts: appendVector(ss, datumIndex, contacts); break;
case DataIndex::activePath: appendList(ss, datumIndex, activePath); break;
case DataIndex::isLeader: appendNumeric(ss, datumIndex, isLeader); break;
case DataIndex::category: appendString(ss, datumIndex, category); break;
case DataIndex::alive: appendNumeric(ss, datumIndex, alive); break;
case DataIndex::human: appendNumeric(ss, datumIndex, human); break;
case DataIndex::controlled: appendNumeric(ss, datumIndex, controlled); break;
case DataIndex::coalition: appendNumeric(ss, datumIndex, coalition); break;
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::groupName: appendString(ss, datumIndex, groupName); break;
case DataIndex::state: appendNumeric(ss, datumIndex, state); break;
case DataIndex::task: appendString(ss, datumIndex, task); break;
case DataIndex::hasTask: appendNumeric(ss, datumIndex, hasTask); break;
case DataIndex::position: appendNumeric(ss, datumIndex, position); break;
case DataIndex::speed: appendNumeric(ss, datumIndex, speed); break;
case DataIndex::horizontalVelocity: appendNumeric(ss, datumIndex, horizontalVelocity); break;
case DataIndex::verticalVelocity: appendNumeric(ss, datumIndex, verticalVelocity); break;
case DataIndex::heading: appendNumeric(ss, datumIndex, heading); break;
case DataIndex::track: appendNumeric(ss, datumIndex, track); break;
case DataIndex::isActiveTanker: appendNumeric(ss, datumIndex, isActiveTanker); break;
case DataIndex::isActiveAWACS: appendNumeric(ss, datumIndex, isActiveAWACS); break;
case DataIndex::onOff: appendNumeric(ss, datumIndex, onOff); break;
case DataIndex::followRoads: appendNumeric(ss, datumIndex, followRoads); break;
case DataIndex::fuel: appendNumeric(ss, datumIndex, fuel); break;
case DataIndex::desiredSpeed: appendNumeric(ss, datumIndex, desiredSpeed); break;
case DataIndex::desiredSpeedType: appendNumeric(ss, datumIndex, desiredSpeedType); break;
case DataIndex::desiredAltitude: appendNumeric(ss, datumIndex, desiredAltitude); break;
case DataIndex::desiredAltitudeType: appendNumeric(ss, datumIndex, desiredAltitudeType); break;
case DataIndex::leaderID: appendNumeric(ss, datumIndex, leaderID); break;
case DataIndex::formationOffset: appendNumeric(ss, datumIndex, formationOffset); break;
case DataIndex::targetID: appendNumeric(ss, datumIndex, targetID); break;
case DataIndex::targetPosition: appendNumeric(ss, datumIndex, targetPosition); break;
case DataIndex::ROE: appendNumeric(ss, datumIndex, ROE); break;
case DataIndex::reactionToThreat: appendNumeric(ss, datumIndex, reactionToThreat); break;
case DataIndex::emissionsCountermeasures: appendNumeric(ss, datumIndex, emissionsCountermeasures); break;
case DataIndex::TACAN: appendNumeric(ss, datumIndex, TACAN); break;
case DataIndex::radio: appendNumeric(ss, datumIndex, radio); break;
case DataIndex::generalSettings: appendNumeric(ss, datumIndex, generalSettings); break;
case DataIndex::ammo: appendVector(ss, datumIndex, ammo); break;
case DataIndex::contacts: appendVector(ss, datumIndex, contacts); break;
case DataIndex::activePath: appendList(ss, datumIndex, activePath); break;
case DataIndex::isLeader: appendNumeric(ss, datumIndex, isLeader); break;
case DataIndex::operateAs: appendNumeric(ss, datumIndex, operateAs); break;
case DataIndex::shotsScatter: appendNumeric(ss, datumIndex, shotsScatter); break;
case DataIndex::shotsIntensity: appendNumeric(ss, datumIndex, shotsIntensity); break;
case DataIndex::health: appendNumeric(ss, datumIndex, health); break;
}
}
}
@@ -397,7 +421,7 @@ void Unit::resetActiveDestination()
void Unit::resetTask()
{
Command* command = dynamic_cast<Command*>(new ResetTask(groupName));
Command* command = dynamic_cast<Command*>(new ResetTask(groupName, [this]() { this->setHasTaskAssigned(false); }));
scheduler->appendCommand(command);
setHasTask(false);
resetTaskFailedCounter();
@@ -406,7 +430,11 @@ void Unit::resetTask()
void Unit::setFormationOffset(Offset newFormationOffset)
{
formationOffset = newFormationOffset;
resetTask();
/* Apply the change */
setHasTask(false);
resetTaskFailedCounter();
AIloop();
triggerUpdate(DataIndex::formationOffset);
}
@@ -491,23 +519,31 @@ void Unit::landAt(Coords loc)
setState(State::LAND);
}
void Unit::setIsTanker(bool newIsTanker)
void Unit::setIsActiveTanker(bool newIsActiveTanker)
{
if (isTanker != newIsTanker) {
isTanker = newIsTanker;
resetTask();
if (isActiveTanker != newIsActiveTanker) {
isActiveTanker = newIsActiveTanker;
/* Apply the change */
setHasTask(false);
resetTaskFailedCounter();
AIloop();
triggerUpdate(DataIndex::isTanker);
triggerUpdate(DataIndex::isActiveTanker);
}
}
void Unit::setIsAWACS(bool newIsAWACS)
void Unit::setIsActiveAWACS(bool newIsActiveAWACS)
{
if (isAWACS != newIsAWACS) {
isAWACS = newIsAWACS;
resetTask();
if (isActiveAWACS != newIsActiveAWACS) {
isActiveAWACS = newIsActiveAWACS;
/* Apply the change */
setHasTask(false);
resetTaskFailedCounter();
AIloop();
triggerUpdate(DataIndex::isAWACS);
triggerUpdate(DataIndex::isActiveAWACS);
}
}
@@ -518,6 +554,12 @@ void Unit::setTACAN(DataTypes::TACAN newTACAN, bool force)
TACAN = newTACAN;
if (TACAN.isOn) {
std::ostringstream commandSS;
if (TACAN.channel < 0)
TACAN.channel = 0;
if (TACAN.channel > 126)
TACAN.channel = 126;
commandSS << "{"
<< "id = 'ActivateBeacon',"
<< "params = {"
@@ -555,6 +597,12 @@ void Unit::setRadio(DataTypes::Radio newRadio, bool force)
std::ostringstream commandSS;
Command* command;
if (radio.frequency < 0)
radio.frequency = 0;
if (radio.frequency > 999000000)
radio.frequency = 999000000;
commandSS << "{"
<< "id = 'SetFrequency',"
<< "params = {"
@@ -608,10 +656,11 @@ void Unit::setDesiredSpeed(double newDesiredSpeed)
{
if (desiredSpeed != newDesiredSpeed) {
desiredSpeed = newDesiredSpeed;
if (state == State::IDLE)
resetTask();
else
goToDestination(); /* Send the command to reach the destination */
/* Apply the change */
setHasTask(false);
resetTaskFailedCounter();
AIloop();
triggerUpdate(DataIndex::desiredSpeed);
}
@@ -621,10 +670,11 @@ void Unit::setDesiredAltitude(double newDesiredAltitude)
{
if (desiredAltitude != newDesiredAltitude) {
desiredAltitude = newDesiredAltitude;
if (state == State::IDLE)
resetTask();
else
goToDestination(); /* Send the command to reach the destination */
/* Apply the change */
setHasTask(false);
resetTaskFailedCounter();
AIloop();
triggerUpdate(DataIndex::desiredAltitude);
}
@@ -634,10 +684,11 @@ void Unit::setDesiredSpeedType(string newDesiredSpeedType)
{
if (desiredSpeedType != (newDesiredSpeedType.compare("GS") == 0)) {
desiredSpeedType = newDesiredSpeedType.compare("GS") == 0;
if (state == State::IDLE)
resetTask();
else
goToDestination(); /* Send the command to reach the destination */
/* Apply the change */
setHasTask(false);
resetTaskFailedCounter();
AIloop();
triggerUpdate(DataIndex::desiredSpeedType);
}
@@ -647,10 +698,11 @@ void Unit::setDesiredAltitudeType(string newDesiredAltitudeType)
{
if (desiredAltitudeType != (newDesiredAltitudeType.compare("AGL") == 0)) {
desiredAltitudeType = newDesiredAltitudeType.compare("AGL") == 0;
if (state == State::IDLE)
resetTask();
else
goToDestination(); /* Send the command to reach the destination */
/* Apply the change */
setHasTask(false);
resetTaskFailedCounter();
AIloop();
triggerUpdate(DataIndex::desiredAltitudeType);
}
@@ -660,7 +712,7 @@ void Unit::goToDestination(string enrouteTask)
{
if (activeDestination != NULL)
{
Command* command = dynamic_cast<Command*>(new Move(groupName, activeDestination, getDesiredSpeed(), getDesiredSpeedType() ? "GS" : "CAS", getDesiredAltitude(), getDesiredAltitudeType() ? "AGL" : "ASL", enrouteTask, getCategory()));
Command* command = dynamic_cast<Command*>(new Move(groupName, activeDestination, getDesiredSpeed(), getDesiredSpeedType() ? "GS" : "CAS", getDesiredAltitude(), getDesiredAltitudeType() ? "AGL" : "ASL", enrouteTask, getCategory(), getFollowRoads(), [this]() { this->setHasTaskAssigned(true); }));
scheduler->appendCommand(command);
setHasTask(true);
}
@@ -726,13 +778,17 @@ bool Unit::updateActivePath(bool looping)
}
}
void Unit::setHasTask(bool newValue) {
updateValue(hasTask, newValue, DataIndex::hasTask);
}
bool Unit::checkTaskFailed()
{
if (getHasTask())
return false;
else {
if (taskCheckCounter > 0)
taskCheckCounter--;
taskCheckCounter -= hasTaskAssigned;
return taskCheckCounter == 0;
}
}
@@ -741,6 +797,14 @@ void Unit::resetTaskFailedCounter() {
taskCheckCounter = TASK_CHECK_INIT_VALUE;
}
void Unit::setHasTaskAssigned(bool newHasTaskAssigned) {
hasTaskAssigned = newHasTaskAssigned;
if (hasTaskAssigned)
log(unitName + " was assigned a new task");
else
log(unitName + " no task assigned");
}
void Unit::triggerUpdate(unsigned char datumIndex) {
updateTimeMap[datumIndex] = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
}

View File

@@ -9,6 +9,10 @@
#include "weapon.h"
#include "commands.h"
#include "scheduler.h"
#include "defines.h"
#include <GeographicLib/Geodesic.hpp>
using namespace GeographicLib;
#include "base64.hpp"
using namespace base64;
@@ -138,15 +142,87 @@ void UnitsManager::getUnitData(stringstream &ss, unsigned long long time)
p.second->getData(ss, time);
}
void UnitsManager::deleteUnit(unsigned int ID, bool explosion, bool immediate)
void UnitsManager::deleteUnit(unsigned int ID, bool explosion, string explosionType, bool immediate)
{
if (getUnit(ID) != nullptr)
{
Command* command = dynamic_cast<Command*>(new Delete(ID, explosion, immediate));
Command* command = dynamic_cast<Command*>(new Delete(ID, explosion, explosionType, immediate));
scheduler->appendCommand(command);
}
}
Unit* UnitsManager::getClosestUnit(Unit* unit, unsigned char coalition, vector<string> categories, double &distance) {
Unit* closestUnit = nullptr;
distance = 0;
for (auto const& p : units) {
/* Check if the units category is of the correct type */
bool requestedCategory = false;
for (auto const& category : categories) {
if (p.second->getCategory().compare(category) == 0) {
requestedCategory = true;
break;
}
}
/* Check if the unit belongs to the desired coalition, is alive, and is of the category requested */
if (requestedCategory && p.second->getCoalition() == coalition && p.second->getAlive()) {
/* Compute the distance from the unit to the tested unit */
double dist;
double bearing1;
double bearing2;
Geodesic::WGS84().Inverse(unit->getPosition().lat, unit->getPosition().lng, p.second->getPosition().lat, p.second->getPosition().lng, dist, bearing1, bearing2);
double altDelta = unit->getPosition().alt - p.second->getPosition().alt;
/* If the closest unit has not been assigned yet, assign it to this unit */
if (closestUnit == nullptr)
{
closestUnit = p.second;
distance = sqrt(dist * dist + altDelta * altDelta);
}
else {
/* Check if the unit is closer than the one already selected */
if (dist < distance) {
closestUnit = p.second;
distance = sqrt(dist * dist + altDelta * altDelta);
}
}
}
}
return closestUnit;
}
map<Unit*, double> UnitsManager::getUnitsInRange(Unit* unit, unsigned char coalition, vector<string> categories, double range) {
map<Unit*, double> unitsInRange;
for (auto const& p : units) {
/* Check if the units category is of the correct type */
bool requestedCategory = false;
for (auto const& category : categories) {
if (p.second->getCategory().compare(category) == 0) {
requestedCategory = true;
break;
}
}
/* Check if the unit belongs to the desired coalition, is alive, and is of the category requested */
if (requestedCategory && p.second->getCoalition() == coalition && p.second->getAlive()) {
/* Compute the distance from the unit to the tested unit */
double dist;
double bearing1;
double bearing2;
Geodesic::WGS84().Inverse(unit->getPosition().lat, unit->getPosition().lng, p.second->getPosition().lat, p.second->getPosition().lng, dist, bearing1, bearing2);
if (dist <= range)
unitsInRange[p.second] = dist;
}
}
return unitsInRange;
}
void UnitsManager::acquireControl(unsigned int ID) {
Unit* leader = getGroupLeader(ID);
if (leader != nullptr) {
@@ -157,3 +233,9 @@ void UnitsManager::acquireControl(unsigned int ID) {
}
}
void UnitsManager::loadDatabases() {
Aircraft::loadDatabase(AIRCRAFT_DATABASE_PATH);
Helicopter::loadDatabase(HELICOPTER_DATABASE_PATH);
GroundUnit::loadDatabase(GROUNDUNIT_DATABASE_PATH);
NavyUnit::loadDatabase(NAVYUNIT_DATABASE_PATH);
}

View 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

View File

@@ -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'">

View File

@@ -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>

View 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

View File

@@ -82,7 +82,7 @@ void getAllUnits(lua_State* L, map<unsigned int, json::value>& unitJSONs)
lua_pushnil(L);
while (lua_next(L, 2) != 0)
{
unsigned int ID = lua_tonumber(L, -2);
unsigned int ID = static_cast<unsigned int>(lua_tonumber(L, -2));
if (unitJSONs.find(ID) == unitJSONs.end())
unitJSONs[ID] = json::value::object();
luaTableToJSON(L, -1, unitJSONs[ID]);

2579
backend/docs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -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);

View File

@@ -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
View 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

View File

@@ -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'">

View File

@@ -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
View 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

View File

@@ -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);

View File

@@ -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()

View File

@@ -5,6 +5,7 @@ void DllExport stackUpdate(lua_State* L, int& stackDepth, int initialStack = 0);
void DllExport stackPop(lua_State* L, int popDepth = 1);
void DllExport stackClean(lua_State* L, int stackDepth);
void DllExport luaTableToJSON(lua_State* L, int index, json::value& json, bool logKeys = false);
void DllExport luaLogTableKeys(lua_State* L, int index);
#define STACK_UPDATE stackUpdate(L, stackDepth, initialStack);
#define STACK_INIT int stackDepth = 0; int initialStack = 0; stackUpdate(L, initialStack);

View 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

View File

@@ -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">

View File

@@ -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>

View 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

View File

@@ -18,6 +18,29 @@ void stackClean(lua_State* L, int stackDepth)
lua_pop(L, stackDepth);
}
void luaLogTableKeys(lua_State* L, int index)
{
if (lua_istable(L, index))
{
STACK_INIT;
lua_pushvalue(L, index);
lua_pushnil(L);
while (lua_next(L, -2))
{
lua_pushvalue(L, -2);
const char* key = lua_tostring(L, -1);
log(key);
lua_pop(L, 2);
}
lua_pop(L, 1);
STACK_CLEAN;
}
}
void luaTableToJSON(lua_State* L, int index, json::value& json, bool logKeys)
{
if (lua_istable(L, index))

110
backend/olympus/olympus.rc Normal file
View 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

View File

@@ -20,10 +20,19 @@
<ProjectReference Include="..\logger\logger.vcxproj">
<Project>{873ecabe-fcfe-4217-ac15-91959c3cf1c6}</Project>
</ProjectReference>
<ProjectReference Include="..\luatools\luatools.vcxproj">
<Project>{de139ec1-4f88-47d5-be73-f41915fe14a3}</Project>
</ProjectReference>
<ProjectReference Include="..\utils\utils.vcxproj">
<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>
@@ -53,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'">
@@ -64,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>
@@ -87,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'">
@@ -112,6 +121,7 @@
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>lua.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\third-party\lua</AdditionalLibraryDirectories>
<DelayLoadDLLs>dcstools.dll;logger.dll;utils.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@@ -13,4 +13,10 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="olympus.rc" />
</ItemGroup>
</Project>

View 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

View File

@@ -5,7 +5,7 @@
/* Run-time linking to core dll allows for "hot swap". This is useful for development but could be removed when stable.*/
HINSTANCE hGetProcIDDLL = NULL;
typedef int(__stdcall* f_coreInit)(lua_State* L);
typedef int(__stdcall* f_coreInit)(lua_State* L, const char* path);
typedef int(__stdcall* f_coreDeinit)(lua_State* L);
typedef int(__stdcall* f_coreFrame)(lua_State* L);
typedef int(__stdcall* f_coreUnitsData)(lua_State* L);
@@ -18,25 +18,43 @@ f_coreUnitsData coreUnitsData = nullptr;
f_coreWeaponsData coreWeaponsData = nullptr;
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 modLocation;
string dllLocation;
char* buf = nullptr;
size_t sz = 0;
if (_dupenv_s(&buf, &sz, "DCSOLYMPUS_PATH") == 0 && buf != nullptr)
{
modLocation = buf;
free(buf);
}
else
{
log("DCSOLYMPUS_PATH environment variable is missing");
goto error;
}
dllLocation = modLocation + "\\bin\\core.dll";
string dllLocation = modPath + "\\core.dll";
log("Loading core.dll");
hGetProcIDDLL = LoadLibrary(to_wstring(dllLocation).c_str());
@@ -90,14 +108,14 @@ static int onSimulationStart(lua_State* L)
goto error;
}
coreInit(L);
coreInit(L, modPath.c_str());
LogInfo(L, "Module loaded and started successfully.");
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;
}
@@ -144,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;
}
@@ -187,6 +205,34 @@ static const luaL_Reg Map[] = {
extern "C" DllExport int luaopen_olympus(lua_State * L)
{
lua_getglobal(L, "require");
lua_pushstring(L, "lfs");
lua_pcall(L, 1, 1, 0);
lua_getfield(L, -1, "writedir");
lua_pcall(L, 0, 1, 0);
if (lua_isstring(L, -1)) {
modPath = string(lua_tostring(L, -1)) + "Mods\\Services\\Olympus\\bin\\";
SetDllDirectoryA(modPath.c_str());
LogInfo(L, "Instance location retrieved successfully");
}
else {
/* Log without using the helper dlls because we have not loaded them yet here */
lua_getglobal(L, "log");
lua_getfield(L, -1, "ERROR");
int errorLevel = (int)lua_tointeger(L, -1);
lua_getglobal(L, "log");
lua_getfield(L, -1, "write");
lua_pushstring(L, "Olympus.dll");
lua_pushnumber(L, errorLevel);
lua_pushstring(L, "An error has occurred while trying to retrieve Olympus's instance location");
lua_pcall(L, 3, 0, 0);
return 0;
}
LogInfo(L, "Loading .dlls from " + modPath);
luaL_register(L, "olympus", Map);
return 1;
}

View 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
View 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

View File

@@ -44,6 +44,7 @@ std::string to_string(const std::wstring& wstr)
std::string random_string(size_t length)
{
srand(static_cast<unsigned int>(time(NULL)));
auto randchar = []() -> char
{
const char charset[] =

110
backend/utils/utils.rc Normal file
View 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

View File

@@ -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>

View File

@@ -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>

View 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
View File

@@ -0,0 +1,6 @@
{
"dependencies": [
"cpprestsdk",
"geographiclib"
]
}

2
build_package.bat Normal file
View File

@@ -0,0 +1,2 @@
call .\scripts\batch\build.bat
call .\scripts\batch\package.bat

View File

@@ -1,2 +0,0 @@
{
}

View File

@@ -1,42 +0,0 @@
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var fs = require('fs');
var atcRouter = require('./routes/api/atc');
var airbasesRouter = require('./routes/api/airbases');
var indexRouter = require('./routes/index');
var uikitRouter = require('./routes/uikit');
var usersRouter = require('./routes/users');
var resourcesRouter = require('./routes/resources');
var app = express();
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
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('/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);

View File

@@ -1,90 +0,0 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('client:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
}

View File

@@ -1,3 +0,0 @@
copy .\\node_modules\\leaflet\\dist\\leaflet.css .\\public\\stylesheets\\leaflet\\leaflet.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

View File

@@ -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 ]

View File

@@ -1,460 +0,0 @@
var basicAuth = require('express-basic-auth')
var enc = new TextEncoder();
const DEMO_UNIT_DATA = {
["1"]:{ category: "Aircraft", alive: true, human: false, controlled: true, coalition: 2, country: 0, name: "KC-135", unitName: "Cool guy 1-1 who also has a very long name", groupName: "Cool group 1", state: 3, task: "Being cool!",
hasTask: true, position: { lat: 37, lng: -116, alt: 1000 }, speed: 200, heading: 45, isTanker: true, isAWACS: 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: 2,
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: [{ quantity: 2, name: "A cool missile\0Ciao", guidance: 0, category: 0, missileCategory: 0 } ],
contacts: [{ID: 2, detectionMethod: 1}, {ID: 3, detectionMethod: 4}],
activePath: [{lat: 38, lng: -115, alt: 0}, {lat: 38, lng: -114, alt: 0}]
},
["2"]:{ category: "Aircraft", alive: true, human: false, controlled: false, coalition: 1, country: 0, name: "FA-18C_hornet", unitName: "Cool guy 1-2", groupName: "Cool group 2", state: 1, task: "Being cool",
hasTask: false, position: { lat: 36.9, lng: -116, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: 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: [{ quantity: 2, name: "A cool missile", guidance: 0, category: 0, missileCategory: 0 } ],
contacts: [{ID: 1, detectionMethod: 16}],
activePath: [ ]
}, ["3"]:{ category: "Helicopter", alive: true, human: false, controlled: false, coalition: 1, country: 0, name: "AH-64D_BLK_II", unitName: "Cool guy 1-4", groupName: "Cool group 3", state: 1, task: "Being cool",
hasTask: false, position: { lat: 37.1, lng: -116.1, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: 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: [{ quantity: 2, name: "A cool missile", guidance: 0, category: 0, missileCategory: 0 } ],
contacts: [{ID: 1, detectionMethod: 16}],
activePath: [ ]
}, ["4"]:{ category: "GroundUnit", alive: true, human: false, controlled: true, coalition: 1, country: 0, name: "Gepard", unitName: "Cool guy 2-1", groupName: "Cool group 4", state: 1, task: "Being cool",
hasTask: false, position: { lat: 37.2, lng: -116.1, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: 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: [{ quantity: 2, name: "A cool missile\0Ciao", guidance: 0, category: 0, missileCategory: 0 } ],
contacts: [{ID: 1001, detectionMethod: 16}],
activePath: [ ],
isLeader: true
}, ["5"]:{ category: "GroundUnit", alive: true, human: false, controlled: true, coalition: 1, country: 0, name: "S_75M_Volhov", unitName: "Cool guy 2-2", groupName: "Cool group 4", state: 1, task: "Being cool",
hasTask: false, position: { lat: 37.21, lng: -116.1, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: 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: [{ quantity: 2, name: "A cool missile", guidance: 0, category: 0, missileCategory: 0 } ],
contacts: [],
activePath: [ ],
isLeader: false
},
["6"]:{ category: "Aircraft", alive: true, human: false, controlled: false, coalition: 1, country: 0, name: "FA-18C_hornet", unitName: "Bad boi 1-2", groupName: "Bad group 1", state: 1, task: "Being bad",
hasTask: false, position: { lat: 36.8, lng: -116, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: 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: [{ quantity: 2, name: "A cool missile", guidance: 0, category: 0, missileCategory: 0 } ],
contacts: [{ID: 1, detectionMethod: 16}],
activePath: [ ]
},
}
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)
{
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.use('/demo', basicAuth({
users: {
'admin': 'password',
'blue': 'bluepassword',
'red': 'redpassword'
},
}))
this.startTime = Date.now();
}
units(req, res){
var array = new Uint8Array();
var time = Date.now();
array = this.concat(array, this.uint64ToByteArray(BigInt(time)));
for (let idx in DEMO_UNIT_DATA) {
const unit = DEMO_UNIT_DATA[idx];
array = this.concat(array, this.uint32ToByteArray(idx));
array = this.appendString(array, unit.category, 1);
array = this.appendUint8(array, unit.alive, 2);
array = this.appendUint8(array, unit.human, 3);
array = this.appendUint8(array, unit.controlled, 4);
array = this.appendUint16(array, unit.coalition, 5);
array = this.appendUint8(array, unit.country, 6);
array = this.appendString(array, unit.name, 7);
array = this.appendString(array, unit.unitName, 8);
array = this.appendString(array, unit.groupName, 9);
array = this.appendUint8(array, unit.state, 10);
array = this.appendString(array, unit.task, 11);
array = this.appendUint8(array, unit.hasTask, 12);
array = this.appendCoordinates(array, unit.position, 13);
array = this.appendDouble(array, unit.speed, 14);
array = this.appendDouble(array, unit.heading, 15);
array = this.appendUint8(array, unit.isTanker, 16);
array = this.appendUint8(array, unit.isAWACS, 17);
array = this.appendUint8(array, unit.onOff, 18);
array = this.appendUint8(array, unit.followRoads, 19);
array = this.appendUint16(array, unit.fuel, 20);
array = this.appendDouble(array, unit.desiredSpeed, 21);
array = this.appendUint8(array, unit.desiredSpeedType, 22);
array = this.appendDouble(array, unit.desiredAltitude, 23);
array = this.appendUint8(array, unit.desiredAltitudeType, 24);
array = this.appendUint32(array, unit.leaderID, 25);
array = this.appendOffset(array, unit.formationOffset, 26);
array = this.appendUint32(array, unit.targetID, 27);
array = this.appendCoordinates(array, unit.targetPosition, 28);
array = this.appendUint8(array, unit.ROE, 29);
array = this.appendUint8(array, unit.reactionToThreat, 30);
array = this.appendUint8(array, unit.emissionsCountermeasures, 31);
array = this.appendTACAN(array, unit.TACAN, 32);
array = this.appendRadio(array, unit.radio, 33);
array = this.appendRadio(array, unit.generalSettings, 34);
array = this.appendAmmo(array, unit.ammo, 35);
array = this.appendContacts(array, unit.contacts, 36);
array = this.appendActivePath(array, unit.activePath, 37);
array = this.appendUint8(array, unit.isLeader, 38);
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: Date.now(),
date: "",
elapsedTime: (Date.now() - this.startTime) / 1000,
startTime: 0
}
ret.mission.coalitions = {
red: [
'Russia',
'China'
],
blue: [
'United States',
'Great Britain'
]
}
ret.mission.commandModeOptions = {
restrictSpawns: false,
restrictToCoalition: true,
setupTime: 0,
spawnPoints: {
red: 1000,
blue: 400
},
eras: ["WW2", "Early Cold War", "Late Cold War", "Modern"]
}
var auth = req.get("Authorization");
if (auth) {
var username = atob(auth.replace("Basic ", "")).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));
}
}
module.exports = DemoDataGenerator;

13738
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +0,0 @@
copy .\\node_modules\\leaflet\\dist\\leaflet.css .\\public\\stylesheets\\leaflet\\leaflet.css
copy .\\node_modules\\leaflet.nauticscale\\dist\\leaflet.nauticscale.js .\\public\\javascripts\\leaflet.nauticscale.js

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,565 +0,0 @@
{
"AH-1W": {
"name": "AH-1W",
"coalition": "blue",
"era": "Mid Cold War",
"label": "AH-1W Cobra",
"shortLabel": "AH1",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "BGM-71 TOW",
"quantity": 8
},
{
"name": "Hydra-70 WP",
"quantity": 38
}
],
"roles": [
"CAS"
],
"code": "8xBGM-71, 38xHYDRA-70 WP",
"name": "TOW / Hydra"
},
{
"fuel": 1,
"items": [
{
"name": "Hydra-70",
"quantity": 76
}
],
"roles": [
"CAS"
],
"code": "76xHYDRA-70",
"name": "Hydra"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "ah-1.png"
},
"AH-64D_BLK_II": {
"name": "AH-64D_BLK_II",
"coalition": "blue",
"era": "Modern",
"label": "AH-64D Apache",
"shortLabel": "AH64",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "AGM-114k Hellfire",
"quantity": 8
},
{
"name": "M151 Rocket Pod",
"quantity": 2
}
],
"roles": [
"CAS"
],
"code": "2 * M261: M151 (6PD), 2 * Hellfire station: 4*AGM-114K",
"name": "Gun / ATGM / Rocket"
},
{
"fuel": 1,
"items": [
{
"name": "AGM-114K Hellfire",
"quantity": 16
}
],
"roles": [
"CAS"
],
"code": "4 * Hellfire station: 4*AGM-114K",
"name": "Gun / ATGM"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "ah-64.png"
},
"Ka-50_3": {
"name": "Ka-50_3",
"coalition": "red",
"era": "Late Cold War",
"label": "Ka-50 Hokum A",
"shortLabel": "K50",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "Igla",
"quantity": 4
}
],
"roles": [
"CAP"
],
"code": "4xIgla",
"name": "Gun / Fox 2"
},
{
"fuel": 1,
"items": [
{
"name": "Igla",
"quantity": 4
},
{
"name": "S-13",
"quantity": 10
},
{
"name": "Kh-25ML",
"quantity": 2
}
],
"roles": [
"Anti-Ship"
],
"code": "2xKh-25ML, 10xS-13, 4xIgla",
"name": "Gun / ASM / Rockets / Fox 2"
},
{
"fuel": 1,
"items": [
{
"name": "Igla",
"quantity": 4
},
{
"name": "S-80FP",
"quantity": 40
},
{
"name": "Vikhr-M",
"quantity": 12
}
],
"roles": [
"CAS"
],
"code": "12x9A4172, 40xS-8OFP, 4xIgla",
"name": "Gun / ATGM / Rockets / Fox 2"
},
{
"fuel": 1,
"items": [
{
"name": "Igla",
"quantity": 4
},
{
"name": "S-80FP",
"quantity": 40
},
{
"name": "Vikhr-M",
"quantity": 12
}
],
"roles": [
"CAS"
],
"code": "12x9A4172, 40xS-8OFP, 4xIgla",
"name": "Gun / ATGM"
},
{
"fuel": 1,
"items": [
{
"name": "Igla",
"quantity": 4
},
{
"name": "FAB-500",
"quantity": 2
},
{
"name": "S-13",
"quantity": 10
}
],
"roles": [
"Strike"
],
"code": "10xS-13, 2xFAB-500, 4xIgla",
"name": "Gun / Bombs / Rockets / Fox 2"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "ka-50.png"
},
"Mi-24P": {
"name": "Mi-24P",
"coalition": "red",
"era": "Mid Cold War",
"label": "Mi-24P Hind",
"shortLabel": "Mi24",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "S-8KOM",
"quantity": 40
},
{
"name": "9M114 ATGM",
"quantity": 8
}
],
"roles": [
"CAS"
],
"code": "2xB8V20 (S-8KOM)+8xATGM 9M114",
"name": "Gun / ATGM / Rockets"
},
{
"fuel": 1,
"items": [
{
"name": "S-24B",
"quantity": 4
},
{
"name": "9M114 ATGM",
"quantity": 4
}
],
"roles": [
"Strike"
],
"code": "4xS-24B+4xATGM 9M114",
"name": "Gun / ATGM / Rockets"
},
{
"fuel": 1,
"items": [
{
"name": "GUV-1 Grenade Launcher",
"quantity": 4
},
{
"name": "9M114 ATGM",
"quantity": 4
}
],
"roles": [
"CAS"
],
"code": "4xGUV-1 AP30+4xATGM 9M114",
"name": "Gun / ATGM / Grenade Launcher"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "mi-24.png"
},
"Mi-26": {
"name": "Mi-26",
"coalition": "red",
"era": "Late Cold War",
"label": "Mi-26 Halo",
"shortLabel": "M26",
"loadouts": [
{
"fuel": 1,
"items": [],
"roles": [
"Transport"
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "mi-26.png"
},
"Mi-28N": {
"name": "Mi-28N",
"coalition": "red",
"era": "Modern",
"label": "Mi-28N Havoc",
"shortLabel": "M28",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "9M114 Shturm",
"quantity": 16
},
{
"name": "S-8",
"quantity": 40
}
],
"roles": [
"CAS"
],
"code": "16x9M114, 40xS-8",
"name": "ATGM / S-8"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "mi-28.png"
},
"Mi-8MT": {
"name": "Mi-8MT",
"coalition": "red",
"era": "Mid Cold War",
"label": "Mi-8MT Hip",
"shortLabel": "Mi8",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "UPK",
"quantity": 2
},
{
"name": "B8",
"quantity": 2
}
],
"roles": [
"CAS"
],
"code": "2 x UPK +2 x B8",
"name": "Rockets / Gunpods"
},
{
"fuel": 1,
"items": [],
"roles": [
"Transport"
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "mi-8.png"
},
"SA342L": {
"name": "SA342L",
"coalition": "blue",
"era": "Mid Cold War",
"label": "SA342L Gazelle",
"shortLabel": "342",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "20mm Cannon",
"quantity": 1
},
{
"name": "SNEB68",
"quantity": 8
}
],
"roles": [
"Recon"
],
"code": "M621, 8xSNEB68 EAP",
"name": "Gun / ATGM / Rockets"
}
],
"filename": "sa-342.png"
},
"SA342M": {
"name": "SA342M",
"coalition": "blue",
"era": "Mid Cold War",
"label": "SA342M Gazelle",
"shortLabel": "342",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "HOT3",
"quantity": 4
}
],
"roles": [
"CAS"
],
"code": "HOT3x4",
"name": "ATGM"
}
],
"filename": "sa-342.png"
},
"SA342Mistral": {
"name": "SA342Mistral",
"coalition": "blue",
"era": "Mid Cold War",
"label": "SA342Mistral Gazelle",
"shortLabel": "342",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "Mistral",
"quantity": 4
}
],
"roles": [
"CAP"
],
"code": "Mistral x 4",
"name": "Fox 2"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "sa-342.png"
},
"SH-60B": {
"name": "SH-60B",
"coalition": "blue",
"era": "Mid Cold War",
"label": "SH-60B Seahawk",
"shortLabel": "S60",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "AGM-119 ASM",
"quantity": 1
}
],
"roles": [
"CAS"
],
"code": "AGM-119",
"name": "ASM"
},
{
"fuel": 1,
"items": [],
"roles": [
"Transport"
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "uh-60.png"
},
"UH-1H": {
"name": "UH-1H",
"coalition": "blue",
"era": "Early Cold War",
"label": "UH-1H Huey",
"shortLabel": "UH1",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "M134 Minigun",
"quantity": 2
},
{
"name": "XM-158",
"quantity": 2
}
],
"roles": [
"CAS"
],
"code": "M134 Minigun*2, XM158*2",
"name": "Miniguns / XM158"
},
{
"fuel": 1,
"items": [],
"roles": [
"Transport"
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "uh-1.png"
},
"UH-60A": {
"name": "UH-60A",
"coalition": "blue",
"era": "Mid Cold War",
"label": "UH-60A Blackhawk",
"shortLabel": "U60",
"loadouts": [
{
"fuel": 1,
"items": [],
"roles": [
"Transport"
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "uh-60.png"
}
}

View File

@@ -1,767 +0,0 @@
{
"An-26B": {
"name": "An-26B",
"coalition": "red",
"label": "An-26B Curl",
"era": "Mid Cold War",
"shortLabel": "26",
"loadouts": [
{
"fuel": 1,
"items": [],
"roles": [
"Transport"
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "an-26.png",
"cost": 0
},
"An-30M": {
"name": "An-30M",
"coalition": "red",
"label": "An-30M Clank",
"era": "Mid Cold War",
"shortLabel": "30",
"loadouts": [
{
"fuel": 1,
"items": [],
"roles": [
"Transport"
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "a-50.png",
"cost": 0
},
"C-130": {
"name": "C-130",
"label": "C-130 Hercules",
"era": "Early Cold War",
"shortLabel": "130",
"loadouts": [
{
"fuel": 1,
"items": [],
"roles": [
"Transport"
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "c-130.png",
"cost": 0
},
"F-14A-135-GR": {
"name": "F-14A-135-GR",
"coalition": "blue",
"label": "F-14A-135-GR Tomcat",
"era": "Mid Cold War",
"shortLabel": "14A",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "fuel",
"quantity": 2
},
{
"name": "AIM-54A",
"quantity": 2
},
{
"name": "AIM-7F",
"quantity": 1
},
{
"name": "AIM-9L",
"quantity": 4
}
],
"roles": [
"CAP"
],
"code": "AIM-54A-MK47*2, AIM-7F*1, AIM-9L*4, XT*2",
"name": "Heavy / Fox 3 / Long Range"
},
{
"fuel": 1,
"items": [
{
"name": "fuel",
"quantity": 2
},
{
"name": "AIM-7F",
"quantity": 4
},
{
"name": "AIM-9L",
"quantity": 4
}
],
"roles": [
"CAP"
],
"code": "AIM-7F*4, AIM-9L*4, XT*2",
"name": "Heavy / Fox 1 / Long Range"
},
{
"fuel": 1,
"items": [
{
"name": "fuel",
"quantity": 2
},
{
"name": "AIM-7M",
"quantity": 1
},
{
"name": "AIM-9M",
"quantity": 2
},
{
"name": "GBU-12",
"quantity": 2
},
{
"name": "LANTIRN",
"quantity": 1
}
],
"roles": [
"Strike"
],
"code": "AIM-7M*1, AIM-9M*2, XT*2, GBU-12*2, LANTIRN",
"name": "Heavy / Fox 3, GBU-12 / Long Range"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "f-14.png",
"cost": 300,
"liveryID": "IRIAF Asia Minor"
},
"F-4E": {
"name": "F-4E",
"coalition": "blue",
"label": "F-4E Phantom II",
"era": "Mid Cold War",
"shortLabel": "4",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "fuel",
"quantity": 2
},
{
"name": "AIM-7M",
"quantity": 4
},
{
"name": "AIM-9M",
"quantity": 4
}
],
"roles": [
"CAP"
],
"code": "AIM-9*4,AIM-7*4,Fuel*2",
"name": "Heavy / Fox 1 / Long Range"
},
{
"fuel": 1,
"items": [
{
"name": "ECM",
"quantity": 1
},
{
"name": "AIM-7M",
"quantity": 2
},
{
"name": "Mk-82",
"quantity": 18
}
],
"roles": [
"Strike"
],
"code": "Mk-82*18,AIM-7*2,ECM",
"name": "Heavy / Fox 1, Mk-82 / Short Range"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "f-4.png",
"cost": 100,
"liveryID": "IRIAF Asia Minor"
},
"F-5E-3": {
"name": "F-5E-3",
"coalition": "blue",
"label": "F-5E Tiger",
"era": "Mid Cold War",
"shortLabel": "5",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "Fuel 275",
"quantity": 3
},
{
"name": "AIM-9P5",
"quantity": 2
}
],
"roles": [
"CAP"
],
"code": "AIM-9P5*2, Fuel 275*3",
"name": "Heavy / Fox 2 / Long Range"
},
{
"fuel": 1,
"items": [
{
"name": "Mk-82",
"quantity": 4
},
{
"name": "AIM-9P5",
"quantity": 2
},
{
"name": "Fuel 275",
"quantity": 1
}
],
"roles": [
"Strike"
],
"code": "Mk-82LD*4,AIM-9P*2,Fuel 275",
"name": "Heavy / Fox 2 / Short Range"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"liveryID": "ir iriaf 43rd tfs",
"filename": "f-5.png",
"cost": 80
},
"F-86F Sabre": {
"name": "F-86F Sabre",
"coalition": "blue",
"label": "F-86F Sabre",
"era": "Early Cold War",
"shortLabel": "86",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "120gal Fuel",
"quantity": 2
}
],
"roles": [
"CAP"
],
"code": "120gal Fuel*2",
"name": "Light / Guns / Short Range"
},
{
"fuel": 1,
"items": [
{
"name": "HVAR",
"quantity": 16
}
],
"roles": [
"CAS"
],
"code": "HVAR*16",
"name": "Light / HVAR / Short Range"
},
{
"fuel": 1,
"items": [
{
"name": "AN-M64",
"quantity": 2
}
],
"roles": [
"Strike"
],
"code": "AN-M64*2",
"name": "Light / AN-M64 / Short Range"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Light / Guns / Short Range"
}
],
"filename": "f-86.png",
"cost": 40,
"liveryID": "iiaf bare metall"
},
"IL-76MD": {
"name": "IL-76MD",
"label": "IL-76MD Candid",
"era": "Mid Cold War",
"shortLabel": "76",
"loadouts": [
{
"fuel": 1,
"items": [],
"roles": [
"Transport"
],
"code": "",
"name": "Default Transport"
}
],
"filename": "il-76.png",
"cost": 0
},
"MiG-15bis": {
"name": "MiG-15bis",
"coalition": "red",
"label": "MiG-15 Fagot",
"era": "Early Cold War",
"shortLabel": "M15",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "300L Fuel Tanks",
"quantity": 2
}
],
"roles": [
"CAP"
],
"code": "2*300L",
"name": "Medium / Guns / Medium Range"
},
{
"fuel": 1,
"items": [
{
"name": "FAB-100M",
"quantity": 2
}
],
"roles": [
"Strike"
],
"code": "2*FAB-100M",
"name": "Medium / FAB-100M / Short Range"
},
{
"fuel": 1,
"items": [],
"roles": [
"CAP"
],
"code": "",
"name": "Light / Guns / Short Range"
}
],
"filename": "mig-15.png",
"cost": 30,
"liveryID": "Iraqi_Camo"
},
"MiG-21Bis": {
"name": "MiG-21Bis",
"coalition": "red",
"label": "MiG-21 Fishbed",
"era": "Mid Cold War",
"shortLabel": "21",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "R-3 Atoll",
"quantity": 2
},
{
"name": "R-60 Aphid",
"quantity": 2
},
{
"name": "130 gal tanks",
"quantity": 1
},
{
"name": "ASO-2 Countermeasures",
"quantity": 1
}
],
"roles": [
"CAP"
],
"code": "Patrol, short range",
"name": "Light / Fox-2 / Short range"
},
{
"fuel": 1,
"items": [
{
"name": "R-3 Atoll",
"quantity": 2
},
{
"name": "R-60 Aphid",
"quantity": 2
},
{
"name": "210 gal tanks",
"quantity": 1
},
{
"name": "ASO-2 Countermeasures",
"quantity": 1
}
],
"roles": [
"CAP"
],
"code": "Patrol, medium range",
"name": "Medium / Fox-2 / Medium range"
},
{
"fuel": 1,
"items": [
{
"name": "R-3R Atoll",
"quantity": 2
},
{
"name": "R-3S Atoll",
"quantity": 2
},
{
"name": "210 gal tanks",
"quantity": 1
},
{
"name": "ASO-2 Countermeasures",
"quantity": 1
}
],
"roles": [
"CAP"
],
"code": "Patrol, long range",
"name": "Medium / Fox-1, Fox-2 / Medium range"
},
{
"fuel": 1,
"items": [
{
"name": "GROM",
"quantity": 2
},
{
"name": "FAB-250",
"quantity": 2
},
{
"name": "210 gal tanks",
"quantity": 1
},
{
"name": "ASO-2 Countermeasures",
"quantity": 1
}
],
"roles": [
"Strike"
],
"code": "Few big targets, GROM + BOMBS",
"name": "Heavy / GROM, FAB250 / Medium range"
},
{
"fuel": 1,
"items": [],
"roles": [
"CAP"
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "mig-21.png",
"cost": 100,
"liveryID": "iran - standard"
},
"MiG-23MLD": {
"name": "MiG-23MLD",
"coalition": "red",
"label": "MiG-23 Flogger",
"era": "Mid Cold War",
"shortLabel": "23",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "Fuel-800",
"quantity": 1
},
{
"name": "R-60M",
"quantity": 4
},
{
"name": "R-24R",
"quantity": 2
}
],
"roles": [
"CAP"
],
"code": "R-24R*2,R-60M*4,Fuel-800",
"name": "Heavy / Fox 1 / Long Range"
},
{
"fuel": 1,
"items": [
{
"name": "Fuel-800",
"quantity": 1
},
{
"name": "FAB-500",
"quantity": 2
},
{
"name": "R-60M",
"quantity": 2
}
],
"roles": [
"Strike"
],
"code": "FAB-500*2,R-60M*2,Fuel-800",
"name": "Heavy / FAB-500 / Long Range"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "mig-23.png",
"cost": 200
},
"Mirage-F1EE": {
"name": "Mirage-F1EE",
"coalition": "red",
"label": "Mirage-F1EE",
"era": "Mid Cold War",
"shortLabel": "F1EE",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "AIM-9JULI",
"quantity": 2
},
{
"name": "R530EM",
"quantity": 2
},
{
"name": "1137L Fuel Tank",
"quantity": 1
}
],
"roles": [
"CAP"
],
"code": "2*AIM9-JULI, 2*R530EM, 1*Fuel Tank",
"name": "Medium / Fox 1 / Medium Range"
},
{
"fuel": 1,
"items": [
{
"name": "AIM-9JULI",
"quantity": 2
},
{
"name": "SAMP 400 LD",
"quantity": 8
}
],
"roles": [
"Strike"
],
"code": "2*AIM-9JULI, 8*SAMP 400 LD",
"name": "Heavy / SAMP400 / Short Range"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "mig-25.png",
"cost": 150,
"liveryID": "iriaf 3-6215 _ 1990-2010s desert (eq variant)"
},
"Mirage-F1CE": {
"name": "Mirage-F1CE",
"coalition": "red",
"label": "Mirage-F1CE",
"era": "Mid Cold War",
"shortLabel": "F1CE",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "AIM-9JULI",
"quantity": 2
},
{
"name": "R530IR",
"quantity": 2
},
{
"name": "1137L Fuel Tank",
"quantity": 1
}
],
"roles": [
"CAP"
],
"code": "2*AIM9-JULI, 2*R530IR, 1*Fuel Tank",
"name": "Medium / Fox 2 / Medium Range"
},
{
"fuel": 1,
"items": [
{
"name": "AIM-9JULI",
"quantity": 2
},
{
"name": "SAMP 400 LD",
"quantity": 8
}
],
"roles": [
"Strike"
],
"code": "2*AIM-9JULI, 8*SAMP 400 LD",
"name": "Heavy / SAMP400 / Short Range"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "mig-25.png",
"cost": 150,
"liveryID": "iraq air force (fictional eq version)"
},
"Su-24M": {
"name": "Su-24M",
"coalition": "red",
"label": "Su-24M Fencer",
"era": "Mid Cold War",
"shortLabel": "24",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "R-60M",
"quantity": 2
},
{
"name": "FAB-1500",
"quantity": 2
}
],
"roles": [
"Strike"
],
"code": "FAB-1500*2,R-60M*2",
"name": "Heavy / FAB-500 / Short Range"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "su-24.png",
"cost": 250,
"liveryID": "iran air force"
}
}

View File

@@ -1,153 +0,0 @@
{
"BMP-1": {
"name": "BMP-1",
"coalition": "red",
"era": "Mid Cold War",
"label": "BMP-1",
"shortLabel": "BMP-1",
"filename": "",
"type": "IFV",
"cost": 10,
"liveryID": "desert"
},
"Hawk SAM Battery": {
"name": "Hawk SAM Battery",
"coalition": "blue",
"era": "Early Cold War",
"label": "Hawk SAM Battery",
"shortLabel": "Hawk SAM Battery",
"range": "Medium",
"filename": "",
"type": "SAM Site",
"cost": 500
},
"Infantry AK": {
"name": "Infantry AK",
"era": "Mid Cold War",
"label": "Infantry AK",
"shortLabel": "Infantry AK",
"filename": "",
"type": "Infantry",
"cost": 1
},
"M-113": {
"name": "M-113",
"coalition": "blue",
"era": "Early Cold War",
"label": "M-113",
"shortLabel": "M-113",
"filename": "",
"type": "APC",
"cost": 5
},
"M-60": {
"name": "M-60",
"coalition": "blue",
"era": "Early Cold War",
"label": "M-60",
"shortLabel": "M-60",
"filename": "",
"type": "Tank",
"cost": 10
},
"SA-2 SAM Battery": {
"name": "SA-2 SAM Battery",
"coalition": "red",
"era": "Early Cold War",
"label": "SA-2 SAM Battery",
"shortLabel": "SA-2 SAM Battery",
"range": "Long",
"filename": "",
"type": "SAM Site",
"cost": 500
},
"T-55": {
"name": "T-55",
"coalition": "red",
"era": "Early Cold War",
"label": "T-55",
"shortLabel": "T-55",
"filename": "",
"type": "Tank",
"cost": 10,
"liveryID": "desert"
},
"T-72B": {
"name": "T-72B",
"coalition": "red",
"era": "Mid Cold War",
"label": "T-72B",
"shortLabel": "T-72B",
"filename": "",
"type": "Tank",
"cost": 20,
"liveryID": "desert"
},
"ZSU-23-4 Shilka": {
"name": "ZSU-23-4 Shilka",
"era": "Late Cold War",
"label": "ZSU-23-4 Shilka",
"shortLabel": "ZSU-23-4 Shilka",
"filename": "",
"type": "AAA",
"cost": 100
},
"Ural-375 ZU-23": {
"name": "Ural-375 ZU-23",
"era": "Early Cold War",
"label": "Ural-375 ZU-23",
"shortLabel": "Ural-375 ZU-23",
"filename": "",
"type": "AAA",
"cost": 50
},
"SAU Gvozdika": {
"name": "SAU Gvozdika",
"coalition": "red",
"era": "Early Cold War",
"label": "SAU Gvozdika",
"shortLabel": "SAU Gvozdika",
"filename": "",
"type": "Gun Artillery",
"cost": 10,
"liveryID": "desert"
},
"Grad-URAL": {
"name": "Grad-URAL",
"coalition": "blue",
"era": "Early Cold War",
"label": "BM-21",
"shortLabel": "BM-21",
"filename": "",
"type": "Rocket Artillery",
"cost": 10
},
"Chieftain_mk3": {
"name": "Chieftain_mk3",
"coalition": "blue",
"era": "Early Cold War",
"label": "Chieftain Mk3",
"shortLabel": "Chieftain Mk3",
"filename": "",
"type": "Tank",
"cost": 20
},
"Scud_B": {
"name": "Scud_B",
"era": "Early Cold War",
"label": "SCUD",
"shortLabel": "SCUD",
"filename": "",
"type": "Rocket Artillery",
"cost": 10
},
"tt_ZU-23": {
"name": "tt_ZU-23",
"era": "Early Cold War",
"label": "Technical ZSU-23",
"shortLabel": "Technical ZSU-23",
"filename": "",
"type": "AAA",
"cost": 25
}
}

View File

@@ -1,141 +0,0 @@
{
"Mi-24P": {
"name": "Mi-24P",
"coalition": "red",
"era": "Mid Cold War",
"label": "Mi-24P Hind",
"shortLabel": "Mi24",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "S-8KOM",
"quantity": 40
},
{
"name": "9M114 ATGM",
"quantity": 8
}
],
"roles": [
"CAS"
],
"code": "2xB8V20 (S-8KOM)+8xATGM 9M114",
"name": "Gun / ATGM / Rockets"
},
{
"fuel": 1,
"items": [
{
"name": "S-24B",
"quantity": 4
},
{
"name": "9M114 ATGM",
"quantity": 4
}
],
"roles": [
"Strike"
],
"code": "4xS-24B+4xATGM 9M114",
"name": "Gun / ATGM / Rockets"
},
{
"fuel": 1,
"items": [
{
"name": "GUV-1 Grenade Launcher",
"quantity": 4
},
{
"name": "9M114 ATGM",
"quantity": 4
}
],
"roles": [
"CAS"
],
"code": "4xGUV-1 AP30+4xATGM 9M114",
"name": "Gun / ATGM / Grenade Launcher"
},
{
"fuel": 1,
"items": [],
"roles": [
""
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "mi-24.png",
"cost": 150,
"liveryID": "IQAF"
},
"Mi-8MT": {
"name": "Mi-8MT",
"coalition": "blue",
"era": "Mid Cold War",
"label": "Mi-8MT Hip",
"shortLabel": "Mi8",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "UPK",
"quantity": 2
},
{
"name": "B8",
"quantity": 2
}
],
"roles": [
"CAS"
],
"code": "2 x UPK +2 x B8",
"name": "Rockets / Gunpods"
},
{
"fuel": 1,
"items": [],
"roles": [
"Transport"
],
"code": "",
"name": "Empty Loadout"
}
],
"filename": "mi-8.png",
"cost": 100,
"liveryID": "IR Iranian Special Police Forces"
},
"SA342M": {
"name": "SA342M",
"coalition": "blue",
"era": "Mid Cold War",
"label": "SA342M Gazelle",
"shortLabel": "342",
"loadouts": [
{
"fuel": 1,
"items": [
{
"name": "HOT3",
"quantity": 4
}
],
"roles": [
"CAS"
],
"code": "4x HOT3, IR Deflector, Sand Filter",
"name": "ATGM"
}
],
"filename": "sa-342.png",
"cost": 80
}
}

View File

@@ -1,452 +0,0 @@
{
"BDK-775": {
"name": "BDK-775",
"coalition": "blue",
"type": "Landing Craft",
"era": "Mid Cold War",
"label": "LS Ropucha",
"shortLabel": "LS Ropucha",
"range": "",
"filename": ""
},
"Boat Armed Hi-Speed": {
"name": "Boat Armed Hi-Speed",
"coalition": "",
"type": "Fast Attack Craft",
"era": "Mid Cold War",
"label": "Boat Armed Hi-Speed",
"shortLabel": "Boat Armed Hi-Speed",
"range": "",
"filename": ""
},
"CVN_71": {
"name": "CVN_71",
"coalition": "blue",
"type": "Super Aircraft Carrier",
"era": "Late Cold War",
"label": "CVN-71 Theodore Roosevelt",
"shortLabel": "CVN-71",
"range": "Short",
"filename": ""
},
"CVN_72": {
"name": "CVN_72",
"coalition": "blue",
"type": "Super Aircraft Carrier",
"era": "Late Cold War",
"label": "CVN-72 Abraham Lincoln",
"shortLabel": "CVN-72",
"range": "Short",
"filename": ""
},
"CVN_73": {
"name": "CVN_73",
"coalition": "blue",
"type": "Super Aircraft Carrier",
"era": "Late Cold War",
"label": "CVN-73 George Washington",
"shortLabel": "CVN-73",
"range": "Medium",
"filename": ""
},
"CVN_75": {
"name": "CVN_75",
"coalition": "blue",
"type": "Aircraft Carrier",
"era": "Late Cold War",
"label": "CVN-75 Harry S. Truman",
"shortLabel": "CVN-75",
"range": "Medium",
"filename": ""
},
"CV_1143_5": {
"name": "CV_1143_5",
"coalition": "red",
"type": "Aircraft Carrier",
"era": "Modern",
"label": "CV Admiral Kuznetsov(2017)",
"shortLabel": "Admiral Kuznetsov(2017)",
"range": "Medium",
"filename": ""
},
"CV_59": {
"name": "CV_59",
"coalition": "blue",
"type": "Aircraft Carrier",
"era": "Early Cold War",
"label": "CV-59 Forrestal",
"shortLabel": "CV-59",
"range": "Short",
"filename": ""
},
"CastleClass_01": {
"name": "CastleClass_01",
"coalition": "blue",
"type": "Patrol",
"era": "Mid Cold War",
"label": "HMS Leeds Castle (P-258)",
"shortLabel": "HMS Leeds Castle (P-258)",
"range": "",
"filename": ""
},
"HandyWind": {
"name": "HandyWind",
"coalition": "blue",
"type": "Cargoship",
"era": "Late Cold War",
"label": "Bulker Handy Wind",
"shortLabel": "Bulker Handy Wind",
"range": "",
"filename": ""
},
"HarborTug": {
"name": "HarborTug",
"coalition": "",
"type": "Tug",
"era": "Mid Cold War",
"label": "Harbor Tug",
"shortLabel": "Harbor Tug",
"range": "",
"filename": ""
},
"LHA_Tarawa": {
"name": "LHA_Tarawa",
"coalition": "blue",
"type": "Aircraft Carrier",
"era": "Mid Cold War",
"label": "LHA-1 Tarawa",
"shortLabel": "LHA-1 Tarawa",
"range": "Short",
"filename": ""
},
"La_Combattante_II": {
"name": "La_Combattante_II",
"coalition": "blue",
"type": "Fast Attack Craft",
"era": "Mid Cold War",
"label": "FAC La Combattante lla",
"shortLabel": "FAC La Combattante",
"range": "",
"filename": ""
},
"Seawise_Giant": {
"name": "Seawise_Giant",
"coalition": "blue",
"type": "Tanker",
"era": "Late Cold War",
"label": "Tanker Seawise Giant",
"shortLabel": "Seawise Giant",
"range": "",
"filename": ""
},
"Ship_Tilde_Supply": {
"name": "Ship_Tilde_Supply",
"coalition": "blue",
"type": "Transport",
"era": "Late Cold War",
"label": "Supply Ship MV Tilde",
"shortLabel": "Supply Ship Tilde",
"range": "",
"filename": ""
},
"Stennis": {
"name": "Stennis",
"coalition": "blue",
"type": "Aircraft Carrier",
"era": "Late Cold War",
"label": "CVN-74 John C. Stennis",
"shortLabel": "CVN-74",
"range": "Medium",
"filename": ""
},
"TICONDEROG": {
"name": "TICONDEROG",
"coalition": "blue",
"type": "Cruiser",
"era": "Late Cold War",
"label": "Ticonderoga",
"shortLabel": "Ticonderoga",
"range": "Medium",
"filename": ""
},
"Type_052B": {
"name": "Type_052B",
"coalition": "red",
"type": "Destroyer",
"era": "Modern",
"label": "052B DDG-168 Guangzhou",
"shortLabel": "Type 52B",
"range": "Short",
"filename": ""
},
"Type_052C": {
"name": "Type_052C",
"coalition": "red",
"type": "Destroyer",
"era": "Modern",
"label": "052C DDG-171 Haikou",
"shortLabel": "Type 52C",
"range": "Short",
"filename": ""
},
"Type_054A": {
"name": "",
"coalition": "red",
"type": "Frigate",
"era": "Modern",
"label": "054A FFG-538 Yantai",
"shortLabel": "Type 54A",
"range": "Medium",
"filename": ""
},
"Type_071": {
"name": "Type_071",
"coalition": "red",
"type": "Transport",
"era": "Modern",
"label": "Type 071",
"shortLabel": "Type 071",
"range": "",
"filename": ""
},
"Type_093": {
"name": "Type_093",
"coalition": "red",
"type": "Submarine",
"era": "Modern",
"label": "Type 093",
"shortLabel": "Type 093",
"range": "",
"filename": ""
},
"USS_Arleigh_Burke_IIa": {
"name": "USS_Arleigh_Burke_IIa",
"coalition": "blue",
"type": "Destroyer",
"era": "Late Cold War",
"label": "DDG Arleigh Burke lla",
"shortLabel": "DDG Arleigh Burke",
"range": "Medium",
"filename": ""
},
"albatros": {
"name": "albatros",
"coalition": "red",
"type": "Aircraft Carrier",
"era": "Early Cold War",
"label": "Albatros (Grisha-5)",
"shortLabel": "Albatros",
"range": "",
"filename": ""
},
"ara_vdm": {
"name": "ara_vdm",
"coalition": "",
"type": "Aircraft Carrier",
"era": "Mid Cold War",
"label": "ARA Vienticinco de Mayo",
"shortLabel": "ARA Vienticinco de Mayo",
"range": "",
"filename": ""
},
"barge-1": {
"name": "barge-1",
"coalition": "red",
"type": "Cargoship",
"era": "Late Cold War",
"label": "Dry cargo ship Ivanov",
"shortLabel": "Dry cargo ship Ivanov",
"range": "",
"filename": ""
},
"barge-2": {
"name": "barge-2",
"coalition": "red",
"type": "Cargoship",
"era": "Late Cold War",
"label": "Dry cargo ship Yakushev",
"shortLabel": "Dry cargo ship Yakushev",
"range": "",
"filename": ""
},
"elnya": {
"name": "elnya",
"coalition": "red",
"type": "Tanker",
"era": "Late Cold War",
"label": "Elnya tanker",
"shortLabel": "Elnya tanker",
"range": "",
"filename": ""
},
"hms_invincible": {
"name": "hms_invincible",
"coalition": "blue",
"type": "Aircraft Carrier",
"era": "Mid Cold War",
"label": "HMS Invincible (R05)",
"shortLabel": "HMS Invincible",
"range": "",
"filename": ""
},
"kilo": {
"name": "kilo",
"coalition": "red",
"type": "Submarine",
"era": "Late Cold War",
"label": "Project 636 Varshavyanka Basic",
"shortLabel": "Varshavyanka Basic",
"range": "Medium",
"filename": ""
},
"kilo_636": {
"name": "kilo_636",
"coalition": "red",
"type": "Submarine",
"era": "Late Cold War",
"label": "Project 636 Varshavyanka Improved",
"shortLabel": "Varshavyanka Improved",
"range": "Medium",
"filename": ""
},
"kuznecow": {
"name": "kuznecow",
"coalition": "red",
"type": "Aircraft Carrier",
"era": "Late Cold War",
"label": "Admiral Kuznetsov",
"shortLabel": "Admiral Kuznetsov",
"range": "Medium",
"filename": ""
},
"leander-gun-achilles": {
"name": "leander-gun-achilles",
"coalition": "blue",
"type": "Frigate",
"era": "Mid Cold War",
"label": "HMS Achilles (F12)",
"shortLabel": "HMS Achilles",
"range": "",
"filename": ""
},
"leander-gun-andromeda": {
"name": "leander-gun-andromeda",
"coalition": "blue",
"type": "Frigate",
"era": "Mid Cold War",
"label": "HMS Andromeda (F57)",
"shortLabel": "HMS Andromeda",
"range": "",
"filename": ""
},
"leander-gun-ariadne": {
"name": "leander-gun-ariadne",
"coalition": "blue",
"type": "Frigate",
"era": "Mid Cold War",
"label": "HMS Ariadne (F72)",
"shortLabel": "HMS Ariadne",
"range": "",
"filename": ""
},
"leander-gun-condell": {
"name": "leander-gun-condell",
"coalition": "",
"type": "Frigate",
"era": "Mid Cold War",
"label": "Almirante Condell PFG-06",
"shortLabel": "Almirante Condell",
"range": "",
"filename": ""
},
"leander-gun-lynch": {
"name": "leander-gun-lynch",
"coalition": "",
"type": "Frigate",
"era": "Mid Cold War",
"label": "CNS Almirante Lynch (PFG-07)",
"shortLabel": "CNS Almirante Lynch",
"range": "",
"filename": ""
},
"molniya": {
"name": "molniya",
"coalition": "",
"type": "Fast Attack Craft",
"era": "Late Cold War",
"label": "Molniya (Tarantul-3)",
"shortLabel": "Molniya",
"range": "Short",
"filename": ""
},
"moscow": {
"name": "moscow",
"coalition": "red",
"type": "Cruiser",
"era": "Late Cold War",
"label": "Moscow",
"shortLabel": "Moscow",
"range": "Medium",
"filename": ""
},
"neustrash": {
"name": "neustrash",
"coalition": "red",
"type": "Frigate",
"era": "Late Cold War",
"label": "Neustrashimy",
"shortLabel": "Neustrashimy",
"range": "Short",
"filename": ""
},
"perry": {
"name": "perry",
"coalition": "blue",
"type": "Frigate",
"era": "Mid Cold War",
"label": "Oliver H. Perry",
"shortLabel": "Oliver H. Perry",
"range": "Medium",
"filename": ""
},
"piotr_velikiy": {
"name": "piotr_velikiy",
"coalition": "red",
"type": "Cruiser",
"era": "Late Cold War",
"label": "Pyotr Velikiy",
"shortLabel": "Pyotr Velikiy",
"range": "Medium",
"filename": ""
},
"rezky": {
"name": "Rezky (Krivak-2)",
"coalition": "red",
"type": "Frigate",
"era": "Early Cold War",
"label": "Rezky (Krivak-2)",
"shortLabel": "Rezky",
"range": "Short",
"filename": ""
},
"santafe": {
"name": "santafe",
"coalition": "",
"type": "Submarine",
"era": "Early Cold War",
"label": "ARA Santa Fe S-21",
"shortLabel": "ARA Santa",
"range": "",
"filename": ""
},
"zwezdny": {
"name": "zwezdny",
"coalition": "",
"type": "Civilian Boat",
"era": "Modern",
"label": "Zwezdny",
"shortLabel": "Zwezdny",
"range": "",
"filename": ""
}
}

View File

@@ -1,84 +0,0 @@
{
"RED": "AGGRESSORS",
"INS": "INSURGENTS",
"DZ" : "ALGERIA",
"AR" : "ARGENTINA",
"AU" : "AUSTRALIA",
"AT" : "AUSTRIA",
"BH" : "BAHRAIN",
"BY" : "BELARUS",
"BE" : "BELGIUM",
"BO" : "BOLIVIA",
"BR" : "BRAZIL",
"BG" : "BULGARIA",
"CA" : "CANADA",
"CL" : "CHILE",
"CN" : "CHINA",
"HR" : "CROATIA",
"CU" : "CUBA",
"CY" : "CYPRUS",
"CZ" : "CHEZH_REPUBLIC",
"DK" : "DENMARK",
"EG" : "EGYPT",
"ET" : "ETHIOPIA",
"FI" : "FINLAND",
"FR" : "FRANCE",
"GE" : "GEORGIA",
"DE" : "GERMANY",
"GH" : "GHANA",
"GI" : "Gibraltar",
"GR" : "GREECE",
"HN" : "HONDURAS",
"HU" : "HUNGARY",
"IS" : "Iceland",
"IN" : "INDIA",
"ID" : "INDONESIA",
"IR" : "IRAN",
"IQ" : "IRAQ",
"IE" : "Ireland",
"IM" : "Isle Of Man",
"IL" : "ISRAEL",
"IT" : "ITALY",
"JP" : "JAPAN",
"JO" : "JORDAN",
"KZ" : "KAZAKHSTAN",
"KR" : "SOUTH_KOREA",
"KW" : "KUWAIT",
"LB" : "LEBANON",
"LY" : "LIBYIA",
"MY" : "MALAYSIA",
"MX" : "MEXICO",
"MA" : "MOROCCO",
"NL" : "THE_NETHERLANDS",
"NG" : "NIGERIA",
"NO" : "NORWAY",
"OM" : "OMAN",
"PK" : "PAKISTAN",
"PE" : "PERU",
"PH" : "PHILIPPINES",
"PL" : "POLAND",
"PT" : "PORTUGAL",
"QA" : "QATAR",
"RO" : "ROMANIA",
"RU" : "RUSSIA",
"SA" : "SAUDI ARABIA",
"RS" : "SERBIA",
"SK" : "SLOVAKIA",
"SI" : "SLOVENIA",
"ZA" : "SOUTH AFRICA",
"ES" : "SPAIN",
"SD" : "SUDAN",
"SE" : "SWEDEN",
"CH" : "SWITZERLAND",
"SY" : "SYRIA",
"TH" : "THAILAND",
"TN" : "TUNISIA",
"TR" : "TURKEY",
"UA" : "UKRAINE",
"AE" : "UNITED ARAB EMIRATES",
"GB" : "UK",
"US" : "USA",
"VE" : "VENEZUELA",
"VN" : "VIETNAM",
"YE" : "YEMEN"
}

File diff suppressed because one or more lines are too long

View File

@@ -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);
};

View File

@@ -1,194 +0,0 @@
/**************************************/
.olympus-dialog {
align-self: center;
background:white;
border-radius: 10px;
display: flex;
flex-direction: column;
justify-self: center;
padding:10px;
position:absolute;
width:fit-content;
z-index: 9999;
}
.olympus-dialog-close {
cursor:pointer;
position:absolute;
right:10px;
top:5px;
}
.olympus-dialog-header {
font-weight:bold;
}
/**************************************/
/***** AIC *****/
.aic-panel {
z-index: 9999;
}
#aic-control-panel {
bottom:30px;
position: absolute;
left:30px;
}
#aic-control-panel .olympus-button img {
max-width: 32px;
}
#aic-toolbox, #aic-callsign-panel {
align-items: flex-start;
align-self: center;
flex-direction: column;
row-gap: 10px;
display:none;
position:absolute;
}
.aic-panel {
background:#eaeaea;
border-bottom-right-radius: 10px;
border-top-right-radius: 10px;
justify-self: left;
padding:5px 10px;
}
.aic-enabled #aic-toolbox, .aic-enabled #aic-callsign-panel {
display:flex;
}
.aic-enabled #aic-callsign-panel {
align-self: auto;
top: 100px;
}
.aic-panel h2 {
font-size:90%;
margin:0;
padding:0;
text-align: center;
}
#aic-callsign-display {
text-align: center;
}
#aic-formation-list {
display:flex;
flex-direction: column;
justify-content: center;
}
#aic-formation-list > div {
align-items: center;
cursor: pointer;
display:flex;
flex-direction: column;
justify-content: center;
margin-top:10px;
position:relative;
}
#aic-formation-list .aic-formation-image img {
border: 1px solid #ccc;
border-radius: 10px;
max-width: 50px;
}
#aic-formation-list .aic-formation-name {
font-size:90%;
}
#aic-formation-list .aic-formation-descriptor {
background:white;
border-radius: 10px;
left:100px;
padding:5px;
position:absolute;
width: max-content;
}
#aic-teleprompt {
background-color: white;
border:2px solid black;
border-radius: 10px;
bottom: 50px;
color: black;
display: none;
justify-content: center;
justify-self: center;
padding: 10px;
position: absolute;
width: fit-content;
z-index: 9999;
}
.aic-enabled #aic-teleprompt {
display:flex;
}
#aic-descriptor {
display:flex;
flex-direction: row;
}
#aic-descriptor .aic-descriptor-section {
display:flex;
flex-direction: column;
margin:0 10px;
}
#aic-descriptor .aic-descriptor-section-label {
background-color:#eaeaea;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
padding:.25em;
text-align: center;
}
#aic-descriptor .aic-descriptor-phrase {
border-bottom: 1px solid #ccc;
display:flex;
flex-direction: row;
margin-bottom:5px;
padding-bottom:2px;
}
#aic-descriptor .aic-descriptor-phrase:last-of-type {
margin-bottom: 0;
}
#aic-descriptor .aic-descriptor-components .aic-descriptor-component {
margin:0 5px;
text-align: center;
}
#aic-descriptor .aic-descriptor-component-label {
display:none;
}
#aic-descriptor .aic-descriptor-component-value:after {
content:",";
margin-right:5px;
}
#aic-descriptor .aic-descriptor-component:last-of-type .aic-descriptor-component-value:after {
content:"; ";
}
#aic-descriptor .aic-descriptor-section:last-of-type .aic-descriptor-component:last-of-type .aic-descriptor-component-value:after {
content:".";
}
/**************************************/

Some files were not shown because too many files have changed in this diff Show More