From 6f3d6416c30c6f6871d7d049d68ea1ec1a08ca2d Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 22 Nov 2023 14:35:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=85=E5=80=BC=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/modulebase.go | 12 ++++++------ modules/privilege/api_buyyueka.go | 2 +- modules/privilege/module.go | 6 ++---- modules/pushgiftbag/module.go | 6 +++--- modules/shopcenter/module.go | 6 +++--- modules/warorder/module.go | 10 +++++----- 6 files changed, 20 insertions(+), 22 deletions(-) diff --git a/modules/modulebase.go b/modules/modulebase.go index b78e735f7..704dd5f39 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -544,9 +544,9 @@ func (this *ModuleBase) DispenseRes(session comm.IUserSession, res []*cfg.Gameat this.Debugf("发放装备资源: %v errdata: %v", equips, errdata) } if len(vip) > 0 { //卡片资源 - for k := range vip { - errdata, _ = this.ModulePrivilege.Delivery(session, k) - this.Debugf("发放月卡资源: %v errdata: %v", k, errdata) + for _, v := range vip { + errdata, _ = this.ModulePrivilege.Delivery(session, v) + this.Debugf("发放月卡资源: %v errdata: %v", v, errdata) } } if len(atlas) > 0 { @@ -809,9 +809,9 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea this.Debugf("发放装备资源: %v errdata: %v", equips, errdata) } if len(vip) > 0 { //卡片资源 - for k := range vip { - errdata, _ = this.ModulePrivilege.Delivery(session, k) - this.Debugf("发放月卡资源: %v errdata: %v", k, errdata) + for _, v := range vip { + errdata, _ = this.ModulePrivilege.Delivery(session, v) + this.Debugf("发放月卡资源: %v errdata: %v", v, errdata) } for k, v := range vip { atno = append(atno, &pb.UserAtno{ diff --git a/modules/privilege/api_buyyueka.go b/modules/privilege/api_buyyueka.go index abff06327..dbcba0d04 100644 --- a/modules/privilege/api_buyyueka.go +++ b/modules/privilege/api_buyyueka.go @@ -22,6 +22,6 @@ func (this *apiComp) BuyYueka(session comm.IUserSession, req *pb.PrivilegeBuyYue if errdata = this.BuyYuekaCheck(session, req); errdata != nil { return } - errdata, _ = this.module.Delivery(session, req.CID) + //errdata, _ = this.module.Delivery(session, req.CID) return } diff --git a/modules/privilege/module.go b/modules/privilege/module.go index e69ed2f2b..64947113f 100644 --- a/modules/privilege/module.go +++ b/modules/privilege/module.go @@ -70,14 +70,12 @@ func (this *Privilege) EventUserOffline(uid, sessionid string) { } // 购买了一个新的特权 -func (this *Privilege) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) { +func (this *Privilege) Delivery(session comm.IUserSession, pId int32) (errdata *pb.ErrorData, items []*pb.UserAssets) { var ( bFind bool cId int32 ) - // 通过计费点获取 - cId = this.configure.GetPrivilegeCardByPid(pid) - conf, err := this.configure.GetPrivilegeCard(cId) + conf, err := this.configure.GetPrivilegeCard(pId) if err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ConfigNoFound, diff --git a/modules/pushgiftbag/module.go b/modules/pushgiftbag/module.go index fc4d259db..554388f5a 100644 --- a/modules/pushgiftbag/module.go +++ b/modules/pushgiftbag/module.go @@ -52,7 +52,7 @@ func (this *PushGiftbag) OnInstallComp() { } // 发货 -func (this *PushGiftbag) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) { +func (this *PushGiftbag) Delivery(session comm.IUserSession, pId int32) (errdata *pb.ErrorData, items []*pb.UserAssets) { var ( confs []*cfg.GamePushGiftData conf *cfg.GamePushGiftData @@ -68,7 +68,7 @@ func (this *PushGiftbag) Delivery(session comm.IUserSession, pid string) (errdat return } for _, v := range confs { - if v.Recharge == pid { + if v.Id == pId { conf = v break } @@ -78,7 +78,7 @@ func (this *PushGiftbag) Delivery(session comm.IUserSession, pid string) (errdat errdata = &pb.ErrorData{ Code: pb.ErrorCode_ConfigNoFound, Title: pb.ErrorCode_ConfigNoFound.String(), - Message: fmt.Sprintf("no found pid:%s", pid), + Message: fmt.Sprintf("no found pid:%s", pId), } return } diff --git a/modules/shopcenter/module.go b/modules/shopcenter/module.go index b445f1aa4..5a6717d57 100644 --- a/modules/shopcenter/module.go +++ b/modules/shopcenter/module.go @@ -92,7 +92,7 @@ func (this *ShopCenter) ActivityCloseNotice(hdlist *pb.DBHuodong) { } // 发货 -func (this *ShopCenter) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) { +func (this *ShopCenter) Delivery(session comm.IUserSession, pId int32) (errdata *pb.ErrorData, items []*pb.UserAssets) { var ( confs []*cfg.GameShopCenterControlData conf *cfg.GameShopCenterControlData @@ -109,7 +109,7 @@ func (this *ShopCenter) Delivery(session comm.IUserSession, pid string) (errdata } for _, v := range confs { - if v.Point == pid { + if v.Id == pId { conf = v } } @@ -117,7 +117,7 @@ func (this *ShopCenter) Delivery(session comm.IUserSession, pid string) (errdata errdata = &pb.ErrorData{ Code: pb.ErrorCode_ConfigNoFound, Title: pb.ErrorCode_ConfigNoFound.String(), - Message: fmt.Sprintf("no found Point:%s", pid), + Message: fmt.Sprintf("no found Point:%s", pId), } return } diff --git a/modules/warorder/module.go b/modules/warorder/module.go index 7e732cd40..b2f34ad54 100644 --- a/modules/warorder/module.go +++ b/modules/warorder/module.go @@ -51,7 +51,7 @@ func (this *Warorder) OnInstallComp() { } // 发货 -func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) { +func (this *Warorder) Delivery(session comm.IUserSession, pId int32) (errdata *pb.ErrorData, items []*pb.UserAssets) { var ( confs []*cfg.GamePassCheckPriceData conf *cfg.GamePassCheckPriceData @@ -71,7 +71,7 @@ func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata * return } for _, v := range confs { - if v.PayId == pid || v.PayproId == pid || v.PaymidId == pid { + if v.PasscheckType == pId { conf = v break } @@ -80,7 +80,7 @@ func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata * errdata = &pb.ErrorData{ Code: pb.ErrorCode_ConfigNoFound, Title: pb.ErrorCode_ConfigNoFound.String(), - Message: fmt.Sprintf("no found pid:%s", pid), + Message: fmt.Sprintf("no found pid:%s", pId), } return } @@ -108,12 +108,12 @@ func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata * dwarorder = &pb.DreamWarorder{} info.Warorder[conf.PasscheckType] = warorder } - if conf.PayId == pid { + if conf.PasscheckType == pId { dwarorder.Vip = 1 } else { dwarorder.Vip = 2 } - if conf.PayproId == pid || conf.PaymidId == pid { + if conf.PasscheckType == pId { if expconf, err = this.configure.getWarorderLvpMax(conf.PasscheckType); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ConfigNoFound,