public bool LoadGlobal()
 {
     string filepath = getSaveDataPathG();
     if (!File.Exists(filepath))
         return false;
     EraDataReader reader = null;
     EraBinaryDataReader bReader = null;
     FileStream fs = null;
     try
     {
         fs = new FileStream(filepath, FileMode.Open, FileAccess.Read);
         bReader = EraBinaryDataReader.CreateReader(fs);
         if (bReader != null)
         {
             EraSaveFileType fileType = bReader.ReadFileType();
             if (fileType != EraSaveFileType.Global)
                 return false;
             if (!gamebase.UniqueCodeEqualTo(bReader.ReadInt64()))
                 return false;
             Int64 version = bReader.ReadInt64();
             if (!gamebase.CheckVersion(version))
                 return false;
             bReader.ReadString();//saveMes
             varData.LoadFromStreamBinary(bReader);
         }
         else
         {
             reader = new EraDataReader(fs);
             if (!gamebase.UniqueCodeEqualTo(reader.ReadInt64()))
                 return false;
             Int64 version = reader.ReadInt64();
             if (!gamebase.CheckVersion(version))
                 return false;
             varData.LoadGlobalFromStream(reader);
             if (reader.SeekEmuStart())
             {
                 varData.LoadGlobalFromStream1808(reader);
             }
         }
         return true;
     }
     catch
     {
         return false;
     }
     finally
     {
         if (reader != null)
             reader.Close();
         else if (bReader != null)
             bReader.Close();
         else if (fs != null)
             fs.Close();
     }
 }
        public void LoadFromStream(EraDataReader reader)
        {
            if (!gamebase.UniqueCodeEqualTo(reader.ReadInt64()))
                throw new FileEE("異なるゲームのセーブデータです");
            Int64 version = reader.ReadInt64();
            if (!gamebase.CheckVersion(version))
                throw new FileEE("セーブデータのバーションが異なります");
            string text = reader.ReadString();//PUTFORM
            varData.SetDefaultValue(constant);
            varData.SetDefaultLocalValue();
            varData.LastLoadVersion = version;
            //varData.LastLoadNo = dataIndex;
            varData.LastLoadText = text;

            int charaCount = (int)reader.ReadInt64();
            varData.CharacterList.Clear();
            for (int i = 0; i < charaCount; i++)
            {
                CharacterData chara = new CharacterData(constant);
                varData.CharacterList.Add(chara);
                chara.LoadFromStream(reader);
            }
            varData.LoadFromStream(reader);
            if (reader.SeekEmuStart())
            {
                if (reader.DataVersion < 1803)//キャラ2次元配列追加以前
                    for (int i = 0; i < charaCount; i++)
                        varData.CharacterList[i].LoadFromStreamExtended_Old1802(reader);
                else
                    for (int i = 0; i < charaCount; i++)
                        varData.CharacterList[i].LoadFromStreamExtended(reader);
                varData.LoadFromStreamExtended(reader, reader.DataVersion);
            }
        }