Skip to content

Commit

Permalink
帧同步jump到某帧,checkhashfail都要用MemoryPack序列化
Browse files Browse the repository at this point in the history
  • Loading branch information
egametang committed Nov 25, 2023
1 parent 12ab008 commit 4864709
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static void JumpReplay(Room room, int frame)
room.LSWorld.Dispose();
// 回滚
byte[] memoryBuffer = room.Replay.Snapshots[snapshotIndex];
LSWorld lsWorld = MongoHelper.Deserialize(typeof (LSWorld), memoryBuffer, 0, memoryBuffer.Length) as LSWorld;
LSWorld lsWorld = MemoryPackHelper.Deserialize(typeof (LSWorld), memoryBuffer, 0, memoryBuffer.Length) as LSWorld;
room.LSWorld = lsWorld;
room.AuthorityFrame = snapshotIndex * LSConstValue.SaveLSWorldFrameCount;
RunLSRollbackSystem(room);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class Room2C_CheckHashFailHandler: MessageHandler<Scene, Room2C_CheckHash
{
protected override async ETTask Run(Scene root, Room2C_CheckHashFail message)
{
LSWorld serverWorld = MongoHelper.Deserialize(typeof(LSWorld), message.LSWorldBytes, 0, message.LSWorldBytes.Length) as LSWorld;
LSWorld serverWorld = MemoryPackHelper.Deserialize(typeof(LSWorld), message.LSWorldBytes, 0, message.LSWorldBytes.Length) as LSWorld;
using (root.AddChild(serverWorld))
{
Log.Debug($"check hash fail, server: {message.Frame} {serverWorld.ToJson()}");
Expand Down

0 comments on commit 4864709

Please sign in to comment.