diff --git a/config.example.toml b/config.example.toml index 90ceb59..5c6c635 100644 --- a/config.example.toml +++ b/config.example.toml @@ -27,6 +27,7 @@ bancmd = "iptables -A INPUT -s $IP -j REJECT" moderatorEnabled = true usernameblacklist = [] maxChatLength = 100 +maxChatHistoryLength = 10 # Temporarily mute a user if they send more than x messages in n seconds automute = {enabled = true, seconds = 5, messages = 5} # How long a temporary mute lasts, in seconds diff --git a/src/IConfig.ts b/src/IConfig.ts index 9d0f81e..ab8ec6e 100644 --- a/src/IConfig.ts +++ b/src/IConfig.ts @@ -21,6 +21,7 @@ export default interface IConfig { moderatorEnabled : boolean; usernameblacklist : string[]; maxChatLength : number; + maxChatHistoryLength : number; automute : { enabled: boolean; seconds: number; diff --git a/src/WSServer.ts b/src/WSServer.ts index f53fd33..188ed27 100644 --- a/src/WSServer.ts +++ b/src/WSServer.ts @@ -47,13 +47,13 @@ export default class WSServer { private ModPerms : number; private VM : VM; constructor(config : IConfig, vm : VM) { - this.ChatHistory = new CircularBuffer<{user:string,msg:string}>(Array, 5); + this.Config = config; + this.ChatHistory = new CircularBuffer<{user:string,msg:string}>(Array, this.Config.collabvm.maxChatHistoryLength); this.TurnQueue = new Queue(); this.TurnTime = 0; this.TurnIntervalRunning = false; this.clients = []; this.ips = []; - this.Config = config; this.voteInProgress = false; this.voteTime = 0; this.voteCooldown = 0;