打点优化
This commit is contained in:
parent
a245a5e33d
commit
dec81f8877
@ -110,7 +110,7 @@ func GetNameById(Id int) string {
|
||||
log.Debug("MergeDataCfg GetOne Id:%v not found", Id)
|
||||
return ""
|
||||
}
|
||||
return gamedata.GetStringValue(data, "Icon")
|
||||
return gamedata.GetStringValue(data, "Title")
|
||||
}
|
||||
|
||||
// 根据等级和颜色获取棋子id
|
||||
|
||||
@ -796,6 +796,7 @@ func (p *Player) HandleItem(itemList []*item.Item, Label string) error {
|
||||
PlayroomBackData(p)
|
||||
}
|
||||
}
|
||||
p.PetItemUseLog(itemList)
|
||||
CardMod := p.PlayMod.getCardMod()
|
||||
p.PushClientRes(CardMod.NotifyCard())
|
||||
p.PushClientRes(ItemMod.NotifyItem())
|
||||
|
||||
@ -265,7 +265,7 @@ func (p *PlayerBaseData) ReqUnBindFacebook(player *Player, buf []byte) {
|
||||
G_getGameLogic().PackResInfo(agent, "ResUnBindFacebook", data)
|
||||
p.SaveDataFromDB("")
|
||||
player.TeLog("platform_disconnect", map[string]interface{}{
|
||||
"platform_type": "facebook",
|
||||
"platform_type": "Facebook",
|
||||
"platform_id": req.BindAccountId,
|
||||
})
|
||||
}
|
||||
|
||||
@ -235,6 +235,7 @@ func (p *PlayerChessData) HandleChess(player *Player, handle_list []*msg.ChessHa
|
||||
}
|
||||
player.TeLog("sell_item", map[string]interface{}{
|
||||
"merge_item_id": ChessId,
|
||||
"product_name": mergeDataCfg.GetNameById(ChessId),
|
||||
"get_star_num": items[0].Num,
|
||||
})
|
||||
itemList = item.Merge(itemList, items)
|
||||
|
||||
@ -27,7 +27,7 @@ func (p *Player) PetItemGetLog(Item []*item.Item, Cost []*item.Item, Label strin
|
||||
CostNum := 0
|
||||
if len(Cost) > 0 {
|
||||
switch Cost[0].Id {
|
||||
case item.ITEM_TYPE_DIAMOND:
|
||||
case item.ITEM_DIAMOND_ID:
|
||||
CostType = "diamond"
|
||||
case item.ITEM_STAR_ID:
|
||||
CostType = "star"
|
||||
@ -36,7 +36,7 @@ func (p *Player) PetItemGetLog(Item []*item.Item, Cost []*item.Item, Label strin
|
||||
default:
|
||||
CostType = "unknown"
|
||||
}
|
||||
CostNum = Cost[0].Num
|
||||
CostNum = -Cost[0].Num
|
||||
}
|
||||
for _, v := range Item {
|
||||
Type := itemCfg.GetItemType(v.Id)
|
||||
@ -61,7 +61,7 @@ func (p *Player) PetItemGetLog_(Type int, Name string, Label string, CostType st
|
||||
func (p *Player) PetItemUseLog(Item []*item.Item) {
|
||||
for _, v := range Item {
|
||||
Type := itemCfg.GetItemType(v.Id)
|
||||
if Type == item.ITEM_TYPE_PLAYROOM_PET {
|
||||
if Type == item.ITEM_TYPE_PLAYROOM_PET && v.Num < 0 {
|
||||
Name, _ := itemCfg.GetItemName(v.Id)
|
||||
Effect := itemCfg.GetItemEffect(v.Id)
|
||||
p.TeLog("pet_item_use", map[string]interface{}{
|
||||
|
||||
@ -325,11 +325,27 @@ func ReqRewardOrder(player *Player, buf []byte) error {
|
||||
|
||||
// 每日任务
|
||||
player.QuestTrigger(&quest.Trigger{Label: quest.TRIGGER_LABEL_FINISHORDER})
|
||||
order_star_reward := 0
|
||||
order_item_reward := []int{}
|
||||
for _, v := range Item {
|
||||
if v.Id == item.ITEM_STAR_ID {
|
||||
order_star_reward += v.Num
|
||||
} else {
|
||||
order_item_reward = append(order_item_reward, v.Id)
|
||||
}
|
||||
}
|
||||
preset_order_group := 0
|
||||
if OrderType != order.Preview_type && OrderType != order.Fixed_type {
|
||||
preset_order_group = -1
|
||||
}
|
||||
player.TeLog("order_finish", map[string]interface{}{
|
||||
"order_id": int(req.OrderId),
|
||||
"order_item_id": mergeList,
|
||||
"order_type": OrderType,
|
||||
"order_star_reward": Star,
|
||||
"order_id": int(req.OrderId),
|
||||
"order_item_id": mergeList,
|
||||
"order_type": OrderType,
|
||||
"order_star_reward": order_star_reward,
|
||||
"order_item_reward": order_item_reward,
|
||||
"order_star_value": Star,
|
||||
"preset_order_group": preset_order_group,
|
||||
})
|
||||
player.PetItemGetLog(Item, nil, "Order")
|
||||
EmitRetireTrigger2(player)
|
||||
@ -403,7 +419,7 @@ func ReqDecorate(player *Player, buf []byte) error {
|
||||
DecorateMod := player.PlayMod.getDecorateMod()
|
||||
DecorateId := int(req.DecorateId)
|
||||
AreaId := int(req.AreaId)
|
||||
CostItem, PetExp := DecorateMod.GetDecorateCostItem(AreaId, DecorateId)
|
||||
CostItem, PetExp, PartItem := DecorateMod.GetDecorateCostItem(AreaId, DecorateId)
|
||||
err := player.HandleLoseItem(CostItem, msg.ITEM_POP_LABEL_DecorateCost.String()) // 扣除道具
|
||||
if err != nil {
|
||||
player.SendErrClienRes(&msg.ResDecorate{
|
||||
@ -451,7 +467,8 @@ func ReqDecorate(player *Player, buf []byte) error {
|
||||
})
|
||||
}
|
||||
player.TeLog("finish_deco", map[string]interface{}{
|
||||
"deco_step_id": fmt.Sprintf("%d_%d", AreaId, DecorateId),
|
||||
"deco_step_id": fmt.Sprintf("%d_%d", AreaId, DecorateId),
|
||||
"material_cost": PartItem,
|
||||
})
|
||||
|
||||
player.PlayMod.save()
|
||||
@ -831,9 +848,9 @@ func ReqUpgradeChess(player *Player, buf []byte) error {
|
||||
})
|
||||
return err
|
||||
}
|
||||
player.TeLog("ReqUpgradeChess", map[string]interface{}{
|
||||
"chess_id": req.ChessId,
|
||||
"new_chess": NewChess,
|
||||
player.TeLog("wand_use", map[string]interface{}{
|
||||
"wand_item_id": req.ChessId,
|
||||
"new_chess": NewChess,
|
||||
})
|
||||
Handbook := player.PlayMod.getHandbookMod()
|
||||
Handbook.SetHandbook(NewChess)
|
||||
@ -1365,8 +1382,13 @@ func ReqSetFace(player *Player, buf []byte) error {
|
||||
player.PushClientRes(&msg.ResSetFace{
|
||||
Code: msg.RES_CODE_SUCCESS,
|
||||
})
|
||||
is_platform := false
|
||||
if req.Face == 0 {
|
||||
is_platform = true
|
||||
}
|
||||
player.TeLog("face_set", map[string]interface{}{
|
||||
"face_id": int(req.Face),
|
||||
"face_id": int(req.Face),
|
||||
"is_platform": is_platform,
|
||||
})
|
||||
player.PlayerDecoSetLog("face", int(req.Face), "")
|
||||
BackUserInfo(player)
|
||||
@ -2454,7 +2476,7 @@ func ReqBuyChessShop(player *Player, buf []byte) error {
|
||||
"item_id": int(req.Id),
|
||||
"change_num": 1,
|
||||
"cost_type": "diamond",
|
||||
"cost_num": LostItem[0].Num,
|
||||
"cost_num": -LostItem[0].Num,
|
||||
})
|
||||
player.PlayMod.save()
|
||||
player.PushClientRes(ChargeMod.BackData())
|
||||
@ -2462,7 +2484,7 @@ func ReqBuyChessShop(player *Player, buf []byte) error {
|
||||
Code: msg.RES_CODE_SUCCESS,
|
||||
})
|
||||
player.TeLog("buy_product_diamond", map[string]interface{}{
|
||||
"diamond_cost": LostItem[0].Num,
|
||||
"diamond_cost": -LostItem[0].Num,
|
||||
"product_id": int(req.Id),
|
||||
"product_name": mergeDataCfg.GetNameById(int(req.Id)),
|
||||
})
|
||||
@ -3436,7 +3458,7 @@ func ReqPlayroomSetRoom(player *Player, buf []byte) error {
|
||||
req := &msg.ReqPlayroomSetRoom{}
|
||||
proto.Unmarshal(buf, req)
|
||||
PlayroomMod := player.PlayMod.getPlayroomMod()
|
||||
Diff, err := PlayroomMod.SetRoom(GoUtil.MapInt32ToInt(req.Playroom))
|
||||
_, err := PlayroomMod.SetRoom(GoUtil.MapInt32ToInt(req.Playroom))
|
||||
if err != nil {
|
||||
player.SendErrClienRes(&msg.ResPlayroomSetRoom{
|
||||
Code: msg.RES_CODE_FAIL,
|
||||
@ -3446,7 +3468,7 @@ func ReqPlayroomSetRoom(player *Player, buf []byte) error {
|
||||
}
|
||||
player.QuestTrigger(&quest.Trigger{Label: quest.TRIGGER_LABEL_ROOMDEC})
|
||||
player.PlayMod.save()
|
||||
player.RoomDecoSetLog(Diff)
|
||||
//player.RoomDecoSetLog(Diff)
|
||||
player.PushClientRes(&msg.ResPlayroomSetRoom{
|
||||
Code: msg.RES_CODE_SUCCESS,
|
||||
})
|
||||
@ -3467,7 +3489,6 @@ func ReqPlayroomGame(player *Player, buf []byte) error {
|
||||
return fmt.Errorf("no target")
|
||||
}
|
||||
Items := player.GetPlayroomGameReward(int(req.Type), 0)
|
||||
PlayroomMod.ResetGame()
|
||||
err := player.HandleItem(Items, msg.ITEM_POP_LABEL_PlayroomGame.String())
|
||||
if err != nil {
|
||||
player.SendErrClienRes(&msg.ResPlayroomGame{
|
||||
@ -3498,6 +3519,7 @@ func ReqPlayroomGame(player *Player, buf []byte) error {
|
||||
"is_chip": false,
|
||||
"item_list": Items,
|
||||
})
|
||||
PlayroomMod.ResetGame()
|
||||
PlayroomBackData(player)
|
||||
player.PlayerDecoSetLog("emoji", int(req.EmojiId), "playroom_game")
|
||||
player.PushClientRes(&msg.ResPlayroomGame{
|
||||
@ -3548,12 +3570,13 @@ func ReqPlayroomSelectReward(player *Player, buf []byte) error {
|
||||
player.GetPetThiefReward(Target)
|
||||
}
|
||||
G_GameLogicPtr.SetUserData(Target, VAR_OP_CHIP, 1)
|
||||
PlayroomMod.ResetGame()
|
||||
player.TeLog("finish_mini_game", map[string]interface{}{
|
||||
"mini_game_type": PlayroomMod.GetGameId(),
|
||||
"is_chip": true,
|
||||
"item_list": Items,
|
||||
})
|
||||
PlayroomMod.ResetGame()
|
||||
|
||||
player.PlayerDecoSetLog("emoji", int(req.EmojiId), "playroom_select_reward")
|
||||
PlayroomBackData(player)
|
||||
player.PlayMod.save()
|
||||
@ -3754,7 +3777,7 @@ func ReqPlayroomFlipReward(player *Player, buf []byte) error {
|
||||
},
|
||||
})
|
||||
player.TeLog("finish_mini_game", map[string]interface{}{
|
||||
"mini_game_type": PlayroomMod.GetGameId(),
|
||||
"mini_game_type": playroom.GAME_TYPE_FILP,
|
||||
"is_chip": false,
|
||||
"item_list": Items,
|
||||
})
|
||||
@ -4191,9 +4214,10 @@ func ReqFriendTreasureEnd(player *Player, buf []byte) error {
|
||||
)
|
||||
return err
|
||||
}
|
||||
player.TeLog("friend_treasure_end", map[string]interface{}{
|
||||
"items": Items,
|
||||
"num": FriendItemNum,
|
||||
player.TeLog("pet_treasure_open", map[string]interface{}{
|
||||
"pet_treasure_step": FriendTreasureMod.Shift,
|
||||
"pet_treasure_box": FriendTreasureMod.BoxItems,
|
||||
"pet_treasure_reward": append(Items, FriendTreasureMod.BoxItems...),
|
||||
})
|
||||
player.PlayMod.save()
|
||||
player.PushClientRes(&msg.ResFriendTreasureEnd{
|
||||
@ -4345,7 +4369,7 @@ func ReqPlayroomDressSet(player *Player, buf []byte) error {
|
||||
req := &msg.ReqPlayroomDressSet{}
|
||||
proto.Unmarshal(buf, req)
|
||||
PlayroomMod := player.PlayMod.getPlayroomMod()
|
||||
Parts, Diff, error := PlayroomMod.PlayroomDressSet(GoUtil.MapInt32ToInt(req.DressSet))
|
||||
Parts, _, error := PlayroomMod.PlayroomDressSet(GoUtil.MapInt32ToInt(req.DressSet))
|
||||
if error != nil {
|
||||
player.SendErrClienRes(&msg.ResPlayroomDressSet{
|
||||
Code: msg.RES_CODE_FAIL,
|
||||
@ -4355,7 +4379,7 @@ func ReqPlayroomDressSet(player *Player, buf []byte) error {
|
||||
}
|
||||
player.QuestTrigger(&quest.Trigger{Label: quest.TRIGGER_LABEL_PETDRESS, A: []interface{}{Parts}})
|
||||
player.PlayMod.save()
|
||||
player.PetDecoSetLog(Diff)
|
||||
//player.PetDecoSetLog(Diff)
|
||||
PlayroomBackData(player)
|
||||
player.PushClientRes(&msg.ResPlayroomDressSet{
|
||||
Code: msg.RES_CODE_SUCCESS,
|
||||
|
||||
@ -301,7 +301,7 @@ func UnitDecoratePartCost(p *Player) error {
|
||||
DecorateMod.PartClassPool = []int{}
|
||||
DecorateMod.PartPool = make(map[int]int)
|
||||
DecorateMod.InitData()
|
||||
Items, _ := DecorateMod.GetDecorateCostItem(1, 33)
|
||||
Items, _, _ := DecorateMod.GetDecorateCostItem(1, 33)
|
||||
err := p.HandleLoseItem(Items, "")
|
||||
if err != nil {
|
||||
fmt.Print(err)
|
||||
|
||||
@ -75,7 +75,7 @@ func (d *Decorate) GetDecorateAddEnergy(cnt int) []*item.Item {
|
||||
}
|
||||
|
||||
// 获取装饰消耗
|
||||
func (d *Decorate) GetDecorateCostItem(AreaId, DecorateId int) ([]*item.Item, int) {
|
||||
func (d *Decorate) GetDecorateCostItem(AreaId, DecorateId int) ([]*item.Item, int, []*item.Item) {
|
||||
Item := decorateCfg.GetStarCost(AreaId, DecorateId)
|
||||
PetExp := decorateCfg.GetDecoratePExp(AreaId, DecorateId)
|
||||
Id := decorateCfg.GetIdBySenceAndLv(AreaId, DecorateId)
|
||||
@ -88,7 +88,7 @@ func (d *Decorate) GetDecorateCostItem(AreaId, DecorateId int) ([]*item.Item, in
|
||||
if len(d.PartCost) == 0 {
|
||||
d.initPartCost(d.AreaId + 1)
|
||||
}
|
||||
return Items, PetExp
|
||||
return Items, PetExp, PartItem.Items
|
||||
}
|
||||
|
||||
func (d *Decorate) DecorateAll(Star int) ([]*item.Item, []*item.Item, int, []int, []interface{}, int) {
|
||||
|
||||
@ -10,13 +10,14 @@ import (
|
||||
)
|
||||
|
||||
type FriendTreasureMod struct {
|
||||
Star int // 星级
|
||||
Shift int // 挡位
|
||||
Pos []int
|
||||
List map[int]*msg.TreasureInfo
|
||||
List2 []int32 // 选择的好友
|
||||
Uids []int64
|
||||
Status int
|
||||
Star int // 星级
|
||||
Shift int // 挡位
|
||||
Pos []int
|
||||
List map[int]*msg.TreasureInfo
|
||||
List2 []int32 // 选择的好友
|
||||
Uids []int64
|
||||
Status int
|
||||
BoxItems []*item.Item
|
||||
}
|
||||
|
||||
const (
|
||||
@ -70,7 +71,11 @@ func (f *FriendTreasureMod) Flip(Pos int) ([]*item.Item, int64, error) {
|
||||
ProbMap := friendTreasureCfg.GetChestProb()
|
||||
Prob := GoUtil.RandMap(ProbMap)
|
||||
Info.Status = GAME_STATUS_START
|
||||
return friendTreasureCfg.GetChestItems(Prob), Info.Uid, nil
|
||||
Items := friendTreasureCfg.GetChestItems(Prob)
|
||||
if Items == nil {
|
||||
f.BoxItems = append(f.BoxItems, Items...)
|
||||
}
|
||||
return Items, Info.Uid, nil
|
||||
}
|
||||
Info.Status = GAME_STATUS_START
|
||||
return nil, 0, nil
|
||||
@ -91,10 +96,15 @@ func (f *FriendTreasureMod) EndGame() ([]*item.Item, int, error) {
|
||||
BigReward := friendTreasureCfg.GetBigReward()
|
||||
Reward = append(Reward, BigReward...)
|
||||
}
|
||||
|
||||
return Reward, FriendItemNum, nil
|
||||
}
|
||||
|
||||
func (f *FriendTreasureMod) ResetGame() {
|
||||
f.Star = 0
|
||||
f.Shift = 0
|
||||
f.Status = GAME_STATUS_END
|
||||
return Reward, FriendItemNum, nil
|
||||
f.BoxItems = []*item.Item{}
|
||||
}
|
||||
|
||||
func (f *FriendTreasureMod) NotifyStar() *msg.ResFriendTreasureStar {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user