(w encoding.Writer)
| 23 | } |
| 24 | |
| 25 | func (c *ChatMessage) Encode(w encoding.Writer) error { |
| 26 | if err := w.String(c.Message); err != nil { |
| 27 | return err |
| 28 | } |
| 29 | if err := w.Long(c.Timestamp); err != nil { |
| 30 | return err |
| 31 | } |
| 32 | if err := w.Long(c.Salt); err != nil { |
| 33 | return err |
| 34 | } |
| 35 | if err := w.Bool(c.HasSignature); err != nil { |
| 36 | return err |
| 37 | } |
| 38 | if c.HasSignature { |
| 39 | if err := w.FixedByteArray(c.Signature[:]); err != nil { |
| 40 | return err |
| 41 | } |
| 42 | } |
| 43 | if err := w.VarInt(c.MessageCount); err != nil { |
| 44 | return err |
| 45 | } |
| 46 | return w.FixedBitSet(c.Acknowledged) |
| 47 | } |
| 48 | |
| 49 | func (c *ChatMessage) Decode(r encoding.Reader) error { |
| 50 | if err := r.String(&c.Message); err != nil { |
nothing calls this directly
no test coverage detected