@@ -111,16 +111,24 @@ export default class ProcessServer {
111111 else {
112112 newPath = path ;
113113 }
114- newPath = newPath . substr ( newPath . lastIndexOf ( '/' ) + 1 ) ;
114+ // newPath = newPath.substr(newPath.lastIndexOf('/') + 1);
115+ // newPath = path.split('/').slice(-2).join('/');
115116
116117 // log(`performance checkpoint: ${(performance.now() - startTime).toFixed(2)}ms`);
117118
118- toCompare . push ( newPath ) ;
119+ // add the original path
120+ toCompare . push ( path ) ;
121+ // toCompare.push(newPath);
119122 if ( path . includes ( '.exe' ) ) {
120123 const part2 = path . split ( '/' ) . slice ( - 2 ) . join ( '/' ) ;
121124 toCompare . push ( part2 ) ;
122125 replaceAll ( toCompare , bitness_suffixes ) ;
123126 }
127+ for ( const inlist of toCompare ) {
128+ if ( inlist . includes ( 'valheim' ) ) {
129+ debug ( `ToCompare: ${ inlist } ` )
130+ }
131+ }
124132
125133 // TODO: Convert into an inline function similar to findInObjArray
126134 // TODO: Don't try to match the running executable more than once
@@ -138,7 +146,8 @@ export default class ProcessServer {
138146 }
139147 } else {
140148 if (
141- toCompare . some ( ( running ) => {
149+ toCompare . some ( ( running_raw ) => {
150+ const running = running_raw . split ( '/' ) . slice ( - 2 ) . join ( '/' ) ; // Format used by many of discord's database
142151 // explicit match first
143152 if ( known_exe . name === running ) {
144153 // debug(`Match Level 2: "${name}" via ${known_exe.name} <==> ${running}`)
@@ -149,6 +158,10 @@ export default class ProcessServer {
149158 // debug(`Match Level 3: "${name}" via ${known_exe.name} <==> ${running}`)
150159 return true
151160 }
161+ if ( known_exe . name === running . replace ( '.x86_64' , '.exe' ) ) {
162+ // debug(`Match Level 3.1: "${name}" via ${known_exe.name} <==> ${running}`)
163+ return true
164+ }
152165 // Try comparing against an exe-less version (mistake in database)
153166 if ( known_exe . name === running . replace ( '.exe' , '' ) ) {
154167 // debug(`Match Level 4: "${name}" via ${known_exe.name} <==> ${running}`)
0 commit comments