From a5d29a9a9c36f226847f377aff4bdd822b639839 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 2 Nov 2022 12:09:52 +0100 Subject: [PATCH 1/8] fix(express): fixing a version mismatch preventing the server from working --- server/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/package.json b/server/package.json index 5d3aa6b..8c276d3 100644 --- a/server/package.json +++ b/server/package.json @@ -13,7 +13,7 @@ "author": "TimothySimpson", "license": "BSD-3-Clause", "dependencies": { - "express": "4.0.0", + "express": "4.18.2", "express-ws": "5.0.2", "int64-buffer": "1.0.1", "opendds": "0.2.1", From 726458f528e590a70ff6f1c18b272452afe124f6 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 12 Nov 2022 20:20:09 +0100 Subject: [PATCH 2/8] docs(readme): more descriptive step by step guide --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 92fd1b7..e367561 100644 --- a/README.md +++ b/README.md @@ -13,18 +13,24 @@ notification (e.g. websockets) would most likely be used for the sake of perform ## Building the Demo - 1. Set up the OpenDDS environment variables (DDS_ROOT, TAO_ROOT, ACE_ROOT etc) - 2. Set up PATH / LD_LIBRARY_PATH to include OpenDDS, TAO, ACE, and MPC binaries - 3. Set up the environment variable DEMO_ROOT to point to the root of this repository - 4. Generate project files using mwc. Assuming `gnuace`: + 1 a. Set up the OpenDDS environment variables (DDS_ROOT, TAO_ROOT, ACE_ROOT etc) + 1 b. Set up PATH / LD_LIBRARY_PATH to include OpenDDS, TAO, ACE, and MPC binaries +``` + source /sentenv.sh +``` + 2. Set up the environment variable DEMO_ROOT to point to the root of this repository +``` + export DEMO_ROOT=$(pwd) +``` + 3. Generate project files using mwc. Assuming `gnuace`: ``` mwc.pl -type gnuace node-opendds-rest-demo.mwc ``` - 5. Build C++ IDL library and `control` application. Again, assuming 'gnuace': + 4. Build C++ IDL library and `control` application. Again, assuming 'gnuace': ``` make depend && make ``` - 6. Build Node.js `server` application + 5. Build Node.js `server` application ``` cd server npm install From 43475e2f0178140cbc20509403db2e4e31df5751 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 12 Nov 2022 21:14:26 +0100 Subject: [PATCH 3/8] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e367561..114b8ad 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,9 @@ notification (e.g. websockets) would most likely be used for the sake of perform 1 a. Set up the OpenDDS environment variables (DDS_ROOT, TAO_ROOT, ACE_ROOT etc) 1 b. Set up PATH / LD_LIBRARY_PATH to include OpenDDS, TAO, ACE, and MPC binaries ``` - source /sentenv.sh + cd + source sentenv.sh + cd ``` 2. Set up the environment variable DEMO_ROOT to point to the root of this repository ``` From 0b9ceab136a177e8d5ff77f6145fabde94b1cc65 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 12 Nov 2022 21:28:56 +0100 Subject: [PATCH 4/8] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 114b8ad..e8a0f3e 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,9 @@ notification (e.g. websockets) would most likely be used for the sake of perform ## Building the Demo - 1 a. Set up the OpenDDS environment variables (DDS_ROOT, TAO_ROOT, ACE_ROOT etc) - 1 b. Set up PATH / LD_LIBRARY_PATH to include OpenDDS, TAO, ACE, and MPC binaries + 1. + a. Set up the OpenDDS environment variables (DDS_ROOT, TAO_ROOT, ACE_ROOT etc) + b. Set up PATH / LD_LIBRARY_PATH to include OpenDDS, TAO, ACE, and MPC binaries ``` cd source sentenv.sh From 919e30e9d74291b25c6feba450b3061e068802d5 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 12 Nov 2022 21:29:29 +0100 Subject: [PATCH 5/8] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e8a0f3e..e4d9664 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ notification (e.g. websockets) would most likely be used for the sake of perform ## Building the Demo 1. - a. Set up the OpenDDS environment variables (DDS_ROOT, TAO_ROOT, ACE_ROOT etc) - b. Set up PATH / LD_LIBRARY_PATH to include OpenDDS, TAO, ACE, and MPC binaries + - Set up the OpenDDS environment variables (DDS_ROOT, TAO_ROOT, ACE_ROOT etc) + - Set up PATH / LD_LIBRARY_PATH to include OpenDDS, TAO, ACE, and MPC binaries ``` cd source sentenv.sh From ffe5c2bddc4453e8f82f6152c6f83adeda70cfb5 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 15 Nov 2022 11:47:14 +0100 Subject: [PATCH 6/8] docs(README): add trouble shooting --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index e4d9664..eb78890 100644 --- a/README.md +++ b/README.md @@ -65,3 +65,17 @@ at the same time. Generally speaking, you hopefully shouldn't ever need to resta Same as the steps above, though you will obviously need to launch multiple 'server' applications running on different ports (use the `--port ` option) as well as have multiple browser tabs open to connect to each of the servers. +### Trouble Shooting + +#### Error: Could not load node-opendds addon module +If you are experiencing the following error when starting the server, +``` +Error: Could not load node-opendds addon module +``` +make that the $PATH is containing all OpenDDS libs. It should look something like: + +``` +/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ubuntu/source/OpenDDS-3.22/ACE_wrappers/bin:/home/ubuntu/source/OpenDDS-3.22/bin +``` + +fix it by sourcing the OpenDDS `setenv.sh` script, e.g. `source ../OpenDDS-3.2.2/setenv.sh` From fc520e28a236ce0942cf377a370c530b17bb266f Mon Sep 17 00:00:00 2001 From: wzr1337 Date: Sat, 1 Jul 2023 19:23:33 +0000 Subject: [PATCH 7/8] migrated to typscript --- README.md | 3 +- server/GameControlClient.ts | 116 ++++++++++++++++++++++++++++++++++ server/game_control_client.js | 114 --------------------------------- server/{main.js => main.ts} | 40 ++++++------ server/package.json | 3 + server/tsconfig.json | 111 ++++++++++++++++++++++++++++++++ 6 files changed, 253 insertions(+), 134 deletions(-) create mode 100644 server/GameControlClient.ts delete mode 100644 server/game_control_client.js rename server/{main.js => main.ts} (67%) create mode 100644 server/tsconfig.json diff --git a/README.md b/README.md index eb78890..e45ed08 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,9 @@ at the same time. Generally speaking, you hopefully shouldn't ever need to resta 2. Run the server application ``` cd server - node main.js -DCPSPendingTimeout 3 -DCPSConfigFile ../rtps.ini + npx ts-node main.js -DCPSPendingTimeout 3 -DCPSConfigFile ../rtps.ini ``` + 3. Navigate a javascript-enabled web browser to [http://localhost:3210](http://localhost:3210) ### Multiple Servers diff --git a/server/GameControlClient.ts b/server/GameControlClient.ts new file mode 100644 index 0000000..90a5cba --- /dev/null +++ b/server/GameControlClient.ts @@ -0,0 +1,116 @@ +import * as opendds from 'opendds'; +import * as path from 'path'; + +export class GameControlClient { + public playerConnectionWriter = null; + public augmentedPlayerConnectionReader = null; + + private factory; + private participant; + private library; + + public constructor() { + // Handle exit gracefully + process.on('SIGINT', () => { + console.log("OnSIGINT"); + this.finalizeDds(); + process.exit(0); + }); + process.on('SIGTERM', () => { + console.log("OnSIGTERM"); + this.finalizeDds(); + process.exit(0); + }); + process.on('exit', () => { + console.log("OnExit"); + this.finalizeDds(); + }); + } + + public create_player_connection(player_connection_request) { + if (this.playerConnectionWriter) { + console.log("Attempting to write player connection: " + JSON.stringify(player_connection_request)); + try { + this.playerConnectionWriter.write(player_connection_request); + return true; + } catch (err) { + console.error(err.message); + } + } + return false; + }; + + public remove_player_connection(player_connection_request) { + if (this.playerConnectionWriter) { + console.log("Attempting to unregister / dispose player connection: " + JSON.stringify(player_connection_request)); + try { + this.playerConnectionWriter.dispose(player_connection_request); + return true; + } catch (err) { + console.error(err.message); + } + } + return false; + }; + + public subscribe_augmented_player_connections(apc_received, apc_removed) { + try { + var qos = { durability: 'TRANSIENT_LOCAL_DURABILITY_QOS' }; + this.augmentedPlayerConnectionReader = + this.participant.subscribe( + 'Augmented Player Connections', + 'Game::AugmentedPlayerConnection', + qos, + function (dr, sInfo, sample) { + if (sInfo.valid_data) { + apc_received(sample); + } else if (sInfo.instance_state == 2 || sInfo.instance_state == 4) { + console.log("About to call apc_removed for guid '" + JSON.stringify(sample.guid) + '"'); + apc_removed(sample.guid); + } + } + ); + console.log("successfully created APC reader"); + } catch (e) { + console.log(e); + } + }; + + private finalizeDds() { + if (this.factory) { + console.log("finalizing DDS connection"); + if (this.participant) { + this.factory.delete_participant(this.participant); + delete this.participant; + } + opendds.finalize(this.factory); + delete this.factory; + } + }; + + public initializeDds(argsArray) { + var CONTROL_DOMAIN_ID = 9; + this.factory = opendds.initialize.apply(null, argsArray); + if (!process.env.DEMO_ROOT) { + throw new Error("DEMO_ROOT environment variable not set"); + } + this.library = opendds.load(path.join(process.env.DEMO_ROOT, 'lib', 'Game_Idl')); + if (!this.library) { + throw new Error("Could not open type support library"); + } + this.participant = this.factory.create_participant(CONTROL_DOMAIN_ID); + + try { + var qos = {}; + this.playerConnectionWriter = + this.participant.create_datawriter( + 'Player Connections', + 'Game::PlayerConnection', + qos + ); + console.log("successfully created PC writer"); + } catch (e) { + console.log(e); + } + }; +} diff --git a/server/game_control_client.js b/server/game_control_client.js deleted file mode 100644 index 75a18ae..0000000 --- a/server/game_control_client.js +++ /dev/null @@ -1,114 +0,0 @@ -var opendds = require('opendds'), - path = require('path'); - -function GameControlClient() { - this.playerConnectionWriter = null; - this.augmentedPlayerConnectionReader = null; -} - -GameControlClient.prototype.create_player_connection = function(player_connection_request) { - if (this.playerConnectionWriter) { - console.log("Attempting to write player connection: " + JSON.stringify(player_connection_request)); - try { - this.playerConnectionWriter.write(player_connection_request); - return true; - } catch (err) { - console.error(err.message); - } - } - return false; -}; - -GameControlClient.prototype.remove_player_connection = function(player_connection_request) { - if (this.playerConnectionWriter) { - console.log("Attempting to unregister / dispose player connection: " + JSON.stringify(player_connection_request)); - try { - this.playerConnectionWriter.dispose(player_connection_request); - return true; - } catch (err) { - console.error(err.message); - } - } - return false; -}; - -GameControlClient.prototype.subscribe_augmented_player_connections = function(apc_received, apc_removed) { - try { - var qos = { durability: 'TRANSIENT_LOCAL_DURABILITY_QOS' }; - this.augmentedPlayerConnectionReader = - this.participant.subscribe( - 'Augmented Player Connections', - 'Game::AugmentedPlayerConnection', - qos, - function(dr, sInfo, sample) { - if (sInfo.valid_data) { - apc_received(sample); - } else if (sInfo.instance_state == 2 || sInfo.instance_state == 4) { - console.log("About to call apc_removed for guid '" + JSON.stringify(sample.guid) + '"'); - apc_removed(sample.guid); - } - } - ); - console.log("successfully created APC reader"); - } catch (e) { - console.log(e); - } -}; - -GameControlClient.prototype.finalizeDds = function(argsArray) { - if (this.factory) { - console.log("finalizing DDS connection"); - if (this.participant) { - this.factory.delete_participant(this.participant); - delete this.participant - } - opendds.finalize(this.factory); - delete this.factory; - } -}; - -GameControlClient.prototype.initializeDds = function(argsArray) { - var CONTROL_DOMAIN_ID = 9; - this.factory = opendds.initialize.apply(null, argsArray); - if (!process.env.DEMO_ROOT) { - throw new Error("DEMO_ROOT environment variable not set"); - } - this.library = opendds.load(path.join(process.env.DEMO_ROOT, 'lib', 'Game_Idl')); - if (!this.library) { - throw new Error("Could not open type support library"); - } - this.participant = this.factory.create_participant(CONTROL_DOMAIN_ID); - - try { - var qos = {}; - this.playerConnectionWriter = - this.participant.create_datawriter( - 'Player Connections', - 'Game::PlayerConnection', - qos - ); - console.log("successfully created PC writer"); - } catch (e) { - console.log(e); - } - - // Handle exit gracefully - var self = this; - process.on('SIGINT', function() { - console.log("OnSIGINT"); - self.finalizeDds(); - process.exit(0); - }); - process.on('SIGTERM', function() { - console.log("OnSIGTERM"); - self.finalizeDds(); - process.exit(0); - }); - process.on('exit', function() { - console.log("OnExit"); - self.finalizeDds(); - }); -}; - - -module.exports = GameControlClient; diff --git a/server/main.js b/server/main.ts similarity index 67% rename from server/main.js rename to server/main.ts index 68700f9..e086c24 100644 --- a/server/main.js +++ b/server/main.ts @@ -1,21 +1,22 @@ -var GameControlClient = require('./game_control_client') -var Uint64BE = require("int64-buffer").Uint64BE; -const { v4 : uuidv4 } = require('uuid'); +import { v4 as uuidv4 } from 'uuid'; +import express, { Application, Request, Response } from 'express'; + +import expressWs from 'express-ws'; +import { GameControlClient } from './GameControlClient'; +const { app, getWss } = expressWs(express()); var my_args = process.argv.slice(2); var port_index = my_args.indexOf("--port"); -var PORT = (port_index == -1 || my_args.size <= port_index + 1) ? 3210 : my_args[port_index + 1]; -var app = require('express')(); -var expressWs = require('express-ws')(app); +var PORT: number = (port_index == -1 || my_args.length <= port_index + 1) ? 3210 : Number(my_args[port_index + 1]); -var gc_client = new GameControlClient(); +const gc_client = new GameControlClient(); // Split out DDS args var ddsArgs = process.argv.slice(process.argv.indexOf(__filename) + 1); gc_client.initializeDds(ddsArgs); -function get_time() { +const get_time = () => { var date = new Date(); var ms = date.getTime(); return { sec: Math.floor(ms / 1000), nsec: (ms % 1000) * 1000000 }; @@ -32,9 +33,7 @@ app.use(function (req, res, next) { return next(); }); -const Websockets = {}; - -app.ws('/ws', (ws, req) => { +app.ws('/ws', (ws: any, req: Request) => { ws.on('message', (msg) => { console.log(`received: ${msg}`); ws.send(`echo ${msg}`); @@ -44,21 +43,24 @@ app.ws('/ws', (ws, req) => { }); }); -app.put('/playerConnection/:player_name/:player_id', function(req, res) { +app.put('/playerConnection/:player_name/:player_id', (req: Request, res: Response) => { const {player_name, player_id} = req.params; var pc = { + // this is derived from ::PlayerConnection guid: player_id, player_id: player_name, connected_since: get_time(), - server_id : server_id + server_id : server_id, + vehicleSpeed: 4000 }; let success = gc_client.create_player_connection(pc); res.status(success ? 200 : 404).end(); }); -app.delete('/playerConnection/:player_name/:player_id', function(req, res) { +app.delete('/playerConnection/:player_name/:player_id', (req: Request, res: Response) => { const {player_name, player_id} = req.params; var pc = { + // this is derived from ::PlayerConnection guid: player_id, player_id: player_name, connected_since: get_time(), @@ -68,15 +70,15 @@ app.delete('/playerConnection/:player_name/:player_id', function(req, res) { res.status(success ? 200 : 404).end(); }); -app.get('/augmentedPlayerConnection/', function(req, res){ +app.get('/augmentedPlayerConnection/', (req: Request, res: Response) => { res.status(200).send(JSON.stringify(apc_cache.size ? Object.fromEntries(apc_cache) : {})); }); -app.get('/', function(req, res){ +app.get('/', (req: Request, res: Response) => { res.sendFile(__dirname + '/index.html'); }); -app.get('/favicon.ico', function(req, res){ +app.get('/favicon.ico', (req: Request, res: Response) => { res.sendFile(__dirname + '/favicon.ico'); }); @@ -101,7 +103,7 @@ function add_apc(sample) { notifyWs(sample); } -function remove_apc(guid) { +function remove_apc(guid:string) { console.log('Removing APC for guid:' + JSON.stringify(guid)); apc_cache.delete(guid); notifyWs(`${guid} left the game`); @@ -109,7 +111,7 @@ function remove_apc(guid) { function notifyWs(msg) { // get all clients connetced via webSocket - const clients = expressWs.getWss().clients; + const clients = getWss().clients; clients.forEach((client) => { //publish the same message via WebSocket client.send(JSON.stringify(msg)); diff --git a/server/package.json b/server/package.json index 8c276d3..863201f 100644 --- a/server/package.json +++ b/server/package.json @@ -18,5 +18,8 @@ "int64-buffer": "1.0.1", "opendds": "0.2.1", "uuid": "9.0.0" + }, + "devDependencies": { + "@types/node": "^20.3.3" } } diff --git a/server/tsconfig.json b/server/tsconfig.json new file mode 100644 index 0000000..6dec333 --- /dev/null +++ b/server/tsconfig.json @@ -0,0 +1,111 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + "types": [ + "node" + ], /* 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. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": false, /* Enable all strict type-checking options. */ + "noImplicitAny": false, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} From 1d39190da906d5f10de2e3c80554e277206006fd Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 1 Jul 2023 22:29:08 +0200 Subject: [PATCH 8/8] Update README.md fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e45ed08..7f7c206 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ at the same time. Generally speaking, you hopefully shouldn't ever need to resta 2. Run the server application ``` cd server - npx ts-node main.js -DCPSPendingTimeout 3 -DCPSConfigFile ../rtps.ini + npx ts-node main.ts -DCPSPendingTimeout 3 -DCPSConfigFile ../rtps.ini ``` 3. Navigate a javascript-enabled web browser to [http://localhost:3210](http://localhost:3210)