From 110ac5676aabdee2b0795775732adfbe983bf95c Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 21 Nov 2023 16:07:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=BB=9F=E8=AE=A1+=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/dispatch/api_do.go | 1 + modules/dispatch/api_refresh.go | 6 ++++++ modules/dragon/api_lvitem.go | 4 ++++ modules/dragon/api_train.go | 1 + modules/enchant/api_challengeover.go | 6 ++++++ modules/entertainment/api_create.go | 3 +++ modules/entertainment/api_joinroom.go | 3 +++ modules/entertainment/api_match.go | 3 +++ modules/equipment/api_ench.go | 2 ++ modules/equipment/api_forg.go | 4 ++++ modules/equipment/api_upgrade.go | 9 ++++----- modules/equipment/api_wash.go | 1 + modules/gourmet/api_createfood.go | 1 + modules/guildgve/api_roulette.go | 1 + modules/hero/api_awaken.go | 1 + modules/hero/api_drawCard.go | 5 +++++ modules/hero/api_strengthenUpSkill.go | 1 + modules/hero/api_strengthenUpStar.go | 1 + modules/hero/api_strengthenUplv.go | 4 ++++ modules/hero/api_talentlearn.go | 1 + modules/hero/api_talentreset.go | 4 ++++ modules/hero/model_talent.go | 3 ++- modules/horoscope/api_rest.go | 1 + modules/horoscope/api_upgrade.go | 10 ++++++---- modules/hunting/api_challenge.go | 10 ++++++++++ modules/hunting/api_getlist.go | 13 +++++++++++-- modules/hunting/model_hunting.go | 3 +-- modules/island/api_buy.go | 4 ++++ modules/island/api_upgrade.go | 3 +++ modules/items/api_buyphysical.go | 1 + modules/items/api_decompose.go | 11 ----------- modules/items/modelitems.go | 9 +++++++-- modules/jielong/api_start.go | 4 ++++ modules/library/api_usegift.go | 10 ++++++---- modules/mainline/api_challenge.go | 5 +++++ modules/mainline/api_shopbuy.go | 3 ++- 36 files changed, 120 insertions(+), 32 deletions(-) diff --git a/modules/dispatch/api_do.go b/modules/dispatch/api_do.go index 218cd2de4..3686d02ed 100644 --- a/modules/dispatch/api_do.go +++ b/modules/dispatch/api_do.go @@ -113,6 +113,7 @@ func (this *apiComp) Do(session comm.IUserSession, req *pb.DispatchDoReq) (errda go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype186, 1)) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "DispatchDoReq", ticketAtn) // 消耗资源 }) return } diff --git a/modules/dispatch/api_refresh.go b/modules/dispatch/api_refresh.go index d7561cc34..3dcb0b1bf 100644 --- a/modules/dispatch/api_refresh.go +++ b/modules/dispatch/api_refresh.go @@ -100,5 +100,11 @@ func (this *apiComp) Refresh(session comm.IUserSession, req *pb.DispatchRefreshR } session.SendMsg(string(this.module.GetType()), "refresh", rsp) + + if len(need) > 0 { + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "DispatchRefreshReq", need) // 消耗资源 + }) + } return } diff --git a/modules/dragon/api_lvitem.go b/modules/dragon/api_lvitem.go index 06a8fbe32..2353f89de 100644 --- a/modules/dragon/api_lvitem.go +++ b/modules/dragon/api_lvitem.go @@ -95,5 +95,9 @@ func (this *apiComp) LvItem(session comm.IUserSession, req *pb.DragonLvItemReq) Dragons: chanegList, }) session.SendMsg(string(this.module.GetType()), "lvitem", rsp) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "DragonLvItemReq", curLvConf.Item) // 消耗资源 + }) return } diff --git a/modules/dragon/api_train.go b/modules/dragon/api_train.go index de68f9958..0f98c580b 100644 --- a/modules/dragon/api_train.go +++ b/modules/dragon/api_train.go @@ -171,6 +171,7 @@ func (this *apiComp) Train(session comm.IUserSession, req *pb.DragonTrainReq) (e go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype235, dragon.Lv, utils.ToInt32(dragon.Dragonid))) this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "DragonTrainReq", atno) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "DragonTrainReq", playConf.Deplete) // 消耗资源 }) } return diff --git a/modules/enchant/api_challengeover.go b/modules/enchant/api_challengeover.go index 17b8a2057..0489d2ac9 100644 --- a/modules/enchant/api_challengeover.go +++ b/modules/enchant/api_challengeover.go @@ -63,11 +63,17 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha return } session.SendMsg(string(this.module.GetType()), EnchantChallengeOverResp, &pb.EnchantChallengeOverResp{Data: enchant}) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "EnchantChallengeOverReq", cfgEnchant[0].PsMg) + }) return } if errdata = this.module.ConsumeRes(session, cfgEnchant[0].PsConsume, true); errdata != nil { return } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "EnchantChallengeOverReq", cfgEnchant[0].PsConsume) + }) userinfo, err := this.module.ModuleUser.GetUser(session.GetUserId()) if err != nil { errdata = &pb.ErrorData{ diff --git a/modules/entertainment/api_create.go b/modules/entertainment/api_create.go index 182098934..e7472521e 100644 --- a/modules/entertainment/api_create.go +++ b/modules/entertainment/api_create.go @@ -51,6 +51,9 @@ func (this *apiComp) CreateRoom(session comm.IUserSession, req *pb.EntertainCrea if errdata = this.module.ConsumeRes(session, conf.Consume, true); errdata != nil { return } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "EntertainCreateRoomReq", conf.Consume) + }) list.Card[req.Idcard] += 1 this.module.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{ "card": list.Card, diff --git a/modules/entertainment/api_joinroom.go b/modules/entertainment/api_joinroom.go index a41d108c0..93b7e57ae 100644 --- a/modules/entertainment/api_joinroom.go +++ b/modules/entertainment/api_joinroom.go @@ -49,6 +49,9 @@ func (this *apiComp) JoinRoom(session comm.IUserSession, req *pb.EntertainJoinRo if errdata = this.module.ConsumeRes(session, conf.Consume, true); errdata != nil { return } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "EntertainJoinRoomReq", conf.Consume) + }) list.Card[req.Idcard] += 1 this.module.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{ "card": list.Card, diff --git a/modules/entertainment/api_match.go b/modules/entertainment/api_match.go index 83fcaae72..eec455a35 100644 --- a/modules/entertainment/api_match.go +++ b/modules/entertainment/api_match.go @@ -49,6 +49,9 @@ func (this *apiComp) Match(session comm.IUserSession, req *pb.EntertainMatchReq) if errdata = this.module.ConsumeRes(session, conf.Consume, true); errdata != nil { return } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "EntertainMatchReq", conf.Consume) + }) list.Card[req.Idcard] += 1 this.module.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{ "card": list.Card, diff --git a/modules/equipment/api_ench.go b/modules/equipment/api_ench.go index 43f0e7935..e397be642 100644 --- a/modules/equipment/api_ench.go +++ b/modules/equipment/api_ench.go @@ -116,6 +116,8 @@ func (this *apiComp) Ench(session comm.IUserSession, req *pb.EquipmentEnchReq) ( go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype94, 1)) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "EquipmentEnchReq", need) + }) return } diff --git a/modules/equipment/api_forg.go b/modules/equipment/api_forg.go index 91602fb06..e8cb7719a 100644 --- a/modules/equipment/api_forg.go +++ b/modules/equipment/api_forg.go @@ -73,5 +73,9 @@ func (this *apiComp) Forg(session comm.IUserSession, req *pb.EquipmentForgReq) ( }) } session.SendMsg(string(this.module.GetType()), "forg", &pb.EquipmentForgResp{Issucc: true, Reward: reward}) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "EquipmentForgReq", need) + }) return } diff --git a/modules/equipment/api_upgrade.go b/modules/equipment/api_upgrade.go index f637ac7bf..9a1aa7f80 100644 --- a/modules/equipment/api_upgrade.go +++ b/modules/equipment/api_upgrade.go @@ -291,10 +291,9 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade session.SendMsg(string(this.module.GetType()), "upgrade", &pb.EquipmentUpgradeResp{IsSucc: issucc, Equipment: modifyequipments}) - if len(tasks) > 0 { - go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { - this.module.ModuleBuried.TriggerBuried(session, tasks...) - }) - } + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.ModuleBuried.TriggerBuried(session, tasks...) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "EquipmentUpgradeReq", intensify.Need) + }) return } diff --git a/modules/equipment/api_wash.go b/modules/equipment/api_wash.go index 4febc09f9..1f3f2e833 100644 --- a/modules/equipment/api_wash.go +++ b/modules/equipment/api_wash.go @@ -83,6 +83,7 @@ func (this *apiComp) Wash(session comm.IUserSession, req *pb.EquipmentWashReq) ( go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype95, 1)) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "EquipmentWashReq", &cfg.Gameatn{A: comm.AttrType, T: comm.ResGold, N: gole}) }) return } diff --git a/modules/gourmet/api_createfood.go b/modules/gourmet/api_createfood.go index 8f5ec7efd..ddd89ae57 100644 --- a/modules/gourmet/api_createfood.go +++ b/modules/gourmet/api_createfood.go @@ -101,6 +101,7 @@ func (this *apiComp) CreateFood(session comm.IUserSession, req *pb.GourmetCreate go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype150, 1)) this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "GourmetCreateFoodReq", atn) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "GourmetCreateFoodReq", res) }) return } diff --git a/modules/guildgve/api_roulette.go b/modules/guildgve/api_roulette.go index a49b87db5..edc03aad6 100644 --- a/modules/guildgve/api_roulette.go +++ b/modules/guildgve/api_roulette.go @@ -74,6 +74,7 @@ func (this *apiComp) Roulette(session comm.IUserSession, req *pb.GuildGveRoulett go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "GuildGveRouletteReq", confs[index].Reward) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "GuildGveRouletteReq", need) }) return } diff --git a/modules/hero/api_awaken.go b/modules/hero/api_awaken.go index 02d3166ab..b20a6aec7 100644 --- a/modules/hero/api_awaken.go +++ b/modules/hero/api_awaken.go @@ -146,6 +146,7 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (e } go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, tasks...) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "HeroAwakenReq", awakenData.Phaseneed) }) return } diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index bc136502c..854483347 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -132,6 +132,10 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq } rsp.FirstGet = firstGet session.SendMsg(string(this.module.GetType()), DrawCard, rsp) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "HeroDrawCardReq", atno) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "HeroDrawCardReq", costRes) + }) return } // 准备数据 @@ -373,6 +377,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "HeroDrawCardReq", atno) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "HeroDrawCardReq", costRes) }) return } diff --git a/modules/hero/api_strengthenUpSkill.go b/modules/hero/api_strengthenUpSkill.go index 9462e3079..3fe1c33c8 100644 --- a/modules/hero/api_strengthenUpSkill.go +++ b/modules/hero/api_strengthenUpSkill.go @@ -155,6 +155,7 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt tasks = append(tasks, comm.GetBuriedParam(comm.Rtype117, lvUpCount, utils.ToInt32(_hero.HeroID))) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, tasks...) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "HeroStrengthenUpSkillReq", cost) }) return } diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index 1d953c085..9602739e6 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -119,6 +119,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr if len(starConf.Starup) > 0 { this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "HeroStrengthenUpStarReq", starConf.Starup) } + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "HeroStrengthenUpStarReq", starConf.Needrace) }) return } diff --git a/modules/hero/api_strengthenUplv.go b/modules/hero/api_strengthenUplv.go index c52ff932d..da2bbf258 100644 --- a/modules/hero/api_strengthenUplv.go +++ b/modules/hero/api_strengthenUplv.go @@ -101,5 +101,9 @@ func (this *apiComp) StrengthenUplv(session comm.IUserSession, req *pb.HeroStren this.module.Errorf("no found userdata uid:%s", session.GetUserId()) } session.SendMsg(string(this.module.GetType()), StrengthenUplv, &pb.HeroStrengthenUplvResp{Hero: _hero}) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "HeroStrengthenUplvReq", cost) + }) return } diff --git a/modules/hero/api_talentlearn.go b/modules/hero/api_talentlearn.go index 09648facc..9fdfa458b 100644 --- a/modules/hero/api_talentlearn.go +++ b/modules/hero/api_talentlearn.go @@ -218,6 +218,7 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe tasks = append(tasks, comm.GetBuriedParam(comm.Rtype199, 1)) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, tasks...) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "HeroTalentLearnReq", res) }) } diff --git a/modules/hero/api_talentreset.go b/modules/hero/api_talentreset.go index 4e774dc74..e3ea56362 100644 --- a/modules/hero/api_talentreset.go +++ b/modules/hero/api_talentreset.go @@ -98,5 +98,9 @@ func (this *apiComp) TalentReset(session comm.IUserSession, req *pb.HeroTalentRe session.SendMsg(string(this.module.GetType()), HeroTalentResetResp, &pb.HeroTalentResetResp{ Telnet: _talent, }) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "HeroTalentResetReq", this.module.ModuleTools.GetGlobalConf().TalentReset) + }) return } diff --git a/modules/hero/model_talent.go b/modules/hero/model_talent.go index d8a52a579..0899ce124 100644 --- a/modules/hero/model_talent.go +++ b/modules/hero/model_talent.go @@ -44,8 +44,9 @@ func (this *ModelTalent) ChangeHeroTalent(talent *pb.DBHeroTalent, update map[st if talent == nil || len(update) == 0 { return errors.New("err") } - if err := this.ChangeList(talent.Uid, talent.Id, update); err != nil { + if err = this.ChangeList(talent.Uid, talent.Id, update); err != nil { this.module.Debugf("ChangeHeroTalent err %v", err) + return } return nil } diff --git a/modules/horoscope/api_rest.go b/modules/horoscope/api_rest.go index 6ab8f74e9..3401b4550 100644 --- a/modules/horoscope/api_rest.go +++ b/modules/horoscope/api_rest.go @@ -72,6 +72,7 @@ func (this *apiComp) Reset(session comm.IUserSession, req *pb.HoroscopeResetReq) session.SendMsg(string(this.module.GetType()), "reset", &pb.HoroscopeResetResp{Issucc: true, Info: info, Award: consume}) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "HoroscopeResetReq", res) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "HoroscopeResetReq", conf.HoroscopeResetCost) }) return diff --git a/modules/horoscope/api_upgrade.go b/modules/horoscope/api_upgrade.go index b88c7ff87..a4ccf9ef7 100644 --- a/modules/horoscope/api_upgrade.go +++ b/modules/horoscope/api_upgrade.go @@ -103,11 +103,13 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.HoroscopeUpgrade } session.SendMsg(string(this.module.GetType()), "upgrade", &pb.HoroscopeUpgradeResp{Nid: conf.NodeId, Lv: conf.Lv + 1}) - if len(tasks) > 0 { - go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + if len(tasks) > 0 { this.module.ModuleBuried.TriggerBuried(session, tasks...) - }) - } + } + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "HoroscopeUpgradeReq", conf.CostItem) + }) return } diff --git a/modules/hunting/api_challenge.go b/modules/hunting/api_challenge.go index 5ba4ea627..ce2eca0d6 100644 --- a/modules/hunting/api_challenge.go +++ b/modules/hunting/api_challenge.go @@ -131,5 +131,15 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.HuntingChallen } else { this.module.Errorf("no found userdata uid:%s", session.GetUserId()) } + if ps > 0 { + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "HuntingChallengeReq", &cfg.Gameatn{ + A: "attr", + T: "ps", + N: ps, + }) + }) + } + return } diff --git a/modules/hunting/api_getlist.go b/modules/hunting/api_getlist.go index c0b57927f..3ba9d4c13 100644 --- a/modules/hunting/api_getlist.go +++ b/modules/hunting/api_getlist.go @@ -12,12 +12,21 @@ func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.HuntingGetL } func (this *apiComp) GetList(session comm.IUserSession, req *pb.HuntingGetListReq) (errdata *pb.ErrorData) { - + var ( + list *pb.DBHunting + err error + ) if errdata = this.GetListCheck(session, req); errdata != nil { return // 参数校验失败直接返回 } - list, _ := this.module.modelHunting.getHuntingList(session.GetUserId()) + if list, err = this.module.modelHunting.getHuntingList(session.GetUserId()); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + } + return + } session.SendMsg(string(this.module.GetType()), HuntingGetListResp, &pb.HuntingGetListResp{Data: list}) return diff --git a/modules/hunting/model_hunting.go b/modules/hunting/model_hunting.go index 5794e95bb..34ac4e3d2 100644 --- a/modules/hunting/model_hunting.go +++ b/modules/hunting/model_hunting.go @@ -45,8 +45,7 @@ func (this *modelHunting) getHuntingList(uid string) (result *pb.DBHunting, err Ps: map[int32]int32{}, } - this.Add(uid, result) - err = nil + err = this.Add(uid, result) } return } diff --git a/modules/island/api_buy.go b/modules/island/api_buy.go index a1de54d2f..4da56d467 100644 --- a/modules/island/api_buy.go +++ b/modules/island/api_buy.go @@ -114,5 +114,9 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.IsLandBuyReq) (errda "heroshop": info.Heroshop, }) session.SendMsg(string(this.module.GetType()), "buy", &pb.IsLandBuyResp{Hero: hero}) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "IsLandBuyReq", coinconf.Need) + }) return } diff --git a/modules/island/api_upgrade.go b/modules/island/api_upgrade.go index 7c522a2ed..6a0206cf2 100644 --- a/modules/island/api_upgrade.go +++ b/modules/island/api_upgrade.go @@ -76,5 +76,8 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.IsLandUpgradeReq "nodes": info.Nodes, }) session.SendMsg(string(this.module.GetType()), "upgrade", &pb.IsLandUpgradeReq{Nid: conf.NodeId}) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "IsLandUpgradeReq", conf.CostItem) + }) return } diff --git a/modules/items/api_buyphysical.go b/modules/items/api_buyphysical.go index 94c2d0562..b4763eac8 100644 --- a/modules/items/api_buyphysical.go +++ b/modules/items/api_buyphysical.go @@ -110,6 +110,7 @@ func (this *apiComp) BuyPhysical(session comm.IUserSession, req *pb.ItemsBuyPhys session.SendMsg(string(this.module.GetType()), "buyphysical", &pb.ItemsBuyPhysicalResp{Issucc: true, PhysicalBuyNum: user.Physicalbuynum, Asets: atno}) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "ItemsBuyPhysicalReq", atno) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "ItemsBuyPhysicalReq", need) }) return } diff --git a/modules/items/api_decompose.go b/modules/items/api_decompose.go index b9572686f..56bd0982a 100644 --- a/modules/items/api_decompose.go +++ b/modules/items/api_decompose.go @@ -55,17 +55,6 @@ func (this *apiComp) Decompose(session comm.IUserSession, req *pb.ItemsDecompose } return } - // sale = make([]*cfg.Gameatn, 0, len(itemcf.DecomposeDeplete)) - // for _, v := range itemcf.DecomposeDeplete { - // sale = append(sale, &cfg.Gameatn{ - // A: v.A, - // T: v.T, - // N: v.N * int32(req.Amount), - // }) - // } - // if errdata = this.module.ConsumeRes(session, sale, true); errdata != nil { - // return - // } if req.Amount > item.Amount { this.module.Errorf("SellItemCheck over all amount:[%d:%d]", req.Amount, item.Amount) diff --git a/modules/items/modelitems.go b/modules/items/modelitems.go index fd1c20e75..123e4efe9 100644 --- a/modules/items/modelitems.go +++ b/modules/items/modelitems.go @@ -547,6 +547,7 @@ func (this *ModelItemsComp) buyTicket(session comm.IUserSession, buy int32) (inf go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "buyTicket", res) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "buyTicket", needs) }) return } @@ -667,7 +668,9 @@ func (this *ModelItemsComp) useitem(session comm.IUserSession, gid string, amoun if errdata = this.module.ConsumeRes(session, sale, true); errdata != nil { return } - + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "itemuse_exchange", sale) + }) if errdata = this.module.AddItemforGrid(session, gid, -1*itemcf.SynthetizeNum*int32(amount), true); errdata != nil { return } @@ -711,7 +714,9 @@ func (this *ModelItemsComp) useitem(session comm.IUserSession, gid string, amoun if errdata = this.module.ConsumeRes(session, sale, true); errdata != nil { return } - + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "itemuse_heroexchange", sale) + }) if errdata = this.module.AddItemforGrid(session, gid, -1*int32(amount), true); errdata != nil { return } diff --git a/modules/jielong/api_start.go b/modules/jielong/api_start.go index a9b6b3465..754d47eac 100644 --- a/modules/jielong/api_start.go +++ b/modules/jielong/api_start.go @@ -48,5 +48,9 @@ func (this *apiComp) StartGame(session comm.IUserSession, req *pb.JielongStartGa session.SendMsg(string(this.module.GetType()), "startgame", &pb.JielongStartGameResp{ Susses: true, }) + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "JielongStartGameReq", jielongItem) + }) return } diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index c5c098f98..017c0d0b2 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -196,11 +196,13 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe tasks = append(tasks, comm.GetBuriedParam(comm.Rtype134, upLv)) tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype132, _heroObj.Heroid, _heroObj.Favorlv)) } - if len(tasks) > 0 { - go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + if len(tasks) > 0 { this.module.ModuleBuried.TriggerBuried(session, tasks...) - }) - } + } + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "LibraryUseGiftReq", res) + }) return } diff --git a/modules/mainline/api_challenge.go b/modules/mainline/api_challenge.go index c7c9c26e6..0e111d131 100644 --- a/modules/mainline/api_challenge.go +++ b/modules/mainline/api_challenge.go @@ -102,5 +102,10 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle }, Level: req.Level, }) + if ps > 0 { + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "MainlineChallengeReq", psAnt) + }) + } return } diff --git a/modules/mainline/api_shopbuy.go b/modules/mainline/api_shopbuy.go index fe0cb5b4a..4d24e61f2 100644 --- a/modules/mainline/api_shopbuy.go +++ b/modules/mainline/api_shopbuy.go @@ -80,7 +80,7 @@ func (this *apiComp) ShopBuy(session comm.IUserSession, req *pb.MainlineShopBuyR return } if errdata, atno = this.module.DispenseAtno(session, shopConf.Itemsell, true); errdata != nil { - this.module.DispenseRes(session, shopConf.Need, true) // ????? + this.module.DispenseRes(session, shopConf.Need, true) // 资源回退 return } this.module.modelShop.updateMainlineShopData(session.GetUserId(), info) @@ -93,6 +93,7 @@ func (this *apiComp) ShopBuy(session comm.IUserSession, req *pb.MainlineShopBuyR go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.ModuleBuried.TriggerBuried(session, tasks...) this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "MainlineShopBuyReq", atno) + this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "MainlineShopBuyReq", shopConf.Need) }) return }