|
|
@ -56,6 +56,7 @@ function newMessage(data) {
|
|
|
|
switch(data.type) {
|
|
|
|
switch(data.type) {
|
|
|
|
case "join":
|
|
|
|
case "join":
|
|
|
|
userJoin(data.content, data.date);
|
|
|
|
userJoin(data.content, data.date);
|
|
|
|
|
|
|
|
serverMessage(data.content + " has joined the server", data.date);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "leave":
|
|
|
|
case "leave":
|
|
|
|
userLeave(data.content, data.date);
|
|
|
|
userLeave(data.content, data.date);
|
|
|
@ -116,7 +117,6 @@ function userJoin(user, date) {
|
|
|
|
p.className = user;
|
|
|
|
p.className = user;
|
|
|
|
p.innerText = user;
|
|
|
|
p.innerText = user;
|
|
|
|
document.getElementById("users").appendChild(p);
|
|
|
|
document.getElementById("users").appendChild(p);
|
|
|
|
serverMessage(user + " has joined the server", date);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function userLeave(user, date) {
|
|
|
|
function userLeave(user, date) {
|
|
|
|