Add option to emit metrics and logs when players connect to the router (#391)
This commit is contained in:
+2
-1
@@ -45,7 +45,8 @@ func ReadPacket(reader *bufio.Reader, addr net.Addr, state State) (*Packet, erro
|
||||
return nil, err
|
||||
}
|
||||
|
||||
packet := &Packet{Length: frame.Length}
|
||||
// Packet length is frame length (bytes for packetID and data) plus bytes used to store the frame length data
|
||||
packet := &Packet{Length: frame.Length + PacketLengthFieldBytes}
|
||||
|
||||
remainder := bytes.NewBuffer(frame.Payload)
|
||||
|
||||
|
||||
@@ -80,3 +80,7 @@ type LegacyServerListPing struct {
|
||||
type ByteReader interface {
|
||||
ReadByte() (byte, error)
|
||||
}
|
||||
|
||||
const (
|
||||
PacketLengthFieldBytes = 1
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user