mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +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();
|
$spawn = $this->getDefaultLevel()->getSafeSpawn();
|
||||||
|
$currentTimeMillis = (int) (microtime(true) * 1000);
|
||||||
|
|
||||||
$nbt = new CompoundTag("", [
|
$nbt = new CompoundTag("", [
|
||||||
new LongTag("firstPlayed", (int) (microtime(true) * 1000)),
|
new LongTag("firstPlayed", $currentTimeMillis),
|
||||||
new LongTag("lastPlayed", (int) (microtime(true) * 1000)),
|
new LongTag("lastPlayed", $currentTimeMillis),
|
||||||
new ListTag("Pos", [
|
new ListTag("Pos", [
|
||||||
new DoubleTag("", $spawn->x),
|
new DoubleTag("", $spawn->x),
|
||||||
new DoubleTag("", $spawn->y),
|
new DoubleTag("", $spawn->y),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user