├── .env-sample ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── Procfile ├── README.md ├── package-lock.json ├── package.json ├── public ├── explosion.js ├── gameover.js ├── intro.js ├── invader.svg ├── script.js ├── space-invaders-hero.svg ├── style.css └── winner.js ├── server-worker.js ├── server.js └── views ├── gameRoomFull.html ├── gameover.html ├── index.html ├── intro.html └── winner.html /.env-sample: -------------------------------------------------------------------------------- 1 | ABLY_API_KEY={ABLY_API_KEY} 2 | PORT=8080 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *node_modules 2 | .env 3 | .vscode -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Hi there, welcome to contributing guidelines for this project. 2 | 3 | ### What do I need to know to help? 4 | 5 | If you are interested in making a code contribution and would like to learn more about the technologies that this projects use, check out the list below. 6 | 7 | - [JavaScript](https://www.javascript.com/) 8 | - [NodeJS](https://nodejs.org/en/) 9 | - [Phaser3](https://phaser.io/) 10 | - [Ably Realtime](https://www.ably.io) 11 | - [p2 physics engine](https://www.npmjs.com/package/p2) 12 | 13 | A very detailed tutorial for this project is available on [Dev.to](https://dev.to/ablydev/building-a-realtime-multiplayer-browser-game-in-less-than-a-day-part-1-4-14pm) 14 | 15 | ### How do I make a contribution? 16 | 17 | 1. Find an issue tagged that you are interested in addressing or a feature that you would like to add. 18 | 19 | 2. Fork the repository associated with the issue to your local GitHub organization. This means that you will have a copy of the repository under your-GitHub-username/repository-name. 20 | 21 | 3. Clone the repository to your local machine using git clone https://github.com/github-username/repository-name.git. 22 | 4. Create a new branch for your fix using git checkout -b . 23 | 5. Make the appropriate changes for the issue you are trying to address or the feature that you want to add. 24 | 6. Use git add to add the file contents of the changed files to the "snapshot" git uses to manage the state of the project, also known as the index. 25 | 26 | 7. Use git commit -m "Insert a short message of the changes made here" to store the contents of the index with a descriptive message. 27 | 8. Push the changes to the remote repository using git push origin branch-name-here. 28 | 9. Submit a pull request to the upstream repository. 29 | 10. Title the pull request with a short description of the changes made and the issue or bug number associated with your change. For example, you can title an issue like so "Added volume control feature to address #4352". 30 | 11. In the description of the pull request, explain the changes that you made, any issues you think exist with the pull request you made, and any questions you have for the maintainer. It's OK if your pull request is not perfect (no pull request is), the reviewer will be able to help you fix any problems and improve it! 31 | 12. Wait for the pull request to be reviewed by a maintainer. 32 | 13. Make changes to the pull request if the reviewing maintainer recommends them. 33 | 14. Celebrate your success after your pull request is merged! 34 | 35 | ### Where can I go for help? 36 | 37 | If you need help, you can reach out to [Srushtika](https://twitter.com/Srushtika) on Twitter or open a support ticket at support@ably.com 38 | 39 | ## Any contributions you make will be under the MIT Software License 40 | 41 | In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern. 42 | 43 | ## Report bugs using Github's [issues](https://github.com/ably/depict-it/issues) 44 | 45 | We use GitHub issues to track public bugs. Report a bug by [opening a new issue](); it's that easy! 46 | 47 | ### Write bug reports with detail, background, and sample code 48 | 49 | **Great Bug Reports** tend to have: 50 | 51 | - A quick summary and/or background 52 | - Steps to reproduce 53 | - Be specific! 54 | - Give sample code if you can. [My stackoverflow question](http://stackoverflow.com/q/12488905/180626) includes sample code that _anyone_ with a base R setup can run to reproduce what I was seeing 55 | - What you expected would happen 56 | - What actually happens 57 | - Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) 58 | 59 | We _love_ thorough bug reports! 💖 60 | 61 | ### License 62 | 63 | By contributing, you agree that your contributions will be licensed under its MIT License. 64 | 65 | ### Code of Conduct 66 | 67 | Our Code of Conduct means that you are responsible for treating everyone on the project with respect and courtesy regardless of their identity. 68 | 69 | If you are the victim of any inappropriate behavior or comments as described in our Code of Conduct, we are here for you and will do the best to ensure that the abuser is reprimanded appropriately. Please reach out to [Srushtika](https://twitter.com/Srushtika) in case of any concerns. 70 | 71 | ## References 72 | 73 | This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md) and [Safia Abdalla's article](https://opensource.com/life/16/3/contributor-guidelines-template-and-tips) on OpenSource.com 74 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: node server.js -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](./public/space-invaders-hero.svg) 2 | 3 | # Realtime multiplayer game of Space Invaders 4 | 5 | This project runs a realtime multiplayer version of the classic retro game, Space Invaders. 6 | 7 | ![Preview of the game](https://user-images.githubusercontent.com/5900152/84092843-7ea1ce80-a9f0-11ea-809d-41cd20fb8e59.gif) 8 | 9 | ## Services/ libraries used in the game 10 | 11 | - [Phaser 3](https://phaser.io) 12 | - [p2 NPM library](https://www.npmjs.com/package/p2) 13 | - [Ably Realtime](https://www.ably.com) 14 | 15 | You will require an Ably API Key, to run this demo, [sign-up for FREE account](https://ably.com/sign-up) 16 | 17 | # How to run this game 18 | 19 | 1. Create a free account with [Ably Realtime](https://www.ably.com) and obtain an API Key 20 | 1. Clone this repo locally 21 | 1. Navigate to the project folder and run `npm install` to install the dependencies 22 | 1. Rename `.env-sample` to `.env`, then edit the file and add your Ably API key and prefered PORT (default 8080). 23 | 1. (Optional) You can update the `MIN_PLAYERS_TO_START_GAME` to enforce a minimum number of players. (see `server-worker.js`) 24 | 1. Run the server with `node server.js` and then open a brower to [localhost:8080](http://localhost:8080) 25 | 26 | Read the full blog post series on [dev.to](https://dev.to/ably/building-a-realtime-multiplayer-browser-game-in-less-than-a-day-part-1-4-14pm). 27 | 28 | Please [reach out to me on Twitter](https://www.twitter.com/Srushtika) for any questions, 29 | or follow us [@ablyrealtime](https://twitter.com/ablyrealtime) 30 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hello-express", 3 | "version": "0.0.1", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "hello-express", 9 | "version": "0.0.1", 10 | "license": "MIT", 11 | "dependencies": { 12 | "ably": "^1.1.25", 13 | "dotenv": "^8.2.0", 14 | "express": "^4.17.1", 15 | "p2": "^0.7.1" 16 | }, 17 | "engines": { 18 | "node": "12.x" 19 | } 20 | }, 21 | "node_modules/@ably/msgpack-js": { 22 | "version": "0.3.3", 23 | "resolved": "https://registry.npmjs.org/@ably/msgpack-js/-/msgpack-js-0.3.3.tgz", 24 | "integrity": "sha512-H7oWg97VyA1JhWUP7YN7zwp9W1ozCqMSsqCcXNz4XLmZNdJKT2ntF/6DPgbviFgUpShjQlbPC/iamisTjwLHdQ==", 25 | "dependencies": { 26 | "bops": "~0.0.6" 27 | } 28 | }, 29 | "node_modules/ably": { 30 | "version": "1.1.25", 31 | "resolved": "https://registry.npmjs.org/ably/-/ably-1.1.25.tgz", 32 | "integrity": "sha512-VGbV2Bsd0Glt0LwwzI39xZ4e9RdFZrFSOS3sKi/8+2ljb8LAujFG5Z6dJaOHPBjUohqj+Gtbv6rNQDrz4b7Ygw==", 33 | "dependencies": { 34 | "@ably/msgpack-js": "^0.3.3", 35 | "request": "^2.87.0", 36 | "ws": "^5.1" 37 | }, 38 | "engines": { 39 | "node": ">=4.5.x" 40 | } 41 | }, 42 | "node_modules/accepts": { 43 | "version": "1.3.7", 44 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 45 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 46 | "dependencies": { 47 | "mime-types": "~2.1.24", 48 | "negotiator": "0.6.2" 49 | }, 50 | "engines": { 51 | "node": ">= 0.6" 52 | } 53 | }, 54 | "node_modules/ajv": { 55 | "version": "6.12.2", 56 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", 57 | "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", 58 | "dependencies": { 59 | "fast-deep-equal": "^3.1.1", 60 | "fast-json-stable-stringify": "^2.0.0", 61 | "json-schema-traverse": "^0.4.1", 62 | "uri-js": "^4.2.2" 63 | } 64 | }, 65 | "node_modules/array-flatten": { 66 | "version": "1.1.1", 67 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 68 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 69 | }, 70 | "node_modules/asn1": { 71 | "version": "0.2.4", 72 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", 73 | "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", 74 | "dependencies": { 75 | "safer-buffer": "~2.1.0" 76 | } 77 | }, 78 | "node_modules/assert-plus": { 79 | "version": "1.0.0", 80 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 81 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", 82 | "engines": { 83 | "node": ">=0.8" 84 | } 85 | }, 86 | "node_modules/async-limiter": { 87 | "version": "1.0.1", 88 | "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", 89 | "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" 90 | }, 91 | "node_modules/asynckit": { 92 | "version": "0.4.0", 93 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 94 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 95 | }, 96 | "node_modules/aws-sign2": { 97 | "version": "0.7.0", 98 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", 99 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", 100 | "engines": { 101 | "node": "*" 102 | } 103 | }, 104 | "node_modules/aws4": { 105 | "version": "1.10.0", 106 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", 107 | "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==" 108 | }, 109 | "node_modules/base64-js": { 110 | "version": "0.0.2", 111 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.2.tgz", 112 | "integrity": "sha1-Ak8Pcq+iW3X5wO5zzU9V7Bvtl4Q=", 113 | "engines": { 114 | "node": ">= 0.4" 115 | } 116 | }, 117 | "node_modules/bcrypt-pbkdf": { 118 | "version": "1.0.2", 119 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", 120 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", 121 | "dependencies": { 122 | "tweetnacl": "^0.14.3" 123 | } 124 | }, 125 | "node_modules/body-parser": { 126 | "version": "1.19.0", 127 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", 128 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", 129 | "dependencies": { 130 | "bytes": "3.1.0", 131 | "content-type": "~1.0.4", 132 | "debug": "2.6.9", 133 | "depd": "~1.1.2", 134 | "http-errors": "1.7.2", 135 | "iconv-lite": "0.4.24", 136 | "on-finished": "~2.3.0", 137 | "qs": "6.7.0", 138 | "raw-body": "2.4.0", 139 | "type-is": "~1.6.17" 140 | }, 141 | "engines": { 142 | "node": ">= 0.8" 143 | } 144 | }, 145 | "node_modules/body-parser/node_modules/qs": { 146 | "version": "6.7.0", 147 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 148 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", 149 | "engines": { 150 | "node": ">=0.6" 151 | } 152 | }, 153 | "node_modules/bops": { 154 | "version": "0.0.7", 155 | "resolved": "https://registry.npmjs.org/bops/-/bops-0.0.7.tgz", 156 | "integrity": "sha1-tKClqDmkBkVK8P4FqLkaenZqVOI=", 157 | "dependencies": { 158 | "base64-js": "0.0.2", 159 | "to-utf8": "0.0.1" 160 | } 161 | }, 162 | "node_modules/bytes": { 163 | "version": "3.1.0", 164 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 165 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", 166 | "engines": { 167 | "node": ">= 0.8" 168 | } 169 | }, 170 | "node_modules/caseless": { 171 | "version": "0.12.0", 172 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", 173 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 174 | }, 175 | "node_modules/combined-stream": { 176 | "version": "1.0.8", 177 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 178 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 179 | "dependencies": { 180 | "delayed-stream": "~1.0.0" 181 | }, 182 | "engines": { 183 | "node": ">= 0.8" 184 | } 185 | }, 186 | "node_modules/content-disposition": { 187 | "version": "0.5.3", 188 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 189 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 190 | "dependencies": { 191 | "safe-buffer": "5.1.2" 192 | }, 193 | "engines": { 194 | "node": ">= 0.6" 195 | } 196 | }, 197 | "node_modules/content-disposition/node_modules/safe-buffer": { 198 | "version": "5.1.2", 199 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 200 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 201 | }, 202 | "node_modules/content-type": { 203 | "version": "1.0.4", 204 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 205 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", 206 | "engines": { 207 | "node": ">= 0.6" 208 | } 209 | }, 210 | "node_modules/cookie": { 211 | "version": "0.4.0", 212 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", 213 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", 214 | "engines": { 215 | "node": ">= 0.6" 216 | } 217 | }, 218 | "node_modules/cookie-signature": { 219 | "version": "1.0.6", 220 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 221 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 222 | }, 223 | "node_modules/core-util-is": { 224 | "version": "1.0.2", 225 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 226 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 227 | }, 228 | "node_modules/dashdash": { 229 | "version": "1.14.1", 230 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", 231 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 232 | "dependencies": { 233 | "assert-plus": "^1.0.0" 234 | }, 235 | "engines": { 236 | "node": ">=0.10" 237 | } 238 | }, 239 | "node_modules/debug": { 240 | "version": "2.6.9", 241 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 242 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 243 | "dependencies": { 244 | "ms": "2.0.0" 245 | } 246 | }, 247 | "node_modules/delayed-stream": { 248 | "version": "1.0.0", 249 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 250 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", 251 | "engines": { 252 | "node": ">=0.4.0" 253 | } 254 | }, 255 | "node_modules/depd": { 256 | "version": "1.1.2", 257 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 258 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", 259 | "engines": { 260 | "node": ">= 0.6" 261 | } 262 | }, 263 | "node_modules/destroy": { 264 | "version": "1.0.4", 265 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 266 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 267 | }, 268 | "node_modules/dotenv": { 269 | "version": "8.2.0", 270 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", 271 | "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==", 272 | "engines": { 273 | "node": ">=8" 274 | } 275 | }, 276 | "node_modules/ecc-jsbn": { 277 | "version": "0.1.2", 278 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", 279 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", 280 | "dependencies": { 281 | "jsbn": "~0.1.0", 282 | "safer-buffer": "^2.1.0" 283 | } 284 | }, 285 | "node_modules/ee-first": { 286 | "version": "1.1.1", 287 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 288 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 289 | }, 290 | "node_modules/encodeurl": { 291 | "version": "1.0.2", 292 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 293 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", 294 | "engines": { 295 | "node": ">= 0.8" 296 | } 297 | }, 298 | "node_modules/escape-html": { 299 | "version": "1.0.3", 300 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 301 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 302 | }, 303 | "node_modules/etag": { 304 | "version": "1.8.1", 305 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 306 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", 307 | "engines": { 308 | "node": ">= 0.6" 309 | } 310 | }, 311 | "node_modules/express": { 312 | "version": "4.17.1", 313 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", 314 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", 315 | "dependencies": { 316 | "accepts": "~1.3.7", 317 | "array-flatten": "1.1.1", 318 | "body-parser": "1.19.0", 319 | "content-disposition": "0.5.3", 320 | "content-type": "~1.0.4", 321 | "cookie": "0.4.0", 322 | "cookie-signature": "1.0.6", 323 | "debug": "2.6.9", 324 | "depd": "~1.1.2", 325 | "encodeurl": "~1.0.2", 326 | "escape-html": "~1.0.3", 327 | "etag": "~1.8.1", 328 | "finalhandler": "~1.1.2", 329 | "fresh": "0.5.2", 330 | "merge-descriptors": "1.0.1", 331 | "methods": "~1.1.2", 332 | "on-finished": "~2.3.0", 333 | "parseurl": "~1.3.3", 334 | "path-to-regexp": "0.1.7", 335 | "proxy-addr": "~2.0.5", 336 | "qs": "6.7.0", 337 | "range-parser": "~1.2.1", 338 | "safe-buffer": "5.1.2", 339 | "send": "0.17.1", 340 | "serve-static": "1.14.1", 341 | "setprototypeof": "1.1.1", 342 | "statuses": "~1.5.0", 343 | "type-is": "~1.6.18", 344 | "utils-merge": "1.0.1", 345 | "vary": "~1.1.2" 346 | }, 347 | "engines": { 348 | "node": ">= 0.10.0" 349 | } 350 | }, 351 | "node_modules/express/node_modules/qs": { 352 | "version": "6.7.0", 353 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 354 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", 355 | "engines": { 356 | "node": ">=0.6" 357 | } 358 | }, 359 | "node_modules/express/node_modules/safe-buffer": { 360 | "version": "5.1.2", 361 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 362 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 363 | }, 364 | "node_modules/extend": { 365 | "version": "3.0.2", 366 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 367 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 368 | }, 369 | "node_modules/extsprintf": { 370 | "version": "1.3.0", 371 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", 372 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", 373 | "engines": [ 374 | "node >=0.6.0" 375 | ] 376 | }, 377 | "node_modules/fast-deep-equal": { 378 | "version": "3.1.1", 379 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", 380 | "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==" 381 | }, 382 | "node_modules/fast-json-stable-stringify": { 383 | "version": "2.1.0", 384 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 385 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" 386 | }, 387 | "node_modules/finalhandler": { 388 | "version": "1.1.2", 389 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", 390 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", 391 | "dependencies": { 392 | "debug": "2.6.9", 393 | "encodeurl": "~1.0.2", 394 | "escape-html": "~1.0.3", 395 | "on-finished": "~2.3.0", 396 | "parseurl": "~1.3.3", 397 | "statuses": "~1.5.0", 398 | "unpipe": "~1.0.0" 399 | }, 400 | "engines": { 401 | "node": ">= 0.8" 402 | } 403 | }, 404 | "node_modules/forever-agent": { 405 | "version": "0.6.1", 406 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 407 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", 408 | "engines": { 409 | "node": "*" 410 | } 411 | }, 412 | "node_modules/form-data": { 413 | "version": "2.3.3", 414 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", 415 | "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", 416 | "dependencies": { 417 | "asynckit": "^0.4.0", 418 | "combined-stream": "^1.0.6", 419 | "mime-types": "^2.1.12" 420 | }, 421 | "engines": { 422 | "node": ">= 0.12" 423 | } 424 | }, 425 | "node_modules/forwarded": { 426 | "version": "0.1.2", 427 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 428 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", 429 | "engines": { 430 | "node": ">= 0.6" 431 | } 432 | }, 433 | "node_modules/fresh": { 434 | "version": "0.5.2", 435 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 436 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", 437 | "engines": { 438 | "node": ">= 0.6" 439 | } 440 | }, 441 | "node_modules/getpass": { 442 | "version": "0.1.7", 443 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 444 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 445 | "dependencies": { 446 | "assert-plus": "^1.0.0" 447 | } 448 | }, 449 | "node_modules/har-schema": { 450 | "version": "2.0.0", 451 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", 452 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", 453 | "engines": { 454 | "node": ">=4" 455 | } 456 | }, 457 | "node_modules/har-validator": { 458 | "version": "5.1.3", 459 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", 460 | "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", 461 | "deprecated": "this library is no longer supported", 462 | "dependencies": { 463 | "ajv": "^6.5.5", 464 | "har-schema": "^2.0.0" 465 | }, 466 | "engines": { 467 | "node": ">=6" 468 | } 469 | }, 470 | "node_modules/http-errors": { 471 | "version": "1.7.2", 472 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", 473 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", 474 | "dependencies": { 475 | "depd": "~1.1.2", 476 | "inherits": "2.0.3", 477 | "setprototypeof": "1.1.1", 478 | "statuses": ">= 1.5.0 < 2", 479 | "toidentifier": "1.0.0" 480 | }, 481 | "engines": { 482 | "node": ">= 0.6" 483 | } 484 | }, 485 | "node_modules/http-signature": { 486 | "version": "1.2.0", 487 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", 488 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 489 | "dependencies": { 490 | "assert-plus": "^1.0.0", 491 | "jsprim": "^1.2.2", 492 | "sshpk": "^1.7.0" 493 | }, 494 | "engines": { 495 | "node": ">=0.8", 496 | "npm": ">=1.3.7" 497 | } 498 | }, 499 | "node_modules/iconv-lite": { 500 | "version": "0.4.24", 501 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 502 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 503 | "dependencies": { 504 | "safer-buffer": ">= 2.1.2 < 3" 505 | }, 506 | "engines": { 507 | "node": ">=0.10.0" 508 | } 509 | }, 510 | "node_modules/inherits": { 511 | "version": "2.0.3", 512 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 513 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 514 | }, 515 | "node_modules/ipaddr.js": { 516 | "version": "1.9.1", 517 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 518 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", 519 | "engines": { 520 | "node": ">= 0.10" 521 | } 522 | }, 523 | "node_modules/is-typedarray": { 524 | "version": "1.0.0", 525 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 526 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 527 | }, 528 | "node_modules/isstream": { 529 | "version": "0.1.2", 530 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 531 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 532 | }, 533 | "node_modules/jsbn": { 534 | "version": "0.1.1", 535 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 536 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" 537 | }, 538 | "node_modules/json-schema": { 539 | "version": "0.2.3", 540 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", 541 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 542 | }, 543 | "node_modules/json-schema-traverse": { 544 | "version": "0.4.1", 545 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 546 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" 547 | }, 548 | "node_modules/json-stringify-safe": { 549 | "version": "5.0.1", 550 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 551 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 552 | }, 553 | "node_modules/jsprim": { 554 | "version": "1.4.1", 555 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", 556 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", 557 | "engines": [ 558 | "node >=0.6.0" 559 | ], 560 | "dependencies": { 561 | "assert-plus": "1.0.0", 562 | "extsprintf": "1.3.0", 563 | "json-schema": "0.2.3", 564 | "verror": "1.10.0" 565 | } 566 | }, 567 | "node_modules/media-typer": { 568 | "version": "0.3.0", 569 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 570 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", 571 | "engines": { 572 | "node": ">= 0.6" 573 | } 574 | }, 575 | "node_modules/merge-descriptors": { 576 | "version": "1.0.1", 577 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 578 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 579 | }, 580 | "node_modules/methods": { 581 | "version": "1.1.2", 582 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 583 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", 584 | "engines": { 585 | "node": ">= 0.6" 586 | } 587 | }, 588 | "node_modules/mime": { 589 | "version": "1.6.0", 590 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 591 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 592 | "bin": { 593 | "mime": "cli.js" 594 | }, 595 | "engines": { 596 | "node": ">=4" 597 | } 598 | }, 599 | "node_modules/mime-db": { 600 | "version": "1.44.0", 601 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", 602 | "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", 603 | "engines": { 604 | "node": ">= 0.6" 605 | } 606 | }, 607 | "node_modules/mime-types": { 608 | "version": "2.1.27", 609 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", 610 | "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", 611 | "dependencies": { 612 | "mime-db": "1.44.0" 613 | }, 614 | "engines": { 615 | "node": ">= 0.6" 616 | } 617 | }, 618 | "node_modules/ms": { 619 | "version": "2.0.0", 620 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 621 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 622 | }, 623 | "node_modules/negotiator": { 624 | "version": "0.6.2", 625 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 626 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", 627 | "engines": { 628 | "node": ">= 0.6" 629 | } 630 | }, 631 | "node_modules/oauth-sign": { 632 | "version": "0.9.0", 633 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", 634 | "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", 635 | "engines": { 636 | "node": "*" 637 | } 638 | }, 639 | "node_modules/on-finished": { 640 | "version": "2.3.0", 641 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 642 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 643 | "dependencies": { 644 | "ee-first": "1.1.1" 645 | }, 646 | "engines": { 647 | "node": ">= 0.8" 648 | } 649 | }, 650 | "node_modules/p2": { 651 | "version": "0.7.1", 652 | "resolved": "https://registry.npmjs.org/p2/-/p2-0.7.1.tgz", 653 | "integrity": "sha1-JfJHTZvDptMUCh2iamfJ4RislUM=", 654 | "dependencies": { 655 | "poly-decomp": "0.1.1" 656 | }, 657 | "engines": { 658 | "node": "*" 659 | } 660 | }, 661 | "node_modules/parseurl": { 662 | "version": "1.3.3", 663 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 664 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 665 | "engines": { 666 | "node": ">= 0.8" 667 | } 668 | }, 669 | "node_modules/path-to-regexp": { 670 | "version": "0.1.7", 671 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 672 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 673 | }, 674 | "node_modules/performance-now": { 675 | "version": "2.1.0", 676 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", 677 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 678 | }, 679 | "node_modules/poly-decomp": { 680 | "version": "0.1.1", 681 | "resolved": "https://registry.npmjs.org/poly-decomp/-/poly-decomp-0.1.1.tgz", 682 | "integrity": "sha1-n2jE+lWGY3kcm6TC33KD8wlsI8k=", 683 | "engines": { 684 | "node": "*" 685 | } 686 | }, 687 | "node_modules/proxy-addr": { 688 | "version": "2.0.6", 689 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", 690 | "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", 691 | "dependencies": { 692 | "forwarded": "~0.1.2", 693 | "ipaddr.js": "1.9.1" 694 | }, 695 | "engines": { 696 | "node": ">= 0.10" 697 | } 698 | }, 699 | "node_modules/psl": { 700 | "version": "1.8.0", 701 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", 702 | "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" 703 | }, 704 | "node_modules/punycode": { 705 | "version": "2.1.1", 706 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 707 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", 708 | "engines": { 709 | "node": ">=6" 710 | } 711 | }, 712 | "node_modules/qs": { 713 | "version": "6.5.2", 714 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", 715 | "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", 716 | "engines": { 717 | "node": ">=0.6" 718 | } 719 | }, 720 | "node_modules/range-parser": { 721 | "version": "1.2.1", 722 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 723 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", 724 | "engines": { 725 | "node": ">= 0.6" 726 | } 727 | }, 728 | "node_modules/raw-body": { 729 | "version": "2.4.0", 730 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", 731 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", 732 | "dependencies": { 733 | "bytes": "3.1.0", 734 | "http-errors": "1.7.2", 735 | "iconv-lite": "0.4.24", 736 | "unpipe": "1.0.0" 737 | }, 738 | "engines": { 739 | "node": ">= 0.8" 740 | } 741 | }, 742 | "node_modules/request": { 743 | "version": "2.88.2", 744 | "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", 745 | "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", 746 | "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", 747 | "dependencies": { 748 | "aws-sign2": "~0.7.0", 749 | "aws4": "^1.8.0", 750 | "caseless": "~0.12.0", 751 | "combined-stream": "~1.0.6", 752 | "extend": "~3.0.2", 753 | "forever-agent": "~0.6.1", 754 | "form-data": "~2.3.2", 755 | "har-validator": "~5.1.3", 756 | "http-signature": "~1.2.0", 757 | "is-typedarray": "~1.0.0", 758 | "isstream": "~0.1.2", 759 | "json-stringify-safe": "~5.0.1", 760 | "mime-types": "~2.1.19", 761 | "oauth-sign": "~0.9.0", 762 | "performance-now": "^2.1.0", 763 | "qs": "~6.5.2", 764 | "safe-buffer": "^5.1.2", 765 | "tough-cookie": "~2.5.0", 766 | "tunnel-agent": "^0.6.0", 767 | "uuid": "^3.3.2" 768 | }, 769 | "engines": { 770 | "node": ">= 6" 771 | } 772 | }, 773 | "node_modules/safe-buffer": { 774 | "version": "5.2.1", 775 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 776 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 777 | "funding": [ 778 | { 779 | "type": "github", 780 | "url": "https://github.com/sponsors/feross" 781 | }, 782 | { 783 | "type": "patreon", 784 | "url": "https://www.patreon.com/feross" 785 | }, 786 | { 787 | "type": "consulting", 788 | "url": "https://feross.org/support" 789 | } 790 | ] 791 | }, 792 | "node_modules/safer-buffer": { 793 | "version": "2.1.2", 794 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 795 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 796 | }, 797 | "node_modules/send": { 798 | "version": "0.17.1", 799 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", 800 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", 801 | "dependencies": { 802 | "debug": "2.6.9", 803 | "depd": "~1.1.2", 804 | "destroy": "~1.0.4", 805 | "encodeurl": "~1.0.2", 806 | "escape-html": "~1.0.3", 807 | "etag": "~1.8.1", 808 | "fresh": "0.5.2", 809 | "http-errors": "~1.7.2", 810 | "mime": "1.6.0", 811 | "ms": "2.1.1", 812 | "on-finished": "~2.3.0", 813 | "range-parser": "~1.2.1", 814 | "statuses": "~1.5.0" 815 | }, 816 | "engines": { 817 | "node": ">= 0.8.0" 818 | } 819 | }, 820 | "node_modules/send/node_modules/ms": { 821 | "version": "2.1.1", 822 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 823 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 824 | }, 825 | "node_modules/serve-static": { 826 | "version": "1.14.1", 827 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", 828 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", 829 | "dependencies": { 830 | "encodeurl": "~1.0.2", 831 | "escape-html": "~1.0.3", 832 | "parseurl": "~1.3.3", 833 | "send": "0.17.1" 834 | }, 835 | "engines": { 836 | "node": ">= 0.8.0" 837 | } 838 | }, 839 | "node_modules/setprototypeof": { 840 | "version": "1.1.1", 841 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 842 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 843 | }, 844 | "node_modules/sshpk": { 845 | "version": "1.16.1", 846 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", 847 | "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", 848 | "dependencies": { 849 | "asn1": "~0.2.3", 850 | "assert-plus": "^1.0.0", 851 | "bcrypt-pbkdf": "^1.0.0", 852 | "dashdash": "^1.12.0", 853 | "ecc-jsbn": "~0.1.1", 854 | "getpass": "^0.1.1", 855 | "jsbn": "~0.1.0", 856 | "safer-buffer": "^2.0.2", 857 | "tweetnacl": "~0.14.0" 858 | }, 859 | "bin": { 860 | "sshpk-conv": "bin/sshpk-conv", 861 | "sshpk-sign": "bin/sshpk-sign", 862 | "sshpk-verify": "bin/sshpk-verify" 863 | }, 864 | "engines": { 865 | "node": ">=0.10.0" 866 | } 867 | }, 868 | "node_modules/statuses": { 869 | "version": "1.5.0", 870 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 871 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", 872 | "engines": { 873 | "node": ">= 0.6" 874 | } 875 | }, 876 | "node_modules/to-utf8": { 877 | "version": "0.0.1", 878 | "resolved": "https://registry.npmjs.org/to-utf8/-/to-utf8-0.0.1.tgz", 879 | "integrity": "sha1-0Xrqcv8vujm55DYBvns/9y4ImFI=" 880 | }, 881 | "node_modules/toidentifier": { 882 | "version": "1.0.0", 883 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 884 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", 885 | "engines": { 886 | "node": ">=0.6" 887 | } 888 | }, 889 | "node_modules/tough-cookie": { 890 | "version": "2.5.0", 891 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", 892 | "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", 893 | "dependencies": { 894 | "psl": "^1.1.28", 895 | "punycode": "^2.1.1" 896 | }, 897 | "engines": { 898 | "node": ">=0.8" 899 | } 900 | }, 901 | "node_modules/tunnel-agent": { 902 | "version": "0.6.0", 903 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 904 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 905 | "dependencies": { 906 | "safe-buffer": "^5.0.1" 907 | }, 908 | "engines": { 909 | "node": "*" 910 | } 911 | }, 912 | "node_modules/tweetnacl": { 913 | "version": "0.14.5", 914 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 915 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" 916 | }, 917 | "node_modules/type-is": { 918 | "version": "1.6.18", 919 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 920 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 921 | "dependencies": { 922 | "media-typer": "0.3.0", 923 | "mime-types": "~2.1.24" 924 | }, 925 | "engines": { 926 | "node": ">= 0.6" 927 | } 928 | }, 929 | "node_modules/unpipe": { 930 | "version": "1.0.0", 931 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 932 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", 933 | "engines": { 934 | "node": ">= 0.8" 935 | } 936 | }, 937 | "node_modules/uri-js": { 938 | "version": "4.2.2", 939 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", 940 | "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", 941 | "dependencies": { 942 | "punycode": "^2.1.0" 943 | } 944 | }, 945 | "node_modules/utils-merge": { 946 | "version": "1.0.1", 947 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 948 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", 949 | "engines": { 950 | "node": ">= 0.4.0" 951 | } 952 | }, 953 | "node_modules/uuid": { 954 | "version": "3.4.0", 955 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", 956 | "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", 957 | "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", 958 | "bin": { 959 | "uuid": "bin/uuid" 960 | } 961 | }, 962 | "node_modules/vary": { 963 | "version": "1.1.2", 964 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 965 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", 966 | "engines": { 967 | "node": ">= 0.8" 968 | } 969 | }, 970 | "node_modules/verror": { 971 | "version": "1.10.0", 972 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", 973 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 974 | "engines": [ 975 | "node >=0.6.0" 976 | ], 977 | "dependencies": { 978 | "assert-plus": "^1.0.0", 979 | "core-util-is": "1.0.2", 980 | "extsprintf": "^1.2.0" 981 | } 982 | }, 983 | "node_modules/ws": { 984 | "version": "5.2.3", 985 | "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.3.tgz", 986 | "integrity": "sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA==", 987 | "dependencies": { 988 | "async-limiter": "~1.0.0" 989 | } 990 | } 991 | }, 992 | "dependencies": { 993 | "@ably/msgpack-js": { 994 | "version": "0.3.3", 995 | "resolved": "https://registry.npmjs.org/@ably/msgpack-js/-/msgpack-js-0.3.3.tgz", 996 | "integrity": "sha512-H7oWg97VyA1JhWUP7YN7zwp9W1ozCqMSsqCcXNz4XLmZNdJKT2ntF/6DPgbviFgUpShjQlbPC/iamisTjwLHdQ==", 997 | "requires": { 998 | "bops": "~0.0.6" 999 | } 1000 | }, 1001 | "ably": { 1002 | "version": "1.1.25", 1003 | "resolved": "https://registry.npmjs.org/ably/-/ably-1.1.25.tgz", 1004 | "integrity": "sha512-VGbV2Bsd0Glt0LwwzI39xZ4e9RdFZrFSOS3sKi/8+2ljb8LAujFG5Z6dJaOHPBjUohqj+Gtbv6rNQDrz4b7Ygw==", 1005 | "requires": { 1006 | "@ably/msgpack-js": "^0.3.3", 1007 | "request": "^2.87.0", 1008 | "ws": "^5.1" 1009 | } 1010 | }, 1011 | "accepts": { 1012 | "version": "1.3.7", 1013 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 1014 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 1015 | "requires": { 1016 | "mime-types": "~2.1.24", 1017 | "negotiator": "0.6.2" 1018 | } 1019 | }, 1020 | "ajv": { 1021 | "version": "6.12.6", 1022 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", 1023 | "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", 1024 | "requires": { 1025 | "fast-deep-equal": "^3.1.1", 1026 | "fast-json-stable-stringify": "^2.0.0", 1027 | "json-schema-traverse": "^0.4.1", 1028 | "uri-js": "^4.2.2" 1029 | } 1030 | }, 1031 | "array-flatten": { 1032 | "version": "1.1.1", 1033 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 1034 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 1035 | }, 1036 | "asn1": { 1037 | "version": "0.2.4", 1038 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", 1039 | "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", 1040 | "requires": { 1041 | "safer-buffer": "~2.1.0" 1042 | } 1043 | }, 1044 | "assert-plus": { 1045 | "version": "1.0.0", 1046 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 1047 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 1048 | }, 1049 | "async-limiter": { 1050 | "version": "1.0.1", 1051 | "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", 1052 | "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" 1053 | }, 1054 | "asynckit": { 1055 | "version": "0.4.0", 1056 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 1057 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 1058 | }, 1059 | "aws-sign2": { 1060 | "version": "0.7.0", 1061 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", 1062 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" 1063 | }, 1064 | "aws4": { 1065 | "version": "1.10.0", 1066 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", 1067 | "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==" 1068 | }, 1069 | "base64-js": { 1070 | "version": "0.0.2", 1071 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.2.tgz", 1072 | "integrity": "sha1-Ak8Pcq+iW3X5wO5zzU9V7Bvtl4Q=" 1073 | }, 1074 | "bcrypt-pbkdf": { 1075 | "version": "1.0.2", 1076 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", 1077 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", 1078 | "requires": { 1079 | "tweetnacl": "^0.14.3" 1080 | } 1081 | }, 1082 | "body-parser": { 1083 | "version": "1.19.0", 1084 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", 1085 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", 1086 | "requires": { 1087 | "bytes": "3.1.0", 1088 | "content-type": "~1.0.4", 1089 | "debug": "2.6.9", 1090 | "depd": "~1.1.2", 1091 | "http-errors": "1.7.2", 1092 | "iconv-lite": "0.4.24", 1093 | "on-finished": "~2.3.0", 1094 | "qs": "6.7.0", 1095 | "raw-body": "2.4.0", 1096 | "type-is": "~1.6.17" 1097 | }, 1098 | "dependencies": { 1099 | "qs": { 1100 | "version": "6.7.0", 1101 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 1102 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" 1103 | } 1104 | } 1105 | }, 1106 | "bops": { 1107 | "version": "0.0.7", 1108 | "resolved": "https://registry.npmjs.org/bops/-/bops-0.0.7.tgz", 1109 | "integrity": "sha1-tKClqDmkBkVK8P4FqLkaenZqVOI=", 1110 | "requires": { 1111 | "base64-js": "0.0.2", 1112 | "to-utf8": "0.0.1" 1113 | } 1114 | }, 1115 | "bytes": { 1116 | "version": "3.1.0", 1117 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 1118 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" 1119 | }, 1120 | "caseless": { 1121 | "version": "0.12.0", 1122 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", 1123 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 1124 | }, 1125 | "combined-stream": { 1126 | "version": "1.0.8", 1127 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 1128 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 1129 | "requires": { 1130 | "delayed-stream": "~1.0.0" 1131 | } 1132 | }, 1133 | "content-disposition": { 1134 | "version": "0.5.3", 1135 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 1136 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 1137 | "requires": { 1138 | "safe-buffer": "5.1.2" 1139 | }, 1140 | "dependencies": { 1141 | "safe-buffer": { 1142 | "version": "5.1.2", 1143 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1144 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 1145 | } 1146 | } 1147 | }, 1148 | "content-type": { 1149 | "version": "1.0.4", 1150 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 1151 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 1152 | }, 1153 | "cookie": { 1154 | "version": "0.4.0", 1155 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", 1156 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" 1157 | }, 1158 | "cookie-signature": { 1159 | "version": "1.0.6", 1160 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 1161 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 1162 | }, 1163 | "core-util-is": { 1164 | "version": "1.0.2", 1165 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 1166 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 1167 | }, 1168 | "dashdash": { 1169 | "version": "1.14.1", 1170 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", 1171 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 1172 | "requires": { 1173 | "assert-plus": "^1.0.0" 1174 | } 1175 | }, 1176 | "debug": { 1177 | "version": "2.6.9", 1178 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 1179 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 1180 | "requires": { 1181 | "ms": "2.0.0" 1182 | } 1183 | }, 1184 | "delayed-stream": { 1185 | "version": "1.0.0", 1186 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 1187 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 1188 | }, 1189 | "depd": { 1190 | "version": "1.1.2", 1191 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 1192 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 1193 | }, 1194 | "destroy": { 1195 | "version": "1.0.4", 1196 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 1197 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 1198 | }, 1199 | "dotenv": { 1200 | "version": "8.2.0", 1201 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", 1202 | "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" 1203 | }, 1204 | "ecc-jsbn": { 1205 | "version": "0.1.2", 1206 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", 1207 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", 1208 | "requires": { 1209 | "jsbn": "~0.1.0", 1210 | "safer-buffer": "^2.1.0" 1211 | } 1212 | }, 1213 | "ee-first": { 1214 | "version": "1.1.1", 1215 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 1216 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 1217 | }, 1218 | "encodeurl": { 1219 | "version": "1.0.2", 1220 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 1221 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 1222 | }, 1223 | "escape-html": { 1224 | "version": "1.0.3", 1225 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 1226 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 1227 | }, 1228 | "etag": { 1229 | "version": "1.8.1", 1230 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 1231 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 1232 | }, 1233 | "express": { 1234 | "version": "4.17.1", 1235 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", 1236 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", 1237 | "requires": { 1238 | "accepts": "~1.3.7", 1239 | "array-flatten": "1.1.1", 1240 | "body-parser": "1.19.0", 1241 | "content-disposition": "0.5.3", 1242 | "content-type": "~1.0.4", 1243 | "cookie": "0.4.0", 1244 | "cookie-signature": "1.0.6", 1245 | "debug": "2.6.9", 1246 | "depd": "~1.1.2", 1247 | "encodeurl": "~1.0.2", 1248 | "escape-html": "~1.0.3", 1249 | "etag": "~1.8.1", 1250 | "finalhandler": "~1.1.2", 1251 | "fresh": "0.5.2", 1252 | "merge-descriptors": "1.0.1", 1253 | "methods": "~1.1.2", 1254 | "on-finished": "~2.3.0", 1255 | "parseurl": "~1.3.3", 1256 | "path-to-regexp": "0.1.7", 1257 | "proxy-addr": "~2.0.5", 1258 | "qs": "6.7.0", 1259 | "range-parser": "~1.2.1", 1260 | "safe-buffer": "5.1.2", 1261 | "send": "0.17.1", 1262 | "serve-static": "1.14.1", 1263 | "setprototypeof": "1.1.1", 1264 | "statuses": "~1.5.0", 1265 | "type-is": "~1.6.18", 1266 | "utils-merge": "1.0.1", 1267 | "vary": "~1.1.2" 1268 | }, 1269 | "dependencies": { 1270 | "qs": { 1271 | "version": "6.7.0", 1272 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 1273 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" 1274 | }, 1275 | "safe-buffer": { 1276 | "version": "5.1.2", 1277 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1278 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 1279 | } 1280 | } 1281 | }, 1282 | "extend": { 1283 | "version": "3.0.2", 1284 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 1285 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 1286 | }, 1287 | "extsprintf": { 1288 | "version": "1.3.0", 1289 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", 1290 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" 1291 | }, 1292 | "fast-deep-equal": { 1293 | "version": "3.1.1", 1294 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", 1295 | "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==" 1296 | }, 1297 | "fast-json-stable-stringify": { 1298 | "version": "2.1.0", 1299 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 1300 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" 1301 | }, 1302 | "finalhandler": { 1303 | "version": "1.1.2", 1304 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", 1305 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", 1306 | "requires": { 1307 | "debug": "2.6.9", 1308 | "encodeurl": "~1.0.2", 1309 | "escape-html": "~1.0.3", 1310 | "on-finished": "~2.3.0", 1311 | "parseurl": "~1.3.3", 1312 | "statuses": "~1.5.0", 1313 | "unpipe": "~1.0.0" 1314 | } 1315 | }, 1316 | "forever-agent": { 1317 | "version": "0.6.1", 1318 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 1319 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 1320 | }, 1321 | "form-data": { 1322 | "version": "2.3.3", 1323 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", 1324 | "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", 1325 | "requires": { 1326 | "asynckit": "^0.4.0", 1327 | "combined-stream": "^1.0.6", 1328 | "mime-types": "^2.1.12" 1329 | } 1330 | }, 1331 | "forwarded": { 1332 | "version": "0.1.2", 1333 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 1334 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 1335 | }, 1336 | "fresh": { 1337 | "version": "0.5.2", 1338 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 1339 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 1340 | }, 1341 | "getpass": { 1342 | "version": "0.1.7", 1343 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 1344 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 1345 | "requires": { 1346 | "assert-plus": "^1.0.0" 1347 | } 1348 | }, 1349 | "har-schema": { 1350 | "version": "2.0.0", 1351 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", 1352 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" 1353 | }, 1354 | "har-validator": { 1355 | "version": "5.1.3", 1356 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", 1357 | "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", 1358 | "requires": { 1359 | "ajv": "^6.5.5", 1360 | "har-schema": "^2.0.0" 1361 | } 1362 | }, 1363 | "http-errors": { 1364 | "version": "1.7.2", 1365 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", 1366 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", 1367 | "requires": { 1368 | "depd": "~1.1.2", 1369 | "inherits": "2.0.3", 1370 | "setprototypeof": "1.1.1", 1371 | "statuses": ">= 1.5.0 < 2", 1372 | "toidentifier": "1.0.0" 1373 | } 1374 | }, 1375 | "http-signature": { 1376 | "version": "1.2.0", 1377 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", 1378 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 1379 | "requires": { 1380 | "assert-plus": "^1.0.0", 1381 | "jsprim": "^1.2.2", 1382 | "sshpk": "^1.7.0" 1383 | } 1384 | }, 1385 | "iconv-lite": { 1386 | "version": "0.4.24", 1387 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 1388 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 1389 | "requires": { 1390 | "safer-buffer": ">= 2.1.2 < 3" 1391 | } 1392 | }, 1393 | "inherits": { 1394 | "version": "2.0.3", 1395 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 1396 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 1397 | }, 1398 | "ipaddr.js": { 1399 | "version": "1.9.1", 1400 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 1401 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" 1402 | }, 1403 | "is-typedarray": { 1404 | "version": "1.0.0", 1405 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 1406 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 1407 | }, 1408 | "isstream": { 1409 | "version": "0.1.2", 1410 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 1411 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 1412 | }, 1413 | "jsbn": { 1414 | "version": "0.1.1", 1415 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 1416 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" 1417 | }, 1418 | "json-schema": { 1419 | "version": "0.2.3", 1420 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", 1421 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 1422 | }, 1423 | "json-schema-traverse": { 1424 | "version": "0.4.1", 1425 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 1426 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" 1427 | }, 1428 | "json-stringify-safe": { 1429 | "version": "5.0.1", 1430 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 1431 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 1432 | }, 1433 | "jsprim": { 1434 | "version": "1.4.1", 1435 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", 1436 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", 1437 | "requires": { 1438 | "assert-plus": "1.0.0", 1439 | "extsprintf": "1.3.0", 1440 | "json-schema": "0.2.3", 1441 | "verror": "1.10.0" 1442 | } 1443 | }, 1444 | "media-typer": { 1445 | "version": "0.3.0", 1446 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 1447 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 1448 | }, 1449 | "merge-descriptors": { 1450 | "version": "1.0.1", 1451 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 1452 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 1453 | }, 1454 | "methods": { 1455 | "version": "1.1.2", 1456 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 1457 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 1458 | }, 1459 | "mime": { 1460 | "version": "1.6.0", 1461 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 1462 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 1463 | }, 1464 | "mime-db": { 1465 | "version": "1.44.0", 1466 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", 1467 | "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" 1468 | }, 1469 | "mime-types": { 1470 | "version": "2.1.27", 1471 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", 1472 | "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", 1473 | "requires": { 1474 | "mime-db": "1.44.0" 1475 | } 1476 | }, 1477 | "ms": { 1478 | "version": "2.0.0", 1479 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 1480 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 1481 | }, 1482 | "negotiator": { 1483 | "version": "0.6.2", 1484 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 1485 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" 1486 | }, 1487 | "oauth-sign": { 1488 | "version": "0.9.0", 1489 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", 1490 | "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" 1491 | }, 1492 | "on-finished": { 1493 | "version": "2.3.0", 1494 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 1495 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 1496 | "requires": { 1497 | "ee-first": "1.1.1" 1498 | } 1499 | }, 1500 | "p2": { 1501 | "version": "0.7.1", 1502 | "resolved": "https://registry.npmjs.org/p2/-/p2-0.7.1.tgz", 1503 | "integrity": "sha1-JfJHTZvDptMUCh2iamfJ4RislUM=", 1504 | "requires": { 1505 | "poly-decomp": "0.1.1" 1506 | } 1507 | }, 1508 | "parseurl": { 1509 | "version": "1.3.3", 1510 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 1511 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 1512 | }, 1513 | "path-to-regexp": { 1514 | "version": "0.1.7", 1515 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 1516 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 1517 | }, 1518 | "performance-now": { 1519 | "version": "2.1.0", 1520 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", 1521 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 1522 | }, 1523 | "poly-decomp": { 1524 | "version": "0.1.1", 1525 | "resolved": "https://registry.npmjs.org/poly-decomp/-/poly-decomp-0.1.1.tgz", 1526 | "integrity": "sha1-n2jE+lWGY3kcm6TC33KD8wlsI8k=" 1527 | }, 1528 | "proxy-addr": { 1529 | "version": "2.0.6", 1530 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", 1531 | "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", 1532 | "requires": { 1533 | "forwarded": "~0.1.2", 1534 | "ipaddr.js": "1.9.1" 1535 | } 1536 | }, 1537 | "psl": { 1538 | "version": "1.8.0", 1539 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", 1540 | "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" 1541 | }, 1542 | "punycode": { 1543 | "version": "2.1.1", 1544 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 1545 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" 1546 | }, 1547 | "qs": { 1548 | "version": "6.5.2", 1549 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", 1550 | "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" 1551 | }, 1552 | "range-parser": { 1553 | "version": "1.2.1", 1554 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 1555 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" 1556 | }, 1557 | "raw-body": { 1558 | "version": "2.4.0", 1559 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", 1560 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", 1561 | "requires": { 1562 | "bytes": "3.1.0", 1563 | "http-errors": "1.7.2", 1564 | "iconv-lite": "0.4.24", 1565 | "unpipe": "1.0.0" 1566 | } 1567 | }, 1568 | "request": { 1569 | "version": "2.88.2", 1570 | "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", 1571 | "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", 1572 | "requires": { 1573 | "aws-sign2": "~0.7.0", 1574 | "aws4": "^1.8.0", 1575 | "caseless": "~0.12.0", 1576 | "combined-stream": "~1.0.6", 1577 | "extend": "~3.0.2", 1578 | "forever-agent": "~0.6.1", 1579 | "form-data": "~2.3.2", 1580 | "har-validator": "~5.1.3", 1581 | "http-signature": "~1.2.0", 1582 | "is-typedarray": "~1.0.0", 1583 | "isstream": "~0.1.2", 1584 | "json-stringify-safe": "~5.0.1", 1585 | "mime-types": "~2.1.19", 1586 | "oauth-sign": "~0.9.0", 1587 | "performance-now": "^2.1.0", 1588 | "qs": "~6.5.2", 1589 | "safe-buffer": "^5.1.2", 1590 | "tough-cookie": "~2.5.0", 1591 | "tunnel-agent": "^0.6.0", 1592 | "uuid": "^3.3.2" 1593 | } 1594 | }, 1595 | "safe-buffer": { 1596 | "version": "5.2.1", 1597 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 1598 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 1599 | }, 1600 | "safer-buffer": { 1601 | "version": "2.1.2", 1602 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1603 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 1604 | }, 1605 | "send": { 1606 | "version": "0.17.1", 1607 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", 1608 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", 1609 | "requires": { 1610 | "debug": "2.6.9", 1611 | "depd": "~1.1.2", 1612 | "destroy": "~1.0.4", 1613 | "encodeurl": "~1.0.2", 1614 | "escape-html": "~1.0.3", 1615 | "etag": "~1.8.1", 1616 | "fresh": "0.5.2", 1617 | "http-errors": "~1.7.2", 1618 | "mime": "1.6.0", 1619 | "ms": "2.1.1", 1620 | "on-finished": "~2.3.0", 1621 | "range-parser": "~1.2.1", 1622 | "statuses": "~1.5.0" 1623 | }, 1624 | "dependencies": { 1625 | "ms": { 1626 | "version": "2.1.1", 1627 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 1628 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 1629 | } 1630 | } 1631 | }, 1632 | "serve-static": { 1633 | "version": "1.14.1", 1634 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", 1635 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", 1636 | "requires": { 1637 | "encodeurl": "~1.0.2", 1638 | "escape-html": "~1.0.3", 1639 | "parseurl": "~1.3.3", 1640 | "send": "0.17.1" 1641 | } 1642 | }, 1643 | "setprototypeof": { 1644 | "version": "1.1.1", 1645 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 1646 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 1647 | }, 1648 | "sshpk": { 1649 | "version": "1.16.1", 1650 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", 1651 | "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", 1652 | "requires": { 1653 | "asn1": "~0.2.3", 1654 | "assert-plus": "^1.0.0", 1655 | "bcrypt-pbkdf": "^1.0.0", 1656 | "dashdash": "^1.12.0", 1657 | "ecc-jsbn": "~0.1.1", 1658 | "getpass": "^0.1.1", 1659 | "jsbn": "~0.1.0", 1660 | "safer-buffer": "^2.0.2", 1661 | "tweetnacl": "~0.14.0" 1662 | } 1663 | }, 1664 | "statuses": { 1665 | "version": "1.5.0", 1666 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 1667 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 1668 | }, 1669 | "to-utf8": { 1670 | "version": "0.0.1", 1671 | "resolved": "https://registry.npmjs.org/to-utf8/-/to-utf8-0.0.1.tgz", 1672 | "integrity": "sha1-0Xrqcv8vujm55DYBvns/9y4ImFI=" 1673 | }, 1674 | "toidentifier": { 1675 | "version": "1.0.0", 1676 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 1677 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 1678 | }, 1679 | "tough-cookie": { 1680 | "version": "2.5.0", 1681 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", 1682 | "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", 1683 | "requires": { 1684 | "psl": "^1.1.28", 1685 | "punycode": "^2.1.1" 1686 | } 1687 | }, 1688 | "tunnel-agent": { 1689 | "version": "0.6.0", 1690 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 1691 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 1692 | "requires": { 1693 | "safe-buffer": "^5.0.1" 1694 | } 1695 | }, 1696 | "tweetnacl": { 1697 | "version": "0.14.5", 1698 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 1699 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" 1700 | }, 1701 | "type-is": { 1702 | "version": "1.6.18", 1703 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 1704 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 1705 | "requires": { 1706 | "media-typer": "0.3.0", 1707 | "mime-types": "~2.1.24" 1708 | } 1709 | }, 1710 | "unpipe": { 1711 | "version": "1.0.0", 1712 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1713 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 1714 | }, 1715 | "uri-js": { 1716 | "version": "4.2.2", 1717 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", 1718 | "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", 1719 | "requires": { 1720 | "punycode": "^2.1.0" 1721 | } 1722 | }, 1723 | "utils-merge": { 1724 | "version": "1.0.1", 1725 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1726 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 1727 | }, 1728 | "uuid": { 1729 | "version": "3.4.0", 1730 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", 1731 | "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" 1732 | }, 1733 | "vary": { 1734 | "version": "1.1.2", 1735 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1736 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 1737 | }, 1738 | "verror": { 1739 | "version": "1.10.0", 1740 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", 1741 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 1742 | "requires": { 1743 | "assert-plus": "^1.0.0", 1744 | "core-util-is": "1.0.2", 1745 | "extsprintf": "^1.2.0" 1746 | } 1747 | }, 1748 | "ws": { 1749 | "version": "5.2.3", 1750 | "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.3.tgz", 1751 | "integrity": "sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA==", 1752 | "requires": { 1753 | "async-limiter": "~1.0.0" 1754 | } 1755 | } 1756 | } 1757 | } 1758 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "//1": "describes your app and its dependencies", 3 | "//2": "https://docs.npmjs.com/files/package.json", 4 | "//3": "updating this file will download and update your packages", 5 | "name": "hello-express", 6 | "version": "0.0.1", 7 | "description": "A simple Node app built on Express, instantly up and running.", 8 | "main": "server.js", 9 | "scripts": { 10 | "start": "node server.js" 11 | }, 12 | "dependencies": { 13 | "ably": "^1.1.25", 14 | "dotenv": "^8.2.0", 15 | "express": "^4.17.1", 16 | "p2": "^0.7.1" 17 | }, 18 | "engines": { 19 | "node": "12.x" 20 | }, 21 | "repository": { 22 | "url": "https://glitch.com/edit/#!/hello-express" 23 | }, 24 | "license": "MIT", 25 | "keywords": [ 26 | "node", 27 | "glitch", 28 | "express" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /public/explosion.js: -------------------------------------------------------------------------------- 1 | class Explosion extends Phaser.GameObjects.Sprite { 2 | constructor(scene, x, y) { 3 | super(scene, x, y, "explosion"); 4 | scene.add.existing(this); 5 | this.play("explode"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /public/gameover.js: -------------------------------------------------------------------------------- 1 | let winner = localStorage.getItem("winner"); 2 | let firstRunnerUp = localStorage.getItem("firstRunnerUp"); 3 | let secondRunnerUp = localStorage.getItem("secondRunnerUp"); 4 | let totalPlayers = localStorage.getItem("totalPlayers"); 5 | 6 | document.getElementById("winner-announcement").innerHTML = 7 | winner + " won the game!"; 8 | 9 | if (firstRunnerUp) { 10 | document.getElementById("first-runnerup").innerHTML = 11 | firstRunnerUp + " got the highest score"; 12 | } 13 | if (secondRunnerUp) { 14 | document.getElementById("second-runnerup").innerHTML = 15 | secondRunnerUp + " got the next highest score"; 16 | } 17 | -------------------------------------------------------------------------------- /public/intro.js: -------------------------------------------------------------------------------- 1 | let nickname = ""; 2 | let roomCode = ""; 3 | 4 | function hostNewGame() { 5 | localStorage.clear(); 6 | let nicknameInput = document.getElementById("create-nickname"); 7 | nickname = nicknameInput.value; 8 | roomCode = getRandomRoomId(); 9 | localStorage.setItem("isHost", true); 10 | localStorage.setItem("nickname", nickname); 11 | localStorage.setItem("roomCode", roomCode); 12 | window.location.replace("/gameplay?roomCode=" + roomCode + "&isHost=true"); 13 | } 14 | 15 | function joinRoom() { 16 | localStorage.clear(); 17 | let nicknameInput = document.getElementById("join-nickname"); 18 | nickname = nicknameInput.value; 19 | roomCode = document.getElementById("join-room-code").value; 20 | localStorage.setItem("isHost", false); 21 | localStorage.setItem("nickname", nickname); 22 | localStorage.setItem("roomCode", roomCode); 23 | window.location.replace("/gameplay?roomCode=" + roomCode + "&isHost=false"); 24 | } 25 | 26 | function getRandomRoomId() { 27 | return "room-" + Math.random().toString(36).substr(2, 8); 28 | } 29 | -------------------------------------------------------------------------------- /public/invader.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/script.js: -------------------------------------------------------------------------------- 1 | let globalChannel; 2 | let myClientId; 3 | let myChannel; 4 | let myChannelName; 5 | let gameOn = false; 6 | let players = {}; 7 | let totalPlayers = 0; 8 | let latestShipPosition; 9 | let bulletThatShotMe; 10 | let bulletThatShotSomeone; 11 | let bulletOutOfBounds = ""; 12 | let amIalive = false; 13 | let game; 14 | let myGameRoomName; 15 | let myGameRoomCh; 16 | 17 | const myNickname = localStorage.getItem("nickname"); 18 | const myGameRoomCode = localStorage.getItem("roomCode"); 19 | const amIHost = localStorage.getItem("isHost"); 20 | const startGameBtn = document.getElementById("btn-startgame"); 21 | const audioControlChkbox = document.getElementById("audio-chkbox"); 22 | 23 | document.getElementById("room-code").innerHTML = 24 | "Other players can join using the code: " + myGameRoomCode; 25 | 26 | // connect to Ably 27 | const realtime = new Ably.Realtime({ 28 | authUrl: "/auth", 29 | }); 30 | 31 | //show modal 32 | if (amIHost == "true") { 33 | document.querySelector(".bg-modal").style.display = "flex"; 34 | document.getElementById("game-link").innerHTML = 35 | "Invite your friends to join using the code:
" + myGameRoomCode; 36 | document.querySelector(".close").addEventListener("click", () => { 37 | document.querySelector(".bg-modal").style.display = "none"; 38 | }); 39 | } 40 | 41 | function copyGameCode() { 42 | navigator.clipboard.writeText(myGameRoomCode); 43 | let copyButton = document.getElementById("copy-button"); 44 | copyButton.style.backgroundColor = "white"; 45 | copyButton.style.color = "black"; 46 | copyButton.style.border = "2px solid black"; 47 | copyButton.innerHTML = "Copied!"; 48 | } 49 | 50 | // once connected to Ably, instantiate channels and launch the game 51 | realtime.connection.once("connected", () => { 52 | myClientId = realtime.auth.clientId; 53 | myGameRoomName = myGameRoomCode + ":primary"; 54 | myChannelName = myGameRoomCode + ":clientChannel-" + myClientId; 55 | myGameRoomCh = realtime.channels.get(myGameRoomName); 56 | myChannel = realtime.channels.get(myChannelName); 57 | 58 | if (amIHost == "true") { 59 | const globalGameName = "main-game-thread"; 60 | globalChannel = realtime.channels.get(globalGameName); 61 | myGameRoomCh.subscribe("thread-ready", (msg) => { 62 | myGameRoomCh.presence.enter({ 63 | nickname: myNickname, 64 | isHost: amIHost, 65 | }); 66 | }); 67 | globalChannel.presence.enter({ 68 | nickname: myNickname, 69 | roomCode: myGameRoomCode, 70 | isHost: amIHost, 71 | }); 72 | startGameBtn.style.display = "inline-block"; 73 | } else if (amIHost != "true") { 74 | myGameRoomCh.presence.enter({ 75 | nickname: myNickname, 76 | isHost: amIHost, 77 | }); 78 | startGameBtn.style.display = "none"; 79 | } 80 | game = new Phaser.Game(config); 81 | }); 82 | 83 | function startGame() { 84 | myChannel.publish("start-game", { 85 | start: true, 86 | }); 87 | } 88 | 89 | // primary game scene 90 | class GameScene extends Phaser.Scene { 91 | constructor() { 92 | super("gameScene"); 93 | } 94 | 95 | preload() { 96 | this.load.spritesheet( 97 | "avatarAanimated", 98 | "https://cdn.glitch.com/c0cf9403-8071-4ec0-afd7-8a5293120d79%2FavatarAanimated.png?v=1592436546438", 99 | { 100 | frameWidth: 48, 101 | frameHeight: 32, 102 | } 103 | ); 104 | this.load.spritesheet( 105 | "avatarBanimated", 106 | "https://cdn.glitch.com/c0cf9403-8071-4ec0-afd7-8a5293120d79%2FavatarBanimated.png?v=1592436575703", 107 | { 108 | frameWidth: 48, 109 | frameHeight: 32, 110 | } 111 | ); 112 | this.load.spritesheet( 113 | "avatarCanimated", 114 | "https://cdn.glitch.com/c0cf9403-8071-4ec0-afd7-8a5293120d79%2FavatarCanimated.png?v=1592436609339", 115 | { 116 | frameWidth: 48, 117 | frameHeight: 32, 118 | } 119 | ); 120 | this.load.spritesheet( 121 | "ship", 122 | "https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2FShip%402x.png?v=1589228730678", 123 | { 124 | frameWidth: 60, 125 | frameHeight: 32, 126 | } 127 | ); 128 | this.load.spritesheet( 129 | "bullet", 130 | "https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2Fbullet.png?v=1589229887570", 131 | { 132 | frameWidth: 48, 133 | frameHeight: 48, 134 | } 135 | ); 136 | this.load.spritesheet( 137 | "explosion", 138 | "https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2Fexplosion57%20(2).png?v=1589491279459", 139 | { 140 | frameWidth: 48, 141 | frameHeight: 48, 142 | } 143 | ); 144 | this.load.audio( 145 | "move1", 146 | "https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2Ffastinvader1.mp3?v=1589983955301" 147 | ); 148 | this.load.audio( 149 | "move2", 150 | "https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2Ffastinvader2.mp3?v=1589983959381" 151 | ); 152 | this.load.audio( 153 | "move3", 154 | "https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2Ffastinvader3.mp3?v=1589983969580" 155 | ); 156 | this.load.audio( 157 | "move4", 158 | "https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2Ffastinvader4.mp3?v=1589983973991" 159 | ); 160 | this.load.audio( 161 | "myDeath", 162 | "https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2Fexplosion.mp3?v=1589984025058" 163 | ); 164 | this.load.audio( 165 | "opponentDeath", 166 | "https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2Finvaderkilled.mp3?v=1589983981160" 167 | ); 168 | this.load.audio( 169 | "shoot", 170 | "https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2Fshoot.mp3?v=1589983990745" 171 | ); 172 | } 173 | create() { 174 | this.avatars = {}; 175 | this.visibleBullets = {}; 176 | this.ship = {}; 177 | this.cursorKeys = this.input.keyboard.createCursorKeys(); 178 | 179 | // explode animation to play when a bullet hits an avatar 180 | this.anims.create({ 181 | key: "explode", 182 | frames: this.anims.generateFrameNumbers("explosion"), 183 | frameRate: 20, 184 | repeat: 0, 185 | hideOnComplete: true, 186 | }); 187 | 188 | this.anims.create({ 189 | key: "animateA", 190 | frames: this.anims.generateFrameNumbers("avatarAanimated"), 191 | frameRate: 2, 192 | repeat: -1, 193 | }); 194 | 195 | this.anims.create({ 196 | key: "animateB", 197 | frames: this.anims.generateFrameNumbers("avatarBanimated"), 198 | frameRate: 2, 199 | repeat: -1, 200 | }); 201 | 202 | this.anims.create({ 203 | key: "animateC", 204 | frames: this.anims.generateFrameNumbers("avatarCanimated"), 205 | frameRate: 2, 206 | repeat: -1, 207 | }); 208 | 209 | this.soundLoop = 0; 210 | this.shootSound = this.sound.add("shoot"); 211 | this.move1 = this.sound.add("move1"); 212 | this.move2 = this.sound.add("move2"); 213 | this.move3 = this.sound.add("move3"); 214 | this.move4 = this.sound.add("move4"); 215 | this.myDeathSound = this.sound.add("myDeath"); 216 | this.opponentDeathSound = this.sound.add("opponentDeath"); 217 | this.movingSounds = [this.move1, this.move2, this.move3, this.move4]; 218 | 219 | setInterval(() => { 220 | if (audioControlChkbox.checked === true) { 221 | this.movingSounds[this.soundLoop].play(); 222 | this.soundLoop++; 223 | if (this.soundLoop == 4) { 224 | this.soundLoop = 0; 225 | } 226 | } 227 | }, 500); 228 | 229 | // subscribe to the game tick 230 | myGameRoomCh.subscribe("game-state", (msg) => { 231 | if (msg.data.gameOn) { 232 | gameOn = true; 233 | if (msg.data.shipBody["0"]) { 234 | latestShipPosition = msg.data.shipBody["0"]; 235 | } 236 | if (msg.data.bulletOrBlank != "") { 237 | let bulletId = msg.data.bulletOrBlank.id; 238 | this.visibleBullets[bulletId] = { 239 | id: bulletId, 240 | y: msg.data.bulletOrBlank.y, 241 | toLaunch: true, 242 | bulletSprite: "", 243 | }; 244 | } 245 | if (msg.data.killerBulletId) { 246 | bulletThatShotSomeone = msg.data.killerBulletId; 247 | } 248 | } 249 | players = msg.data.players; 250 | totalPlayers = msg.data.playerCount; 251 | }); 252 | 253 | // subscribe to the game over event and switch to a new page 254 | myGameRoomCh.subscribe("game-over", (msg) => { 255 | gameOn = false; 256 | localStorage.setItem("totalPlayers", msg.data.totalPlayers); 257 | localStorage.setItem("winner", msg.data.winner); 258 | localStorage.setItem("firstRunnerUp", msg.data.firstRunnerUp); 259 | localStorage.setItem("secondRunnerUp", msg.data.secondRunnerUp); 260 | myGameRoomCh.detach(); 261 | myChannel.detach(); 262 | if (msg.data.winner == "Nobody") { 263 | window.location.replace("/gameover"); 264 | } else { 265 | window.location.replace("/winner"); 266 | } 267 | }); 268 | } 269 | 270 | update() { 271 | if (gameOn) { 272 | // create and update the position of the ship 273 | if (this.ship.x) { 274 | this.ship.x = latestShipPosition; 275 | } else { 276 | this.ship = this.physics.add 277 | .sprite(latestShipPosition, config.scale.height - 32, "ship") 278 | .setOrigin(0.5, 0.5); 279 | 280 | this.ship.x = latestShipPosition; 281 | } 282 | // create and update the position of the bullets 283 | for (let item in this.visibleBullets) { 284 | if (this.visibleBullets[item].toLaunch) { 285 | this.visibleBullets[item].toLaunch = false; 286 | this.createBullet(this.visibleBullets[item]); 287 | } else { 288 | this.visibleBullets[item].bulletSprite.y -= 20; 289 | if ( 290 | this.visibleBullets[item].bulletSprite.y < 0 || 291 | this.visibleBullets[item].id == bulletThatShotSomeone 292 | ) { 293 | this.visibleBullets[item].bulletSprite.destroy(); 294 | delete this.visibleBullets[item]; 295 | } 296 | } 297 | } 298 | } 299 | 300 | // remove avatars of players that have left the game 301 | for (let item in this.avatars) { 302 | if (!players[item]) { 303 | this.avatars[item].destroy(); 304 | delete this.avatars[item]; 305 | } 306 | } 307 | 308 | // create and update avatars and scores of all the players 309 | for (let item in players) { 310 | let avatarId = players[item].id; 311 | if (this.avatars[avatarId] && players[item].isAlive) { 312 | this.avatars[avatarId].x = players[item].x; 313 | this.avatars[avatarId].y = players[item].y; 314 | if (avatarId == myClientId) { 315 | document.getElementById("score").innerHTML = 316 | "Score: " + players[item].score; 317 | } 318 | } else if (!this.avatars[avatarId] && players[item].isAlive) { 319 | if (players[item].id != myClientId) { 320 | let avatarName = 321 | "avatar" + players[item].invaderAvatarType + "animated"; 322 | this.avatars[avatarId] = this.physics.add 323 | .sprite(players[item].x, players[item].y, avatarName) 324 | .setOrigin(0.5, 0.5) 325 | .setTintFill(players[item].invaderAvatarColor.toString()); 326 | console.log(players[item].invaderAvatarColor); 327 | this.avatars[avatarId].play( 328 | "animate" + players[item].invaderAvatarType 329 | ); 330 | this.avatars[avatarId].setCollideWorldBounds(true); 331 | document.getElementById("join-leave-updates").innerHTML = 332 | players[avatarId].nickname + " joined"; 333 | setTimeout(() => { 334 | document.getElementById("join-leave-updates").innerHTML = ""; 335 | }, 2000); 336 | } else if (players[item].id == myClientId) { 337 | let avatarName = 338 | "avatar" + players[item].invaderAvatarType + "animated"; 339 | this.avatars[avatarId] = this.physics.add 340 | .sprite(players[item].x, players[item].y, avatarName) 341 | .setOrigin(0.5, 0.5); 342 | this.avatars[avatarId].play( 343 | "animate" + players[item].invaderAvatarType 344 | ); 345 | this.avatars[avatarId].setCollideWorldBounds(true); 346 | amIalive = true; 347 | } 348 | } else if (this.avatars[avatarId] && !players[item].isAlive) { 349 | this.explodeAndKill(avatarId); 350 | } 351 | } 352 | 353 | // check for user input 354 | this.publishMyInput(); 355 | } 356 | 357 | // play the explosion animation and destroy the avatar 358 | explodeAndKill(deadPlayerId) { 359 | this.avatars[deadPlayerId].disableBody(true, true); 360 | if (deadPlayerId == myClientId) { 361 | if (audioControlChkbox.checked === true) { 362 | this.myDeathSound.play(); 363 | } 364 | } else { 365 | if (audioControlChkbox.checked === true) { 366 | this.opponentDeathSound.play(); 367 | } 368 | } 369 | let explosion = new Explosion( 370 | this, 371 | this.avatars[deadPlayerId].x, 372 | this.avatars[deadPlayerId].y 373 | ); 374 | delete this.avatars[deadPlayerId]; 375 | document.getElementById("join-leave-updates").innerHTML = 376 | players[deadPlayerId].nickname + " died"; 377 | setTimeout(() => { 378 | document.getElementById("join-leave-updates").innerHTML = ""; 379 | }, 2000); 380 | } 381 | 382 | // publish user input to the game server 383 | publishMyInput() { 384 | if (Phaser.Input.Keyboard.JustDown(this.cursorKeys.left) && amIalive) { 385 | myChannel.publish("pos", { 386 | keyPressed: "left", 387 | }); 388 | } else if ( 389 | Phaser.Input.Keyboard.JustDown(this.cursorKeys.right) && 390 | amIalive 391 | ) { 392 | myChannel.publish("pos", { 393 | keyPressed: "right", 394 | }); 395 | } 396 | } 397 | 398 | // create a new bullet sprite 399 | createBullet(bulletObject) { 400 | let bulletId = bulletObject.id; 401 | this.visibleBullets[bulletId].bulletSprite = this.physics.add 402 | .sprite(this.ship.x + 23, bulletObject.y, "bullet") 403 | .setOrigin(0.5, 0.5); 404 | if (audioControlChkbox.checked === true) { 405 | this.shootSound.play(); 406 | } 407 | // add an overlap callback if the current player is still alive 408 | if (amIalive) { 409 | if ( 410 | this.physics.add.overlap( 411 | this.visibleBullets[bulletId].bulletSprite, 412 | this.avatars[myClientId], 413 | this.publishMyDeathNews, 414 | null, 415 | this 416 | ) 417 | ) { 418 | bulletThatShotMe = bulletId; 419 | } 420 | } 421 | } 422 | 423 | // publish an eventto the server if the current player is hit 424 | publishMyDeathNews(bullet, avatar) { 425 | if (amIalive) { 426 | myChannel.publish("dead-notif", { 427 | killerBulletId: bulletThatShotMe, 428 | deadPlayerId: myClientId, 429 | }); 430 | } 431 | amIalive = false; 432 | } 433 | } 434 | 435 | //game configuration 436 | const config = { 437 | type: Phaser.AUTO, 438 | backgroundColor: "#FFFFF", 439 | scale: { 440 | parent: "gameContainer", 441 | mode: Phaser.Scale.FIT, 442 | autoCenter: Phaser.Scale.CENTER_BOTH, 443 | width: 1400, 444 | height: 700, 445 | }, 446 | //canvasStyle: "border:1px solid #ffffff;", 447 | scene: [GameScene], 448 | physics: { 449 | default: "arcade", 450 | arcade: { 451 | debug: false, 452 | }, 453 | }, 454 | 455 | }; 456 | -------------------------------------------------------------------------------- /public/space-invaders-hero.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | -------------------------------------------------------------------------------- /public/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 10px; 4 | } 5 | 6 | * { 7 | box-sizing: border-box; 8 | } 9 | 10 | input { 11 | height: 40px; 12 | display: block; 13 | margin: 0; 14 | padding: 5px 10px; 15 | border: 0; 16 | border-right: 1px solid silver; 17 | border-radius: 0; 18 | font-size: 16px; 19 | } 20 | 21 | .intro-body { 22 | font-family: "VT323"; 23 | font-size: 22px; 24 | text-align: center; 25 | color: #fff; 26 | background-color: black; 27 | background-image: url("https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2FScreenshot%202020-05-19%20at%2013.36.26.png?v=1589892011044"); 28 | } 29 | 30 | .intro-img { 31 | width: 80%; 32 | max-width: 800px; 33 | } 34 | 35 | .room-full-body { 36 | font-family: "VT323"; 37 | font-size: 52px; 38 | text-align: center; 39 | color: #fff; 40 | background-color: black; 41 | background-image: url("https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2FScreenshot%202020-05-19%20at%2013.36.26.png?v=1589892011044"); 42 | } 43 | 44 | .index-body { 45 | font-family: "VT323"; 46 | font-size: 22px; 47 | color: #fff; 48 | background-color: black; 49 | } 50 | 51 | .game-text { 52 | max-width: 700px; 53 | margin-left: auto; 54 | margin-right: auto; 55 | } 56 | 57 | .game-instructions { 58 | width: 80%; 59 | margin: 20px auto; 60 | padding-top: 20px; 61 | font-size: 30px; 62 | } 63 | 64 | .create-room { 65 | width: 60%; 66 | margin: 0 auto; 67 | padding: 10px 0; 68 | text-align: center; 69 | display: inline-block; 70 | } 71 | 72 | .button-center { 73 | display: inline-block; 74 | } 75 | 76 | .text-center { 77 | text-align: center; 78 | } 79 | 80 | .room-input { 81 | display: flex; 82 | justify-content: center; 83 | align-items: center; 84 | width: 70%; 85 | margin: 0 auto; 86 | padding: 10px 0; 87 | } 88 | 89 | .nickname { 90 | width: 30%; 91 | min-width: 300px; 92 | margin: 30px auto 10px; 93 | text-align: center; 94 | } 95 | 96 | #score { 97 | width: 100px; 98 | margin-right: 10px; 99 | } 100 | 101 | #room-code { 102 | width: 480px; 103 | } 104 | 105 | #deaths { 106 | margin-left: auto; 107 | text-align: right; 108 | } 109 | 110 | .game-area { 111 | display: flex; 112 | justify-content: space-between; 113 | } 114 | 115 | .game-div { 116 | margin: 20px; 117 | max-width: 1200px; 118 | text-align: center; 119 | } 120 | 121 | .game-div-container { 122 | text-align: center; 123 | display: block; 124 | } 125 | 126 | .game-headline-left { 127 | float: left; 128 | } 129 | 130 | .game-headline-right { 131 | float: right; 132 | } 133 | 134 | .winner-body { 135 | font-family: "VT323"; 136 | font-size: 62px; 137 | text-align: center; 138 | color: #fff; 139 | background-color: black; 140 | background-image: url("https://cdn.glitch.com/f66772e3-bbf6-4f6d-b5d5-94559e3c1c6f%2FScreenshot%202020-05-19%20at%2013.36.26.png?v=1589892011044"); 141 | } 142 | 143 | .winner-div { 144 | width: 80%; 145 | margin: 0 auto; 146 | padding-top: 20px; 147 | font-size: 82px; 148 | } 149 | 150 | .winner-text { 151 | text-transform: uppercase; 152 | } 153 | 154 | .runner-ups-div { 155 | width: 80%; 156 | margin: 0 auto; 157 | padding-top: 20px; 158 | font-size: 42px; 159 | } 160 | 161 | .bg-modal { 162 | display: none; 163 | position: absolute; 164 | top: 0; 165 | justify-content: center; 166 | align-items: center; 167 | width: 100%; 168 | height: 100%; 169 | color: #fff; 170 | background-color: rgba(0, 0, 0, 0.7); 171 | } 172 | 173 | .modal-content { 174 | position: relative; 175 | width: 500px; 176 | height: 300px; 177 | padding: 20px; 178 | border: 5px solid white; 179 | border-radius: 4px; 180 | text-align: center; 181 | } 182 | 183 | .button { 184 | display: inline-block; 185 | margin-top: 10px; 186 | padding: 10px 28px; 187 | border: 2px solid white; 188 | border-radius: 10px; 189 | text-decoration: none; 190 | font-size: 16px; 191 | font-family: "VT323"; 192 | color: white; 193 | background-color: #000; 194 | } 195 | 196 | .button:hover { 197 | border: 2px solid black; 198 | color: #000; 199 | background-color: white; 200 | } 201 | 202 | .button:active { 203 | border: 2px solid black; 204 | color: #000; 205 | background-color: white; 206 | } 207 | 208 | label { 209 | display: block; 210 | margin: 15px auto; 211 | } 212 | 213 | .close { 214 | position: absolute; 215 | top: 0; 216 | right: 14px; 217 | font-size: 42px; 218 | cursor: pointer; 219 | } 220 | 221 | .text-group { 222 | border: none; 223 | color: white; 224 | background-color: black; 225 | } 226 | 227 | .input-button { 228 | flex-shrink: 0; 229 | width: max-content; 230 | height: 40px; 231 | padding: 0 20px; 232 | border: 0; 233 | color: var(--gray); 234 | font-weight: 400; 235 | font-size: 1rem; 236 | text-transform: uppercase; 237 | } 238 | 239 | .input-button:hover { 240 | color: white; 241 | background-color: var(--gray); 242 | } 243 | 244 | .room-input-text { 245 | margin: 0 10px; 246 | } 247 | 248 | .room-code { 249 | min-width: 300px; 250 | } 251 | 252 | .img-invaders { 253 | width: 60%; 254 | } 255 | 256 | .copy { 257 | width: 60px; 258 | height: 60px; 259 | } 260 | 261 | .audio-control { 262 | display: flex; 263 | width: 100px; 264 | margin-right: 10px; 265 | } 266 | 267 | .audio-label { 268 | margin: 0 15px; 269 | } 270 | 271 | .audio-chkbox { 272 | padding: 0; 273 | height: 25px; 274 | } 275 | 276 | /*======================*/ 277 | 278 | .game-card { 279 | margin: 10px 50px; 280 | padding: 50px; 281 | background-image: url("https://user-images.githubusercontent.com/5900152/90127067-85382380-dd5c-11ea-87b1-4946c0df92d8.jpg"); 282 | } 283 | 284 | .info-bar { 285 | display: flex; 286 | padding: 10px 50px; 287 | justify-content: space-evenly; 288 | } 289 | 290 | .start-btn-div { 291 | text-align: center; 292 | font-family: inherit; 293 | } 294 | 295 | .start-info-card { 296 | width: 50%; 297 | margin: 20px; 298 | } 299 | 300 | .nav-tabs { 301 | justify-content: center; 302 | } 303 | 304 | .input-box { 305 | text-align: center; 306 | } 307 | 308 | .create-wait-msg { 309 | display: none; 310 | 311 | } -------------------------------------------------------------------------------- /public/winner.js: -------------------------------------------------------------------------------- 1 | let winner = localStorage.getItem("winner"); 2 | let firstRunnerUp = localStorage.getItem("firstRunnerUp"); 3 | let secondRunnerUp = localStorage.getItem("secondRunnerUp"); 4 | let totalPlayers = localStorage.getItem("totalPlayers"); 5 | 6 | document.getElementById("winner-announcement").innerHTML = 7 | winner + " won the game!"; 8 | 9 | if (firstRunnerUp) { 10 | document.getElementById("first-runnerup").innerHTML = 11 | firstRunnerUp + " is the first runner up"; 12 | } 13 | if (secondRunnerUp) { 14 | document.getElementById("second-runnerup").innerHTML = 15 | secondRunnerUp + " is the second runner up"; 16 | } 17 | -------------------------------------------------------------------------------- /server-worker.js: -------------------------------------------------------------------------------- 1 | const { 2 | Worker, 3 | isMainThread, 4 | parentPort, 5 | threadId, 6 | workerData, 7 | } = require("worker_threads"); 8 | const envConfig = require("dotenv").config(); 9 | const Ably = require("ably"); 10 | const p2 = require("p2"); 11 | 12 | const ABLY_API_KEY = process.env.ABLY_API_KEY; 13 | 14 | const CANVAS_HEIGHT = 700; 15 | const CANVAS_WIDTH = 1400; 16 | const SHIP_PLATFORM = CANVAS_HEIGHT - 12; 17 | const BULLET_PLATFORM = SHIP_PLATFORM - 32; 18 | const PLAYER_VERTICAL_INCREMENT = 20; 19 | const PLAYER_VERTICAL_MOVEMENT_UPDATE_INTERVAL = 1000; 20 | const PLAYER_SCORE_INCREMENT = 5; 21 | const P2_WORLD_TIME_STEP = 1 / 16; 22 | const MIN_PLAYERS_TO_START_GAME = 6; 23 | const GAME_TICKER_MS = 100; 24 | 25 | let players = {}; 26 | let playerChannels = {}; 27 | let shipX = between(20, CANVAS_WIDTH - 20); 28 | let shipY = SHIP_PLATFORM; 29 | let colorIndex = 0; 30 | let avatarTypes = ["A", "B", "C"]; 31 | let gameOn = false; 32 | let alivePlayers = 0; 33 | let totalPlayers = 0; 34 | let gameRoomName = workerData.hostRoomCode + ":primary"; 35 | let roomCode = workerData.hostRoomCode; 36 | let hostClientId = workerData.hostClientId; 37 | let hostNickname = workerData.hostNickname; 38 | let gameRoom; 39 | let gameTickerOn = false; 40 | let bulletTimer = 0; 41 | let shipBody; 42 | let world; 43 | let shipVelocityTimer = 0; 44 | let killerBulletId = ""; 45 | let copyOfShipBody = { 46 | position: "", 47 | velocity: "", 48 | }; 49 | 50 | // instantiate to Ably 51 | const realtime = new Ably.Realtime({ 52 | key: ABLY_API_KEY, 53 | echoMessages: false, 54 | }); 55 | 56 | // wait until connection with Ably is established 57 | realtime.connection.once("connected", () => { 58 | gameRoom = realtime.channels.get(gameRoomName); 59 | 60 | // subscribe to new players entering the game 61 | gameRoom.presence.subscribe("enter", (player) => { 62 | console.log("new player"); 63 | let newPlayerId; 64 | alivePlayers++; 65 | totalPlayers++; 66 | parentPort.postMessage({ 67 | roomName: roomCode, 68 | totalPlayers: totalPlayers, 69 | gameOn: gameOn, 70 | }); 71 | newPlayerId = player.clientId; 72 | playerChannels[newPlayerId] = realtime.channels.get( 73 | workerData.hostRoomCode + ":clientChannel-" + player.clientId 74 | ); 75 | if (++colorIndex == 6) { 76 | colorIndex = 0; 77 | } 78 | if (totalPlayers == 1) { 79 | gameTickerOn = true; 80 | startGameDataTicker(); 81 | } 82 | newPlayerObject = { 83 | id: newPlayerId, 84 | invaderAvatarType: avatarTypes[between(0, 3)], 85 | invaderAvatarColor: randomColorGenerator(), 86 | x: playerXposition(colorIndex), 87 | y: 20, 88 | score: 0, 89 | nickname: player.data.nickname, 90 | isAlive: true, 91 | }; 92 | players[newPlayerId] = newPlayerObject; 93 | subscribeToPlayerInput(playerChannels[newPlayerId], newPlayerId); 94 | }); 95 | 96 | // subscribe to players leaving the game 97 | gameRoom.presence.subscribe("leave", (player) => { 98 | let leavingPlayer = player.clientId; 99 | alivePlayers--; 100 | totalPlayers--; 101 | parentPort.postMessage({ 102 | roomName: roomCode, 103 | totalPlayers: totalPlayers, 104 | }); 105 | delete players[leavingPlayer]; 106 | if (totalPlayers <= 0) { 107 | killWorkerThread(); 108 | } 109 | }); 110 | gameRoom.publish("thread-ready", { 111 | start: true, 112 | }); 113 | }); 114 | 115 | // start the ship and bullets 116 | function startShipAndBullets() { 117 | gameOn = true; 118 | 119 | world = new p2.World({ 120 | gravity: [0, -9.82], 121 | }); 122 | shipBody = new p2.Body({ 123 | position: [shipX, shipY], 124 | velocity: [calcRandomVelocity(), 0], 125 | }); 126 | world.addBody(shipBody); 127 | startMovingPhysicsWorld(); 128 | 129 | for (let playerId in players) { 130 | startDownwardMovement(playerId); 131 | } 132 | } 133 | 134 | // start the game tick 135 | function startGameDataTicker() { 136 | let tickInterval = setInterval(() => { 137 | if (!gameTickerOn) { 138 | clearInterval(tickInterval); 139 | } else { 140 | bulletOrBlank = ""; 141 | bulletTimer += GAME_TICKER_MS; 142 | if (bulletTimer >= GAME_TICKER_MS * 5) { 143 | bulletTimer = 0; 144 | bulletOrBlank = { 145 | y: BULLET_PLATFORM, 146 | id: "bulletId-" + generateRandomId(), 147 | }; 148 | } 149 | if (shipBody) { 150 | copyOfShipBody = shipBody; 151 | } 152 | 153 | // fan out the latest game state 154 | gameRoom.publish("game-state", { 155 | players: players, 156 | playerCount: totalPlayers, 157 | shipBody: copyOfShipBody.position, 158 | bulletOrBlank: bulletOrBlank, 159 | gameOn: gameOn, 160 | killerBullet: killerBulletId, 161 | }); 162 | } 163 | }, GAME_TICKER_MS); 164 | } 165 | 166 | // subscribe to each player's input events 167 | function subscribeToPlayerInput(channelInstance, playerId) { 168 | channelInstance.subscribe("pos", (msg) => { 169 | if (msg.data.keyPressed == "left") { 170 | if (players[playerId].x - 20 < 20) { 171 | players[playerId].x = 25; 172 | } else { 173 | players[playerId].x -= 20; 174 | } 175 | } else if (msg.data.keyPressed == "right") { 176 | if (players[playerId].x + 20 > 1380) { 177 | players[playerId].x = 1375; 178 | } else { 179 | players[playerId].x += 20; 180 | } 181 | } 182 | }); 183 | channelInstance.subscribe("start-game", (msg) => { 184 | startShipAndBullets(); 185 | }); 186 | 187 | // subscribe to players being shot 188 | channelInstance.subscribe("dead-notif", (msg) => { 189 | players[msg.data.deadPlayerId].isAlive = false; 190 | killerBulletId = msg.data.killerBulletId; 191 | alivePlayers--; 192 | if (alivePlayers == 0) { 193 | setTimeout(() => { 194 | finishGame(""); 195 | }, 1000); 196 | } 197 | }); 198 | } 199 | 200 | // update the y position of each player when the game starts 201 | function startDownwardMovement(playerId) { 202 | let interval = setInterval(() => { 203 | if (players[playerId] && players[playerId].isAlive) { 204 | players[playerId].y += PLAYER_VERTICAL_INCREMENT; 205 | players[playerId].score += PLAYER_SCORE_INCREMENT; 206 | 207 | if (players[playerId].y > SHIP_PLATFORM) { 208 | finishGame(playerId); 209 | clearInterval(interval); 210 | } 211 | } else { 212 | clearInterval(interval); 213 | } 214 | }, PLAYER_VERTICAL_MOVEMENT_UPDATE_INTERVAL); 215 | } 216 | 217 | // finish the game 218 | function finishGame(playerId) { 219 | console.log("finished"); 220 | let firstRunnerUpName = ""; 221 | let secondRunnerUpName = ""; 222 | let winnerName = "Nobody"; 223 | let leftoverPlayers = new Array(); 224 | for (let item in players) { 225 | leftoverPlayers.push({ 226 | nickname: players[item].nickname, 227 | score: players[item].score, 228 | }); 229 | } 230 | 231 | leftoverPlayers.sort((a, b) => { 232 | return b.score - a.score; 233 | }); 234 | if (playerId == "") { 235 | if (leftoverPlayers.length >= 3) { 236 | firstRunnerUpName = leftoverPlayers[0].nickname; 237 | secondRunnerUpName = leftoverPlayers[1].nickname; 238 | } else if (leftoverPlayers == 2) { 239 | firstRunnerUp = leftoverPlayers[0].nickname; 240 | } 241 | } else { 242 | winnerName = players[playerId].nickname; 243 | if (leftoverPlayers.length >= 3) { 244 | firstRunnerUpName = leftoverPlayers[1].nickname; 245 | secondRunnerUpName = leftoverPlayers[2].nickname; 246 | } else if (leftoverPlayers.length == 2) { 247 | firstRunnerUpName = leftoverPlayers[1].nickname; 248 | } 249 | } 250 | 251 | // fan out leaderboard info when the game has finished 252 | gameRoom.publish("game-over", { 253 | winner: winnerName, 254 | firstRunnerUp: firstRunnerUpName, 255 | secondRunnerUp: secondRunnerUpName, 256 | totalPlayers: totalPlayers, 257 | }); 258 | 259 | killWorkerThread(); 260 | } 261 | 262 | // reset all variables in the server 263 | function killWorkerThread() { 264 | parentPort.postMessage({ 265 | resetEntry: true, 266 | roomName: roomCode, 267 | }); 268 | for (let item in playerChannels) { 269 | playerChannels[item].detach(); 270 | } 271 | process.exit(0); 272 | } 273 | 274 | // assign player position per color to form pride rainbow 275 | function playerXposition(index) { 276 | switch (index) { 277 | case 0: 278 | return between(22, 246); 279 | case 1: 280 | return between(247, 474); 281 | case 2: 282 | return between(475, 702); 283 | case 3: 284 | return between(703, 930); 285 | case 4: 286 | return between(931, 1158); 287 | case 5: 288 | return between(1159, 1378); 289 | default: 290 | return between(22, 246); 291 | } 292 | } 293 | 294 | function between(min, max) { 295 | return Math.floor(Math.random() * (max - min) + min); 296 | } 297 | 298 | function generateRandomId() { 299 | return Math.random().toString(36).substr(2, 8); 300 | } 301 | 302 | // start the server-side physics world 303 | function startMovingPhysicsWorld() { 304 | let p2WorldInterval = setInterval(function () { 305 | if (!gameOn) { 306 | clearInterval(p2WorldInterval); 307 | } else { 308 | // updates velocity every 5 seconds 309 | if (++shipVelocityTimer >= 80) { 310 | shipVelocityTimer = 0; 311 | shipBody.velocity[0] = calcRandomVelocity(); 312 | } 313 | world.step(P2_WORLD_TIME_STEP); 314 | if (shipBody.position[0] > 1400 && shipBody.velocity[0] > 0) { 315 | shipBody.position[0] = 0; 316 | } else if (shipBody.position[0] < 0 && shipBody.velocity[0] < 0) { 317 | shipBody.position[0] = 1400; 318 | } 319 | } 320 | }, 1000 * P2_WORLD_TIME_STEP); 321 | } 322 | 323 | // calculate a random horizontal velocity for the ship 324 | function calcRandomVelocity() { 325 | let randomShipXVelocity = between(20, 200); 326 | randomShipXVelocity *= Math.floor(Math.random() * 2) == 1 ? 1 : -1; 327 | return randomShipXVelocity; 328 | } 329 | 330 | // method to randomly generate a color for the player 331 | function randomColorGenerator() { 332 | const randomColor = "000000".replace(/0/g, function () { 333 | return (~~(Math.random() * 16)).toString(16); 334 | }); 335 | return "0x" + randomColor; 336 | } 337 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | const { 2 | Worker, 3 | isMainThread, 4 | parentPort, 5 | workerData, 6 | threadId, 7 | MessageChannel, 8 | } = require("worker_threads"); 9 | 10 | const envConfig = require("dotenv").config(); 11 | const express = require("express"); 12 | const Ably = require("ably"); 13 | const p2 = require("p2"); 14 | const app = express(); 15 | const {ABLY_API_KEY, PORT} = process.env; 16 | 17 | console.log("Environment variables", envConfig) 18 | 19 | const globalGameName = "main-game-thread"; 20 | const GAME_ROOM_CAPACITY = 6; 21 | let globalChannel; 22 | let activeGameRooms = {}; 23 | 24 | // instantiate to Ably 25 | const realtime = new Ably.Realtime({ 26 | key: ABLY_API_KEY, 27 | echoMessages: false, 28 | }); 29 | 30 | // create a uniqueId to assign to clients on auth 31 | const uniqueId = function () { 32 | return "id-" + Math.random().toString(36).substr(2, 16); 33 | }; 34 | 35 | app.use(express.static("public")); 36 | 37 | app.get("/auth", (request, response) => { 38 | const tokenParams = { clientId: uniqueId() }; 39 | realtime.auth.createTokenRequest(tokenParams, function (err, tokenRequest) { 40 | if (err) { 41 | response 42 | .status(500) 43 | .send("Error requesting token: " + JSON.stringify(err)); 44 | } else { 45 | response.setHeader("Content-Type", "application/json"); 46 | response.send(JSON.stringify(tokenRequest)); 47 | } 48 | }); 49 | }); 50 | 51 | app.get("/", (request, response) => { 52 | response.header("Access-Control-Allow-Origin", "*"); 53 | response.header( 54 | "Access-Control-Allow-Headers", 55 | "Origin, X-Requested-With, Content-Type, Accept" 56 | ); 57 | response.sendFile(__dirname + "/views/intro.html"); 58 | }); 59 | 60 | app.get("/gameplay", (request, response) => { 61 | let requestedRoom = request.query.roomCode; 62 | let isReqHost = request.query.isHost == "true"; 63 | if (!isReqHost && activeGameRooms[requestedRoom]) { 64 | if ( 65 | activeGameRooms[requestedRoom].totalPlayers + 1 <= GAME_ROOM_CAPACITY && 66 | !activeGameRooms[requestedRoom].gameOn 67 | ) { 68 | response.sendFile(__dirname + "/views/index.html"); 69 | } else { 70 | console.log("here"); 71 | response.sendFile(__dirname + "/views/gameRoomFull.html"); 72 | } 73 | } else if (isReqHost) { 74 | response.sendFile(__dirname + "/views/index.html"); 75 | } else { 76 | response.sendFile(__dirname + "/views/gameRoomFull.html"); 77 | } 78 | console.log(JSON.stringify(activeGameRooms)); 79 | }); 80 | 81 | app.get("/winner", (request, response) => { 82 | response.sendFile(__dirname + "/views/winner.html"); 83 | }); 84 | 85 | app.get("/gameover", (request, response) => { 86 | response.sendFile(__dirname + "/views/gameover.html"); 87 | }); 88 | 89 | const listener = app.listen(PORT, () => { 90 | console.log("Your app is listening on port " + listener.address().port); 91 | }); 92 | 93 | // wait until connection with Ably is established 94 | realtime.connection.once("connected", () => { 95 | globalChannel = realtime.channels.get(globalGameName); 96 | // subscribe to new players entering the game 97 | globalChannel.presence.subscribe("enter", (player) => { 98 | generateNewGameThread( 99 | player.data.isHost, 100 | player.data.nickname, 101 | player.data.roomCode, 102 | player.clientId 103 | ); 104 | }); 105 | }); 106 | 107 | function generateNewGameThread( 108 | isHost, 109 | hostNickname, 110 | hostRoomCode, 111 | hostClientId 112 | ) { 113 | if (isHost && isMainThread) { 114 | const worker = new Worker("./server-worker.js", { 115 | workerData: { 116 | hostNickname: hostNickname, 117 | hostRoomCode: hostRoomCode, 118 | hostClientId: hostClientId, 119 | }, 120 | }); 121 | console.log(`CREATING NEW THREAD WITH ID ${threadId}`); 122 | worker.on("error", (error) => { 123 | console.log(`WORKER EXITED DUE TO AN ERROR ${error}`); 124 | }); 125 | worker.on("message", (msg) => { 126 | if (msg.roomName && !msg.resetEntry) { 127 | activeGameRooms[msg.roomName] = { 128 | roomName: msg.roomName, 129 | totalPlayers: msg.totalPlayers, 130 | gameOn: msg.gameOn, 131 | }; 132 | } else if (msg.roomName && msg.resetEntry) { 133 | delete activeGameRooms[msg.roomName]; 134 | } 135 | }); 136 | worker.on("exit", (code) => { 137 | console.log(`WORKER EXITED WITH THREAD ID ${threadId}`); 138 | if (code !== 0) { 139 | console.log(`WORKER EXITED DUE TO AN ERROR WITH CODE ${code}`); 140 | } 141 | }); 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /views/gameRoomFull.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Space Invaders 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Space Invaders 21 |
22 |

