|
@ -26,7 +26,7 @@ server.create = function create() { |
|
|
tokenized[lastParam] = tokenized[lastParam] + " " + splitted[i] |
|
|
tokenized[lastParam] = tokenized[lastParam] + " " + splitted[i] |
|
|
} else if (splitted[i].charAt(0) == ":" && i > 0) { |
|
|
} else if (splitted[i].charAt(0) == ":" && i > 0) { |
|
|
lastParam = i |
|
|
lastParam = i |
|
|
tokenized[lastParam] = splitted[i] |
|
|
|
|
|
|
|
|
tokenized[lastParam] = splitted[i].slice(1) |
|
|
} else { |
|
|
} else { |
|
|
tokenized[i] = splitted[i] |
|
|
tokenized[i] = splitted[i] |
|
|
} |
|
|
} |
|
@ -62,6 +62,12 @@ server.create = function create() { |
|
|
let address = user.getAddress() |
|
|
let address = user.getAddress() |
|
|
socket.write(`001 ${user.nickname} :Welcome to the example IRC Project ${user.nickname}!~${user.username}@${address}`) |
|
|
socket.write(`001 ${user.nickname} :Welcome to the example IRC Project ${user.nickname}!~${user.username}@${address}`) |
|
|
break; |
|
|
break; |
|
|
|
|
|
case "PRIVMSG": |
|
|
|
|
|
let target = userlist[tokenized[1]] |
|
|
|
|
|
let message = tokenized[2] |
|
|
|
|
|
|
|
|
|
|
|
target.sendMsg(user, message) |
|
|
|
|
|
break; |
|
|
case "QUIT": |
|
|
case "QUIT": |
|
|
server.closeConnection(user.nickname) |
|
|
server.closeConnection(user.nickname) |
|
|
break; |
|
|
break; |
|
|