军团活动:修复活动结束之后还继续挑战的bug
This commit is contained in:
@@ -12,6 +12,7 @@ export class CityActivityObject {
|
||||
private guilds: Map<string, number> = new Map(); // 军团所在的城池 guildCode => cityId
|
||||
private historyCity: Map<string, number> = new Map(); // 获取自己打开过的城池的页面 roleId => cityId
|
||||
private sentCity: string[] = [];
|
||||
private startTime: number = 0;
|
||||
|
||||
private getKey(serverId: number, cityId: number) {
|
||||
return `${serverId}_${cityId}`;
|
||||
@@ -36,6 +37,14 @@ export class CityActivityObject {
|
||||
}
|
||||
}
|
||||
|
||||
public startActivity() {
|
||||
this.startTime = Date.now();
|
||||
}
|
||||
|
||||
public getTimeGap() {
|
||||
return Date.now() - this.startTime;
|
||||
}
|
||||
|
||||
public hasSent(serverId: number, cityId: number) {
|
||||
let key = this.getKey(serverId, cityId);
|
||||
return this.sentCity.indexOf(key) != -1;
|
||||
|
||||
Reference in New Issue
Block a user