message: Added doorstop v4 support
diff: @@ -10,6 +10,18 @@ import { GameInstanceType } from '../../../../../model/game/GameInstanceType';
  export default class BepInExGameInstructions extends GameInstructionGenerator {
  public async generate(game: Game, profile: Profile): Promise<GameInstruction> {
  + if (await FsProvider.instance.exists(path.join(profile.getPathOfProfile(), ".doorstop_version"))) {
  + const dvContent = (await FsProvider.instance.readFile(path.join(profile.getPathOfProfile(), ".doorstop_version"))).toString();
  + const majorVersion = Number(dvContent.split(".")[0]);
  + if (majorVersion === 4) {
  + return this.genDoorstopV4(game, profile);
  + }
  + }
  + // Fallback to V3.
  + return this.genDoorstopV3(game, profile);
  + }
  +
  + private async genDoorstopV3(game: Game, profile: Profile): Promise<GameInstruction> {
  let extraArguments = "";
  if (["linux", "darwin"].includes(process.platform.toLowerCase())) {
  extraArguments += ` --r2profile "${DynamicGameInstruction.PROFILE_NAME}"`;
  @@ -26,4 +38,21 @@ export default class BepInExGameInstructions extends GameInstructionGenerator {
  };
  }
  + private async genDoorstopV4(game: Game, profile: Profile): Promise<GameInstruction> {
  + let extraArguments = "";
  + if (["linux", "darwin"].includes(process.platform.toLowerCase())) {
  + extraArguments += ` --r2profile "${DynamicGameInstruction.PROFILE_NAME}"`;
  + if (game.instanceType === GameInstanceType.SERVER) {
  + extraArguments += ` --server`;
  + }
  + if (await FsProvider.instance.exists(path.join(Profile.getActiveProfile().getPathOfProfile(), "unstripped_corlib"))) {
  + extraArguments += ` --doorstop-mono-dll-search-path-override "${DynamicGameInstruction.BEPINEX_CORLIBS}"`;
  + }
  + }
  + return {
  + moddedParameters: `--doorstop-enabled true --doorstop-target-assembly "${DynamicGameInstruction.BEPINEX_PRELOADER_PATH}"${extraArguments.trimEnd()}`,
  + vanillaParameters: `--doorstop-enabled false`
  + };
  + }
  +
  }
  