✨ feat(拍卖行): 拍卖行最后10s延长15s
This commit is contained in:
21
game-server/app/services/memoryCache/auctionData.ts
Normal file
21
game-server/app/services/memoryCache/auctionData.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
let auctionTimer = new Map<string, NodeJS.Timer>();
|
||||
|
||||
export function getLotTimer(code: string) {
|
||||
return auctionTimer.get(code)
|
||||
}
|
||||
|
||||
export function setLotTimer(code: string, timer: NodeJS.Timer) {
|
||||
if(auctionTimer.has(code)) {
|
||||
let originTimer = auctionTimer.get(code);
|
||||
if(originTimer) clearTimeout(originTimer);
|
||||
}
|
||||
auctionTimer.set(code, timer);
|
||||
}
|
||||
|
||||
export function clearLotTimer(code: string) {
|
||||
let timer = getLotTimer(code);
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
auctionTimer.delete(code)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user