Esempio n. 1
0
 public static Save FromString(string content)
 {
     var decompressed = StringCompressor.DecompressString(content);
     try
     {
         return JsonConvert.DeserializeObject<Save>(decompressed);
     }
     catch
     {
         return null;
     }
 }
Esempio n. 2
0
 public static string ToCompressedString(this Save save)
 {
     //File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\" + $"{guild.Id}-{save.SaveTime}.json", StringCompressor.CompressString(JsonConvert.SerializeObject(save)));
     return(StringCompressor.CompressString(JsonConvert.SerializeObject(save)));
 }