public static FileMetadata GetFileMetadata(string file, bool cloudSave)
{
if (file != null)
{
try
{
using (Stream stream = (new FileStream(file, FileMode.Open)))
{
using (BinaryReader reader = new BinaryReader(stream))
{
if (reader.ReadInt32() >= 0x87)
return FileMetadata.Read(reader, FileType.World);
return FileMetadata.FromCurrentSettings(FileType.World);
}
}
}
catch
{
}
}
return null;
}