diff --git a/comm/imodule.go b/comm/imodule.go index d9f929d38..0fa45a827 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -36,7 +36,7 @@ type ( CheckTaskCond(session IUserSession, id int32) CheckMlineCond(session IUserSession, id int32) // 查询opencond 配置 - GetOpenCondCfgById(id string) (data *cfg.GameOpencondData, err error) + GetOpenCondCfgById(uid string, id string) (bOpen bool, errdata *pb.ErrorData) } //邮件业务模块对外接口定义 提供给其他模块使用的 diff --git a/modules/sys/module.go b/modules/sys/module.go index 5d3dff47a..8fc26c47d 100644 --- a/modules/sys/module.go +++ b/modules/sys/module.go @@ -95,6 +95,20 @@ func (this *ModuleSys) AutoActivate(session comm.IUserSession, cids []string) bo return true } -func (this *ModuleSys) GetOpenCondCfgById(id string) (data *cfg.GameOpencondData, err error) { - return this.configure.GetOpenCondCfgById(id) +func (this *ModuleSys) GetOpenCondCfgById(uid string, id string) (bOpen bool, errdata *pb.ErrorData) { + + conf, err := this.configure.GetOpenCondCfgById(id) + if err != nil { + bOpen = false + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.ToString(), + Message: err.Error(), + } + return + } + if this.ValidCond(uid, conf) != "" { + bOpen = true + } + return }