exoscoriae / eXoDOS

eXoDOS
71 stars 3 forks source link

eXo\util\launch.bat search issues #5356

Closed parricc closed 3 months ago

parricc commented 3 months ago

In util\launch.bat, two changes are necessary to ensure the right games are getting selected by findstr statements for a couple outlying situations.

Affected games: Games with names in their entirety that are identical to the name ending of another game.

First change:

for /F "delims=" %%a in ('findstr /i /C:"%GameName%" .\util\multiplayer.txt') do (set multi=yes) should be: for /F "delims=" %%a in ('findstr /i /C:":%GameName%" .\util\multiplayer.txt') do (set multi=yes)

What is the change: The : character is added as an anchor to ensure that the correct game text is being pulled from the util\multiplayer.txt file to test whether a game is multiplayer.

Why: This ensures games with identical endings such as Blood (1997) and Cryptic Passages for Blood (1997) check themselves. Yes, those happen to both be multiplayer games, but with over 7000 games, there are other games with the same naming situations. When looking for a specific game to test whether it is multiplayer, we do not want any other game to be tested instead.

Second change:

findstr /C:"%GameName%" .\util\aria\index.txt >Nul should be: findstr /C:":%GameName%" .\util\aria\index.txt >Nul

What is the change: The : character is added as an anchor to ensure that the correct game text is being pulled from the util\aria\index.txt file to test whether an English version of a game exists in the aria index.

Why: This involves the same situation as in the first change. We want to return a result only for the game we are wanting to find and no other possible game. There is a : character before each game name in the aria index file that can be used as an anchorpoint.

Note: Nothing in this ticket concerns language packs, and the above changes do not affect any lines involving language pack text files. The text files that the language packs use follow a different formatting convention than the equivalent files in the base eXoDOS collection. As such, to eliminate similar situations that could arise for the language packs in the future, their equivalent findstr lines would need to be handled differently. A discussion would also need to happen with Timber before implementing any language pack changes to ensure that all language packs are and will continue to follow the same file formatting convention that the GLP currently is using.

exoscoriae commented 3 months ago

approved. same trick I was using in other areas. should have been applied to all