29 Commits

Author SHA1 Message Date
codinget 14fd29871b chore: force websocket transport 2026-05-10 19:42:50 +02:00
codinget 724df64c82 Merge branch 'Maspenguin:main' into main 2024-10-06 18:15:55 +02:00
Samuel Kent de5d36d16c added chadley buzzery 2024-10-06 11:36:19 +11:00
Samuel Kent 56c42435c8 updated dependencies 2024-09-17 10:04:46 +10:00
Samuel Kent 894dc4693b updated dependencies 2024-09-16 12:55:06 +10:00
Samuel Kent 37714bcdd7 added some new buzzers 2024-09-16 12:49:33 +10:00
Samuel Kent 71a4057de7 updated dependencies 2024-07-02 11:20:18 +10:00
codinget 35fc8dc974 Merge branch 'Maspenguin:main' into main 2024-05-29 20:54:16 +02:00
Samuel Kent 236e1ecf31 added buzzer cache to fix buzzer sound delay 2024-05-29 12:17:22 +10:00
codinget 8f650e4043 Merge pull request #5 from Maspenguin/main
update
2024-05-20 02:43:39 +02:00
Samuel Kent 652c5de4f1 updated dependencies 2024-05-19 17:24:35 +10:00
Samuel Kent 0831309ff2 added a bunch of buzzers 2024-05-19 13:16:31 +10:00
codinget 97bb20a2a9 Merge pull request #4 from Maspenguin/main
Catch up to upstream
2024-05-17 00:35:20 +02:00
Samuel Kent a2efd3bab2 added MvC buzzers and made tetris buzzers special 2024-04-06 18:57:21 +11:00
Samuel K 08c0902606 Merge pull request #4 from frozentreasure/main
Added new buzzers
2024-04-01 09:05:52 +11:00
frozentreasure e761112951 Added new buzzers
Added Ace Combat "Missile" warning buzzer
Added Tetris Grand Master piece SFX buzzers
2024-03-31 11:05:42 +11:00
frozentreasure 0758f974ec Added new buzzers
Added Ace Combat "Missile" warning buzzer
Added Tetris Grand Master piece SFX buzzers
2024-03-31 10:58:34 +11:00
frozentreasure 59a11f2ed1 Revert "Added new buzzers"
This reverts commit 7ccf281074.
2024-03-31 10:58:10 +11:00
frozentreasure 7ccf281074 Added new buzzers
Added Ace Combat "Missile" warning buzzer
Added Tetris Grand Master piece SFX buzzers
2024-03-31 10:39:59 +11:00
Samuel Kent 6a401d6c1b added a bunch of buzzers 2024-03-27 23:21:42 +11:00
Samuel Kent d03d5b0fd9 fixed issues with certain characters in user names 2024-02-03 09:58:56 +11:00
Samuel Kent 42cf703556 fixed https issue 2024-01-27 16:57:10 +11:00
Samuel Kent 81926e1467 updated readme 2023-12-29 19:43:25 +11:00
Samuel K be018e5603 Merge pull request #1 from natnat-mc/build/npm
add package.json, package-lock.json, remove node_modules and add .gitignore
2023-12-29 18:29:51 +11:00
codinget 1fd1db4e14 Merge pull request #3 from natnat-mc/feat/reset
feat: add possibility to reset the entire app
2023-12-28 23:37:01 +01:00
codinget 17e4d233d2 feat: add possibility to reset the entire app 2023-12-28 23:34:19 +01:00
codinget 5319296eb1 Merge pull request #2 from natnat-mc/build/npm
add package json
2023-12-28 22:55:40 +01:00
codinget d7422d3885 Merge pull request #1 from natnat-mc/fix/mixed-content
fixed mixed content that prevents the game from running on https
2023-12-28 22:54:13 +01:00
codinget 5b4fba8dc8 add package json 2023-12-23 22:12:04 +01:00
999 changed files with 1059 additions and 149903 deletions
+1
View File
@@ -0,0 +1 @@
node_modules
+3 -2
View File
@@ -6,5 +6,6 @@ To run TheChaseBuzzer yourself, complete the following steps:
2. Install node.js from https://nodejs.org/en/ 2. Install node.js from https://nodejs.org/en/
3. Download all project files for TheChaseBuzzer from this github repository 3. Download all project files for TheChaseBuzzer from this github repository
4. Open the main folder of TheChaseBuzzer in cmd (this is the folder containing app.js) 4. Open the main folder of TheChaseBuzzer in cmd (this is the folder containing app.js)
5. Enter the command: `node app.js` 5. Install the node modules using the command: `npm install`
6. You should then be able to connect to the server in a browser by entering your public ip, followed by `:8080` 6. Run the app with the command: `node app.js`
7. You should then be able to connect to the server in a browser by entering your public ip, followed by `:8080`
+36
View File
@@ -20,8 +20,33 @@ let anyObjections = false;
const teamsList = ["Players","Chasers"] const teamsList = ["Players","Chasers"]
const teamsScore = [0,0]; const teamsScore = [0,0];
let currentTeamNumber = 0; let currentTeamNumber = 0;
let sockets = []
async function resetApp() {
console.log("resetting app")
io.emit("resetApp")
Object.keys(options).forEach(x => delete options[x])
userMap.clear()
buzzInfo.splice(0, buzzInfo.length)
idkList.splice(0, buzzInfo.length)
Object.keys(userMap).forEach(x => delete userMap[x])
Object.keys(userInfo).forEach(x => delete userInfo[x])
anyObjections = false
teamsList.splice(0, buzzInfo.length, "Players", "Chasers")
teamsScore.splice(0, teamsScore.length, 0, 0)
currentTeamNumber = 0
const oldSockets = sockets
sockets = []
await new Promise(ok => setTimeout(ok, 1000))
oldSockets.forEach(x => x.disconnect(true))
oldSockets.splice(0, oldSockets.length)
}
io.on("connection", (socket) => { io.on("connection", (socket) => {
console.log("a user connected"); console.log("a user connected");
sockets.push(socket)
socket.on("disconnect", () => { socket.on("disconnect", () => {
console.log("user disconnected"); console.log("user disconnected");
@@ -97,9 +122,15 @@ io.on("connection", (socket) => {
io.emit("userInfoToClient", userInfo); io.emit("userInfoToClient", userInfo);
}); });
//used by the host when they refresh the page.
socket.on("refreshUserInfo", () => {
io.emit("userInfoToClient", userInfo);
});
socket.on("unregisterUsers", () => { socket.on("unregisterUsers", () => {
userInfo = new Object(); userInfo = new Object();
io.emit("userInfoToClient", userInfo); io.emit("userInfoToClient", userInfo);
io.emit("reconnectUsers");
}); });
socket.on("objectionToServer", (userName) => { socket.on("objectionToServer", (userName) => {
@@ -135,6 +166,11 @@ app.get("/browserFunctions.js", (request, response) => {
response.sendFile("/browserFunctions.js", {root: __dirname }); response.sendFile("/browserFunctions.js", {root: __dirname });
}); });
app.post("/reset", (request, response) => {
resetApp()
response.redirect("/")
});
//all files in these folders can be accessed with a GET request of the filename //all files in these folders can be accessed with a GET request of the filename
let assetFolders = ["styles","pages","images","images/buzzers","audio","fonts"]; let assetFolders = ["styles","pages","images","images/buzzers","audio","fonts"];
assetFolders.forEach((folderName) => { assetFolders.forEach((folderName) => {
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+9 -2
View File
@@ -1,6 +1,13 @@
var buzzerCache = new Map();
function userInfoToClient(userInfo) { function userInfoToClient(userInfo) {
for (const user in userInfo) { for (const user in userInfo) {
const userId = user.replaceAll(" ","_"); re = new RegExp("\\W","g");
const userId = user.replaceAll(re,"_");
buzzerCache.set(userInfo[user].buzzerId, new Audio(userInfo[user].buzzerId+".wav"));
if ($("#userListPanel").find("#"+userId).length >= 1) { if ($("#userListPanel").find("#"+userId).length >= 1) {
//update buzzer icon of existing user //update buzzer icon of existing user
$("#userListPanel").find("#"+userId).find("img").attr("data-buzzerId",userInfo[user].buzzerId); $("#userListPanel").find("#"+userId).find("img").attr("data-buzzerId",userInfo[user].buzzerId);
@@ -33,7 +40,7 @@ function buzzInfoToClient(buzzInfo, soundOn) {
$("#firstBuzz").html(buzzInfo[0].userName); $("#firstBuzz").html(buzzInfo[0].userName);
const userId = buzzInfo[0].userName.replaceAll(" ","_"); const userId = buzzInfo[0].userName.replaceAll(" ","_");
let buzzerId = $("#userListPanel").find("#"+userId).find("img").attr("data-buzzerId"); let buzzerId = $("#userListPanel").find("#"+userId).find("img").attr("data-buzzerId");
let buzzerSound = new Audio(buzzerId+".wav"); let buzzerSound = buzzerCache.get(buzzerId);
if (soundOn == true) { if (soundOn == true) {
buzzerSound.play(); buzzerSound.play();
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Some files were not shown because too many files have changed in this diff Show More