Update const.go
refactor: replace var with const for timeouts, fix RaknetMagic allocation
This commit is contained in:
@@ -2,17 +2,20 @@ package raknet
|
||||
|
||||
import "time"
|
||||
|
||||
var raknetMagic = [16]byte{0x00, 0xff, 0xff, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfd, 0xfd, 0xfd, 0xfd, 0x12, 0x34, 0x56, 0x78}
|
||||
|
||||
func RaknetMagic() []byte {
|
||||
return []byte{0x00, 0xff, 0xff, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfd, 0xfd, 0xfd, 0xfd, 0x12, 0x34, 0x56, 0x78}
|
||||
b := raknetMagic
|
||||
return b[:]
|
||||
}
|
||||
|
||||
const (
|
||||
MaxMTU = 1400
|
||||
MinMTU = 400
|
||||
MaxMTU = 1400
|
||||
MinMTU = 400
|
||||
MaxChannels = 32
|
||||
)
|
||||
|
||||
var (
|
||||
const (
|
||||
SessionTimeout = 10 * time.Second
|
||||
PingSendInterval = 2500 * time.Millisecond
|
||||
DetectionSendInterval = 5 * time.Second
|
||||
|
||||
Reference in New Issue
Block a user