forked from Hri7566/mpp-server-dev2
Add bye message
This commit is contained in:
parent
2f3311be1f
commit
0ece65e940
|
@ -409,7 +409,9 @@ export class Socket extends EventEmitter {
|
||||||
public subscribeToChannelList() {
|
public subscribeToChannelList() {
|
||||||
ChannelList.subscribe(this.id);
|
ChannelList.subscribe(this.id);
|
||||||
|
|
||||||
const firstList = ChannelList.getPublicList().map(v => v.getInfo(this._id));
|
const firstList = ChannelList.getPublicList().map(v =>
|
||||||
|
v.getInfo(this._id)
|
||||||
|
);
|
||||||
this.sendChannelList(firstList);
|
this.sendChannelList(firstList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { ServerEventListener } from "../../../../util/types";
|
||||||
|
|
||||||
|
export const bye: ServerEventListener<"bye"> = {
|
||||||
|
id: "bye",
|
||||||
|
callback: (msg, socket) => {
|
||||||
|
// Leave server
|
||||||
|
socket.destroy();
|
||||||
|
}
|
||||||
|
};
|
|
@ -14,6 +14,7 @@ import { minus_ls } from "./handlers/-ls";
|
||||||
import { admin_message } from "./handlers/admin_message";
|
import { admin_message } from "./handlers/admin_message";
|
||||||
import { chset } from "./handlers/chset";
|
import { chset } from "./handlers/chset";
|
||||||
import { kickban } from "./handlers/kickban";
|
import { kickban } from "./handlers/kickban";
|
||||||
|
import { bye } from "./handlers/bye";
|
||||||
|
|
||||||
// Imagine not having an "addMany" function...
|
// Imagine not having an "addMany" function...
|
||||||
|
|
||||||
|
@ -42,7 +43,8 @@ EVENTGROUP_USER.addMany(
|
||||||
minus_ls,
|
minus_ls,
|
||||||
admin_message,
|
admin_message,
|
||||||
chset,
|
chset,
|
||||||
kickban
|
kickban,
|
||||||
|
bye
|
||||||
);
|
);
|
||||||
|
|
||||||
eventGroups.push(EVENTGROUP_USER);
|
eventGroups.push(EVENTGROUP_USER);
|
||||||
|
|
Loading…
Reference in New Issue