Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
c74f05e451
@ -158,7 +158,11 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR
|
||||
if len(tconfigure.Ants) > 0 { //额外道具加成
|
||||
ants1 = make([]*cfg.Gameatn, 0)
|
||||
r := rand.New(rand.NewSource(time.Now().Unix()))
|
||||
num := r.Int31n(tconfigure.Num[1]-tconfigure.Num[0]) + tconfigure.Num[0]
|
||||
interval := tconfigure.Num[1] - tconfigure.Num[0]
|
||||
num := tconfigure.Num[0]
|
||||
if interval > 0 {
|
||||
num = r.Int31n(interval) + tconfigure.Num[0]
|
||||
}
|
||||
if r.Int31n(100) < tconfigure.Probability { //随机一个道具
|
||||
total := 0
|
||||
for _, v := range tconfigure.Wget {
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
@ -34,7 +35,6 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
||||
this.module = module.(*Practice)
|
||||
this.LoadConfigure(game_pandamasmz, cfg.NewGamePandamasMz)
|
||||
this.LoadConfigure(game_pandamasjs, cfg.NewGamePandamasJs)
|
||||
this.LoadConfigure(game_pandamasjx, cfg.NewGamePandamasJx)
|
||||
this.LoadConfigure(game_pandamasyxjx, cfg.NewGamePandamasYxjx)
|
||||
this.LoadConfigure(game_pandamasmryl, cfg.NewGamePandamasMryl)
|
||||
this.LoadConfigure(game_dispatch_battle, cfg.NewGameDispatch_Battle)
|
||||
@ -55,6 +55,20 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
||||
}
|
||||
this.lock.Unlock()
|
||||
})
|
||||
|
||||
configure.RegisterConfigure(game_pandamasjx, cfg.NewGamePandamasJx, func() {
|
||||
if v, err := this.GetConfigure(game_pandamasjx); err != nil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
this.lock.Unlock()
|
||||
return
|
||||
} else {
|
||||
for _, v := range v.(*cfg.GamePandamasJx).GetDataList() {
|
||||
if len(v.Ants) > 0 && (len(v.Num) != 2 || v.Num[1] < v.Num[0]) {
|
||||
this.module.Error("配置错误!", log.Field{Key: "Num", Value: v.Num})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user