mirror of
https://github.com/genxium/DelayNoMore
synced 2025-11-10 16:29:06 +00:00
Initial commit.
This commit is contained in:
31
battle_srv/common/vals.go
Normal file
31
battle_srv/common/vals.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
RE_PHONE_NUM = regexp.MustCompile(`^\+?[0-9]{8,14}$`)
|
||||
RE_SMS_CAPTCHA_CODE = regexp.MustCompile(`^[0-9]{4}$`)
|
||||
RE_CHINA_PHONE_NUM = regexp.MustCompile(`^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$`)
|
||||
)
|
||||
|
||||
// 隐式导入
|
||||
var ConstVals = &struct {
|
||||
Player struct {
|
||||
CaptchaExpire time.Duration
|
||||
CaptchaMaxTTL time.Duration
|
||||
}
|
||||
Ws struct {
|
||||
WillKickIfInactiveFor time.Duration
|
||||
}
|
||||
}{}
|
||||
|
||||
func constantsPost() {
|
||||
ConstVals.Player.CaptchaExpire = time.Duration(Constants.Player.SmsExpiredSeconds) * time.Second
|
||||
ConstVals.Player.CaptchaMaxTTL = ConstVals.Player.CaptchaExpire -
|
||||
time.Duration(Constants.Player.SmsValidResendPeriodSeconds)*time.Second
|
||||
|
||||
ConstVals.Ws.WillKickIfInactiveFor = time.Duration(Constants.Ws.WillKickIfInactiveFor) * time.Millisecond
|
||||
}
|
||||
Reference in New Issue
Block a user