@@ -8,7 +8,7 @@ import { resolveCFGFilePath, validateFixServerConfig } from '@lib/fxserver/fxsCo
88import { msToShortishDuration } from '@lib/misc' ;
99import { SYM_SYSTEM_AUTHOR } from '@lib/symbols' ;
1010import { UpdateConfigKeySet } from '@modules/ConfigStore/utils' ;
11- import { childProcessEventBlackHole , getFxSpawnVariables , getMutableConvars , isValidChildProcess , mutableConvarConfigDependencies , stringifyConsoleArgs } from './utils' ;
11+ import { childProcessEventBlackHole , getFxSpawnVariables , getMutableConvars , isValidChildProcess , mutableConvarConfigDependencies , setupCustomLocaleFile , stringifyConsoleArgs } from './utils' ;
1212import ProcessManager , { ChildProcessStateInfo } from './ProcessManager' ;
1313import handleFd3Messages from './handleFd3Messages' ;
1414import ConsoleLineEnum from '@modules/Logger/FXServerLogger/ConsoleLineEnum' ;
@@ -41,7 +41,7 @@ export default class FxRunner {
4141 * Triggers a convar update
4242 */
4343 public handleConfigUpdate ( updatedConfigs : UpdateConfigKeySet ) {
44- this . updateMutableConvars ( ) ;
44+ this . updateMutableConvars ( ) . catch ( ( ) => { } ) ;
4545 }
4646
4747
@@ -116,7 +116,7 @@ export default class FxRunner {
116116 return msg ;
117117 }
118118
119- //Setup spawn variables
119+ //Setup spawn variables & locale file
120120 let fxSpawnVars ;
121121 const newServerMutex = genMutex ( ) ;
122122 try {
@@ -128,6 +128,13 @@ export default class FxRunner {
128128 console . error ( errMsg ) ;
129129 return errMsg ;
130130 }
131+ try {
132+ await setupCustomLocaleFile ( ) ;
133+ } catch ( error ) {
134+ const errMsg = `Error copying custom locale: ${ ( error as any ) . message } ` ;
135+ console . error ( errMsg ) ;
136+ return errMsg ;
137+ }
131138
132139 //If there is any FXServer configuration missing
133140 if ( ! this . isConfigured ) {
@@ -355,9 +362,10 @@ export default class FxRunner {
355362 * Useful for when we change txAdmin settings and want it to reflect on the server.
356363 * This will also fire the `txAdmin:event:configChanged`
357364 */
358- private updateMutableConvars ( ) {
365+ private async updateMutableConvars ( ) {
359366 console . log ( 'Updating FXServer ConVars.' ) ;
360367 try {
368+ await setupCustomLocaleFile ( ) ;
361369 const convarList = getMutableConvars ( false ) ;
362370 for ( const [ set , convar , value ] of convarList ) {
363371 this . sendCommand ( set , [ convar , value ] , SYM_SYSTEM_AUTHOR ) ;
0 commit comments