Update const.go
refactor: replace var with const for timeouts, fix RaknetMagic allocation
This commit is contained in:
@@ -2,8 +2,11 @@ package raknet
|
|||||||
|
|
||||||
import "time"
|
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 {
|
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 (
|
const (
|
||||||
@@ -12,7 +15,7 @@ const (
|
|||||||
MaxChannels = 32
|
MaxChannels = 32
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
const (
|
||||||
SessionTimeout = 10 * time.Second
|
SessionTimeout = 10 * time.Second
|
||||||
PingSendInterval = 2500 * time.Millisecond
|
PingSendInterval = 2500 * time.Millisecond
|
||||||
DetectionSendInterval = 5 * time.Second
|
DetectionSendInterval = 5 * time.Second
|
||||||
|
|||||||
Reference in New Issue
Block a user