Exemplo n.º 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]?.TrackedActors != null)
                {
                    TrackedActors = metaTrackers[index]?.TrackedActors;
                }

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

                tracker.SetTrackedActors(TrackedActors);
                metaTrackers.Add(tracker);
                // -1 due to zero-based arrays
                currentIndex = metaTrackers.Count - 1;
            }
        }
Exemplo n.º 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.SetTrackedActors(TrackedActors);
         metaTrackers.Add(tracker);
         // -1 due to zero-based arrays
         currentIndex = metaTrackers.Count - 1;
     }
 }