Parcourir la source

帧同步jump到某帧,checkhashfail都要用MemoryPack序列化

tanghai il y a 2 ans
Parent
commit
4864709b8a

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Client/LockStep/LSClientHelper.cs

@@ -113,7 +113,7 @@ namespace ET.Client
                 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);

+ 1 - 1
Unity/Assets/Scripts/Hotfix/Client/LockStep/Room2C_CheckHashFailHandler.cs

@@ -5,7 +5,7 @@ namespace ET.Client
     {
         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()}");