mirror of
https://github.com/CPunch/gopenfusion.git
synced 2025-11-06 23:50:20 +00:00
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user