增加playroom引导奖励

This commit is contained in:
hahwu 2025-05-12 17:27:37 +08:00
parent c5d7f55543
commit 0fab14a138
4 changed files with 1476 additions and 1332 deletions

View File

@ -684,7 +684,9 @@ func (ad *GameLogic) RegisterNetWorkFunc() {
RegisterMsgProcessFunc("ReqDailyUnlock", ReqDailyUnlock) // 日常任务解锁
// 引导奖励
RegisterMsgProcessFunc("ReqGuideReward", ReqGuideReward) // 领取引导奖励
RegisterMsgProcessFunc("ReqGuideReward", ReqGuideReward) // 领取引导奖励
RegisterMsgProcessFunc("ReqGuidePlayroom", ReqGuidePlayroom) // 领取playroom引导奖励
// 头像
RegisterMsgProcessFunc("ReqSetFace", ReqSetFace) // 设置头像
// 头像框

View File

@ -4310,3 +4310,32 @@ func ReqWishApply(player *Player, buf []byte) error {
})
return nil
}
func ReqGuidePlayroom(player *Player, buf []byte) error {
req := &msg.ReqGuidePlayroom{}
proto.Unmarshal(buf, req)
GuideMod := player.PlayMod.getGuideMod()
B := GuideMod.GetPlayroomGuide()
if B {
player.SendErrClienRes(&msg.ResGuidePlayroom{
Code: msg.RES_CODE_FAIL,
Msg: "已领取",
})
return fmt.Errorf("已领取")
}
Items := []*item.Item{item.NewItem(int(req.Id), 1)}
err := player.HandleItem(Items, msg.ITEM_POP_LABEL_PlayroomGame.String())
if err != nil {
player.SendErrClienRes(&msg.ResWishApply{
Code: msg.RES_CODE_FAIL,
Msg: err.Error(),
})
return err
}
GuideMod.SetPlayroomGuide(true)
player.PlayMod.save()
player.PushClientRes(&msg.ResGuidePlayroom{
Code: msg.RES_CODE_SUCCESS,
})
return nil
}

View File

@ -9,9 +9,10 @@ import (
)
type Guide struct {
Guide int
GuideOrder bool
Reward map[int]int
Guide int
GuideOrder bool
Reward map[int]int
PlayroomGuide bool // playroom引导奖励
}
func (g *Guide) InitData() {
@ -55,3 +56,11 @@ func (g *Guide) GetGuideOrder() bool {
func (g *Guide) SetGuideOrder(guideOrder bool) {
g.GuideOrder = guideOrder
}
func (g *Guide) GetPlayroomGuide() bool {
return g.PlayroomGuide
}
func (g *Guide) SetPlayroomGuide(playroomGuide bool) {
g.PlayroomGuide = playroomGuide
}

File diff suppressed because it is too large Load Diff