This commit is contained in:
shoopea
2021-11-13 14:23:40 +08:00
parent 11ec55ba70
commit ccd41c2e1b
3 changed files with 7 additions and 27 deletions

View File

@@ -505,22 +505,6 @@ func (p *PacketServerChat) Read(b []byte) {
p.Amount = binary.LittleEndian.Uint64(bs[0:])
}
func (p *PacketServerChat) Bytes() []byte {
buf := new(bytes.Buffer)
p.PLength = uint16(len(p.Message) + 17)
binary.Write(buf, binary.LittleEndian, p.PLength)
binary.Write(buf, binary.LittleEndian, p.ActionID)
binary.Write(buf, binary.LittleEndian, p.DestinationID)
binary.Write(buf, binary.LittleEndian, p.ClientID)
buf.WriteString(p.Message)
buf.WriteByte(0)
binary.Write(buf, binary.LittleEndian, p.Amount)
return buf.Bytes()
}
func (p *PacketServerConsole) Read(b []byte) {
r := bufio.NewReader(bytes.NewReader(b))
r.Discard(3)