예제 #1
0
        // fired before a save deserializes itself through a patch on GameInstanceSave's PostDeserialization
        public static void Resync(DateTime previousSaveTime)
        {
            DeserializeStorageJson();
            var index = FindTrackerByTime(previousSaveTime);

            if (index > -1)
            {
                // part where everything seems to fall apart?  (legacy comment)
                if (metaTrackers[index]?.TrackedPilots != null)
                {
                    trackedPilots = metaTrackers[index]?.TrackedPilots;
                }

                currentIndex = index;
            }
            // we were unable to find a tracker, add our own
            else if (metaTrackers != null)
            {
                var tracker = new MetaTracker();

                tracker.SetTrackedPilots(trackedPilots);
                metaTrackers.Add(tracker);
                // -1 due to zero-based arrays
                currentIndex = metaTrackers.Count - 1;
            }
        }
예제 #2
0
 //fired when player starts a new campaign
 public static void SyncNewCampaign()
 {
     DeserializeStorageJson();
     //we were unable to find a tracker, add our own
     if (metaTrackers != null)
     {
         var tracker = new MetaTracker();
         tracker.SetTrackedPilots(trackedPilots);
         metaTrackers.Add(tracker);
         // -1 due to zero-based arrays
         currentIndex = metaTrackers.Count - 1;
     }
 }