Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
feat: Added motd feature
Browse files Browse the repository at this point in the history
  • Loading branch information
freehuntx committed Dec 5, 2024
1 parent f6942fc commit 54333dd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@
"private": true,
"type": "module",
"scripts": {
"ci": "yarn install --frozen-lockfile",
"dev": "vite --force",
"start": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@ruffle-rs/ruffle": "^0.1.0-nightly.2024.12.2",
"@ruffle-rs/ruffle": "^0.1.0-nightly.2024.12.5",
"events": "^3.3.0",
"fast-xml-parser": "^4.5.0",
"trystero": "^0.20.0"
},
"devDependencies": {
"@types/events": "^3.0.3",
"typescript": "^5.7.2",
"vite": "^6.0.2"
"vite": "^6.0.3"
}
}
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ new MpRuffle({
disconnect('Connecting failed!')
}

const motd = new URLSearchParams(location.search).get('motd')
if (motd) {
socket.send(`<msgAll name="System" msg="${motd}" />\0`)
}

lobby.on('xml', (xml: string) => {
xml = xml.replace(/\0*$/, '\0').replace(/(<[ \t/]*)Tag(\d)/g, '$1$2')
xml = xml.replace(/\n\0$/g, '\0')
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1128,10 +1128,10 @@
resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.27.4.tgz#67d516613c9f2fe42e2d8b78e252d0003179d92c"
integrity sha512-3j4jx1TppORdTAoBJRd+/wJRGCPC0ETWkXOecJ6PPZLj6SptXkrXcNqdj0oclbKML6FkQltdz7bBA3rUSirZug==

"@ruffle-rs/ruffle@^0.1.0-nightly.2024.12.2":
version "0.1.0-nightly.2024.12.2"
resolved "https://registry.yarnpkg.com/@ruffle-rs/ruffle/-/ruffle-0.1.0-nightly.2024.12.2.tgz#4d4012d7c3a7894a2412d3abe55d83f2ba524d6b"
integrity sha512-RUld1W72UsLOrU/4znB+8SWz8u6ZPWfYrbMStWFWexWnlXTsXxE3tfiP+CmgHoAzvcl7Z9hnvL866SmKfVLO6g==
"@ruffle-rs/ruffle@^0.1.0-nightly.2024.12.5":
version "0.1.0-nightly.2024.12.5"
resolved "https://registry.npmjs.org/@ruffle-rs/ruffle/-/ruffle-0.1.0-nightly.2024.12.5.tgz#283569053aaf74ed20f143ba4608e7334f1cfe16"
integrity sha512-zjPyWJen0V/PnI2EdDGjLyTP1uCEFopxaMpKQ7Gf2nUOMKzh2S5WQGLs2/Pgq5hg5pGyXlLm/siOyKX+wdJ16A==

"@sindresorhus/fnv1a@^3.1.0":
version "3.1.0"
Expand Down Expand Up @@ -2676,10 +2676,10 @@ uuid@^9.0.0:
resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==

vite@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/vite/-/vite-6.0.2.tgz#7a22630c73c7b663335ddcdb2390971ffbc14993"
integrity sha512-XdQ+VsY2tJpBsKGs0wf3U/+azx8BBpYRHFAyKm5VeEZNOJZRB63q7Sc8Iup3k0TrN3KO6QgyzFf+opSbfY1y0g==
vite@^6.0.3:
version "6.0.3"
resolved "https://registry.npmjs.org/vite/-/vite-6.0.3.tgz#cc01f403e326a9fc1e064235df8a6de084c8a491"
integrity sha512-Cmuo5P0ENTN6HxLSo6IHsjCLn/81Vgrp81oaiFFMRa8gGDj5xEjIcEpf2ZymZtZR8oU0P2JX5WuUp/rlXcHkAw==
dependencies:
esbuild "^0.24.0"
postcss "^8.4.49"
Expand Down

0 comments on commit 54333dd

Please sign in to comment.