nagalun / multiplayerpiano-server

Unofficial server for the http://multiplayerpiano.com client.
https://piano.ourworldofpixels.com
ISC License
12 stars 16 forks source link

. #7

Closed ghost closed 6 years ago

ghost commented 6 years ago

.

nagalun commented 6 years ago

You mean on ourworldofpixels.com/piano? I closed it some time ago due to abuse, people were connecting proxies (that didn't interact with the server) just to take up connection slots and lag the server. I may try to fix it, and open the server again. EDIT: nevermind, didn't see your second comment, but I can't seem to access your site

nagalun commented 6 years ago

Try this: https://github.com/nagalun/multiplayerpiano-server/releases/tag/1.0.2 Please reopen if it didn't fix the issue

nagalun commented 6 years ago

Please be patient. I went to sleep since it was late, no need to delete your comments.. Anyways, here is the server without the color change: mpp-sv-64x-1.0.2.1-shared.zip

nagalun commented 6 years ago

kickban is not implemented on this server atm, and the only admin command is the color change feature, sorry! Automatic sustain should be enabled by modifying the script.js (not server related) As for the admin command not working, make sure you type the correct password and color. You can get all user's id in the current room (not the _id, it is different) with this code:

Object.keys(MPP.client.ppl).reduce((a, b) => `${a}\n${b} -> ${MPP.client.ppl[b].name} (${MPP.client.ppl[b].color})`,'');

It will return a string to the console that has the id and the user it refers to: userId -> userName (userColor) For example: 1529944377885 -> Anonymoose (#fb62a0) To change the user's color it would be:

MPP.client.sendArray([{m: "adminmsg", password: "123456", message: {m: "color", id: "1529944377885", color: "#a92111"}}]);
nagalun commented 6 years ago

Try this, if there is more than one user with the same name it will change all that match:

function changeColor(name, newColor) {
    Object.keys(MPP.client.ppl)
    .filter(id => MPP.client.ppl[id].name === name)
    .forEach(id => {
        MPP.client.sendArray([{m: "adminmsg", password: "123456", message: {m: "color", id: id, color: newColor}}]);
    });
}

Change the password and after pasting it in console use it like this: changeColor("Anonymoose", "#a92111");

nagalun commented 6 years ago

:/ use setInterval(() => { changeColor(...); }, milliseconds);... I'll let you figure out how to calculate the hex string :) https://krazydad.com/tutorials/makecolors.php

nagalun commented 6 years ago

if you still don't hear other people play delete extbinary.js from the client and it will work