MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / Encode

Method Encode

protocol/net/packet/play/chatMessage.go:25–47  ·  view source on GitHub ↗
(w encoding.Writer)

Source from the content-addressed store, hash-verified

23}
24
25func (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
49func (c *ChatMessage) Decode(r encoding.Reader) error {
50 if err := r.String(&c.Message); err != nil {

Callers

nothing calls this directly

Calls 6

StringMethod · 0.45
LongMethod · 0.45
BoolMethod · 0.45
FixedByteArrayMethod · 0.45
VarIntMethod · 0.45
FixedBitSetMethod · 0.45

Tested by

no test coverage detected