fix jumping far past
This commit is contained in:
parent
9e56d00573
commit
f553e1418d
6 changed files with 108 additions and 151 deletions
|
@ -53,6 +53,22 @@ class SnowFlake<x extends WeakKey>{
|
|||
return snowflake;
|
||||
}
|
||||
}
|
||||
static hasSnowFlakeFromID(id:string,type:any){
|
||||
if(!SnowFlake.SnowFlakes.get(type)){
|
||||
return false;
|
||||
}
|
||||
const flake=SnowFlake.SnowFlakes.get(type).get(id);
|
||||
if(flake){
|
||||
const flake2=flake.deref()?.getObject();
|
||||
if(flake2){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
getUnixTime():number{
|
||||
return Number((BigInt(this.id)>>22n)+1420070400000n);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue