Commit 63a5778c authored by mercury233's avatar mercury233

support REPLAY_ID_YRP2

parent 987cd120
...@@ -1287,8 +1287,15 @@ namespace Percy ...@@ -1287,8 +1287,15 @@ namespace Percy
yrp3dbuilder = new BinaryWriter(stream); yrp3dbuilder = new BinaryWriter(stream);
sendToPlayer(yrp.getNamePacket()); sendToPlayer(yrp.getNamePacket());
dll.end_duel(duel); dll.end_duel(duel);
var mtrnd = new MersenneTwister(yrp.Seed); if (yrp.ID == 0x32707279) // REPLAY_ID_YRP2
duel = dll.create_duel(mtrnd.genrand_Int32()); {
duel = dll.create_duel_v2(yrp.SeedsV2);
}
else
{
var mtrnd = new MersenneTwister(yrp.Seed);
duel = dll.create_duel(mtrnd.genrand_Int32());
}
godMode = true; godMode = true;
isFirst = true; isFirst = true;
dll.set_player_info(duel, 0, yrp.StartLp, yrp.StartHand, yrp.DrawCount); dll.set_player_info(duel, 0, yrp.StartLp, yrp.StartHand, yrp.DrawCount);
...@@ -1396,6 +1403,7 @@ namespace Percy ...@@ -1396,6 +1403,7 @@ namespace Percy
public List<PlayerData> playerData = new List<PlayerData>(); public List<PlayerData> playerData = new List<PlayerData>();
public byte[] Props = new byte[8]; public byte[] Props = new byte[8];
public uint Seed = 0; public uint Seed = 0;
public uint[] SeedsV2 = new uint[8];
public int StartHand = 0; public int StartHand = 0;
public int StartLp = 0; public int StartLp = 0;
public int Version = 0; public int Version = 0;
......
...@@ -139,6 +139,17 @@ public class selectReplay : WindowServantSP ...@@ -139,6 +139,17 @@ public class selectReplay : WindowServantSP
returnValue.DataSize = reader.ReadInt32(); returnValue.DataSize = reader.ReadInt32();
returnValue.Hash = reader.ReadInt32(); returnValue.Hash = reader.ReadInt32();
returnValue.Props = reader.ReadBytes(8); returnValue.Props = reader.ReadBytes(8);
if (returnValue.ID == 0x32707279) // REPLAY_ID_YRP2
{
for (int i = 0; i < 8; i++)
{
returnValue.SeedsV2[i] = reader.ReadUInt32();
}
for (int i = 0; i < 4; i++) // other flags, unused for now
{
reader.ReadUInt32();
}
}
var raw = reader.ReadToEnd(); var raw = reader.ReadToEnd();
if ((returnValue.Flag & 0x1) > 0) if ((returnValue.Flag & 0x1) > 0)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment