上传代码

This commit is contained in:
liwei 2023-07-11 21:06:15 +08:00
parent 7424b5c57b
commit 36d26e0448
2 changed files with 20 additions and 5 deletions

View File

@ -32,15 +32,16 @@ type Pay struct {
modelPayUser *modelPayUserComp modelPayUser *modelPayUserComp
modelDaily *modelDailyComp modelDaily *modelDailyComp
privilege comm.IPayDelivery //月卡 privilege comm.IPayDelivery //月卡
warorder comm.IWarorder //月卡
configure *configureComp configure *configureComp
} }
//模块名 // 模块名
func (this *Pay) GetType() core.M_Modules { func (this *Pay) GetType() core.M_Modules {
return comm.ModulePay return comm.ModulePay
} }
//模块初始化接口 注册用户创建角色事件 // 模块初始化接口 注册用户创建角色事件
func (this *Pay) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { func (this *Pay) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options) err = this.ModuleBase.Init(service, module, options)
this.service = service.(base.IRPCXService) this.service = service.(base.IRPCXService)
@ -57,7 +58,7 @@ func (this *Pay) Start() (err error) {
return return
} }
//装备组件 // 装备组件
func (this *Pay) OnInstallComp() { func (this *Pay) OnInstallComp() {
this.ModuleBase.OnInstallComp() this.ModuleBase.OnInstallComp()
@ -68,7 +69,7 @@ func (this *Pay) OnInstallComp() {
this.configure = this.RegisterComp(new(configureComp)).(*configureComp) 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) { 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()}) this.Debug("Rpc_ModulePayDelivery", log.Field{Key: "args", Value: args.String()})
var ( var (
@ -136,6 +137,12 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery
return return
} }
break break
case 4:
if errdata, items = this.privilege.Delivery(session, args.Productid); errdata != nil {
reply.Code = errdata.Code
return
}
break
} }
for _, v := range res { for _, v := range res {
items = append(items, &pb.UserAssets{A: v.A, T: v.T, N: v.N}) 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 return
} }
//发货 // 发货
func (this *Pay) ModulePayDelivery(session comm.IUserSession, Productid string, Price int32) (errdata *pb.ErrorData) { func (this *Pay) ModulePayDelivery(session comm.IUserSession, Productid string, Price int32) (errdata *pb.ErrorData) {
var ( var (
conf *cfg.GameRechargeData conf *cfg.GameRechargeData

View File

@ -77,6 +77,14 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.WTaskAcceptReq) (
wtask.Accepts = append(wtask.Accepts, req.Tid) wtask.Accepts = append(wtask.Accepts, req.Tid)
update["activations"] = wtask.Activations update["activations"] = wtask.Activations
update["accepts"] = wtask.Accepts 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 { if progress, errdata = this.module.pushtaskprogress(session, wtask, false); errdata != nil {
return return
} }