- Timestamp:
- Sep 4, 2018, 2:33:52 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs
r325 r326 53 53 54 54 public static bool Load () { 55 if (File.Exists (GameUtils.GetSaveGameDir () + "/AllocsPeristentData.bin")) { 56 try { 57 PersistentContainer obj; 58 Stream stream = File.Open (GameUtils.GetSaveGameDir () + "/AllocsPeristentData.bin", FileMode.Open); 59 BinaryFormatter bFormatter = new BinaryFormatter (); 60 obj = (PersistentContainer) bFormatter.Deserialize (stream); 61 stream.Close (); 62 instance = obj; 63 return true; 64 } catch (Exception e) { 65 Log.Error ("Exception in PersistentContainer.Load"); 66 Log.Exception (e); 67 } 55 if (!File.Exists (GameUtils.GetSaveGameDir () + "/AllocsPeristentData.bin")) { 56 return false; 57 } 58 59 try { 60 PersistentContainer obj; 61 Stream stream = File.Open (GameUtils.GetSaveGameDir () + "/AllocsPeristentData.bin", FileMode.Open); 62 BinaryFormatter bFormatter = new BinaryFormatter (); 63 obj = (PersistentContainer) bFormatter.Deserialize (stream); 64 stream.Close (); 65 instance = obj; 66 return true; 67 } catch (Exception e) { 68 Log.Error ("Exception in PersistentContainer.Load"); 69 Log.Exception (e); 68 70 } 69 71
Note:
See TracChangeset
for help on using the changeset viewer.