Skip to content

Commit

Permalink
show num of accounts on settings server
Browse files Browse the repository at this point in the history
  • Loading branch information
ayunami2000 committed Dec 27, 2024
1 parent 82a6890 commit 80366e8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/connection/fakewebsocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,27 @@ class SettingsWS extends EventTarget {
}
send(chunk: Uint8Array | ArrayBuffer | string) {
if (typeof chunk === "string" && chunk.toLowerCase() === "accept: motd") {
//@ts-expect-error this gets filled in by rollup
const ver = self.VERSION;
const accs = localStorage["wispcraft_accounts"] ? JSON.parse(localStorage["wispcraft_accounts"]).length : 0;
this.dispatchEvent(
new MessageEvent("message", {
data: JSON.stringify({
name: "Settings",
brand: "mercuryworkshop",
vers: "wispcraft/1.0",
vers: "wispcraft/" + ver,
cracked: true,
time: Date.now(),
uuid: "00000000-0000-0000-0000-000000000000",
type: "motd",
data: {
cache: false,
icon: true,
online: 0,
online: accs,
max: 0,
players: [],
motd: ["Sign in with Microsoft", "Configure Proxy URL"],
//@ts-expect-error these get filled in by rollup
players: [`Version: ${self.VERSION}`, `Build: ${self.COMMITHASH}`],
//@ts-expect-error this gets filled in by rollup
players: [`Version: ${ver}`, `Build: ${self.COMMITHASH}`],
},
}),
})
Expand Down

0 comments on commit 80366e8

Please sign in to comment.