好友优化

This commit is contained in:
hahwu 2025-11-07 16:42:00 +08:00
parent 6fc48de7ae
commit 17689cab25
2 changed files with 20 additions and 3 deletions

View File

@ -4651,6 +4651,8 @@ func ReqAddNpc(player *Player, buf []byte) error {
player.TeLog("add_npc", map[string]interface{}{
"NpcId": int(req.NpcId),
})
FriendMod.AddReplyInfo(int(req.NpcId), friend.REPLY_TYPE_GREETING, "")
FriendMod.AddReplyInfo(int(req.NpcId), friend.REPLY_TYPE_GREETING_Get, "")
player.AddLog(int(req.NpcId), friend.LOG_TYPE_FRIEND_BECOME_NPC, GoUtil.String(req.NpcId), GoUtil.Now())
player.PushClientRes(&msg.ResAddNpc{
Code: msg.RES_CODE_SUCCESS,
@ -5249,7 +5251,7 @@ func ReqFriendReplyHandle(player *Player, buf []byte) error {
})
return fmt.Errorf("reply info not exist")
}
if req.Type == 1 {
if req.Type == 1 && ReplyInfo.Uid > 10000 {
switch ReplyInfo.Type {
case friend.REPLY_TYPE_GREETING:
ReplyData := friend.ReplyInfo{
@ -5266,6 +5268,17 @@ func ReqFriendReplyHandle(player *Player, buf []byte) error {
})
}
}
Items := []*item.Item{
item.NewItem(item.ITEM_ENERGY_ID, 5),
}
err := player.HandleItem(Items, msg.ITEM_POP_LABEL_FriendReplyHandle.String())
if err != nil {
player.SendErrClienRes(&msg.ResFriendReplyHandle{
Code: msg.RES_CODE_FAIL,
Msg: err.Error(),
})
return err
}
FriendLogBackData(player)
player.PushClientRes(&msg.ResFriendReplyHandle{
Code: msg.RES_CODE_SUCCESS,

View File

@ -100,6 +100,7 @@ const (
ITEM_POP_LABEL_GuideActiveReward ITEM_POP_LABEL = 73 // 新手任务活跃度奖励
ITEM_POP_LABEL_PassCharge ITEM_POP_LABEL = 74 // 通行证充值
ITEM_POP_LABEL_ActPassReward ITEM_POP_LABEL = 75 // 通行证奖励
ITEM_POP_LABEL_FriendReplyHandle ITEM_POP_LABEL = 76 // 好友请求处理
)
// Enum value maps for ITEM_POP_LABEL.
@ -181,6 +182,7 @@ var (
73: "GuideActiveReward",
74: "PassCharge",
75: "ActPassReward",
76: "FriendReplyHandle",
}
ITEM_POP_LABEL_value = map[string]int32{
"Playroom": 0,
@ -259,6 +261,7 @@ var (
"GuideActiveReward": 73,
"PassCharge": 74,
"ActPassReward": 75,
"FriendReplyHandle": 76,
}
)
@ -28959,7 +28962,7 @@ const file_proto_Gameapi_proto_rawDesc = "" +
"\x10ReqAdminShipping\x12\x18\n" +
"\aOrderSn\x18\x01 \x01(\tR\aOrderSn\x12\x16\n" +
"\x06Status\x18\x02 \x01(\x05R\x06Status\x12&\n" +
"\x0eChannelOrderSn\x18\x03 \x01(\tR\x0eChannelOrderSn*\xa5\v\n" +
"\x0eChannelOrderSn\x18\x03 \x01(\tR\x0eChannelOrderSn*\xbc\v\n" +
"\x0eITEM_POP_LABEL\x12\f\n" +
"\bPlayroom\x10\x00\x12\r\n" +
"\tPiggyBank\x10\x01\x12\n" +
@ -29045,7 +29048,8 @@ const file_proto_Gameapi_proto_rawDesc = "" +
"\x11GuideActiveReward\x10I\x12\x0e\n" +
"\n" +
"PassCharge\x10J\x12\x11\n" +
"\rActPassReward\x10K*B\n" +
"\rActPassReward\x10K\x12\x15\n" +
"\x11FriendReplyHandle\x10L*B\n" +
"\vHANDLE_TYPE\x12\a\n" +
"\x03ADD\x10\x00\x12\v\n" +
"\aCOMPOSE\x10\x01\x12\a\n" +