我收到了来自客户的代码和听众:
byte PacketSize = br.ReadByte();
PacketTypes packetType = (PacketTypes)br.ReadInt16();
Console.WriteLine("Packet: [Size: {0}], Type: {1}", PacketSize, packetType);
Listener.Parse(this, packetType);
我运行它没问题,但需要字节--- 00 00“00”44 -----
它的位置为2个字节。我希望它移动位置读取3个字节以获得其他44个值。我尝试将(PacketTypes) br.ReadInt16 ();
更改为(PacketTypes) br.ReadBytes (3)
和(PacketTypes) br.ReadBytes (int 3)
,但它会出现此错误:
Can not convert type 'byte [] 'to' ServerLogin.PacketTypes'
抱歉,我的英语不好并且抱歉我复制代码@@
时上一篇文章有问题