From 12299736e0a53f8d6a91cd794d2f419b15e8f2aa Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 22 Dec 2022 20:19:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=92=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 4 ++++ modules/pay/module.go | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/comm/imodule.go b/comm/imodule.go index fabdb5fcb..ded2c12d3 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -336,4 +336,8 @@ type ( IGrowtask interface { BingoAllGrowTask(session IUserSession) error } + //支付发货 + IPayDelivery interface { + Delivery(session IUserSession, pid string) (code pb.ErrorCode, items []*pb.UserAssets) + } ) diff --git a/modules/pay/module.go b/modules/pay/module.go index 3b8763013..f98cfab0a 100644 --- a/modules/pay/module.go +++ b/modules/pay/module.go @@ -29,6 +29,7 @@ type Pay struct { modelPay *modelPayComp modelPayUser *modelPayUserComp modelDaily *modelDailyComp + privilege comm.IPayDelivery //月卡 configure *configureComp } @@ -45,6 +46,11 @@ func (this *Pay) Init(service core.IService, module core.IModule, options core.I } func (this *Pay) Start() (err error) { err = this.ModuleBase.Start() + var module core.IModule + if module, err = this.service.GetModule(comm.ModuleMainline); err != nil { + return + } + this.privilege = module.(comm.IPayDelivery) this.service.RegisterFunctionName(string(comm.Rpc_ModulePayDelivery), this.Rpc_ModulePayDelivery) return } @@ -115,6 +121,9 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery case 2: reply.Code, items = this.modelDaily.delivery(session, args.Productid) break + case 3: + reply.Code, items = this.privilege.Delivery(session, args.Productid) + break } for _, v := range res { items = append(items, &pb.UserAssets{A: v.A, T: v.T, N: v.N}) @@ -131,6 +140,6 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery return } } - this.ModuleHero.RechargeMoney(session.GetUserId(), conf.Amount) + go this.ModuleHero.RechargeMoney(session.GetUserId(), conf.Amount) return } From c0e41abefc14635809a2ae8a3a44ddbe350ae6aa Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 22 Dec 2022 20:26:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A7=98=E5=A2=83?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/moonfantasy/module.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/moonfantasy/module.go b/modules/moonfantasy/module.go index 2c43b6bf6..51b89d4ee 100644 --- a/modules/moonfantasy/module.go +++ b/modules/moonfantasy/module.go @@ -93,7 +93,14 @@ func (this *Moonfantasy) Trigger(session comm.IUserSession, source *pb.BattleRep n, _ := rand.Int(rand.Reader, big.NewInt(1000)) if int32(n.Int64()) < triggerData.DreamlandPro { if this.IsCross() { - this.modelDream.trigger(session) + go func(uid string) { + ss, _ := this.GetUserSession(uid) + this.modelDream.trigger(ss) + if err = ss.Push(); err != nil { + this.Errorln(err) + } + }(session.GetUserId()) + } else { if _, err = this.service.AcrossClusterRpcGo(context.Background(), this.GetCrossTag(),