猫草大作战

This commit is contained in:
hahwu 2025-12-17 10:20:56 +08:00
parent 1520798201
commit b1347f48cb
3 changed files with 21 additions and 14 deletions

View File

@ -470,10 +470,15 @@ func (p *Player) handle(m *msg.Msg) error {
if CatnipMsg.FriendItems > 0 {
Items := catnipCfg.GetItemCost(ActivityId, CatnipMsg.FriendItems)
FriendMod := p.PlayMod.getFriendMod()
FriendMod.AddReplyInfo(m.From, friend.REPLY_TYPE_CATNIP_ITEMS, "", m.End, Items)
ReplyInfo := FriendMod.AddReplyInfo(m.From, friend.REPLY_TYPE_CATNIP_ITEMS, "", m.End, Items)
PlayerSimpleData := G_GameLogicPtr.GetResSimplePlayerByUid(m.From)
p.PushClientRes(&proto.ResFriendReplyNotify{
Info: &proto.ResFriendLog{
Player: PlayerSimpleData,
Param: ReplyInfo.Param,
Type: int32(ReplyInfo.Type),
Id: int32(ReplyInfo.Id),
},
Type: int32(friend.REPLY_TYPE_CATNIP_ITEMS),
Time: int32(m.SendT),
})

View File

@ -507,9 +507,9 @@ func (f *FriendMod) GetActLogLast() *ActLogInfo {
return f.ActivityLog[len(f.ActivityLog)-1]
}
func (f *FriendMod) AddReplyInfo(Uid int, Type int, Param string, EndTime int64, Items []*item.Item) {
func (f *FriendMod) AddReplyInfo(Uid int, Type int, Param string, EndTime int64, Items []*item.Item) *ReplyInfo {
f.AutoId++
f.ReplyList = append(f.ReplyList, &ReplyInfo{
ReplyInfo := &ReplyInfo{
Id: f.AutoId,
Uid: Uid,
Type: Type,
@ -518,7 +518,9 @@ func (f *FriendMod) AddReplyInfo(Uid int, Type int, Param string, EndTime int64,
AddTime: GoUtil.Now(),
EndTime: EndTime,
Items: Items,
})
}
f.ReplyList = append(f.ReplyList, ReplyInfo)
return ReplyInfo
}
func (f *FriendMod) ReplyFriend(LogId int) *ReplyInfo {

View File

@ -15753,7 +15753,7 @@ func (x *ResFriendApplyNotify) GetTime() int32 {
type ResFriendReplyNotify struct {
state protoimpl.MessageState `protogen:"open.v1"`
Player *ResPlayerSimple `protobuf:"bytes,1,opt,name=Player,proto3" json:"Player,omitempty"`
Info *ResFriendLog `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"`
Type int32 `protobuf:"varint,2,opt,name=Type,proto3" json:"Type,omitempty"` // 1:打招呼 2被打招呼;
Time int32 `protobuf:"varint,3,opt,name=Time,proto3" json:"Time,omitempty"`
unknownFields protoimpl.UnknownFields
@ -15790,9 +15790,9 @@ func (*ResFriendReplyNotify) Descriptor() ([]byte, []int) {
return file_proto_Gameapi_proto_rawDescGZIP(), []int{259}
}
func (x *ResFriendReplyNotify) GetPlayer() *ResPlayerSimple {
func (x *ResFriendReplyNotify) GetInfo() *ResFriendLog {
if x != nil {
return x.Player
return x.Info
}
return nil
}
@ -28736,9 +28736,9 @@ const file_proto_Gameapi_proto_rawDesc = "" +
"\x14ResFriendApplyNotify\x121\n" +
"\x06Player\x18\x01 \x01(\v2\x19.tutorial.ResPlayerSimpleR\x06Player\x12\x12\n" +
"\x04Type\x18\x02 \x01(\x05R\x04Type\x12\x12\n" +
"\x04Time\x18\x03 \x01(\x05R\x04Time\"q\n" +
"\x14ResFriendReplyNotify\x121\n" +
"\x06Player\x18\x01 \x01(\v2\x19.tutorial.ResPlayerSimpleR\x06Player\x12\x12\n" +
"\x04Time\x18\x03 \x01(\x05R\x04Time\"j\n" +
"\x14ResFriendReplyNotify\x12*\n" +
"\x04info\x18\x01 \x01(\v2\x16.tutorial.ResFriendLogR\x04info\x12\x12\n" +
"\x04Type\x18\x02 \x01(\x05R\x04Type\x12\x12\n" +
"\x04Time\x18\x03 \x01(\x05R\x04Time\"6\n" +
"\x0eReqApplyFriend\x12\x10\n" +
@ -30590,7 +30590,7 @@ var file_proto_Gameapi_proto_depIdxs = []int32{
2, // 153: tutorial.ResFriendTLUpvote.Code:type_name -> tutorial.RES_CODE
2, // 154: tutorial.ResFriendTReward.Code:type_name -> tutorial.RES_CODE
233, // 155: tutorial.ResFriendApplyNotify.Player:type_name -> tutorial.ResPlayerSimple
233, // 156: tutorial.ResFriendReplyNotify.Player:type_name -> tutorial.ResPlayerSimple
236, // 156: tutorial.ResFriendReplyNotify.info:type_name -> tutorial.ResFriendLog
2, // 157: tutorial.ResApplyFriend.Code:type_name -> tutorial.RES_CODE
2, // 158: tutorial.ResAgreeFriend.Code:type_name -> tutorial.RES_CODE
233, // 159: tutorial.ResAgreeFriend.Player:type_name -> tutorial.ResPlayerSimple