Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
b37cbfbc48
@ -167,8 +167,9 @@ func (this *MCompConfigure) GetDropData(dropId int32) (data []*cfg.GameDropData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// todo 调用drop 表 获取掉落信息
|
// 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)
|
res := make([]*cfg.Gameatn, 0)
|
||||||
|
|
||||||
for i := 0; i < int(count); i++ {
|
for i := 0; i < int(count); i++ {
|
||||||
data := this.GetDropData(dropId)
|
data := this.GetDropData(dropId)
|
||||||
szW := make([]int32, 0)
|
szW := make([]int32, 0)
|
||||||
@ -182,21 +183,21 @@ func (this *MCompConfigure) GetMultipleDropReward(count, dropId int32, Items []*
|
|||||||
}
|
}
|
||||||
for _, v := range res {
|
for _, v := range res {
|
||||||
bFind := false
|
bFind := false
|
||||||
for _, v1 := range Items {
|
for _, v1 := range items {
|
||||||
if v.A == v1.A && v.T == v1.T {
|
if v.A == v1.A && v.T == v1.T {
|
||||||
v1.N += v.N
|
v1.N += v.N
|
||||||
bFind = true
|
bFind = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !bFind {
|
if !bFind {
|
||||||
Items = append(Items, &pb.UserAssets{
|
items = append(items, &pb.UserAssets{
|
||||||
A: v.A,
|
A: v.A,
|
||||||
T: v.T,
|
T: v.T,
|
||||||
N: v.N,
|
N: v.N,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
resData = append(resData, items...)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
func (this *MCompConfigure) GetDropReward(dropId int32, Items []*cfg.Gameatn) {
|
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 // 清空当天的订单时长
|
gourmet.OrderCostTime = 0 // 清空当天的订单时长
|
||||||
}
|
}
|
||||||
order.FoodCount--
|
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 {
|
if curTime > costTime {
|
||||||
gourmet.OrderCostTime += int32(curTime - costTime)
|
gourmet.OrderCostTime += int32(curTime - costTime)
|
||||||
|
@ -2,7 +2,6 @@ package hunting
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/lego/core/cbase"
|
|
||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/sys/configure"
|
"go_dreamfactory/sys/configure"
|
||||||
@ -17,7 +16,6 @@ const (
|
|||||||
|
|
||||||
///配置管理基础组件
|
///配置管理基础组件
|
||||||
type configureComp struct {
|
type configureComp struct {
|
||||||
cbase.ModuleCompBase
|
|
||||||
hlock sync.RWMutex
|
hlock sync.RWMutex
|
||||||
modules.MCompConfigure
|
modules.MCompConfigure
|
||||||
_vikingMap map[int64]*cfg.GameHuntingBossData
|
_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) {
|
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)
|
this._vikingMap = make(map[int64]*cfg.GameHuntingBossData, 0)
|
||||||
configure.RegisterConfigure(game_vikingboss, cfg.NewGameHuntingBoss, func() {
|
configure.RegisterConfigure(game_vikingboss, cfg.NewGameHuntingBoss, func() {
|
||||||
|
@ -2,15 +2,15 @@ package mail
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/lego/core/cbase"
|
"go_dreamfactory/modules"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 邮件配置管理组件
|
// 邮件配置管理组件
|
||||||
type Configure_Comp struct {
|
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) {
|
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
|
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) {
|
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)
|
this.module = module.(*Mainline)
|
||||||
err = this.LoadMultiConfigure(map[string]interface{}{
|
err = this.LoadMultiConfigure(map[string]interface{}{
|
||||||
game_mainlinechapter: cfg.NewGameMainlineChapter,
|
game_mainlinechapter: cfg.NewGameMainlineChapter,
|
||||||
|
@ -103,7 +103,9 @@ func (this *modelSmithy) CalculationSmithy(uid string, Smithy *pb.DBSmithy) {
|
|||||||
Smithy.OrderCostTime = 0 // 清空当天的订单时长
|
Smithy.OrderCostTime = 0 // 清空当天的订单时长
|
||||||
}
|
}
|
||||||
order.Count--
|
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
|
mapData["items"] = Smithy.Items
|
||||||
if curTime > costTime {
|
if curTime > costTime {
|
||||||
Smithy.OrderCostTime += int32(curTime - costTime)
|
Smithy.OrderCostTime += int32(curTime - costTime)
|
||||||
|
Loading…
Reference in New Issue
Block a user