protocol/packet: accept structs by value for encoding

- server/loginServer: no longer sending packets by pointer, except in cases like AcceptLogin(), which operates on a sent structure slice. since these are already allocated, no need to copy them
This commit is contained in:
2023-03-11 00:24:20 -06:00
parent 00fa94162c
commit 850dd59967
2 changed files with 11 additions and 11 deletions

View File

@@ -53,7 +53,7 @@ func (pkt Packet) encodeStructField(field reflect.StructField, value reflect.Val
return err
}
default:
if err := pkt.Encode(value.Addr().Interface()); err != nil {
if err := pkt.Encode(value.Interface()); err != nil {
return err
}
}