DoomLauncher icon indicating copy to clipboard operation
DoomLauncher copied to clipboard

Improved sync

Open kenbot opened this issue 5 months ago • 3 comments
trafficstars

1. IsSyncNeeded feature

  • GameFile now has a boolean IsSyncNeeded field. This allows us to modify how syncing, thumbnail images, etc are generated and ensuring that users will see the new content next time they upgrade DoomLauncher
  • If set, the application will automatically lazily resync files as it displays them in the GUI
  • Works for both tile view & grid view
  • Where there are multiple pages, only resyncs the GameFiles in the displayed page
  • The DB upgrade sets it to 1 for all GameFiles, so as of the next release, users will have all their stuff automatically resynced
  • @nstlaurent btw would you mind letting me know when you plan to cut the next release? I'll make sure to cram as many sync improvements in as possible by then, to minimise the forced resyncing

2. IntendedGame feature

  • GameFile now has an IntendedGame field. This is so we can judge what game the wad is supposed to be played with, even if they don't have that IWAD installed.
  • Drops the IsDoom64 field, which is now represented by IntendedGame = DOOM64
  • IWadInfo has been upgraded into a Java-style enum (ie a real object, not an int), and the database maps the stored string into an IWadInfo. This keeps it typesafe, and makes sure we can't put junk into the string DB field. (I prefer to enforce this in the type system / code rather than SQLite)
  • Drops the unused IWadInfo field HasMetadata
  • Adds IWadInfo field BackupGame which means that Freedoom1 and Freedoom2 will automatically replace Doom1 and Doom2 respectively if they are not present.
  • On sync, it tries a few things to guess the IntendedGame:
    • Looks for the "Game" field in text files and WADINFO
    • Looks for the "IWAD" field in GAMEINFO
    • Looks for the "iwad" field in GAMECONF
    • Last of all, it will set IWadId to the first matching IWad, if any
  • I originally tried to use the existing (but unused) field GameID, but being an INTEGER, wasn't usable for this purpose.
  • If required, MainForm_Play will confirm and apply the intended IWAD before play.

I have about 200 wads installed, including every Cacoward winner & runner up since 2018, and 75% of them get allocated a correct IntendedGame, including wads intended for Doom, Doom2, Heretic, TNT, Plutonia and of course Doom 64.

3. Other stuff

  • The TextFileSyncAction, in addition to checking text files, also checks the WADINFO lump, which often contains text file-like content.

kenbot avatar May 25 '25 16:05 kenbot