make motd make more sense

This commit is contained in:
ayunami2000 2022-04-14 10:26:04 -04:00
parent 31deea629f
commit 7827cdf7dd

View File

@ -11,7 +11,7 @@ const listenPort = 25565;
const mcHost = "localhost"; const mcHost = "localhost";
const mcPort = 25569; const mcPort = 25569;
const serverName = "ayunMultiPort Server"; const serverName = "ayunMultiPort Server";
const serverMotd = "line1\nline2"; const serverMotd = ["line1", "line2"];
const serverMaxPlayers = 20; const serverMaxPlayers = 20;
const serverOnlinePlayers = 4; const serverOnlinePlayers = 4;
const serverPlayers = ["Welcome to my", "ayunMultiPort-powered", "Eaglercraft server!"]; const serverPlayers = ["Welcome to my", "ayunMultiPort-powered", "Eaglercraft server!"];
@ -62,7 +62,7 @@ const httpsrv = require("http").createServer((req,res)=>{
const wss = new WebSocketServer({ server: httpsrv }); const wss = new WebSocketServer({ server: httpsrv });
const motdBase = {data:{motd:serverMotd.split("\n"),cache:true,max:serverMaxPlayers,players:serverPlayers,icon:serverIcon!=null,online:serverOnlinePlayers},vers:"0.2.0",name:serverName,time:0,type:"motd",brand:"Eagtek",uuid:crypto.randomUUID(),cracked:true}; const motdBase = {data:{motd:serverMotd,cache:true,max:serverMaxPlayers,players:serverPlayers,icon:serverIcon!=null,online:serverOnlinePlayers},vers:"0.2.0",name:serverName,time:0,type:"motd",brand:"Eagtek",uuid:crypto.randomUUID(),cracked:true};
function getMotd(){ function getMotd(){
motdBase.time = Date.now(); motdBase.time = Date.now();
return JSON.stringify(motdBase); return JSON.stringify(motdBase);