lt 1 rok temu
rodzic
commit
eb08d3fcbc

+ 1 - 1
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role.go

@@ -1233,7 +1233,7 @@ func (this *Role) DailyReset(notify bool) {
 
 	this.roleDaoChang100.DailyReset(notify)
 
-	this.roleCross.DailyReset(notify)
+	this.roleCross.DailyReset(notify, oldDailyResetTimeStamp)
 
 	this.roleHead.DailyReset(notify)
 

+ 11 - 2
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_cross.go

@@ -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)