mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
Compute time in milliseconds once and use it for both firstPlayed and lastPlayed
fixes issues where lastPlayed can be a tiny fraction of time into the future of firstPlayed when players join for the first time
This commit is contained in:
parent
1dea25d123
commit
1d651046c9
@ -757,9 +757,11 @@ class Server{
|
||||
}
|
||||
}
|
||||
$spawn = $this->getDefaultLevel()->getSafeSpawn();
|
||||
$currentTimeMillis = (int) (microtime(true) * 1000);
|
||||
|
||||
$nbt = new CompoundTag("", [
|
||||
new LongTag("firstPlayed", (int) (microtime(true) * 1000)),
|
||||
new LongTag("lastPlayed", (int) (microtime(true) * 1000)),
|
||||
new LongTag("firstPlayed", $currentTimeMillis),
|
||||
new LongTag("lastPlayed", $currentTimeMillis),
|
||||
new ListTag("Pos", [
|
||||
new DoubleTag("", $spawn->x),
|
||||
new DoubleTag("", $spawn->y),
|
||||
|
Loading…
x
Reference in New Issue
Block a user