Compare commits
4 Commits
8a8ce405fd
...
00ec1f5640
Author | SHA1 | Date |
---|---|---|
Hri7566 | 00ec1f5640 | |
Hri7566 | b6e9ccd441 | |
Hri7566 | 89613ca641 | |
Hri7566 | db36945ae8 |
|
@ -12,7 +12,6 @@
|
||||||
"bun-types": "^1.0.1",
|
"bun-types": "^1.0.1",
|
||||||
"commander": "^11.1.0",
|
"commander": "^11.1.0",
|
||||||
"date-holidays": "^3.21.5",
|
"date-holidays": "^3.21.5",
|
||||||
"dotenv": "^8.6.0",
|
|
||||||
"events": "^3.3.0",
|
"events": "^3.3.0",
|
||||||
"fancy-text-converter": "^1.0.9",
|
"fancy-text-converter": "^1.0.9",
|
||||||
"keccak": "^2.1.0",
|
"keccak": "^2.1.0",
|
||||||
|
|
|
@ -53,14 +53,14 @@ export class Channel extends EventEmitter {
|
||||||
public logger: Logger;
|
public logger: Logger;
|
||||||
public chatHistory = new Array<ClientEvents["a"]>();
|
public chatHistory = new Array<ClientEvents["a"]>();
|
||||||
|
|
||||||
// TODO Add the crown
|
|
||||||
public crown?: Crown;
|
public crown?: Crown;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private _id: string,
|
private _id: string,
|
||||||
set?: Partial<IChannelSettings>,
|
set?: Partial<IChannelSettings>,
|
||||||
creator?: Socket,
|
creator?: Socket,
|
||||||
owner_id?: string
|
owner_id?: string,
|
||||||
|
public stays: boolean = false
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ export class Channel extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.ppl.length == 0) {
|
if (this.ppl.length == 0 && !this.stays) {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -562,10 +562,10 @@ export default Channel;
|
||||||
let hasFullChannel = false;
|
let hasFullChannel = false;
|
||||||
|
|
||||||
for (const id of config.forceLoad) {
|
for (const id of config.forceLoad) {
|
||||||
new Channel(id);
|
new Channel(id, undefined, undefined, undefined, true);
|
||||||
if (id == config.fullChannel) hasFullChannel = true;
|
if (id == config.fullChannel) hasFullChannel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasFullChannel) {
|
if (!hasFullChannel) {
|
||||||
new Channel(config.fullChannel);
|
new Channel(config.fullChannel, undefined, undefined, undefined, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
* by Hri7566
|
* by Hri7566
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Preload environment variables
|
|
||||||
import env from "./util/env";
|
|
||||||
|
|
||||||
// import { app } from "./ws/server";
|
// import { app } from "./ws/server";
|
||||||
import "./ws/server";
|
import "./ws/server";
|
||||||
import { Logger } from "./util/Logger";
|
import { Logger } from "./util/Logger";
|
||||||
|
|
|
@ -395,7 +395,13 @@ export class Socket extends EventEmitter {
|
||||||
ch.playNotes(msg, this);
|
ch.playNotes(msg, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public subscribeToChannelList() {}
|
public subscribeToChannelList() {
|
||||||
|
// TODO Channel list subbing
|
||||||
|
}
|
||||||
|
|
||||||
|
public unsubscribeFromChannelList() {
|
||||||
|
// TODO Channel list unsubbing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const socketsBySocketID = new Map<string, Socket>();
|
export const socketsBySocketID = new Map<string, Socket>();
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
import { ServerEventListener } from "../../../../util/types";
|
||||||
|
|
||||||
|
export const minus_ls: ServerEventListener<"-ls"> = {
|
||||||
|
id: "-ls",
|
||||||
|
callback: (msg, socket) => {
|
||||||
|
socket.unsubscribeFromChannelList();
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue