From 93757437392ea2da5410f1dda6013182e8bbd0bc Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:22:26 +0000 Subject: [PATCH 1/6] feat: Updated server/index.ts --- server/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/index.ts b/server/index.ts index 7da236b03..b197bada8 100644 --- a/server/index.ts +++ b/server/index.ts @@ -68,7 +68,7 @@ Player Section: ${addresses[0]} DM Section: ${addresses[0]}/dm`); console.log(`\n-------------------\n`); - process.on('SIGINT', () => { + process.on('SIGINT', (shutdownHandler) => { console.log("Shutting down gracefully"); httpServer.close((err) => { if (err) { @@ -97,7 +97,10 @@ DM Section: ${addresses[0]}/dm`); httpServer.close((err) => { if (err) { - console.error('Server shutdown error:', err); + console.error('Server shutdown error:', err); + if (err) { + process.exitCode = 1; + } process.exit(1); } else { console.log('Server shut down gracefully.'); From 3ea3c7a5c3201e85d4dadeaddef27a6e0302fd17 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:26:27 +0000 Subject: [PATCH 2/6] feat: Updated server/index.ts --- server/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/index.ts b/server/index.ts index b197bada8..b7b16548c 100644 --- a/server/index.ts +++ b/server/index.ts @@ -27,7 +27,7 @@ const getListeningAddresses = () => { }; bootstrapServer(env).then(({ httpServer }) => { - httpServer.on('error', (err) => { + httpServer.on('error', (error) => { console.log('Server startup error:', err); process.exitCode = 1; process.exit(1); From 64fbf26fca947a970000eeb8075ea62f3c52503d Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:29:38 +0000 Subject: [PATCH 3/6] feat: Updated server/index.ts --- server/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/index.ts b/server/index.ts index b7b16548c..a0e31c52a 100644 --- a/server/index.ts +++ b/server/index.ts @@ -68,7 +68,7 @@ Player Section: ${addresses[0]} DM Section: ${addresses[0]}/dm`); console.log(`\n-------------------\n`); - process.on('SIGINT', (shutdownHandler) => { + process.on('SIGINT', shutdownHandler); console.log("Shutting down gracefully"); httpServer.close((err) => { if (err) { @@ -103,6 +103,12 @@ DM Section: ${addresses[0]}/dm`); } process.exit(1); } else { + }); + process.on("SIGINT", shutdownHandler); +}); + }); + process.on("SIGINT", shutdownHandler); +}); console.log('Server shut down gracefully.'); process.exit(0); } From a5a782682e3178e5a47fbf5dc3cadf92e13494d0 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:38:20 +0000 Subject: [PATCH 4/6] feat: Updated wiki/Dice-Macros.md --- wiki/Dice-Macros.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wiki/Dice-Macros.md b/wiki/Dice-Macros.md index 2eec43017..965fb49c7 100644 --- a/wiki/Dice-Macros.md +++ b/wiki/Dice-Macros.md @@ -81,7 +81,7 @@ As well as the following custom components for structuring content: - BoxRow (Horizontal row) - BoxColumn (horizontal row column) -Variables can bes set by using the variable name surrounded by curly brackets `{{myVariable}}`. +Variables can be set by using the variable name surrounded by curly brackets `{{myVariable}}`. The template can be used by setting the `templateId` attribute to the Template `id`. In addition variable values can be passed by setting them as attributes on the `ChatMacro` and prefixing them with `var-`. @@ -148,11 +148,11 @@ This allows powerful features such as conditionals, variable declarations and ma "value": 0, "min": -20, "max": 20 - }} + > {% assign attackRoll = "1d20" | diceRoll %} {% assign result = attackRoll.result | plus: vars.handicap %} -
Attack with {{weapon}}
+
Attack with {{weapon}}
Attack Roll: {% renderDiceRoll attackRoll %} From b096eb4218ad20ce02fc5383def1acde3fa87f9e Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:39:44 +0000 Subject: [PATCH 5/6] feat: Updated README.md --- README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 48895e6ed..9c3e65d05 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Heroku is a platform supporting one-click deployments and includes a free usage [![button](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/dungeon-revealer/dungeon-revealer/tree/v1.17.1) -### Using the app +### Using the dungeon-revealer App The app is separated into two sections. One for the dungeon master and one for the players. Check out the [wiki](https://github.com/dungeon-revealer/dungeon-revealer/wiki) for a detailed walkthrough! @@ -106,9 +106,11 @@ To clear areas of the map, click and draw on the map. You can switch the brush m To switch to a different map, click "Map Library", and then select one of the maps you have already uploaded and click "Load". The "LIVE" indicator in the lower right indicates if the map currently on the dungeon master page is being presented on the player page. the "Stop Sharing" button will blank the player page in preparation for a new map to be loaded. -You can add token with the "Token" tool. Click anywhere on the map to place it. The token can be changed by opening the context menu trough right-clicking on a single token. You can alter it's label, color and size. +**Keyboard Shortcuts for Players** -##### Shortcuts +- `Long Click` - Place a point of interest on the map. + +##### Keyboard Shortcuts for the Dungeon Master | Key | Functionality | | -------------- | --------------------------------------------------------------------------------------------- | @@ -118,12 +120,17 @@ You can add token with the "Token" tool. Click anywhere on the map to place it. | `4` | select mark tool. | | `5` | select token tool. | | `Shift` | toggle between hide/reveal. | -| `CMD/Ctrl + S` | push map to players. | +| ``CMD/Ctrl + S` - Push map to players.` | push map to players. | | Hold `Alt` | use move tool while `Alt` key is pressed and return to previous mode after `Alt` is released. | #### Players -Navigate to the server using a web browser and wait at the home page. (The connection information is displayed in command prompt for convenience.) When the dungeon master is ready, they will push a map to your webpage. You will see either a black screen or a partially covered image. You can zoom in/out and pan the map. On a long click you will place a "point of interest" on the map that will show as a red circle. +**Player Functionality** + +Navigate to the server using a web browser and wait at the home page. (The connection information is displayed in command prompt for convenience.) Once the dungeon master is ready, they will push a map to your webpage. You will see either a black screen or a partially covered image. You can zoom in/out and pan the map. On a long click, you will place a "point of interest" on the map that will show as a red circle. +**Keyboard Shortcuts for Players** + +- `Long Click` - Place a point of interest on the map. ## Contributing From d097eb90db3834d7a1c3e3f5e382684c2b7d96a3 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:40:58 +0000 Subject: [PATCH 6/6] feat: Updated CONTRIBUTING.md --- CONTRIBUTING.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e4a6fb1bd..661a5de02 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -This document will help you setting up this project on your machine for development. If you just want to use dungeon-revealer we recommend using the docker images or prebuilt binaries. [See the release section for more information](https://github.com/dungeon-revealer/dungeon-revealer/releases). +This document will provide detailed instructions for setting up the project on your machine for development. If you only want to use dungeon-revealer, it is recommended to use the docker images or prebuilt binaries. [See the release section for more information](https://github.com/dungeon-revealer/dungeon-revealer/releases). ## Required Software @@ -16,6 +16,7 @@ These are the most important commands for getting the dev server up and running. ### Install dependencies ```bash +npm run start npm install ``` @@ -44,6 +45,11 @@ npm run start:server:dev Run the react development server: ```bash +npm run start:server:dev + +Run the react development server: +```bash +npm run start:frontend:dev npm run start:frontend:dev ``` @@ -70,9 +76,9 @@ The executables are located in the bin folder. ## TypeScript Migration We are currently in the process of migrating the code base to TypeScript. -All new files under `src` and `server` should be written in TypeScript. +All new files under `src` and `server` should be written in TypeScript using the `id` attribute instead of `templateId`. All new features should be built using TypeScript. All new features should be built using TypeScript. Existing features can be ported over to TypeScript by adding changing the file extension from `.js` to `.ts`/`.tsx`. -In case you want to help porting features over to TypeScript, feel free to open an issue or pull request. +If you want to contribute to the TypeScript migration, feel free to open an issue or pull request.