Files
bl/logic/service/player/cmd.go

40 lines
873 B
Go
Raw Normal View History

package player
import (
"blazing/logic/service/common"
2026-02-14 04:27:57 +08:00
"blazing/logic/service/pet"
"blazing/modules/config/service"
)
2025-11-18 20:52:04 +00:00
func (p *Player) SendPackCmd(cmd uint32, b any) {
p.SendPack(common.NewTomeeHeader(cmd, p.Info.UserID).Pack(b))
}
2026-02-14 04:27:57 +08:00
func (p *Player) MessWin(win bool) {
var getcony uint32
_, ok := p.Service.Talk.Cheak(p.Info.MapID, 5000)
if ok {
//更新次数
config := service.NewTalkConfigService().GetCache(5000)
//service.NewItemService().GetItemCount(config.ItemID)
for _, itemID := range config.ItemIDS {
iteminfo := service.NewItemService().GetItem(itemID)
if win {
getcony = uint32(iteminfo.ItemMaxCount)
} else {
getcony = uint32(iteminfo.ItemMinCount)
}
p.ItemAdd(iteminfo.ItemID, int64(getcony))
}
p.Service.Talk.Update(5000, 1)
2026-02-14 12:49:03 +08:00
p.SendPackCmd(50006, &pet.S2C_50006{
ItemID: 3,
Count: getcony,
})
2026-02-14 04:27:57 +08:00
}
2026-02-14 12:49:03 +08:00
2026-02-14 04:27:57 +08:00
}