diff --git a/modules/entertainment/model.go b/modules/entertainment/model.go index 9cad1e1de..5448cba96 100644 --- a/modules/entertainment/model.go +++ b/modules/entertainment/model.go @@ -1,6 +1,8 @@ package entertainment import ( + "errors" + "fmt" "go_dreamfactory/comm" "go_dreamfactory/lego/core" "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 { dbModel = db.NewDBModel(comm.TableEntertainm, conn) } + } else { + err = errors.New(fmt.Sprintf("split uid err: %s", uid)) } } if dbModel == nil { diff --git a/modules/entertainment/room.go b/modules/entertainment/room.go index 4d4eb1e07..a1703c65d 100644 --- a/modules/entertainment/room.go +++ b/modules/entertainment/room.go @@ -565,22 +565,23 @@ func (this *Room) GameOver() (errdata *pb.ErrorData) { } } // 查看能不能获得箱子 - if list, err := this.module.model.getEntertainmList(winner.Userinfo.Uid); err == nil { - if len(list.Box) < 3 { // 可以获得一个宝箱 - if c, err := this.module.configure.GetGameRandomConsumeBoxConf(); err == nil { - if c.Color != 0 { - box = &pb.BoxData{ - Boxid: c.Boxid, - Opentime: int64(c.Cd) + configure.Now().Unix(), - } - list.Box = append(list.Box, box) + if winner.Userinfo.Uid != "999" { + if list, err := this.module.model.getEntertainmList(winner.Userinfo.Uid); err == nil { + if len(list.Box) < 3 { // 可以获得一个宝箱 + if c, err := this.module.configure.GetGameRandomConsumeBoxConf(); err == nil { + if c.Color != 0 { + box = &pb.BoxData{ + Boxid: c.Boxid, + Opentime: int64(c.Cd) + configure.Now().Unix(), + } + list.Box = append(list.Box, box) - this.module.model.modifyEntertainmList(winner.Userinfo.Uid, map[string]interface{}{ - "box": list.Box, - }) + this.module.model.modifyEntertainmList(winner.Userinfo.Uid, map[string]interface{}{ + "box": list.Box, + }) + } } } - } }