File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,10 @@ const common_config = {
141
141
kick_other_sessions : true
142
142
} ,
143
143
144
+ chat : {
145
+ create_global_chat : true
146
+ } ,
147
+
144
148
tps : 20 , // tickrate
145
149
146
150
// Disable some of the features that you don't need in your game
Original file line number Diff line number Diff line change @@ -2,15 +2,17 @@ import Chat, { chatCreate } from "#concepts/chat";
2
2
import ChatLog from "#schemas/chat" ;
3
3
4
4
// create instances of every chat from the DB
5
- const chatLogs = await ChatLog . find ( { } ) ;
6
- chatLogs . forEach ( chatlog => {
7
- let chat = new Chat ( chatlog ) ;
8
- global . chats [ chat . chat_id ] = chat ;
9
- } ) ;
5
+ if ( global . config . db_enabled ) {
6
+ const chatLogs = await ChatLog . find ( { } ) ;
7
+ chatLogs . forEach ( chatlog => {
8
+ let chat = new Chat ( chatlog ) ;
9
+ global . chats [ chat . chat_id ] = chat ;
10
+ } ) ;
11
+ }
10
12
11
13
12
14
// create a new id=0 "global" chat if it doesn't exist already
13
- if ( global . chats [ '0' ] === undefined ) {
15
+ if ( global . chats [ '0' ] === undefined && global . config . chat . create_global_chat ) {
14
16
let chatlog = new ChatLog ( ) ;
15
17
chatlog . _id = '0' ;
16
18
You can’t perform that action at this time.
0 commit comments