mirror of
https://github.com/genxium/DelayNoMore
synced 2024-12-25 11:18:55 +00:00
Minor fix.
This commit is contained in:
parent
8cd5f1d475
commit
7fd96b335a
@ -89,10 +89,10 @@ func (p *playerController) SMSCaptchaGet(c *gin.Context) {
|
||||
var succRet int
|
||||
if Conf.General.ServerEnv == SERVER_ENV_TEST {
|
||||
player, err := models.GetPlayerByName(req.Num)
|
||||
Logger.Info("A new SmsCaptcha record is needed for: ", zap.String("key", redisKey), zap.Any("player", player))
|
||||
if nil == err && nil != player {
|
||||
pass = true
|
||||
succRet = Constants.RetCode.IsTestAcc
|
||||
Logger.Info("A new SmsCaptcha record is needed for: ", zap.String("key", redisKey), zap.Any("player", player))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,13 +77,14 @@ func getPlayer(cond sq.Eq) (*Player, error) {
|
||||
return nil, err
|
||||
}
|
||||
rows, err := storage.MySQLManagerIns.Queryx(query, args...)
|
||||
if err != nil {
|
||||
if nil != err {
|
||||
return nil, err
|
||||
}
|
||||
cols, err := rows.Columns()
|
||||
if nil != err {
|
||||
panic(err)
|
||||
}
|
||||
cnt := 0
|
||||
for rows.Next() {
|
||||
// TODO: Do it more elegantly, but by now I don't have time to learn reflection of Golang
|
||||
vals := rowValues(rows, cols)
|
||||
@ -105,9 +106,14 @@ func getPlayer(cond sq.Eq) (*Player, error) {
|
||||
}
|
||||
}
|
||||
Logger.Debug("Queried player from db", zap.Any("cond", cond), zap.Any("p", p), zap.Any("pd", pd), zap.Any("cols", cols), zap.Any("rowValues", vals))
|
||||
cnt++
|
||||
}
|
||||
if 0 < cnt {
|
||||
p.PlayerDownsync = pd
|
||||
return &p, nil
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Player) Insert(tx *sqlx.Tx) error {
|
||||
|
Loading…
Reference in New Issue
Block a user