forked from CringeStudios/gamja
Handle RPL_WELCOME
This commit is contained in:
parent
8b35d40702
commit
a8e876843b
@ -181,9 +181,6 @@ function connect() {
|
|||||||
ws.onopen = function() {
|
ws.onopen = function() {
|
||||||
console.log("Connection opened");
|
console.log("Connection opened");
|
||||||
|
|
||||||
// TODO: wait for RPL_WELCOME
|
|
||||||
connectElt.style.display = "none";
|
|
||||||
|
|
||||||
if (server.pass) {
|
if (server.pass) {
|
||||||
ws.send(formatMessage({ command: "PASS", params: [server.pass] }));
|
ws.send(formatMessage({ command: "PASS", params: [server.pass] }));
|
||||||
}
|
}
|
||||||
@ -199,6 +196,10 @@ function connect() {
|
|||||||
console.log(msg);
|
console.log(msg);
|
||||||
|
|
||||||
switch (msg.command) {
|
switch (msg.command) {
|
||||||
|
case RPL_WELCOME:
|
||||||
|
console.log("Registration complete");
|
||||||
|
connectElt.style.display = "none";
|
||||||
|
break;
|
||||||
case "NOTICE":
|
case "NOTICE":
|
||||||
case "PRIVMSG":
|
case "PRIVMSG":
|
||||||
var target = msg.params[0];
|
var target = msg.params[0];
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
const RPL_WELCOME = "001";
|
||||||
|
|
||||||
function parsePrefix(s) {
|
function parsePrefix(s) {
|
||||||
var prefix = {
|
var prefix = {
|
||||||
name: null,
|
name: null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user