bugs
This commit is contained in:
parent
562498ac25
commit
c934218f47
@ -167,8 +167,9 @@ func (this *MCompConfigure) GetDropData(dropId int32) (data []*cfg.GameDropData)
|
||||
}
|
||||
|
||||
// todo 调用drop 表 获取掉落信息
|
||||
func (this *MCompConfigure) GetMultipleDropReward(count, dropId int32, Items []*pb.UserAssets) {
|
||||
func (this *MCompConfigure) GetMultipleDropReward(count, dropId int32, items []*pb.UserAssets) (resData []*pb.UserAssets) {
|
||||
res := make([]*cfg.Gameatn, 0)
|
||||
|
||||
for i := 0; i < int(count); i++ {
|
||||
data := this.GetDropData(dropId)
|
||||
szW := make([]int32, 0)
|
||||
@ -182,21 +183,21 @@ func (this *MCompConfigure) GetMultipleDropReward(count, dropId int32, Items []*
|
||||
}
|
||||
for _, v := range res {
|
||||
bFind := false
|
||||
for _, v1 := range Items {
|
||||
for _, v1 := range items {
|
||||
if v.A == v1.A && v.T == v1.T {
|
||||
v1.N += v.N
|
||||
bFind = true
|
||||
}
|
||||
}
|
||||
if !bFind {
|
||||
Items = append(Items, &pb.UserAssets{
|
||||
items = append(items, &pb.UserAssets{
|
||||
A: v.A,
|
||||
T: v.T,
|
||||
N: v.N,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
resData = append(resData, items...)
|
||||
return
|
||||
}
|
||||
func (this *MCompConfigure) GetDropReward(dropId int32, Items []*cfg.Gameatn) {
|
||||
|
@ -105,7 +105,7 @@ func (this *modelGourmet) CalculationGourmet(uid string, gourmet *pb.DBGourmet)
|
||||
gourmet.OrderCostTime = 0 // 清空当天的订单时长
|
||||
}
|
||||
order.FoodCount--
|
||||
this.module.configure.GetMultipleDropReward(_gourmetcfg.Using, _gourmetcfg.Propsgroup, gourmet.Items) // 获取掉落奖励
|
||||
gourmet.Items = this.module.configure.GetMultipleDropReward(_gourmetcfg.Using, _gourmetcfg.Propsgroup, gourmet.Items) // 获取掉落奖励
|
||||
|
||||
if curTime > costTime {
|
||||
gourmet.OrderCostTime += int32(curTime - costTime)
|
||||
|
@ -2,7 +2,6 @@ package hunting
|
||||
|
||||
import (
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/core/cbase"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/sys/configure"
|
||||
@ -17,7 +16,6 @@ const (
|
||||
|
||||
///配置管理基础组件
|
||||
type configureComp struct {
|
||||
cbase.ModuleCompBase
|
||||
hlock sync.RWMutex
|
||||
modules.MCompConfigure
|
||||
_vikingMap map[int64]*cfg.GameHuntingBossData
|
||||
@ -25,7 +23,7 @@ type configureComp struct {
|
||||
|
||||
//组件初始化接口
|
||||
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleCompBase.Init(service, module, comp, options)
|
||||
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||
|
||||
this._vikingMap = make(map[int64]*cfg.GameHuntingBossData, 0)
|
||||
configure.RegisterConfigure(game_vikingboss, cfg.NewGameHuntingBoss, func() {
|
||||
|
@ -2,15 +2,15 @@ package mail
|
||||
|
||||
import (
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/core/cbase"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
|
||||
// 邮件配置管理组件
|
||||
type Configure_Comp struct {
|
||||
cbase.ModuleCompBase
|
||||
modules.MCompConfigure
|
||||
}
|
||||
|
||||
func (this *Configure_Comp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.ModuleCompBase.Init(service, module, comp, options)
|
||||
this.MCompConfigure.Init(service, module, comp, options)
|
||||
return
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ type configureComp struct {
|
||||
|
||||
//组件初始化接口
|
||||
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleCompBase.Init(service, module, comp, options)
|
||||
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||
this.module = module.(*Mainline)
|
||||
err = this.LoadMultiConfigure(map[string]interface{}{
|
||||
game_mainlinechapter: cfg.NewGameMainlineChapter,
|
||||
|
@ -103,7 +103,9 @@ func (this *modelSmithy) CalculationSmithy(uid string, Smithy *pb.DBSmithy) {
|
||||
Smithy.OrderCostTime = 0 // 清空当天的订单时长
|
||||
}
|
||||
order.Count--
|
||||
this.module.configure.GetMultipleDropReward(1, _Smithycfg.Drop, Smithy.Items) // 获取掉落奖励
|
||||
|
||||
Smithy.Items = this.module.configure.GetMultipleDropReward(1, _Smithycfg.Drop, Smithy.Items) // 获取掉落奖励
|
||||
|
||||
mapData["items"] = Smithy.Items
|
||||
if curTime > costTime {
|
||||
Smithy.OrderCostTime += int32(curTime - costTime)
|
||||
|
Loading…
Reference in New Issue
Block a user