|
@@ -851,35 +851,64 @@ public class GameMain : MonoSingleton<GameMain>
|
|
|
int num = binaryReader.ReadInt32();
|
|
|
binaryWriter.Write(num);
|
|
|
this.SerializeWriteHeader(binaryWriter, this.DeserializeReadHeader(binaryReader, num));
|
|
|
- if (!this.TryBinaryReadString(binaryReader.BaseStream, (string str) => str == "bookmark_kk_01"))
|
|
|
+ GameMain.BinaryBookmark binaryBookmark;
|
|
|
+ if (this.TryBinaryReadString(binaryReader.BaseStream, (string str) => str == "bookmark_kk_01"))
|
|
|
{
|
|
|
- NDebug.MessageBox("傅きセーブ", "元セーブデータのしおり取得に失敗しました。古いセーブデータかもしれません。");
|
|
|
- UnityEngine.Debug.LogWarning("[GameMain.SerializeKasizukiOnly]\u3000元セーブデータのしおり取得に失敗しました。古いセーブデータかもしれません。");
|
|
|
- binaryReader.Close();
|
|
|
- return false;
|
|
|
+ binaryBookmark = new GameMain.BinaryBookmark(binaryReader);
|
|
|
}
|
|
|
- GameMain.BinaryBookmark binaryBookmark = new GameMain.BinaryBookmark(binaryReader);
|
|
|
- if (!this.TryBinaryReadString(binaryReader.BaseStream, (string str) => str == "bookmark_kk_02"))
|
|
|
+ else
|
|
|
{
|
|
|
- NDebug.MessageBox("傅きセーブ", "元セーブデータのしおり取得に失敗しました。古いセーブデータかもしれません。");
|
|
|
- UnityEngine.Debug.LogWarning("[GameMain.SerializeKasizukiOnly]\u3000元セーブデータのしおり取得に失敗しました。古いセーブデータかもしれません。");
|
|
|
- binaryReader.Close();
|
|
|
- return false;
|
|
|
+ if (num >= 1280)
|
|
|
+ {
|
|
|
+ NDebug.MessageBox("傅きセーブ", "元セーブデータのしおり取得に失敗しました。古いセーブデータかもしれません。");
|
|
|
+ UnityEngine.Debug.LogWarning("[GameMain.SerializeKasizukiOnly]\u3000元セーブデータのしおり取得に失敗しました。古いセーブデータかもしれません。");
|
|
|
+ binaryReader.Close();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ long offset = (long)("bookmark_kk_01".Length + 1 - 4);
|
|
|
+ binaryReader.BaseStream.Seek(offset, SeekOrigin.Current);
|
|
|
+ int num2 = binaryReader.ReadInt32();
|
|
|
+ binaryReader.BaseStream.Seek(-4L, SeekOrigin.Current);
|
|
|
+ binaryBookmark = new GameMain.BinaryBookmark(binaryReader);
|
|
|
+ binaryBookmark.bookmark_value = (long)num2;
|
|
|
+ }
|
|
|
+ GameMain.BinaryBookmark binaryBookmark2;
|
|
|
+ if (this.TryBinaryReadString(binaryReader.BaseStream, (string str) => str == "bookmark_kk_02"))
|
|
|
+ {
|
|
|
+ binaryBookmark2 = new GameMain.BinaryBookmark(binaryReader);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (num >= 1280)
|
|
|
+ {
|
|
|
+ NDebug.MessageBox("傅きセーブ", "元セーブデータのしおり取得に失敗しました。古いセーブデータかもしれません。");
|
|
|
+ UnityEngine.Debug.LogWarning("[GameMain.SerializeKasizukiOnly]\u3000元セーブデータのしおり取得に失敗しました。古いセーブデータかもしれません。");
|
|
|
+ binaryReader.Close();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ long offset2 = (long)("bookmark_kk_02".Length + 1);
|
|
|
+ binaryReader.BaseStream.Seek(offset2, SeekOrigin.Current);
|
|
|
+ int num3 = binaryReader.ReadInt32();
|
|
|
+ binaryReader.BaseStream.Seek(-4L, SeekOrigin.Current);
|
|
|
+ binaryBookmark2 = new GameMain.BinaryBookmark(binaryReader);
|
|
|
+ binaryBookmark2.bookmark_value = (long)num3;
|
|
|
}
|
|
|
- GameMain.BinaryBookmark binaryBookmark2 = new GameMain.BinaryBookmark(binaryReader);
|
|
|
binaryWriter.Write("bookmark_kk_01");
|
|
|
GameMain.BinaryBookmark binaryBookmark3 = new GameMain.BinaryBookmark(binaryWriter);
|
|
|
binaryWriter.Write("bookmark_kk_02");
|
|
|
GameMain.BinaryBookmark binaryBookmark4 = new GameMain.BinaryBookmark(binaryWriter);
|
|
|
binaryReader.BaseStream.Seek(binaryBookmark.bookmark_write_position, SeekOrigin.Begin);
|
|
|
- binaryWriter.BaseStream.Seek(binaryBookmark.bookmark_write_position, SeekOrigin.Begin);
|
|
|
- binaryWriter.Write(binaryReader.ReadBytes((int)binaryBookmark.bookmark_value + 8));
|
|
|
+ binaryWriter.BaseStream.Seek(binaryBookmark3.bookmark_write_position, SeekOrigin.Begin);
|
|
|
+ long num4 = (long)(8 + ("bookmark_kk_02".Length + 1) + 8);
|
|
|
+ binaryReader.BaseStream.Seek(num4, SeekOrigin.Current);
|
|
|
+ binaryWriter.BaseStream.Seek(num4, SeekOrigin.Current);
|
|
|
+ binaryWriter.Write(binaryReader.ReadBytes((int)binaryBookmark.bookmark_value + 8 - (int)num4));
|
|
|
binaryBookmark3.WriteBinaryLength(binaryWriter);
|
|
|
this.KasizukiMgr.Serialize(binaryWriter);
|
|
|
binaryBookmark4.WriteBinaryLength(binaryWriter);
|
|
|
- long num2 = binaryBookmark2.bookmark_value + binaryBookmark2.bookmark_write_position + 8L;
|
|
|
- binaryReader.BaseStream.Seek(num2, SeekOrigin.Begin);
|
|
|
- binaryWriter.Write(binaryReader.ReadBytes((int)binaryReader.BaseStream.Length - (int)num2));
|
|
|
+ long num5 = binaryBookmark2.bookmark_value + binaryBookmark2.bookmark_write_position + 8L;
|
|
|
+ binaryReader.BaseStream.Seek(num5, SeekOrigin.Begin);
|
|
|
+ binaryWriter.Write(binaryReader.ReadBytes((int)binaryReader.BaseStream.Length - (int)num5));
|
|
|
binaryReader.Close();
|
|
|
File.WriteAllBytes(path, memoryStream.ToArray());
|
|
|
}
|
|
@@ -938,17 +967,19 @@ public class GameMain : MonoSingleton<GameMain>
|
|
|
{
|
|
|
GameMain.BinaryBookmark binaryBookmark = new GameMain.BinaryBookmark(binaryReader);
|
|
|
}
|
|
|
- else
|
|
|
+ else if (num < 1280)
|
|
|
{
|
|
|
- UnityEngine.Debug.Log("[GameMain.Deserialize()]\u3000しおりの取得に失敗しました。\u3000古いセーブデータかもしれないです。");
|
|
|
+ long offset = (long)("bookmark_kk_01".Length + 1 + 8 - 4);
|
|
|
+ binaryReader.BaseStream.Seek(offset, SeekOrigin.Current);
|
|
|
}
|
|
|
if (this.TryBinaryReadString(binaryReader.BaseStream, (string str) => str == "bookmark_kk_02"))
|
|
|
{
|
|
|
GameMain.BinaryBookmark binaryBookmark2 = new GameMain.BinaryBookmark(binaryReader);
|
|
|
}
|
|
|
- else
|
|
|
+ else if (num < 1280)
|
|
|
{
|
|
|
- UnityEngine.Debug.Log("[GameMain.Deserialize()]\u3000しおりの取得に失敗しました。\u3000古いセーブデータかもしれないです。");
|
|
|
+ long offset2 = (long)("bookmark_kk_02".Length + 1 + 8);
|
|
|
+ binaryReader.BaseStream.Seek(offset2, SeekOrigin.Current);
|
|
|
}
|
|
|
bool flag = false;
|
|
|
if (215 < num)
|
|
@@ -1088,7 +1119,10 @@ public class GameMain : MonoSingleton<GameMain>
|
|
|
serializeHeader.strPlayerName = brRead.ReadString();
|
|
|
serializeHeader.nMaidNum = brRead.ReadInt32();
|
|
|
serializeHeader.strComment = brRead.ReadString();
|
|
|
- if (1280 <= gameVersion)
|
|
|
+ long position = brRead.BaseStream.Position;
|
|
|
+ byte b = brRead.ReadByte();
|
|
|
+ brRead.BaseStream.Seek(position, SeekOrigin.Begin);
|
|
|
+ if (b != 14)
|
|
|
{
|
|
|
serializeHeader.productTypeID = brRead.ReadInt32();
|
|
|
}
|