mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-22 03:20:30 +08:00
add crc chksum
This commit is contained in:
@@ -15,7 +15,13 @@ func (l *Link) Read() *head.Packet {
|
||||
}
|
||||
|
||||
func (m *Me) wait(data []byte) *head.Packet {
|
||||
if len(data) < 60 { // not a valid packet
|
||||
return nil
|
||||
}
|
||||
flags := binary.LittleEndian.Uint16(data[10:12])
|
||||
if flags&0x8000 == 0x8000 { // not a valid packet
|
||||
return nil
|
||||
}
|
||||
logrus.Debugln("[recv]", len(data), "bytes data with flag", hex.EncodeToString(data[10:12]))
|
||||
if flags == 0 || flags == 0x4000 {
|
||||
h := head.SelectPacket()
|
||||
|
||||
Reference in New Issue
Block a user