A quotaless, partially limitless, and fast Node.js Multiplayer Piano server implementation that efficiently makes use of the protocol and uWebSockets.js

Overview

speedymppserver

A quotaless, partially limitless, and fast Node.js Multiplayer Piano server implementation that efficiently makes use of the protocol and uWebSockets.js

How this improves performance:

  • Sends most events at 50ms tick intervals, including mouse movements, name and color changes, participant joins, participant leaves, chat messages, and notifications
    • This helps reduce bandwidth spent sending data for clients that frequently change these properties
    • Also helps reduce total message count, reducing overhead
  • Sends entire channel updates as little as possible, only when the crown or settings are changed
  • Sends minimal participant data when entire channel updates must be sent, usually only the player's ID so the client can confirm they're still present
  • Broadcasts messages efficiently with uWebSockets.js using pub/sub, ensuring stringifying and framing is only done one time for messages that get sent to an entire channel
  • Every websocket event handler is synchronous, improving performance and reducing bugs
  • Participant ids are short - incrementing hexadecimal starting at 0 when the server is created. This once again improves bandwidth usage

Usage

  1. Install Node.js and Yarn
  2. Clone or download this repo
  3. Rename .env.example to .env, then configure the variables inside of it according to the comments
  4. Run yarn install from a command prompt in the server directory
  5. Run yarn start to start the server

This server does not serve static files. It is recommended to host MPP's static files with another service, such as NGINX, and have it proxy websocket connections through to this server. Alternatively, you can host this server on a separate domain or port than the file server.

Notes

Because this server is made for performance testing and as a bot playground, there is a customId option in .env. If set to 1 or greater, users will be able to create x number of random IDs for themself, by sending a field called "customId" in "hi". This field's value can be anything from 1 to the number of IDs allowed by the server.

Example: [{"m":"hi","customId":69}] - this would give the user their 69th custom ID. 0 or invalid values are equivalent to not having the field at all, or give you your default ID.

This server is NOT intended to be a safe server for people to use to play the piano together or chat. It is purely meant as a playground for coders. It lacks some features such as adminmsg, saved channel data, and rate limits, all of which I have no intention of implementing later. It does, however, support most of the official server's protocol and message types.

This was written in under 24 hours, so there may be bugs. Feel free to report bugs in existing features to me on Discord: Lapis#7110

If you host this publicly, please make sure to change ID_SALT in .env to a long and secret value, otherwise people will be able to brute-force IP addresses of your users.

You might also like...

A JavaScript implementation of the Spring 83 protocol

An implementation of the Spring 83 protocol. Very much a work-in-progress. This was built in reference to draft-20220616.md@0f63d3d2. Setup Requires n

Aug 22, 2022

The Basement SDK has sensible defaults and flexibility to allow you to get the data you want efficiently and effortlessly.

Basement SDK The Basement SDK has sensible defaults and flexibility to allow you to get the data you want efficiently and effortlessly. Installation B

Dec 6, 2022

Offer a translation system to your users! a plugin capable of translating your website, simply and efficiently!

Offer a translation system to your users! a plugin capable of translating your website, simply and efficiently!

TranslateForMe Offer a translation system to your users, a plugin capable of translating your website, simply and efficiently! View Demo · Report Bug

Jan 12, 2022

Chrome Extension that enables you to read 30% more efficiently and easily!

Chrome Extension that enables you to read 30% more efficiently and easily!

Bionic Reading Extension that enables you to read 30% more efficiently and easily! About The Project All credits for this method go to https://bionic-

Jan 1, 2023

Open-source CD platform that helps developers to deliver applications efficiently by simplifying software releases and operations in any environment.

Open-source CD platform that helps developers to deliver applications efficiently by simplifying software releases and operations in any environment.

dyrector.io - The open source internal delivery platform Overview dyrector.io is an open-source internal delivery platform that helps developers to de

Jan 3, 2023

This tool allows you to draw up plans for facilities from Foxhole's new Inferno update. It takes power and resource needs into account to help you efficiently design your facilities.

This tool allows you to draw up plans for facilities from Foxhole's new Inferno update. It takes power and resource needs into account to help you efficiently design your facilities.

Foxhole Facility Planner This tool allows you to draw up plans for facilities from Foxhole's new Inferno update. It takes power and resource needs int

Dec 23, 2022

A simple, no-hassle library for efficiently querying Your Enrollment Services.

@vanderbilt/yes-api A simple, no-hassle library for efficiently querying Your Enrollment Services. Created by Dylan Hanson (jovialis) NOTE: THIS MODUL

Jan 25, 2022

Web application that manages your sales team efficiently.

Sales Incentive Management System Overview • Entities • APIs • Demo • Application Properties • Development • Build Overview Problem Statement Creating

Nov 28, 2022

A fast Protocol 6 Agar.io client for private servers

A fast Protocol 6 Agar.io client for private servers

Cigar3 A fast Protocol 6 Agar.io client for private servers Getting started. After installing nodejs, run npm install and npm run cigar3 in a terminal

Mar 6, 2022
Owner
Lapis
Lapis
A mock Twitter page implemented without, partially with, and then with a design system.

Design Systems Workshop A mock Twitter page implemented without, partially with, and then with a design system. Setup Install npm dependencies, then s

Josh Goldberg 5 Dec 8, 2022
Kasada's p.js partially deobfuscated, still has VM logic

Kasada's p.js Deobfuscated The script was obfuscated by replacing most strings with a function to grab the string from an array and decode it. Ex: _0x

null 11 Nov 9, 2022
🎹 Memorize piano scales with ease! A music practice program w/ MIDI support. Consider it an interactive reference manual

Piano Trainer Learn to play the piano at your own pace through various modes of practice. Watch the video Features MIDI compatible Home row keyboard i

Zane Helton 1.1k Dec 21, 2022
Learn to play the piano at your own pace through various modes of practice.

Piano Trainer Learn to play the piano at your own pace through various modes of practice. Features MIDI compatible Cross-platform support Interactive

Derek Jones 14 Aug 25, 2022
A basic implementation of Flappy Bird with real-time multiplayer using Hathora

Multiplayer Flappy Bird with Hathora A basic implementation of Flappy Bird with real-time multiplayer Overview This is a simple game of Flappy Bird ex

ourcade 11 Jul 1, 2022
A JavaScript module that shortens your code, makes life easier, and makes development faster!

Quxt A JavaScript module that shortens your code, makes life easier, and makes development faster! Installation npm install quxt Quick Start Check ind

Qux App 5 May 8, 2022
A Browser extension that not only makes your browsing experience safe but makes it optimized

Sia Sia is a browser extension that not only makes your browsing experience safe but makes it optimized Table of Contents About The Project Built With

Arun Govind M 14 Feb 23, 2022
A simple library for Node and the browser that allows you to rapidly develop stateful, socketed multiplayer games and web applications.

gameroom.js Overview gameroom.js is a simple library for Node and the browser that allows you to rapidly develop stateful, socketed multiplayer games

Jackson Bierfeldt 3 Nov 3, 2022
A simple implementation example (framework) of Deso Protocol's Smart Services.

This project serves as a simple implementation example (framework) of Deso Protocol's Smart Services. This framework comes with out-of-the-box SSL, MongoDB, dev/stage/prod environments, and modularity.

Hunter Paulson 5 Sep 22, 2022
GO implementation of the Terra 2.0 Protocol

The full-node software implementation of the Terra blockchain. Explore the Docs » Terra Core reference · Go API · Rest API · Finder · Station Terra mi

Terra 326 Jan 4, 2023