三消异常处理

This commit is contained in:
meixiongfeng 2023-12-01 09:20:30 +08:00
parent c8927cde3d
commit cf64fd4877
2 changed files with 18 additions and 13 deletions

View File

@ -1,6 +1,8 @@
package entertainment package entertainment
import ( import (
"errors"
"fmt"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/modules" "go_dreamfactory/modules"
@ -43,6 +45,8 @@ func (this *modelComp) getEntertainmList(uid string) (result *pb.DBXXLData, err
if conn, err := db.ServerDBConn(tag); err == nil { if conn, err := db.ServerDBConn(tag); err == nil {
dbModel = db.NewDBModel(comm.TableEntertainm, conn) dbModel = db.NewDBModel(comm.TableEntertainm, conn)
} }
} else {
err = errors.New(fmt.Sprintf("split uid err: %s", uid))
} }
} }
if dbModel == nil { if dbModel == nil {

View File

@ -565,6 +565,7 @@ func (this *Room) GameOver() (errdata *pb.ErrorData) {
} }
} }
// 查看能不能获得箱子 // 查看能不能获得箱子
if winner.Userinfo.Uid != "999" {
if list, err := this.module.model.getEntertainmList(winner.Userinfo.Uid); err == nil { if list, err := this.module.model.getEntertainmList(winner.Userinfo.Uid); err == nil {
if len(list.Box) < 3 { // 可以获得一个宝箱 if len(list.Box) < 3 { // 可以获得一个宝箱
if c, err := this.module.configure.GetGameRandomConsumeBoxConf(); err == nil { if c, err := this.module.configure.GetGameRandomConsumeBoxConf(); err == nil {
@ -580,7 +581,7 @@ func (this *Room) GameOver() (errdata *pb.ErrorData) {
}) })
} }
} }
}
} }
} }