Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
dde670cbab
@ -350,6 +350,7 @@ const (
|
|||||||
EventOpenCond core.Event_Key = "event_open_cond" //功能开放事件
|
EventOpenCond core.Event_Key = "event_open_cond" //功能开放事件
|
||||||
|
|
||||||
EventBuriedComplete core.Event_Key = "event_buried_complete" //埋点系统条件完成事件批处理接口 接口样例 func(uid string,conids []int32)
|
EventBuriedComplete core.Event_Key = "event_buried_complete" //埋点系统条件完成事件批处理接口 接口样例 func(uid string,conids []int32)
|
||||||
|
EventFriendChange core.Event_Key = "event_friend_change" //加好友
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -463,5 +463,10 @@ func (this *Battle) CheckBattleReport(session comm.IUserSession, report *pb.Batt
|
|||||||
// this.ModuleBuried.SendToRtask(session, comm.Rtype157, int32(report.Info.Ptype), v)
|
// this.ModuleBuried.SendToRtask(session, comm.Rtype157, int32(report.Info.Ptype), v)
|
||||||
go this.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype157, int32(report.Info.Ptype), v))
|
go this.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype157, int32(report.Info.Ptype), v))
|
||||||
}
|
}
|
||||||
return nil, true
|
|
||||||
|
if (report.WinSide == 1 && report.Info.RedCompId == session.GetUserId()) || (report.WinSide == 2 && report.Info.BlueCompId == session.GetUserId()) {
|
||||||
|
return nil, true
|
||||||
|
} else {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package friend
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/lego/sys/event"
|
||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/utils"
|
"go_dreamfactory/utils"
|
||||||
@ -150,6 +151,8 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (e
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event.TriggerEvent(comm.EventFriendChange, uid, len(self.FriendIds))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 拥有xx个好友
|
// 拥有xx个好友
|
||||||
|
@ -36,7 +36,7 @@ func (this *ModelHero) Init(service core.IService, module core.IModule, comp cor
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化英雄
|
// 初始化英雄
|
||||||
func (this *ModelHero) InitHero(uid string, heroCfgId string) *pb.DBHero {
|
func (this *ModelHero) InitHero(uid string, heroCfgId string) *pb.DBHero {
|
||||||
heroCfg, _ := this.module.configure.GetHeroConfig(heroCfgId)
|
heroCfg, _ := this.module.configure.GetHeroConfig(heroCfgId)
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ func (this *ModelHero) InitHero(uid string, heroCfgId string) *pb.DBHero {
|
|||||||
return newHero
|
return newHero
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化英雄技能
|
// 初始化英雄技能
|
||||||
func (this *ModelHero) initHeroSkill(hero *pb.DBHero) []*pb.SkillData {
|
func (this *ModelHero) initHeroSkill(hero *pb.DBHero) []*pb.SkillData {
|
||||||
heroCfg, _ := this.module.configure.GetHeroConfig(hero.HeroID)
|
heroCfg, _ := this.module.configure.GetHeroConfig(hero.HeroID)
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ func (this *ModelHero) initHeroSkill(hero *pb.DBHero) []*pb.SkillData {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//创建一个指定的英雄
|
// 创建一个指定的英雄
|
||||||
func (this *ModelHero) createSpecialHero(uid string, heroCfgId string) (hero *pb.DBHero, err error) {
|
func (this *ModelHero) createSpecialHero(uid string, heroCfgId string) (hero *pb.DBHero, err error) {
|
||||||
list := this.getHeroList(uid)
|
list := this.getHeroList(uid)
|
||||||
for _, v := range list {
|
for _, v := range list {
|
||||||
@ -132,7 +132,7 @@ func (this *ModelHero) CloneNewHero(uid string, hero *pb.DBHero) (newHero *pb.DB
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化可叠加的英雄
|
// 初始化可叠加的英雄
|
||||||
func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int32) (hero *pb.DBHero, err error) {
|
func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int32) (hero *pb.DBHero, err error) {
|
||||||
var (
|
var (
|
||||||
model *db.DBModel
|
model *db.DBModel
|
||||||
@ -158,7 +158,7 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取一个英雄(参数唯一objID)
|
// 获取一个英雄(参数唯一objID)
|
||||||
func (this *ModelHero) getOneHero(uid, heroId string) *pb.DBHero {
|
func (this *ModelHero) getOneHero(uid, heroId string) *pb.DBHero {
|
||||||
hero := &pb.DBHero{}
|
hero := &pb.DBHero{}
|
||||||
err := this.GetListObj(uid, heroId, hero)
|
err := this.GetListObj(uid, heroId, hero)
|
||||||
@ -168,7 +168,7 @@ func (this *ModelHero) getOneHero(uid, heroId string) *pb.DBHero {
|
|||||||
return hero
|
return hero
|
||||||
}
|
}
|
||||||
|
|
||||||
//消耗英雄卡
|
// 消耗英雄卡
|
||||||
func (this *ModelHero) consumeHeroCard(uid string, hero *pb.DBHero) (err error) {
|
func (this *ModelHero) consumeHeroCard(uid string, hero *pb.DBHero) (err error) {
|
||||||
|
|
||||||
if hero == nil {
|
if hero == nil {
|
||||||
@ -183,7 +183,7 @@ func (this *ModelHero) consumeHeroCard(uid string, hero *pb.DBHero) (err error)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取玩家的英雄列表
|
// 获取玩家的英雄列表
|
||||||
func (this *ModelHero) getHeroList(uid string) []*pb.DBHero {
|
func (this *ModelHero) getHeroList(uid string) []*pb.DBHero {
|
||||||
heroes := make([]*pb.DBHero, 0)
|
heroes := make([]*pb.DBHero, 0)
|
||||||
err := this.GetList(uid, &heroes)
|
err := this.GetList(uid, &heroes)
|
||||||
@ -276,11 +276,13 @@ func (this *ModelHero) setEquipProperty(hero *pb.DBHero, equip []*pb.DB_Equipmen
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range hero.Suits {
|
for _, v := range hero.Suits {
|
||||||
if configure, err := this.module.configure.GetEquipsuit(v.Suitid); err != nil {
|
if v.Effect {
|
||||||
this.module.Errorln(err)
|
if configure, err := this.module.configure.GetEquipsuit(v.Suitid); err != nil {
|
||||||
} else {
|
this.module.Errorln(err)
|
||||||
for k, v := range configure.SetBonuses {
|
} else {
|
||||||
addProperty[k] += v
|
for k, v := range configure.SetBonuses {
|
||||||
|
addProperty[k] += v
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -300,7 +302,7 @@ func (this *ModelHero) setEquipProperty(hero *pb.DBHero, equip []*pb.DB_Equipmen
|
|||||||
this.mergeAddProperty(hero.Uid, hero, addProperty, equipSkill)
|
this.mergeAddProperty(hero.Uid, hero, addProperty, equipSkill)
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置装备
|
// 设置装备
|
||||||
func (this *ModelHero) setEquipment(uid string, hero *pb.DBHero) (newHero *pb.DBHero, err error) {
|
func (this *ModelHero) setEquipment(uid string, hero *pb.DBHero) (newHero *pb.DBHero, err error) {
|
||||||
if len(hero.EquipID) == 0 {
|
if len(hero.EquipID) == 0 {
|
||||||
return
|
return
|
||||||
@ -316,7 +318,7 @@ func (this *ModelHero) setEquipment(uid string, hero *pb.DBHero) (newHero *pb.DB
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//合并属性即属性值累加 (data 额外加的属性)
|
// 合并属性即属性值累加 (data 额外加的属性)
|
||||||
func (this *ModelHero) mergeMainProperty(uid string, hero *pb.DBHero, data map[string]int32) (err error) {
|
func (this *ModelHero) mergeMainProperty(uid string, hero *pb.DBHero, data map[string]int32) (err error) {
|
||||||
for k, v := range hero.Property {
|
for k, v := range hero.Property {
|
||||||
if v1, ok := data[k]; ok {
|
if v1, ok := data[k]; ok {
|
||||||
@ -332,7 +334,7 @@ func (this *ModelHero) mergeMainProperty(uid string, hero *pb.DBHero, data map[s
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//合并附加属性
|
// 合并附加属性
|
||||||
func (this *ModelHero) mergeAddProperty(uid string, hero *pb.DBHero, data map[string]int32, skills []*pb.SkillData) {
|
func (this *ModelHero) mergeAddProperty(uid string, hero *pb.DBHero, data map[string]int32, skills []*pb.SkillData) {
|
||||||
hero.AddProperty = data
|
hero.AddProperty = data
|
||||||
|
|
||||||
@ -373,8 +375,8 @@ func (this *ModelHero) StarHpAddition(star int32) (addValue float32) {
|
|||||||
return addValue
|
return addValue
|
||||||
}
|
}
|
||||||
|
|
||||||
//属性计算 基础属性
|
// 属性计算 基础属性
|
||||||
//英雄基础属性 + 英雄等级基础属性 * 英雄成长系数 + 英雄星级对应等级属性 * 英雄品质系数
|
// 英雄基础属性 + 英雄等级基础属性 * 英雄成长系数 + 英雄星级对应等级属性 * 英雄品质系数
|
||||||
func (this *ModelHero) PropertyCompute(hero *pb.DBHero) {
|
func (this *ModelHero) PropertyCompute(hero *pb.DBHero) {
|
||||||
growCfg := this.module.configure.GetHeroLvgrow(hero.HeroID)
|
growCfg := this.module.configure.GetHeroLvgrow(hero.HeroID)
|
||||||
heroCfg, _ := this.module.configure.GetHeroConfig(hero.HeroID)
|
heroCfg, _ := this.module.configure.GetHeroConfig(hero.HeroID)
|
||||||
@ -416,7 +418,7 @@ func (this *ModelHero) PropertyCompute(hero *pb.DBHero) {
|
|||||||
this.resetJuexingProperty(hero)
|
this.resetJuexingProperty(hero)
|
||||||
}
|
}
|
||||||
|
|
||||||
//重新计算英雄属性
|
// 重新计算英雄属性
|
||||||
func (this *ModelHero) ChangeHeroProperty(session comm.IUserSession, hero *pb.DBHero) (err error) {
|
func (this *ModelHero) ChangeHeroProperty(session comm.IUserSession, hero *pb.DBHero) (err error) {
|
||||||
this.PropertyCompute(hero) //重新计算 property 的值
|
this.PropertyCompute(hero) //重新计算 property 的值
|
||||||
update := map[string]interface{}{
|
update := map[string]interface{}{
|
||||||
@ -639,7 +641,7 @@ func (this *ModelHero) InitMonsterHero(heroCfgId string, star, lv int32) *pb.DBH
|
|||||||
return newHero
|
return newHero
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置天赋属性
|
// 设置天赋属性
|
||||||
func (this *ModelHero) setTalentProperty(hero *pb.DBHero, conf *cfg.GameHeroTalentData) {
|
func (this *ModelHero) setTalentProperty(hero *pb.DBHero, conf *cfg.GameHeroTalentData) {
|
||||||
if conf == nil || hero == nil {
|
if conf == nil || hero == nil {
|
||||||
return
|
return
|
||||||
|
@ -105,6 +105,7 @@ func (this *modelPandata) queryrooms(uids []string) (results []*pb.DBPracticeRoo
|
|||||||
// }
|
// }
|
||||||
go this.module.atlas.CheckActivatePandaAtlasCollect(v, "100001")
|
go this.module.atlas.CheckActivatePandaAtlasCollect(v, "100001")
|
||||||
newdata[v] = temp
|
newdata[v] = temp
|
||||||
|
results = append(results, temp)
|
||||||
}
|
}
|
||||||
if err = this.Adds(newdata); err != nil {
|
if err = this.Adds(newdata); err != nil {
|
||||||
this.module.Errorln(err)
|
this.module.Errorln(err)
|
||||||
|
@ -135,6 +135,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
|||||||
}
|
}
|
||||||
if int(shopData.RefreshnumgoldShop) < refresh {
|
if int(shopData.RefreshnumgoldShop) < refresh {
|
||||||
isrefresh = true
|
isrefresh = true
|
||||||
|
shopData.RefreshnumgoldShop++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !isrefresh {
|
if !isrefresh {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package smithy
|
package smithy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/utils"
|
"go_dreamfactory/utils"
|
||||||
@ -24,14 +25,24 @@ func (this *apiComp) Customer(session comm.IUserSession, req *pb.SmithyCustomerR
|
|||||||
cus, err := this.module.modelTrade.getDBCustomer(session.GetUserId())
|
cus, err := this.module.modelTrade.getDBCustomer(session.GetUserId())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == mongo.ErrNoDocuments {
|
if err == mongo.ErrNoDocuments {
|
||||||
c, err := this.module.modelTrade.addCustomer(session.GetUserId(), customerCount) //3个顾客
|
c, err := this.module.modelTrade.addCustomer(session.GetUserId(), customerCount)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
var customErr = new(comm.CustomError)
|
||||||
Code: pb.ErrorCode_DBError,
|
if errors.As(err, &customErr) {
|
||||||
Title: pb.ErrorCode_DBError.ToString(),
|
errdata = &pb.ErrorData{
|
||||||
Message: err.Error(),
|
Code: customErr.Code,
|
||||||
|
Title: customErr.Code.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_DBError,
|
||||||
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
cus = c
|
cus = c
|
||||||
} else {
|
} else {
|
||||||
@ -43,8 +54,7 @@ func (this *apiComp) Customer(session comm.IUserSession, req *pb.SmithyCustomerR
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if utils.IsFirstTody(cus.LastRefreshTime) || (cus.Customers == nil || len(cus.Customers) == 0) {
|
||||||
if utils.IsFirstTody(cus.LastRefreshTime) {
|
|
||||||
this.module.modelTrade.DelByUId(session.GetUserId())
|
this.module.modelTrade.DelByUId(session.GetUserId())
|
||||||
c, err := this.module.modelTrade.addCustomer(session.GetUserId(), customerCount)
|
c, err := this.module.modelTrade.addCustomer(session.GetUserId(), customerCount)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -31,20 +31,15 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.SmithySellReq) (err
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
var customErr = new(comm.CustomError)
|
var customErr = new(comm.CustomError)
|
||||||
if errors.As(err, &customErr) {
|
if errors.As(err, &customErr) {
|
||||||
errdata = &pb.ErrorData{
|
this.module.Debug(customErr.Code.String())
|
||||||
Code: customErr.Code,
|
|
||||||
Title: customErr.Code.ToString(),
|
|
||||||
Message: err.Error(),
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
Title: pb.ErrorCode_DBError.ToString(),
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
conf, err := this.module.configure.GetSmithyCustomerConf(req.CustomerId)
|
conf, err := this.module.configure.GetSmithyCustomerConf(req.CustomerId)
|
||||||
|
@ -93,12 +93,22 @@ func (s *modelTrade) addCustomer(uid string, num int32) (*pb.DBCustomer, error)
|
|||||||
Total: num,
|
Total: num,
|
||||||
LastRefreshTime: configure.Now().Unix(),
|
LastRefreshTime: configure.Now().Unix(),
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < int(num); i++ {
|
for i := 0; i < int(num); i++ {
|
||||||
customer.Customers = append(customer.Customers, &pb.CustomerInfo{
|
randCustomerId := s.getCustomerRandom()
|
||||||
CustomerId: s.getCustomerRandom(),
|
conf, err := s.module.configure.GetSmithyCustomerConf(randCustomerId)
|
||||||
SuitId: s.GetSuitRandom(uid),
|
if err != nil {
|
||||||
EquipCount: s.module.modelStove.StoveSkillBuyEquip(uid),
|
return nil, comm.NewCustomError(pb.ErrorCode_ConfigNoFound)
|
||||||
})
|
}
|
||||||
|
suitId := s.GetSuitRandom(uid, conf.CustomerType)
|
||||||
|
if suitId != 0 {
|
||||||
|
customer.Customers = append(customer.Customers, &pb.CustomerInfo{
|
||||||
|
CustomerId: randCustomerId,
|
||||||
|
SuitId: suitId,
|
||||||
|
EquipCount: s.module.modelStove.StoveSkillBuyEquip(uid),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if err := s.Add(uid, customer); err != nil {
|
if err := s.Add(uid, customer); err != nil {
|
||||||
s.module.Errorln(err)
|
s.module.Errorln(err)
|
||||||
@ -139,12 +149,20 @@ func (s *modelTrade) updateCustomer(uid string, customerId int32) (*pb.DBCustome
|
|||||||
if left < 0 {
|
if left < 0 {
|
||||||
return nil, comm.NewCustomError(pb.ErrorCode_SmithyCustomerLimit)
|
return nil, comm.NewCustomError(pb.ErrorCode_SmithyCustomerLimit)
|
||||||
}
|
}
|
||||||
|
randCustomerId := s.getCustomerRandom()
|
||||||
|
conf, err := s.module.configure.GetSmithyCustomerConf(randCustomerId)
|
||||||
|
if err != nil {
|
||||||
|
return nil, comm.NewCustomError(pb.ErrorCode_ConfigNoFound)
|
||||||
|
}
|
||||||
|
suiteId := s.GetSuitRandom(uid, conf.CustomerType)
|
||||||
|
if suiteId != 0 {
|
||||||
|
cus.Customers = append(cus.Customers, &pb.CustomerInfo{
|
||||||
|
CustomerId: randCustomerId,
|
||||||
|
SuitId: suiteId,
|
||||||
|
EquipCount: s.module.modelStove.StoveSkillBuyEquip(uid),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
cus.Customers = append(cus.Customers, &pb.CustomerInfo{
|
|
||||||
CustomerId: s.getCustomerRandom(),
|
|
||||||
SuitId: s.GetSuitRandom(uid),
|
|
||||||
EquipCount: s.module.modelStove.StoveSkillBuyEquip(uid),
|
|
||||||
})
|
|
||||||
cus.LastRefreshTime = configure.Now().Unix()
|
cus.LastRefreshTime = configure.Now().Unix()
|
||||||
update := map[string]interface{}{
|
update := map[string]interface{}{
|
||||||
"customers": cus.Customers,
|
"customers": cus.Customers,
|
||||||
@ -159,7 +177,7 @@ func (s *modelTrade) updateCustomer(uid string, customerId int32) (*pb.DBCustome
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 返回概率下的套装
|
// 返回概率下的套装
|
||||||
func (s *modelTrade) GetSuitRandom(uid string) (suiteId int32) {
|
func (s *modelTrade) GetSuitRandom(uid string, ctype int32) (suiteId int32) {
|
||||||
//获取玩家所有解锁套装
|
//获取玩家所有解锁套装
|
||||||
uex, err := s.module.ModuleUser.GetUserExpand(uid)
|
uex, err := s.module.ModuleUser.GetUserExpand(uid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -187,7 +205,14 @@ func (s *modelTrade) GetSuitRandom(uid string) (suiteId int32) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
merge := append(unlockSuiteItems, ownerSuiteItems...)
|
var merge []*WeightItem
|
||||||
|
|
||||||
|
if ctype == 1 {
|
||||||
|
merge = append(unlockSuiteItems, ownerSuiteItems...)
|
||||||
|
} else if ctype == 2 {
|
||||||
|
merge = unlockSuiteItems
|
||||||
|
}
|
||||||
|
|
||||||
// 设置权重
|
// 设置权重
|
||||||
wr := newWeightedRandom(merge)
|
wr := newWeightedRandom(merge)
|
||||||
if c := wr.pick(); c != nil {
|
if c := wr.pick(); c != nil {
|
||||||
|
@ -90,6 +90,17 @@ func (this *apiComp) Battlefinish(session comm.IUserSession, req *pb.WorldtaskBa
|
|||||||
if errdata, isWin = ibattle.CheckBattleReport(session, req.Report); errdata == nil {
|
if errdata, isWin = ibattle.CheckBattleReport(session, req.Report); errdata == nil {
|
||||||
if isWin {
|
if isWin {
|
||||||
if battleConf, ok := battleConf.GetDataMap()[req.BattleConfId]; ok {
|
if battleConf, ok := battleConf.GetDataMap()[req.BattleConfId]; ok {
|
||||||
|
|
||||||
|
if battleConf.Carexe > 0 {
|
||||||
|
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||||
|
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||||
|
if !v.Ishelp { // 助战英雄不加经验
|
||||||
|
this.module.ModuleHero.AddHeroExp(session, v.Oid, battleConf.Carexe)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{battleConf.Playexp}, true); errdata != nil {
|
if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{battleConf.Playexp}, true); errdata != nil {
|
||||||
this.module.Error("世界任务战斗玩家经验结算",
|
this.module.Error("世界任务战斗玩家经验结算",
|
||||||
log.Field{Key: "uid", Value: uid},
|
log.Field{Key: "uid", Value: uid},
|
||||||
@ -114,6 +125,7 @@ func (this *apiComp) Battlefinish(session comm.IUserSession, req *pb.WorldtaskBa
|
|||||||
|
|
||||||
//判断是否配置了通知module
|
//判断是否配置了通知module
|
||||||
if len(taskConf.Module) == 0 {
|
if len(taskConf.Module) == 0 {
|
||||||
|
|
||||||
// 发奖
|
// 发奖
|
||||||
// if errdata = this.module.DispenseRes(session, taskConf.Reword, true); errdata != nil {
|
// if errdata = this.module.DispenseRes(session, taskConf.Reword, true); errdata != nil {
|
||||||
// this.module.Error("资源发放",
|
// this.module.Error("资源发放",
|
||||||
|
Loading…
Reference in New Issue
Block a user