1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

playerJoinEvent high pct tick

Discussion in 'Help' started by Levi, Oct 28, 2017.

  1. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    timings:
    cd v1 Total: 4.294 s Pct: 1.01%
    Pct Total Pct Tick Total Avg PerTick Count Event

    0.52% 77.77% 2.22 s 38.88 ms 0.0 0.1k cd\cd\Main::updatePlayerListData(PlayerJoinEvent)

    0.47% 0.49% 1.98 s 0.25 ms 16 125.0k cd\cd\Main::eek:nMove(PlayerMoveEvent)
     
  2. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    this is onjoin
    PHP:
    $pk = new PlayerListPacket();

    $pk->type PlayerListPacket::TYPE_ADD;
    $pk->entries[] = PlayerListEntry::createAdditionEntry($player->getUniqueId(), $player->getId(), $player->getName(),$player->getSkin(), $player->getXuid());

    foreach(
    $this->getServer()->getOnlinePlayers() as $players){
    $players->dataPacket($pk);
    does this make lag?
     
  3. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    test it yourself with microtime :p
     
    Levi likes this.
  4. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    oki, and also, is there a better way to do this w/o using player join event?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.