Explorar o código

修复一个bug,暂停或者卡顿会导致服务端的消息堆积过来,塞爆FrameBuffer,所以FrameBuffer要设置大一点,或者采取其它办法,比如把服务端消息放到一个队列中去取,demo暂时把FrameBuffer调大

tanghai %!s(int64=2) %!d(string=hai) anos
pai
achega
8c48f1ff98
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      Unity/Assets/Scripts/Model/Share/LockStep/FrameBuffer.cs

+ 2 - 2
Unity/Assets/Scripts/Model/Share/LockStep/FrameBuffer.cs

@@ -11,9 +11,9 @@ namespace ET
         private readonly List<MemoryBuffer> snapshots;
         private readonly List<MemoryBuffer> snapshots;
         private readonly List<long> hashs;
         private readonly List<long> hashs;
 
 
-        public FrameBuffer(int frame = 0, int capacity = LSConstValue.FrameCountPerSecond * 10)
+        public FrameBuffer(int frame = 0, int capacity = LSConstValue.FrameCountPerSecond * 60)
         {
         {
-            this.MaxFrame = frame + LSConstValue.FrameCountPerSecond;
+            this.MaxFrame = frame + LSConstValue.FrameCountPerSecond * 30;
             this.frameInputs = new List<OneFrameInputs>(capacity);
             this.frameInputs = new List<OneFrameInputs>(capacity);
             this.snapshots = new List<MemoryBuffer>(capacity);
             this.snapshots = new List<MemoryBuffer>(capacity);
             this.hashs = new List<long>(capacity);
             this.hashs = new List<long>(capacity);