商队结算积分超出部分转其他道具
This commit is contained in:
parent
6f09e9996f
commit
2107b54b65
@ -24,9 +24,10 @@ const (
|
||||
///配置管理基础组件
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
module *Caravan
|
||||
lock sync.RWMutex
|
||||
event map[int32][]*cfg.GameCaravanEventData
|
||||
module *Caravan
|
||||
lock sync.RWMutex
|
||||
event map[int32][]*cfg.GameCaravanEventData
|
||||
overflow int32
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
@ -52,7 +53,19 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
||||
}
|
||||
this.lock.Unlock()
|
||||
})
|
||||
|
||||
configure.RegisterConfigure(game_caravan_reward, cfg.NewGameCaravanReward, func() {
|
||||
if v, err := this.GetConfigure(game_caravan_event); err != nil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
return
|
||||
} else {
|
||||
for _, v := range v.(*cfg.GameCaravanReward).GetDataList() {
|
||||
if v.Key < 0 {
|
||||
this.overflow = v.Id
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@ -209,12 +222,10 @@ func (this *configureComp) GetCaravanReward() (reward []*cfg.GameCaravanRewardDa
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) GetCaravanMoreReward() (reward []*cfg.Gameatn) {
|
||||
func (this *configureComp) GetCaravanMoreReward() (reward *cfg.GameCaravanRewardData) {
|
||||
if v, err := this.GetConfigure(game_caravan_reward); err == nil {
|
||||
if configure, ok := v.(*cfg.GameCaravanReward); ok {
|
||||
if configure.Get(0) != nil {
|
||||
return configure.Get(0).Reward
|
||||
}
|
||||
reward = configure.Get(this.overflow)
|
||||
}
|
||||
} else {
|
||||
log.Errorf("get GetCaravanInitCity conf err:%v", err)
|
||||
|
@ -465,7 +465,7 @@ func (this *Caravan) Rpc_ModuleCaravanSettlement(ctx context.Context, args *pb.E
|
||||
|
||||
if maxKey <= temp.Merchantmoney {
|
||||
var res []*cfg.Gameatn
|
||||
for _, v := range moreReard {
|
||||
for _, v := range moreReard.Reward {
|
||||
if v.N == 0 {
|
||||
continue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user