@@ -58,7 +58,11 @@ class ProcessBuilder {
5858 args = args . concat ( this . constructModList ( modObj . fMods ) )
5959 }
6060
61- logger . info ( 'Launch Arguments:' , args )
61+ // Hide access token
62+ const loggableArgs = [ ...args ]
63+ loggableArgs [ loggableArgs . findIndex ( x => x === this . authUser . accessToken ) ] = '**********'
64+
65+ logger . info ( 'Launch Arguments:' , loggableArgs )
6266
6367 const child = child_process . spawn ( ConfigManager . getJavaExecutable ( this . server . rawServer . id ) , args , {
6468 cwd : this . gameDir ,
@@ -832,9 +836,7 @@ class ProcessBuilder {
832836 libs [ mdl . getVersionlessMavenIdentifier ( ) ] = mdl . getPath ( )
833837 if ( mdl . subModules . length > 0 ) {
834838 const res = this . _resolveModuleLibraries ( mdl )
835- if ( res . length > 0 ) {
836- libs = { ...libs , ...res }
837- }
839+ libs = { ...libs , ...res }
838840 }
839841 }
840842 }
@@ -843,9 +845,7 @@ class ProcessBuilder {
843845 for ( let i = 0 ; i < mods . length ; i ++ ) {
844846 if ( mods . sub_modules != null ) {
845847 const res = this . _resolveModuleLibraries ( mods [ i ] )
846- if ( res . length > 0 ) {
847- libs = { ...libs , ...res }
848- }
848+ libs = { ...libs , ...res }
849849 }
850850 }
851851
@@ -856,27 +856,25 @@ class ProcessBuilder {
856856 * Recursively resolve the path of each library required by this module.
857857 *
858858 * @param {Object } mdl A module object from the server distro index.
859- * @returns {Array.< string> } An array containing the paths of each library this module requires.
859+ * @returns {{[id: string]: string} } An object containing the paths of each library this server requires.
860860 */
861861 _resolveModuleLibraries ( mdl ) {
862862 if ( ! mdl . subModules . length > 0 ) {
863- return [ ]
863+ return { }
864864 }
865- let libs = [ ]
865+ let libs = { }
866866 for ( let sm of mdl . subModules ) {
867867 if ( sm . rawModule . type === Type . Library ) {
868868
869869 if ( sm . rawModule . classpath ?? true ) {
870- libs . push ( sm . getPath ( ) )
870+ libs [ sm . getVersionlessMavenIdentifier ( ) ] = sm . getPath ( )
871871 }
872872 }
873873 // If this module has submodules, we need to resolve the libraries for those.
874874 // To avoid unnecessary recursive calls, base case is checked here.
875875 if ( mdl . subModules . length > 0 ) {
876876 const res = this . _resolveModuleLibraries ( sm )
877- if ( res . length > 0 ) {
878- libs = libs . concat ( res )
879- }
877+ libs = { ...libs , ...res }
880878 }
881879 }
882880 return libs
0 commit comments