@@ -57,11 +57,16 @@ const resourceName = GetCurrentResourceName();
5757//9423 = feat(server): add more infos to playerDropped event
5858//9655 = Fixed ScanResourceRoot + latent events
5959const minFxsVersion = 5894 ;
60- const fxsVerParsed = parseFxserverVersion ( getConvarString ( 'version' ) ) ;
60+ const fxsVerConvar = getConvarString ( 'version' ) ;
61+ const fxsVerParsed = parseFxserverVersion ( fxsVerConvar ) ;
6162const fxsVersion = fxsVerParsed . valid ? fxsVerParsed . build : 99999 ;
6263if ( ! fxsVerParsed . valid ) {
6364 console . error ( 'It looks like you are running a custom build of fxserver.' ) ;
6465 console . error ( 'And because of that, there is no guarantee that txAdmin will work properly.' ) ;
66+ console . error ( `Convar: ${ fxsVerConvar } ` ) ;
67+ console . error ( `Parsed Build: ${ fxsVerParsed . build } ` ) ;
68+ console . error ( `Parsed Branch: ${ fxsVerParsed . branch } ` ) ;
69+ console . error ( `Parsed Platform: ${ fxsVerParsed . platform } ` ) ;
6570} else if ( fxsVerParsed . build < minFxsVersion ) {
6671 fatalError . GlobalData ( 2 , [
6772 'This version of FXServer is too outdated and NOT compatible with txAdmin' ,
@@ -187,6 +192,7 @@ if (txDevEnvSrc.ENABLED) {
187192
188193/**
189194 * MARK: Host type check
195+ * TODO: move all the hosting stuff to another file
190196 */
191197//Checking for ZAP Configuration file
192198const zapCfgFile = path . join ( dataPath , 'txAdminZapConfig.json' ) ;
@@ -196,7 +202,18 @@ let forceFXServerPort: false | number;
196202let txAdminPort : number ;
197203let loginPageLogo : false | string ;
198204let defaultMasterAccount : false | { name : string , password_hash : string } ;
199- let deployerDefaults : false | Record < string , string > ;
205+
206+ type DeployerDefaultsType = {
207+ license ?: string ,
208+ maxClients ?: number ,
209+ mysqlHost ?: string ,
210+ mysqlPort ?: string ,
211+ mysqlUser ?: string ,
212+ mysqlPassword ?: string ,
213+ mysqlDatabase ?: string ,
214+ }
215+
216+ let deployerDefaults : undefined | DeployerDefaultsType ;
200217const isPterodactyl = ! isWindows && process . env ?. TXADMIN_ENABLE === '1' ;
201218if ( fs . existsSync ( zapCfgFile ) ) {
202219 isZapHosting = ! isPterodactyl ;
@@ -209,6 +226,7 @@ if (fs.existsSync(zapCfgFile)) {
209226 txAdminPort = zapCfgData . txAdminPort ;
210227 loginPageLogo = zapCfgData . loginPageLogo ;
211228 defaultMasterAccount = false ;
229+ //FIXME: add validation
212230 deployerDefaults = {
213231 license : zapCfgData . defaults . license ,
214232 maxClients : zapCfgData . defaults . maxClients ,
@@ -238,7 +256,6 @@ if (fs.existsSync(zapCfgFile)) {
238256 forceFXServerPort = false ;
239257 loginPageLogo = false ;
240258 defaultMasterAccount = false ;
241- deployerDefaults = false ;
242259
243260 const txAdminPortConvar = GetConvar ( 'txAdminPort' , '40120' ) . trim ( ) ;
244261 if ( ! / ^ \d + $ / . test ( txAdminPortConvar ) ) {
0 commit comments