@@ -105,8 +105,8 @@ public int AccountId
105105 public event EventHandler < LogContentEventArgs < GroupMatchRaidReadyLogContent > > ? GroupMemberReady ;
106106 public event EventHandler ? GroupDisbanded ;
107107 public event EventHandler < LogContentEventArgs < GroupMatchUserLeaveLogContent > > ? GroupUserLeave ;
108- public event EventHandler ? MapLoading ;
109- public event EventHandler < RaidInfoEventArgs > ? MatchingStarted ;
108+ public event EventHandler < RaidInfoEventArgs > ? MapLoading ;
109+ // public event EventHandler<RaidInfoEventArgs>? MatchingStarted;
110110 public event EventHandler < RaidInfoEventArgs > ? MatchFound ; // only fires on initial load into a raid
111111 public event EventHandler < RaidInfoEventArgs > ? MapLoaded ; // fires on initial and subsequent loads into a raid
112112 public event EventHandler < RaidInfoEventArgs > ? MatchingAborted ;
@@ -131,6 +131,22 @@ public static string GetDefaultLogsFolder()
131131 return Path . Combine ( key . GetValue ( "InstallLocation" ) ? . ToString ( ) ?? throw new Exception ( "InstallLocation registry value not found" ) , "Logs" ) ;
132132 }
133133
134+ public static Dictionary < string , string > MapBundles = new ( ) {
135+ { "city_preset" , "TarkovStreets" } ,
136+ { "customs_preset" , "bigmap" } ,
137+ { "factory_day_preset" , "factory4_day" } ,
138+ { "factory_night_preset" , "factory4_night" } ,
139+ { "laboratory_preset" , "laboratory" } ,
140+ { "labyrinth_preset" , "Labyrinth" } ,
141+ { "lighthouse_preset" , "Lighthouse" } ,
142+ { "rezerv_base_preset" , "ReservBase" } ,
143+ { "sandbox_preset" , "Sandbox" } ,
144+ { "sandbox_high_preset" , "Sandbox_high" } ,
145+ { "shopping_mall" , "Interchange" } ,
146+ { "shoreline_preset" , "Shoreline" } ,
147+ { "woods_preset" , "Woods" } ,
148+ } ;
149+
134150 public GameWatcher ( )
135151 {
136152 Monitors = new ( ) ;
@@ -391,19 +407,33 @@ internal void GameWatcher_NewLogData(object? sender, NewLogDataEventArgs e)
391407 // Occurs for each other member of the group when ready
392408 GroupMemberReady ? . Invoke ( this , new LogContentEventArgs < GroupMatchRaidReadyLogContent > ( ) { LogContent = jsonNode ? . AsObject ( ) . Deserialize < GroupMatchRaidReadyLogContent > ( ) ?? throw new Exception ( "Error parsing GroupMatchRaidReadyEventArgs" ) , Profile = CurrentProfile } ) ;
393409 }
394- if ( eventLine . Contains ( "application|Matching with group id" ) )
410+ /* if (eventLine.Contains("application|Matching with group id"))
395411 {
396412 MapLoading?.Invoke(this, new());
413+ }*/
414+ if ( eventLine . Contains ( "application|scene preset path:" ) )
415+ {
416+ raidInfo = new ( )
417+ {
418+ ProfileType = CurrentProfile . Type ,
419+ } ;
420+ var bundleMatch = Regex . Match ( eventLine , @"scene preset path:maps\/(?<mapBundleName>[a-zA-Z0-9_]+)\.bundle" ) ;
421+ if ( bundleMatch . Success )
422+ {
423+ var mapBundle = bundleMatch . Groups [ "mapBundleName" ] . Value ;
424+ if ( MapBundles . ContainsKey ( mapBundle ) )
425+ {
426+ string mapId = MapBundles [ mapBundle ] ;
427+ raidInfo . Map = mapId ;
428+ MapLoading ? . Invoke ( this , new ( raidInfo , CurrentProfile ) ) ;
429+ }
430+ }
397431 }
398432 if ( eventLine . Contains ( "application|LocationLoaded" ) )
399433 {
400- // The map has been loaded and the game is searching for a match
401- raidInfo = new ( )
402- {
403- MapLoadTime = float . Parse ( Regex . Match ( eventLine , @"LocationLoaded:[0-9.,]+ real:(?<loadTime>[0-9.,]+)" ) . Groups [ "loadTime" ] . Value . Replace ( "," , "." ) , CultureInfo . InvariantCulture ) ,
404- ProfileType = CurrentProfile . Type ,
405- } ;
406- MatchingStarted ? . Invoke ( this , new ( raidInfo , CurrentProfile ) ) ;
434+ // The map has been loaded and the game is searching for a match
435+ raidInfo . MapLoadTime = float . Parse ( Regex . Match ( eventLine , @"LocationLoaded:[0-9.,]+ real:(?<loadTime>[0-9.,]+)" ) . Groups [ "loadTime" ] . Value . Replace ( "," , "." ) , CultureInfo . InvariantCulture ) ;
436+ //MatchingStarted?.Invoke(this, new(raidInfo, CurrentProfile));
407437 }
408438 if ( eventLine . Contains ( "application|MatchingCompleted" ) )
409439 {
@@ -418,6 +448,7 @@ internal void GameWatcher_NewLogData(object? sender, NewLogDataEventArgs e)
418448 {
419449 // Immediately after matching is complete
420450 // Sufficient information is available to raise the MatchFound event
451+ var mapUnknown = raidInfo . Map == "" || raidInfo . Map == null ;
421452 raidInfo . Map = Regex . Match ( eventLine , "Location: (?<map>[^,]+)" ) . Groups [ "map" ] . Value ;
422453 raidInfo . Online = eventLine . Contains ( "RaidMode: Online" ) ;
423454 raidInfo . RaidId = Regex . Match ( eventLine , @"shortId: (?<raidId>[A-Z0-9]{6})" ) . Groups [ "raidId" ] . Value ;
@@ -434,6 +465,10 @@ internal void GameWatcher_NewLogData(object? sender, NewLogDataEventArgs e)
434465 // Raise the MatchFound event only if we queued; not if we are re-loading back into a raid
435466 MatchFound ? . Invoke ( this , new ( raidInfo , CurrentProfile ) ) ;
436467 }
468+ if ( mapUnknown )
469+ {
470+ MapLoading ? . Invoke ( this , new ( raidInfo , CurrentProfile ) ) ;
471+ }
437472 MapLoaded ? . Invoke ( this , new ( raidInfo , CurrentProfile ) ) ;
438473 }
439474 if ( eventLine . Contains ( "application|GameStarting" ) )
0 commit comments