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

Method Encode

protocol/net/packet/play/signedChatCommand.go:27–52  ·  view source on GitHub ↗
(w encoding.Writer)

Source from the content-addressed store, hash-verified

25}
26
27func (c *SignedChatCommand) Encode(w encoding.Writer) error {
28 if err := w.String(c.Command); err != nil {
29 return err
30 }
31 if err := w.Long(c.Timestamp); err != nil {
32 return err
33 }
34 if err := w.Long(c.Salt); err != nil {
35 return err
36 }
37 if err := w.VarInt(int32(len(c.Arguments))); err != nil {
38 return err
39 }
40 for _, arg := range c.Arguments {
41 if err := w.String(arg.Name); err != nil {
42 return err
43 }
44 if err := w.FixedByteArray(arg.Signature[:]); err != nil {
45 return err
46 }
47 }
48 if err := w.VarInt(c.MessageCount); err != nil {
49 return err
50 }
51 return w.FixedBitSet(c.Acknowledged)
52}
53
54func (c *SignedChatCommand) Decode(r encoding.Reader) error {
55 if err := r.String(&c.Command); err != nil {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected