Update Network

Update Network
This commit is contained in:
ALEXTANG
2023-05-19 17:01:04 +08:00
parent 4bc63fafc8
commit ec409c7e15
5 changed files with 64 additions and 11 deletions

View File

@@ -1,9 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Reflection;
using GameProto;
using Google.Protobuf;
using TEngine;
namespace GameLogic
@@ -88,9 +89,7 @@ namespace GameLogic
_cachedStream.SetLength(_cachedStream.Capacity); // 此行防止 Array.Copy 的数据无法写入
_cachedStream.Position = 0L;
global::ProtobufUtility.ToStream(packet,destination);
global::ProtobufUtility.ToStreamWithHead(packet,_cachedStream);
_cachedStream.WriteTo(destination);
return true;
}