好友助战奖励

This commit is contained in:
meixiongfeng 2023-12-19 11:21:41 +08:00
parent 4c80b25242
commit 6cbf13d8fc
3 changed files with 7 additions and 10 deletions

View File

@ -231,7 +231,7 @@
"friend_peize": [ "friend_peize": [
{ {
"a": "attr", "a": "attr",
"t": "friend", "t": "friendPoint",
"n": 100 "n": 100
} }
], ],

View File

@ -63,11 +63,8 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth
"assistHeroId": req.HeroObjId, "assistHeroId": req.HeroObjId,
"hero": hero, "hero": hero,
} }
self.Received = 1
received := self.Received update["received"] = self.Received //设置可领取状态
if received == 0 {
update["received"] = 1 //设置可领取状态
}
if err := this.module.modelFriend.Change(self.Uid, update); err != nil { if err := this.module.modelFriend.Change(self.Uid, update); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
@ -82,7 +79,7 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth
return return
} }
rsp := &pb.FriendAssistheroResp{HeroObjId: req.HeroObjId, Received: received} rsp := &pb.FriendAssistheroResp{HeroObjId: req.HeroObjId, Received: self.Received}
if err := session.SendMsg(string(this.module.GetType()), FriendSubTypeAssistHero, rsp); err != nil { if err := session.SendMsg(string(this.module.GetType()), FriendSubTypeAssistHero, rsp); err != nil {
return return
} }

View File

@ -34,9 +34,9 @@ func (this *apiComp) Getreward(session comm.IUserSession, req *pb.FriendGetrewar
return return
} }
received := 2 //已领 self.Received = 2 //已领
update := map[string]interface{}{ update := map[string]interface{}{
"received": received, "received": self.Received,
} }
if err := this.module.modelFriend.Change(self.Uid, update); err != nil { if err := this.module.modelFriend.Change(self.Uid, update); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
@ -60,7 +60,7 @@ func (this *apiComp) Getreward(session comm.IUserSession, req *pb.FriendGetrewar
} }
session.SendMsg(string(this.module.GetType()), "getreward", &pb.FriendGetrewardResp{ session.SendMsg(string(this.module.GetType()), "getreward", &pb.FriendGetrewardResp{
Received: int32(received), Received: int32(self.Received),
Atno: atno, Atno: atno,
}) })