Skip to content

Commit

Permalink
Update debug action related to desync source searching (#469)
Browse files Browse the repository at this point in the history
I've made some changes to the debug tool back when 1.5 originally released, but haven't bothered finishing it up. I've decided to also include a special window for it, which allows to configure the search tool. Anyway, included changes:

The debug tool option now opens a window where you can configure desync source search options. It allows you to select specific elements you want to search, if you want to search mods and/or vanilla types, as well as select if you want to log all checked types. There's also 2 buttons to select 2 presets, basic and full, and the dialog by default selects the basic preset. The basic preset was tailored towards a player who may not fully understand what to look for in the other options, especially since the majority of what they'll report will be false positives.

Since the selection of logging of all classes is now inside the dialog, one of the 2 debug actions was removed as it was pointless.

Added `NonBasicAttribute` and applied it to all options in the enum that are, as the name suggests, non-basic. It's used for the selection of basic options in the dialog, as those options in particular will be skipped.

Added a `LongEvents` options, which will log every single long event. Majority of them will be false positives, but may be worth investigating. They can cause issues if they are asynchronous or if they are queued during the game loading (hosting the server), as they end up being queued twice for host.

Removed all references of Biomes Core special terrain in non-ticking updates, as those were removed some time ago (back in 1.4).

Removed the check to `MaxFoundStuff` that would end checking a method early, as it was extremely unlikely that a single method would have all the elements in it. It was just a waste of computational power, even if a minor one. (Also it stopped working since addition of `PatchedSyncMethods`, as that one was checked in a different place, so the max value would have to be lowered by 1 to compensate).

The `LogUnpatchedStuff` now accepts more arguments that determine what it should do. It also has a few extra checks early if the input data is correct, even if the window should already provide correct data (just in case of some weird shenanigans).

Renamed `unsupportedTypes` to `unsupportedNamespaces`, as that name is more correct. `Prepatcher` and `Prestarter` namespaces were included, as Prepatcher is going to be commonly used with MP and causes a few false positives. `FisheryLib` and `PerformanceFish` were also included, as operating on those crashes RimWorld. Also removed the note about RW namespaces, as RW itself can now be checked as well.

The dictionary containing the lists of all found issues now only include entries for stuff that can be found, so all operations performed on it generally use `TryGetValue` for safety.

Added a few calls to `Enumerable.Distinct()` to make sure we don't have duplicates and don't operate on duplicates.
  • Loading branch information
SokyranTheDragon authored Sep 4, 2024
1 parent 51e86ac commit 99c042d
Showing 1 changed file with 220 additions and 67 deletions.
Loading

0 comments on commit 99c042d

Please sign in to comment.