diff --git a/client/package-lock.json b/client/package-lock.json index 1a17cba1..3dee87cc 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,10 +1,11 @@ { - "name": "client", + "name": "DCS Olympus", "version": "0.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { + "name": "DCS Olympus", "version": "0.0.0", "dependencies": { "@types/geojson": "^7946.0.10", @@ -19,6 +20,7 @@ "save": "^2.9.0" }, "devDependencies": { + "@types/gtag.js": "^0.0.12", "browserify": "^17.0.0", "concurrently": "^7.6.0", "tsify": "^5.0.4", @@ -31,6 +33,12 @@ "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz", "integrity": "sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==" }, + "node_modules/@types/gtag.js": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/@types/gtag.js/-/gtag.js-0.0.12.tgz", + "integrity": "sha512-YQV9bUsemkzG81Ea295/nF/5GijnD2Af7QhEofh7xu+kvCN6RdodgNwwGWXB5GMI3NoyvQo0odNctoH/qLMIpg==", + "dev": true + }, "node_modules/@types/leaflet": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.0.tgz", @@ -3080,6 +3088,12 @@ "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz", "integrity": "sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==" }, + "@types/gtag.js": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/@types/gtag.js/-/gtag.js-0.0.12.tgz", + "integrity": "sha512-YQV9bUsemkzG81Ea295/nF/5GijnD2Af7QhEofh7xu+kvCN6RdodgNwwGWXB5GMI3NoyvQo0odNctoH/qLMIpg==", + "dev": true + }, "@types/leaflet": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.0.tgz", @@ -5544,4 +5558,4 @@ "dev": true } } -} \ No newline at end of file +} diff --git a/client/package.json b/client/package.json index 3a7711c2..e26205f6 100644 --- a/client/package.json +++ b/client/package.json @@ -22,10 +22,11 @@ "save": "^2.9.0" }, "devDependencies": { + "@types/gtag.js": "^0.0.12", "browserify": "^17.0.0", "concurrently": "^7.6.0", "tsify": "^5.0.4", "typescript": "^4.9.4", "watchify": "^4.0.0" } -} \ No newline at end of file +} diff --git a/client/src/index.ts b/client/src/index.ts index 5d2f8c5a..94f0330c 100644 --- a/client/src/index.ts +++ b/client/src/index.ts @@ -38,7 +38,7 @@ function setup() { selectionScroll = new SelectionScroll("selection-scroll"); unitsManager = new UnitsManager(); unitInfoPanel = new UnitInfoPanel("unit-info-panel"); - scenarioDropdown = new Dropdown("scenario-dropdown", ["Caucasus", "Syria", "Marianas", "Nevada", "South Atlantic", "The channel"], () => { }); + scenarioDropdown = new Dropdown("scenario-dropdown", ["Caucasus", "Marianas", "Nevada", "South Atlantic", "Syria", "The Channel"], () => { }); mapSourceDropdown = new Dropdown("map-source-dropdown", map.getLayers(), (option: string) => map.setLayer(option)); connectionStatusPanel = new ConnectionStatusPanel("connection-status-panel"); missionData = new MissionData(); @@ -68,12 +68,23 @@ function setup() { function requestUpdate() { getDataFromDCS(update); + /* Main update rate = 250ms is minimum time, equal to server update time. */ setTimeout(() => requestUpdate(), getConnected() ? 250 : 1000); + + setInterval( () => { + /* + gtag( "event", "heartbeat", { + + }); + //*/ + }, 60000); + connectionStatusPanel.update(getConnected()); } export function update(data: JSON) { + console.log( data ); unitsManager.update(data); missionData.update(data); } diff --git a/client/tsconfig.json b/client/tsconfig.json index 74c81cdf..f7606274 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -33,7 +33,8 @@ ], /* Specify multiple folders that act like './node_modules/@types'. */ "types": [ "leaflet", - "geojson" + "geojson", + "@types/gtag.js" ], /* Specify type package names to be included without being referenced in a source file. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ diff --git a/client/views/index.ejs b/client/views/index.ejs index f53a4638..02a7903b 100644 --- a/client/views/index.ejs +++ b/client/views/index.ejs @@ -7,6 +7,17 @@ + + + + + diff --git a/scripts/OlympusMission.lua b/scripts/OlympusMission.lua index 30533cb4..e089a657 100644 --- a/scripts/OlympusMission.lua +++ b/scripts/OlympusMission.lua @@ -55,9 +55,11 @@ function Olympus.setMissionData(arg, time) basesData[i] = info end + + -- Assemble missionData table missionData["bullseye"] = bullseye - missionData["unitsData"] = unitsData + missionData["unitsData"] = unitsData missionData["airbases"] = basesData local command = "Olympus.missionData = " .. Olympus.serializeTable(missionData) .. "\n" .. "Olympus.OlympusDLL.setMissionData()"