Example #1
0
 public void Load()
 {
     try
     {
         if (MyAPIGateway.Multiplayer.MultiplayerActive && !MyAPIGateway.Multiplayer.IsServer)
         {
             SyncHarvestEfficiency.Ask();
             return;
         }
         string Storage = "";
         //if (Tool.Storage.ContainsKey(SessionCore.StorageGuid))
         if (Drill.Storage?.TryGetValue(SessionCore.StorageGuid, out Storage) == true)
         {
             try
             {
                 Persistent persistent = MyAPIGateway.Utilities.SerializeFromBinary <Persistent>(Convert.FromBase64String(Storage));
                 SyncHarvestEfficiency.Set(persistent.HarvestMultiplier);
             }
             catch (Exception Scrap)
             {
                 SessionCore.LogError($"{Drill.CustomName}.Load()", Scrap);
             }
         }
         else
         {
             SessionCore.DebugWrite($"{Drill.CustomName}.Load()", "Storage access failed.");
         }
     }
     catch (Exception Scrap)
     {
         SessionCore.LogError($"{Drill.CustomName}.Load().AccessStorage", Scrap);
     }
 }
Example #2
0
 public void LoadSyncersFromServer()
 {
     SyncBeamLength.Ask();
     SyncDistanceMode.Ask();
     SyncSpeedMultiplier.Ask();
 }