Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
5598af6fb5
@ -33,9 +33,10 @@ func (this *apiComp) FuncActivate(session comm.IUserSession, req *pb.SysFuncActi
|
|||||||
}
|
}
|
||||||
list.Cond[req.Cid] = 1
|
list.Cond[req.Cid] = 1
|
||||||
this.module.modelSys.ChangeOpenCondData(session.GetUserId(), map[string]interface{}{
|
this.module.modelSys.ChangeOpenCondData(session.GetUserId(), map[string]interface{}{
|
||||||
"cond": list,
|
"cond": list.Cond,
|
||||||
})
|
})
|
||||||
if err := session.SendMsg(string(this.module.GetType()), SysSubTypeFunc, rsp); err != nil {
|
rsp.Cid = req.Cid
|
||||||
|
if err := session.SendMsg(string(this.module.GetType()), "funcactivate", rsp); err != nil {
|
||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,9 +19,14 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
|||||||
if len(req.Keys) == 0 {
|
if len(req.Keys) == 0 {
|
||||||
confList := this.module.configure.getOpencondList()
|
confList := this.module.configure.getOpencondList()
|
||||||
for _, v := range confList {
|
for _, v := range confList {
|
||||||
|
if v.ActivateType == 0 {
|
||||||
id := this.module.modelSys.validCond(session.GetUserId(), v)
|
id := this.module.modelSys.validCond(session.GetUserId(), v)
|
||||||
if id != "" {
|
if id != "" {
|
||||||
rsp.Cond[id] = 0
|
rsp.Cond[id] = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
rsp.Cond[v.Id] = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -31,9 +36,13 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if conf, ok := opencfg.GetDataMap()[key]; ok {
|
if conf, ok := opencfg.GetDataMap()[key]; ok {
|
||||||
|
if conf.ActivateType == 0 {
|
||||||
id := this.module.modelSys.validCond(session.GetUserId(), conf)
|
id := this.module.modelSys.validCond(session.GetUserId(), conf)
|
||||||
if id != "" {
|
if id != "" {
|
||||||
rsp.Cond[id] = 0
|
rsp.Cond[id] = 1
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rsp.Cond[conf.Id] = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -41,10 +50,8 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
|||||||
|
|
||||||
list, _ := this.module.modelSys.GetOpenCondList(session.GetUserId())
|
list, _ := this.module.modelSys.GetOpenCondList(session.GetUserId())
|
||||||
for k, v := range list.Cond {
|
for k, v := range list.Cond {
|
||||||
if _, ok := rsp.Cond[k]; ok {
|
|
||||||
rsp.Cond[k] = v
|
rsp.Cond[k] = v
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if err := session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp); err != nil {
|
if err := session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp); err != nil {
|
||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ type configureComp struct {
|
|||||||
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
err = this.MCompConfigure.Init(service, module, comp, options)
|
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||||
this.LoadConfigure(gameOpencond, cfg.NewGameOpencond)
|
this.LoadConfigure(gameOpencond, cfg.NewGameOpencond)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,7 +48,7 @@ func (this *configureComp) getOpencondList() (list []*cfg.GameOpencondData) {
|
|||||||
if cfg, err := this.getOpencondCfg(); err == nil {
|
if cfg, err := this.getOpencondCfg(); err == nil {
|
||||||
list = cfg.GetDataList()
|
list = cfg.GetDataList()
|
||||||
}
|
}
|
||||||
return nil
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通过cid 找数据
|
// 通过cid 找数据
|
||||||
|
Loading…
Reference in New Issue
Block a user