Added channel-kicks. added up disconnect message

This commit is contained in:
rainbow napkin 2024-11-27 03:02:58 -05:00
parent 796bb033a7
commit 5c30508e96
5 changed files with 30 additions and 5 deletions

View file

@ -43,6 +43,14 @@ class channel{
document.title = `${this.channelName} - Connected`
});
this.socket.on("kick", (data) => {
if(data.type == "kick"){
window.alert(`You have been kicked from the channel for the following reason:\n\n${data.reason}`);
}else{
window.alert(`You have been disconnceted from the channel by the server!\nType: ${data.type}\nReason: ${data.reason}`);
}
});
this.socket.on("clientMetadata", this.handleClientInfo.bind(this));
this.socket.on("error", console.log);