【猫草大作战】-修改回复协议
This commit is contained in:
parent
03eca57bb5
commit
865cc45c59
@ -417,6 +417,12 @@ func (p *Player) handle(m *msg.Msg) error {
|
||||
CatnipMod.BeInvited(int(m.From), m.SendT)
|
||||
FriendMod := p.PlayMod.getFriendMod()
|
||||
FriendMod.AddReplyInfo(m.From, friend.REPLY_TYPE_CATNIP, fmt.Sprintf("%d", CatnipMsg.GameId), m.End, nil)
|
||||
PlayerSimpleData := G_GameLogicPtr.GetResSimplePlayerByUid(m.From)
|
||||
p.PushClientRes(&proto.ResFriendReplyNotify{
|
||||
Player: PlayerSimpleData,
|
||||
Type: int32(friend.REPLY_TYPE_CATNIP),
|
||||
Time: int32(m.SendT),
|
||||
})
|
||||
case msg.HANDLE_TYPE_CATNIP_AGREE: // 同意好友参与猫咪游戏
|
||||
CatnipMod := p.PlayMod.getCatnipMod()
|
||||
CatnipMsg, ok := m.Extra.(CatnipMsg)
|
||||
@ -465,6 +471,12 @@ func (p *Player) handle(m *msg.Msg) error {
|
||||
Items := catnipCfg.GetItemCost(ActivityId, CatnipMsg.FriendItems)
|
||||
FriendMod := p.PlayMod.getFriendMod()
|
||||
FriendMod.AddReplyInfo(m.From, friend.REPLY_TYPE_CATNIP_ITEMS, "", m.End, Items)
|
||||
PlayerSimpleData := G_GameLogicPtr.GetResSimplePlayerByUid(m.From)
|
||||
p.PushClientRes(&proto.ResFriendReplyNotify{
|
||||
Player: PlayerSimpleData,
|
||||
Type: int32(friend.REPLY_TYPE_CATNIP_ITEMS),
|
||||
Time: int32(m.SendT),
|
||||
})
|
||||
}
|
||||
p.CatnipBackData()
|
||||
case msg.HANDLE_TYPE_CATNIP_SEND_EMOJI:
|
||||
|
||||
@ -5740,6 +5740,7 @@ func ReqFriendReplyHandle(player *Player, buf []byte) error {
|
||||
})
|
||||
return fmt.Errorf("reply info not exist")
|
||||
}
|
||||
ErrType := msg.FRIEND_REPLY_HANDLE_ERR_TYPE_NONE
|
||||
if req.Type == 1 && ReplyInfo.Uid > 10000 {
|
||||
switch ReplyInfo.Type {
|
||||
case friend.REPLY_TYPE_GREETING:
|
||||
@ -5759,12 +5760,7 @@ func ReqFriendReplyHandle(player *Player, buf []byte) error {
|
||||
GameId := GoUtil.Int(ReplyInfo.Param)
|
||||
activityInfo := player.GetActivityInfo(player.GetActivityId(activity.ACT_TYPE_CATNIP))
|
||||
err := G_GameLogicPtr.SetCatnipPartner(int(player.M_DwUin), GameId, ReplyInfo.Uid, activityInfo.EndT)
|
||||
if err != nil {
|
||||
player.PushClientRes(&msg.ResFriendReplyHandle{
|
||||
Code: msg.RES_CODE_FAIL,
|
||||
Msg: err.Error(),
|
||||
})
|
||||
} else {
|
||||
if err == nil {
|
||||
CatnipMod := player.PlayMod.getCatnipMod()
|
||||
ActivityId := player.GetActivityId(activity.ACT_TYPE_MINING)
|
||||
UserList, _ := CatnipMod.Agree(GameId, ReplyInfo.Uid)
|
||||
@ -5795,6 +5791,8 @@ func ReqFriendReplyHandle(player *Player, buf []byte) error {
|
||||
})
|
||||
}
|
||||
player.CatnipBackData()
|
||||
} else {
|
||||
ErrType = msg.FRIEND_REPLY_HANDLE_ERR_TYPE_CATNIP
|
||||
}
|
||||
|
||||
}
|
||||
@ -5810,9 +5808,10 @@ func ReqFriendReplyHandle(player *Player, buf []byte) error {
|
||||
}
|
||||
player.FriendLogBackData()
|
||||
player.PushClientRes(&msg.ResFriendReplyHandle{
|
||||
Code: msg.RES_CODE_SUCCESS,
|
||||
LogId: req.LogId,
|
||||
Type: req.Type,
|
||||
Code: msg.RES_CODE_SUCCESS,
|
||||
LogId: req.LogId,
|
||||
Type: req.Type,
|
||||
ErrType: ErrType,
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user