Add option to emit metrics and logs when players connect to the router (#391)

This commit is contained in:
Samuel McBroom
2025-04-22 05:37:25 -07:00
committed by GitHub
parent cc590524c4
commit d21ccb5b9f
6 changed files with 59 additions and 3 deletions
+2 -1
View File
@@ -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)
+4
View File
@@ -80,3 +80,7 @@ type LegacyServerListPing struct {
type ByteReader interface {
ReadByte() (byte, error)
}
const (
PacketLengthFieldBytes = 1
)