]> git.eli173.com Git - pong_br/commitdiff
relocated to eli173 domain, rewrote to use systemd service master
authorElijah Cohen <eli@eli173.com>
Mon, 16 Aug 2021 04:19:28 +0000 (00:19 -0400)
committerElijah Cohen <eli@eli173.com>
Mon, 16 Aug 2021 04:19:28 +0000 (00:19 -0400)
server/constants.js
server/package-lock.json
server/package.json
server/pong.service [new file with mode: 0644]
web/draw.js
web/index.html

index d42b8df11b408baa40c25fe80248806d5a777af7..5146e7a68289293f009a3c9f903aa0f46034fca7 100644 (file)
@@ -2,7 +2,7 @@
 
 var c = {
     // matchmaker
 
 var c = {
     // matchmaker
-    WS_PORT: 80,
+    WS_PORT: 9680,
     NUM_PLAYERS: 10,
     FPS: 30,
     WAIT_TIME: 60000, // 1 minute
     NUM_PLAYERS: 10,
     FPS: 30,
     WAIT_TIME: 60000, // 1 minute
index fb88917853ca63bf3d2cb419414385e500b3ada7..82e75485698295f0e31509a7d410861b45614145 100644 (file)
@@ -1,11 +1,13 @@
 {
 {
-  "requires": true,
+  "name": "pong_br",
+  "version": "1.0.0",
   "lockfileVersion": 1,
   "lockfileVersion": 1,
+  "requires": true,
   "dependencies": {
     "async-limiter": {
   "dependencies": {
     "async-limiter": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
-      "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-2.0.0.tgz",
+      "integrity": "sha512-nyHFzvVaR+4mfHc90/VqOUQjlnk9+ioDxQfqDuqKnm3m9sIT7joVKW8dkxeaKpamMJ3MYD73t6M8PMKEWlQESQ=="
     },
     "ws": {
       "version": "6.2.1",
     },
     "ws": {
       "version": "6.2.1",
       "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
       "requires": {
         "async-limiter": "~1.0.0"
       "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
       "requires": {
         "async-limiter": "~1.0.0"
+      },
+      "dependencies": {
+        "async-limiter": {
+          "version": "1.0.1",
+          "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
+          "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
+        }
       }
     }
   }
       }
     }
   }
index d99549f4db705929715be8b1c6feca4e632b1002..03627b6a53a0c6f64a6e54cc8e01e932c3787af6 100644 (file)
@@ -1,16 +1,17 @@
 {
 {
-    "name": "pong_br",
-    "version": "1.0.0",
-    "description": "Pong: Battle Royale!",
-    "main": "matchmaker.js",
-    "dependencies": {
-       "ws": "^6.2.1"
-    },
-    "devDependencies": {},
-    "scripts": {
-       "start": "node matchmaker.js",
-       "test": "echo \"Error: no test specified\" && exit 1"
-    },
-    "author": "Elijah Cohen",
-    "license": "UNLICENSED"
+   "name": "pong_br",
+   "version": "1.0.0",
+   "description": "Pong: Battle Royale!",
+   "main": "matchmaker.js",
+   "dependencies": {
+      "async-limiter": "^2.0.0",
+      "ws": "^6.2.1"
+   },
+   "devDependencies": {},
+   "scripts": {
+      "start": "node matchmaker.js",
+      "test": "echo \"Error: no test specified\" && exit 1"
+   },
+   "author": "Elijah Cohen",
+   "license": "UNLICENSED"
 }
 }
diff --git a/server/pong.service b/server/pong.service
new file mode 100644 (file)
index 0000000..b80d305
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Pong Battle Royale
+
+[Service]
+Type=simple
+User=eli
+ExecStart=/usr/bin/npm start --prefix /home/eli/pong_br/server
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
\ No newline at end of file
index 94374d2af5c380e1d3b686aa3976b77c7c230142..fd630c49bdfbcb639fae088b8f975c0b5bac2c57 100644 (file)
@@ -116,7 +116,7 @@ var drawOverlay = function(ctx, place) {
     ctx.fillStyle = 'rgba(225,225,225,100)'
     ctx.textAlign = 'center';
     ctx.fillText("you placed: " + place, 0, -7.5);
     ctx.fillStyle = 'rgba(225,225,225,100)'
     ctx.textAlign = 'center';
     ctx.fillText("you placed: " + place, 0, -7.5);
-    ctx.fillText("press =g= or click/tap", 0, 0); // magic numbers...
+    ctx.fillText("press 'g' or click/tap", 0, 0); // magic numbers...
     ctx.fillText("to play again", 0, 7.5);
     ctx.restore();
 }
     ctx.fillText("to play again", 0, 7.5);
     ctx.restore();
 }
index de949b8f2a19e69dff2416cda57418b8010ad2fb..790aa96e85a3d723d245e7b654b4052cc74b0b5d 100644 (file)
@@ -28,7 +28,7 @@
       <p>Yes, this is a battle royale version of pong. You are matched up with a large amount of other players in a shrinking arena, and your goal is to survive to the very end.</p>
       <p>Use 'w' and 's', 'k' and 'j', or the arrow keys to move your paddle with the keyboard, or touch the top or bottom half of the screen to move up or down with a touchscreen.</p>
       <p>You are the player on the left-hand side whose paddle is a slightly different color.</p>
       <p>Yes, this is a battle royale version of pong. You are matched up with a large amount of other players in a shrinking arena, and your goal is to survive to the very end.</p>
       <p>Use 'w' and 's', 'k' and 'j', or the arrow keys to move your paddle with the keyboard, or touch the top or bottom half of the screen to move up or down with a touchscreen.</p>
       <p>You are the player on the left-hand side whose paddle is a slightly different color.</p>
-      <a href="/play" id="b">PLAY</a>
+      <a href="https://pong.eli173.com/play" id="b">PLAY</a>
     </div>
   </body>
 </html>
     </div>
   </body>
 </html>