|
|
@@ -279,7 +279,7 @@ func (this *RoleCross) Save() {
|
|
|
this.role.SendDb(saveMsg)
|
|
|
}
|
|
|
|
|
|
-func (this *RoleCross) DailyReset(notify bool) {
|
|
|
+func (this *RoleCross) DailyReset(notify bool, last uint64) {
|
|
|
this.getTrial().TrialNum = 0
|
|
|
this.getTrial().ChallengeNum = 0
|
|
|
this.getTrial().BuyNum = 0
|
|
|
@@ -287,8 +287,17 @@ func (this *RoleCross) DailyReset(notify bool) {
|
|
|
this.getTopTower().ValidEndTime = 0
|
|
|
this.getTopTower().FightList = this.getTopTower().FightList[:0]
|
|
|
//周一刷新分数
|
|
|
- if time.Now().Weekday() == time.Monday {
|
|
|
+ day := time.Now().Weekday()
|
|
|
+ diff := util.GetDurationDay1(last, util.GetTimeMilliseconds())
|
|
|
+ if day == time.Monday {
|
|
|
this.getTrial().TrialScore = 0
|
|
|
+ } else if diff > 1 {
|
|
|
+ if day == 0 {
|
|
|
+ day = 7
|
|
|
+ }
|
|
|
+ if diff >= int32(day) {
|
|
|
+ this.getTrial().TrialScore = 0
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
this.SetDirty(true)
|