陌生人助战还有刷新次数限制

This commit is contained in:
meixiongfeng 2023-12-27 13:39:17 +08:00
parent e6b5e105b8
commit 1f6f29011a
5 changed files with 53 additions and 28 deletions

View File

@ -285,7 +285,12 @@
{
"a": "attr",
"t": "diamond",
"n": 60
"n": 40
},
{
"a": "attr",
"t": "diamond",
"n": 80
},
{
"a": "attr",
@ -300,27 +305,22 @@
{
"a": "attr",
"t": "diamond",
"n": 120
"n": 100
},
{
"a": "attr",
"t": "diamond",
"n": 140
"n": 100
},
{
"a": "attr",
"t": "diamond",
"n": 160
"n": 100
},
{
"a": "attr",
"t": "diamond",
"n": 180
},
{
"a": "attr",
"t": "diamond",
"n": 200
"n": 100
}
],
"ps_limit": 8,
@ -771,6 +771,12 @@
"NewDrawcardAttempts_Nums": 30,
"stonehenge_guideStage": 88,
"story_waittime": 0.8,
"sx_ranknum": 200
"sx_ranknum": 200,
"IntegralBoss_challenge_num": 3,
"friend_help_hero_refresh_num": 5,
"td_mainstage_challenge_num": 2,
"td_mainstage_challenge_num_max": 10,
"td_dailystage_challenge_num": 2,
"td_dailystage_challenge_num_max": 2
}
]

View File

@ -15,9 +15,10 @@ func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.FriendListReq)
func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (errdata *pb.ErrorData) {
var (
self *pb.DBFriend
list []*pb.FriendBase
err error
self *pb.DBFriend
list []*pb.FriendBase
err error
update map[string]interface{}
)
self, err = this.module.modelFriend.GetFriend(session.GetUserId())
@ -59,27 +60,35 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (err
list = append(list, base)
}
update = make(map[string]interface{}, 0)
if configure.Now().Unix() >= self.CleanTime || self.CleanTime == 0 {
self.CleanTime = configure.Now().Unix() + 3*24*3600
self.Weapplyids = []string{}
if err = this.module.modelFriend.Change(session.GetUserId(), map[string]interface{}{
"weapplyids": self.Weapplyids,
"cleanTime": self.CleanTime,
}); err != nil {
update["weapplyids"] = self.Weapplyids
update["cleanTime"] = self.CleanTime
}
if !utils.IsToday(self.UpdateTime) {
self.UpdateTime = configure.Now().Unix()
update["updateTime"] = self.UpdateTime
self.RefreshNum = 0
update["refreshNum"] = self.RefreshNum
}
if len(update) > 0 {
if err = this.module.modelFriend.Change(session.GetUserId(), update); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendApplyError,
Title: pb.ErrorCode_FriendApplyError.ToString(),
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
}
resp := &pb.FriendListResp{
session.SendMsg(string(this.module.GetType()), FriendSubTypeList, &pb.FriendListResp{
List: list,
Friend: self,
}
session.SendMsg(string(this.module.GetType()), FriendSubTypeList, resp)
})
return
}

View File

@ -31,7 +31,7 @@ func (this *apiComp) RefreshAssistHero(session comm.IUserSession, req *pb.Friend
}
return
}
if self.RefreshNum >= 5 {
if self.RefreshNum >= this.module.ModuleTools.GetGlobalConf().FriendHelpHeroRefreshNum {
return
}
self.RefreshNum++
@ -47,7 +47,6 @@ func (this *apiComp) RefreshAssistHero(session comm.IUserSession, req *pb.Friend
localNum, _ := this.module.modelFriend.DB.CountDocuments(core.SqlTable(this.module.modelFriend.TableName), bson.M{})
randomIndex := comm.GetRandNum(0, int32(localNum))
randomIndex = 0
cur, err := this.module.modelFriend.DB.Find(core.SqlTable(this.module.modelFriend.TableName), bson.M{"assistHeroId": bson.M{"$ne": ""}}, options.Find().SetSkip(int64(randomIndex)).SetLimit(12)) //.skip(1).limit(1)
for cur.Next(context.TODO()) {
tmp := &pb.DBFriend{}

View File

@ -179,7 +179,6 @@ func (this *Friend) UseAssistHero(uid, friendId string) (*pb.DBHero, error) {
update := map[string]interface{}{
"assistScore": friend.AssistScore,
"record": friend.Record,
"updateTime": configure.Now().Unix(),
}
return friend.Hero, this.modelFriend.Change(friendId, update)
}

View File

@ -269,6 +269,12 @@ type GameGlobalData struct {
StonehengeGuideStage int32
StoryWaittime float32
SxRanknum int32
IntegralBossChallengeNum int32
FriendHelpHeroRefreshNum int32
TdMainstageChallengeNum int32
TdMainstageChallengeNumMax int32
TdDailystageChallengeNum int32
TdDailystageChallengeNumMax int32
}
const TypeId_GameGlobalData = 477542761
@ -1069,6 +1075,12 @@ func (_v *GameGlobalData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["stonehenge_guideStage"].(float64); !_ok_ { err = errors.New("stonehenge_guideStage error"); return }; _v.StonehengeGuideStage = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["story_waittime"].(float64); !_ok_ { err = errors.New("story_waittime error"); return }; _v.StoryWaittime = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["sx_ranknum"].(float64); !_ok_ { err = errors.New("sx_ranknum error"); return }; _v.SxRanknum = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["IntegralBoss_challenge_num"].(float64); !_ok_ { err = errors.New("IntegralBoss_challenge_num error"); return }; _v.IntegralBossChallengeNum = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["friend_help_hero_refresh_num"].(float64); !_ok_ { err = errors.New("friend_help_hero_refresh_num error"); return }; _v.FriendHelpHeroRefreshNum = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["td_mainstage_challenge_num"].(float64); !_ok_ { err = errors.New("td_mainstage_challenge_num error"); return }; _v.TdMainstageChallengeNum = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["td_mainstage_challenge_num_max"].(float64); !_ok_ { err = errors.New("td_mainstage_challenge_num_max error"); return }; _v.TdMainstageChallengeNumMax = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["td_dailystage_challenge_num"].(float64); !_ok_ { err = errors.New("td_dailystage_challenge_num error"); return }; _v.TdDailystageChallengeNum = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["td_dailystage_challenge_num_max"].(float64); !_ok_ { err = errors.New("td_dailystage_challenge_num_max error"); return }; _v.TdDailystageChallengeNumMax = int32(_tempNum_) }
return
}