23 | Sorry, the game room you are trying to join is either full or doesn't exist. 24 |

25 |
26 | Invader avatars 28 | 29 | 30 | -------------------------------------------------------------------------------- /views/gameover.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Space Invaders 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |

Game over

21 |
22 |

23 |
24 |
25 |

26 |

27 |
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Space Invaders 6 | 7 | 8 | 9 | 14 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 | 49 |
50 |
51 |
52 |
Score: 0
53 |
Game room 0
54 |
55 |
56 |
57 | 58 | 59 |
60 |
61 | 62 | 63 |
64 |
65 |
66 |
67 |
68 | 75 |
76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /views/intro.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Space Invaders 6 | 7 | 8 | 9 | 14 | 20 | 24 | 25 | 26 | 27 | 28 | Space Invaders 29 | 30 |

31 | Use the arrow keys on your keyboard to move your avatar left or right to 32 | escape the bullets from the spaceship. Your goal is to make it to the 33 | other side, alive! 34 |

35 | 36 |
37 |
38 |
39 | 65 |
66 |
72 |
73 |
74 | 80 |
81 | 88 |
89 |
90 |
96 |
97 |
98 | 104 |
105 |
106 | 112 |
113 | 120 |
121 |
122 |
123 |
124 |
125 |
126 | 127 | 128 | 133 | 134 | 139 | 144 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /views/winner.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Space Invaders 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |

The game has ended

21 |
22 |

23 |
24 |
25 |

26 |

27 |
28 | 29 | 30 | 31 | --------------------------------------------------------------------------------