コード例 #1
0
        internal PBETeamPacket(PBETeam team)
        {
            var bytes = new List <byte>();

            bytes.AddRange(BitConverter.GetBytes(Code));
            bytes.Add((Team = team).Id);
            Team.ToBytes(bytes);
            bytes.InsertRange(0, BitConverter.GetBytes((short)bytes.Count));
            Buffer = new ReadOnlyCollection <byte>(bytes);
        }
コード例 #2
0
 internal PBETeamPacket(PBETeam team)
 {
     using (var ms = new MemoryStream())
         using (var w = new EndianBinaryWriter(ms, encoding: EncodingType.UTF16))
         {
             w.Write(Code);
             w.Write((Team = team).Id);
             Team.ToBytes(w);
             Data = new ReadOnlyCollection <byte>(ms.ToArray());
         }
 }