package egghunt import ( "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" ) func (this *apiComp) AwardCheck(session comm.IUserSession, req *pb.EgghuntAwardReq) (errdata *pb.ErrorData) { return } func (this *apiComp) Award(session comm.IUserSession, req *pb.EgghuntAwardReq) (errdata *pb.ErrorData) { var ( conf *cfg.GameRepeatAllData atno []*pb.UserAtno err error ) if errdata = this.AwardCheck(session, req); errdata != nil { return } if conf, err = this.module.configure.getGameRepeatAllData(req.Id); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ConfigNoFound, Message: err.Error(), } return } if errdata, atno = this.module.DispenseAtno(session, conf.Reward, true); errdata != nil { return } session.SendMsg(string(this.module.GetType()), "info", &pb.EgghuntAwardResp{Id: req.Id, Award: atno}) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.WriteUserLog(session.GetUserId(), "EgghuntAwardReq", atno) }) return }