🐞 fix(防加速): 客户端间隔时间小于服务器时不判断
This commit is contained in:
@@ -473,7 +473,7 @@ export class ComBattleHandler {
|
|||||||
if(!roleSt.startActionTime || roleSt.startActionTime == 0) { // 第一次调用设置初始
|
if(!roleSt.startActionTime || roleSt.startActionTime == 0) { // 第一次调用设置初始
|
||||||
roleSt.startActionTime = nowSeconds();
|
roleSt.startActionTime = nowSeconds();
|
||||||
}
|
}
|
||||||
if(Math.abs(nowSeconds() - roleSt.startActionTime - timegap) > 5) { // 前后端误差超过5秒拦截
|
if(timegap - (nowSeconds() - roleSt.startActionTime) > 5) { // 前后端误差超过5秒拦截
|
||||||
return resResult(STATUS.SUCCESS, {
|
return resResult(STATUS.SUCCESS, {
|
||||||
isError: true,
|
isError: true,
|
||||||
timegap: nowSeconds() - roleSt.startActionTime
|
timegap: nowSeconds() - roleSt.startActionTime
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ export class CityActivityHandler {
|
|||||||
if(!member.startActionTime || member.startActionTime == 0) {
|
if(!member.startActionTime || member.startActionTime == 0) {
|
||||||
member.startActionTime = nowSeconds();
|
member.startActionTime = nowSeconds();
|
||||||
}
|
}
|
||||||
if(Math.abs(nowSeconds() - member.startActionTime - timegap) > 5) { // 前后端误差超过5秒拦截
|
if(timegap - (nowSeconds() - member.startActionTime) > 5) { // 前后端误差超过5秒拦截
|
||||||
return resResult(STATUS.SUCCESS, {
|
return resResult(STATUS.SUCCESS, {
|
||||||
isError: true,
|
isError: true,
|
||||||
timegap: nowSeconds() - member.startActionTime
|
timegap: nowSeconds() - member.startActionTime
|
||||||
|
|||||||
Reference in New Issue
Block a user