forked from ppfun/pixelplanet
APISocket less noisy
This commit is contained in:
parent
0360ba0dc1
commit
95bfcae964
|
@ -164,7 +164,6 @@ class APISocketServer extends WebSocketEvents {
|
||||||
}
|
}
|
||||||
|
|
||||||
async onTextMessage(message, ws) {
|
async onTextMessage(message, ws) {
|
||||||
logger.info(`Got message ${message}`);
|
|
||||||
try {
|
try {
|
||||||
const packet = JSON.parse(message);
|
const packet = JSON.parse(message);
|
||||||
const command = packet[0];
|
const command = packet[0];
|
||||||
|
@ -183,6 +182,7 @@ class APISocketServer extends WebSocketEvents {
|
||||||
if (even == 'online') {
|
if (even == 'online') {
|
||||||
ws.subOnline = true;
|
ws.subOnline = true;
|
||||||
}
|
}
|
||||||
|
logger.info(`APISocket client subscribed to ${command}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (command == 'setpxl') {
|
if (command == 'setpxl') {
|
||||||
|
@ -209,6 +209,7 @@ class APISocketServer extends WebSocketEvents {
|
||||||
]));
|
]));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
logger.info(`APISocket message ${message}`);
|
||||||
if (command == 'login') {
|
if (command == 'login') {
|
||||||
const [minecraftid, minecraftname, ip] = packet;
|
const [minecraftid, minecraftname, ip] = packet;
|
||||||
const user = await this.mc.report_login(minecraftid, minecraftname);
|
const user = await this.mc.report_login(minecraftid, minecraftname);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user