Squad Commits, Robust new Game Regex

Attempt at more Robust Regex

This regex searches for all the current information we get via the NewGame event, but with a few patterns that search deeper/different folder structures.

Appears to work on all base game content and mods that I have tested, however, mods may capture garbage information inside of mapClassname.

This will also fail if a modder puts no folders between the root of their project and their layers

/mymod/mymap

vs

/mymod/afolder/mymap

afolder would end up being the mapClassname.

https://regex101.com/r/e0Ui0K/1
This commit is contained in:
ect0s 2021-11-25 10:36:14 -05:00
parent d6c0edf37e
commit a2348c6bd1

View File

@ -1,6 +1,10 @@
export default {
regex: /^\[([0-9.:-]+)]\[([ 0-9]*)]LogWorld: Bringing World \/([A-z]+)\/Maps\/([A-z]+)\/(?:Gameplay_Layers\/)?([A-z0-9_]+)/,
regex:
/^\[([0-9.:-]+)]\[([ 0-9]*)]LogWorld: Bringing World \/([A-z]+)\/(?:Maps\/)?([A-z0-9-]+)\/(?:.+\/)?([A-z0-9-]+)(?:\.[A-z0-9-]+)/,
onMatch: (args, logParser) => {
if (args[5] === 'TransitionMap') {
return;
}
const data = {
...logParser.eventStore.WON,
raw: args[0],