diff --git a/def.go b/def.go index 951ddec..037a800 100644 --- a/def.go +++ b/def.go @@ -60,8 +60,8 @@ func (p *PacketAdminJoin) Bytes() []byte { buf := new(bytes.Buffer) p.PLength = uint16(len(p.Password) + len(p.AppName) + len(p.AppVersion) + 3) - buf.WriteByte(p.PLength) - buf.WriteByte(p.PType) + binary.Write(buf, binary.LittleEndian, p.PLength) + binary.Write(buf, binary.LittleEndian, p.PType) buf.WriteString(p.Password) buf.WriteString(p.AppName) buf.WriteString(p.AppVersion)