From 36d26e0448a578ab68d09d7fc598af3688521bff Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Tue, 11 Jul 2023 21:06:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/pay/module.go | 17 ++++++++++++----- modules/wtask/api_accept.go | 8 ++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/modules/pay/module.go b/modules/pay/module.go index b19a0b800..c0898831a 100644 --- a/modules/pay/module.go +++ b/modules/pay/module.go @@ -32,15 +32,16 @@ type Pay struct { modelPayUser *modelPayUserComp modelDaily *modelDailyComp privilege comm.IPayDelivery //月卡 + warorder comm.IWarorder //月卡 configure *configureComp } -//模块名 +// 模块名 func (this *Pay) GetType() core.M_Modules { return comm.ModulePay } -//模块初始化接口 注册用户创建角色事件 +// 模块初始化接口 注册用户创建角色事件 func (this *Pay) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { err = this.ModuleBase.Init(service, module, options) this.service = service.(base.IRPCXService) @@ -57,7 +58,7 @@ func (this *Pay) Start() (err error) { return } -//装备组件 +// 装备组件 func (this *Pay) OnInstallComp() { this.ModuleBase.OnInstallComp() @@ -68,7 +69,7 @@ func (this *Pay) OnInstallComp() { this.configure = this.RegisterComp(new(configureComp)).(*configureComp) } -//RPC----------------------------------------------------------------------------------------------------------------------- +// RPC----------------------------------------------------------------------------------------------------------------------- func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDeliveryReq, reply *pb.PayDeliveryResp) (err error) { this.Debug("Rpc_ModulePayDelivery", log.Field{Key: "args", Value: args.String()}) var ( @@ -136,6 +137,12 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery return } break + case 4: + if errdata, items = this.privilege.Delivery(session, args.Productid); errdata != nil { + reply.Code = errdata.Code + return + } + break } for _, v := range res { items = append(items, &pb.UserAssets{A: v.A, T: v.T, N: v.N}) @@ -156,7 +163,7 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery return } -//发货 +// 发货 func (this *Pay) ModulePayDelivery(session comm.IUserSession, Productid string, Price int32) (errdata *pb.ErrorData) { var ( conf *cfg.GameRechargeData diff --git a/modules/wtask/api_accept.go b/modules/wtask/api_accept.go index ab8204742..7102c6f7e 100644 --- a/modules/wtask/api_accept.go +++ b/modules/wtask/api_accept.go @@ -77,6 +77,14 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.WTaskAcceptReq) ( wtask.Accepts = append(wtask.Accepts, req.Tid) update["activations"] = wtask.Activations update["accepts"] = wtask.Accepts + if err = this.module.ModuleBuried.ActiveCondition(session.GetUserId(), conf.Completetask...); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ExternalModule, + Title: pb.ErrorCode_ExternalModule.ToString(), + Message: fmt.Sprintf("ModuleBuried.ActiveCondition uid:%s condiIds:%v", session.GetUserId(), conf.Completetask), + } + return + } if progress, errdata = this.module.pushtaskprogress(session, wtask, false); errdata != nil { return }