From 4d623cae3f78d454c131ac80f8c870a5e86d3ef6 Mon Sep 17 00:00:00 2001 From: Hri7566 Date: Mon, 4 Nov 2024 21:19:56 -0500 Subject: [PATCH] Disable crown config --- src/channel/Channel.ts | 16 +++++++++------- src/channel/config.ts | 4 +++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/channel/Channel.ts b/src/channel/Channel.ts index c0600d1..a97154c 100644 --- a/src/channel/Channel.ts +++ b/src/channel/Channel.ts @@ -181,14 +181,16 @@ export class Channel extends EventEmitter { } } - // We are not a lobby, so we probably have a crown - // this.getFlag("no_crown"); - this.crown = new Crown(); + if (!config.disableCrown) { + // We are not a lobby, so we probably have a crown + // this.getFlag("no_crown"); + this.crown = new Crown(); - // ...and, possibly, an owner, too - if (creator) { - const part = creator.getParticipant(); - if (part) this.giveCrown(part, true, false); + // ...and, possibly, an owner, too + if (creator) { + const part = creator.getParticipant(); + if (part) this.giveCrown(part, true, false); + } } } else { this.settings = config.lobbySettings; diff --git a/src/channel/config.ts b/src/channel/config.ts index ce5d7ae..5f5182e 100644 --- a/src/channel/config.ts +++ b/src/channel/config.ts @@ -12,6 +12,7 @@ interface ChannelConfig { chownOnRejoin: boolean; channelDestroyTimeout: number; maxBanMinutes: number; + disableCrown: boolean; } export const config = ConfigManager.loadConfig( @@ -46,6 +47,7 @@ export const config = ConfigManager.loadConfig( sendLimit: false, chownOnRejoin: true, channelDestroyTimeout: 1000, - maxBanMinutes: 60 + maxBanMinutes: 60, + disableCrown: false } );