writeLong() public static method

public static writeLong ( $value )
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->from);
     $this->buffer .= Binary::writeLong($this->to);
     $this->buffer .= \chr($this->type);
 }
Exemplo n.º 2
0
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= Binary::writeLong($this->target);
     $this->buffer .= Binary::writeLong($this->eid);
 }
Exemplo n.º 3
0
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= Binary::writeLong($this->eid);
     $this->putUUID($this->clientId);
 }
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->eid);
     $meta = Binary::writeMetadata($this->metadata);
     $this->buffer .= $meta;
 }
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= Binary::writeLong($this->from);
     $this->buffer .= Binary::writeLong($this->to);
     $this->buffer .= \chr($this->type);
 }
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= Binary::writeLong($this->eid);
     $meta = Binary::writeMetadata($this->metadata);
     $this->buffer .= $meta;
 }
Exemplo n.º 7
0
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong(0);
     //TODO: remove
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
 }
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= Binary::writeLong($this->eid);
     $this->putSlot($this->item);
     $this->buffer .= \chr($this->slot);
     $this->buffer .= \chr($this->selectedSlot);
 }
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \pack("n", $this->item);
     $this->buffer .= \pack("n", $this->meta);
     $this->buffer .= \chr($this->slot);
     $this->buffer .= \chr($this->selectedSlot);
 }
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \chr($this->slots[0]);
     $this->buffer .= \chr($this->slots[1]);
     $this->buffer .= \chr($this->slots[2]);
     $this->buffer .= \chr($this->slots[3]);
 }
Exemplo n.º 11
0
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \pack("N", $this->x);
     $this->buffer .= \pack("N", $this->y);
     $this->buffer .= \pack("N", $this->z);
     $this->buffer .= \pack("N", $this->direction);
     $this->putString($this->title);
 }
Exemplo n.º 12
0
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \pack("N", $this->action);
     $this->buffer .= \pack("N", $this->x);
     $this->buffer .= \pack("N", $this->y);
     $this->buffer .= \pack("N", $this->z);
     $this->buffer .= \pack("N", $this->face);
 }
Exemplo n.º 13
0
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \chr($this->eventId);
     $this->buffer .= \chr($this->effectId);
     $this->buffer .= \chr($this->amplifier);
     $this->buffer .= \chr($this->particles ? 1 : 0);
     $this->buffer .= \pack("N", $this->duration);
 }
Exemplo n.º 14
0
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= Binary::writeLong($this->eid);
     $this->putSlot($this->slots[0]);
     $this->putSlot($this->slots[1]);
     $this->putSlot($this->slots[2]);
     $this->putSlot($this->slots[3]);
 }
Exemplo n.º 15
0
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \chr($this->eventId);
     $this->buffer .= \chr($this->effectId);
     $this->buffer .= \chr($this->amplifier);
     $this->buffer .= \chr($this->particles ? 1 : 0);
     $this->buffer .= \pack("N", $this->duration);
 }
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \pack("N", $this->action);
     $this->buffer .= \pack("N", $this->x);
     $this->buffer .= \pack("N", $this->y);
     $this->buffer .= \pack("N", $this->z);
     $this->buffer .= \pack("N", $this->face);
 }
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->eid);
     $this->putSlot($this->item);
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedX) : \strrev(\pack("f", $this->speedX));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedY) : \strrev(\pack("f", $this->speedY));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedZ) : \strrev(\pack("f", $this->speedZ));
 }
Exemplo n.º 18
0
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= Binary::writeLong($this->eid);
     $this->putSlot($this->item);
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedX) : \strrev(\pack("f", $this->speedX));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedY) : \strrev(\pack("f", $this->speedY));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedZ) : \strrev(\pack("f", $this->speedZ));
 }
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= Binary::writeLong($this->entityId);
     $this->buffer .= \pack("n", \count($this->entries));
     foreach ($this->entries as $entry) {
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $entry->getMinValue()) : \strrev(\pack("f", $entry->getMinValue()));
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $entry->getMaxValue()) : \strrev(\pack("f", $entry->getMaxValue()));
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $entry->getValue()) : \strrev(\pack("f", $entry->getValue()));
         $this->putString($entry->getName());
     }
 }
Exemplo n.º 20
0
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->yaw) : \strrev(\pack("f", $this->yaw));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->bodyYaw) : \strrev(\pack("f", $this->bodyYaw));
     //TODO
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->pitch) : \strrev(\pack("f", $this->pitch));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->bodyYaw) : \strrev(\pack("f", $this->bodyYaw));
     $this->buffer .= \chr($this->mode);
 }
Exemplo n.º 21
0
 public function encode()
 {
     $this->reset();
     $this->buffer .= \pack("N", $this->seed);
     $this->buffer .= \pack("N", $this->generator);
     $this->buffer .= \pack("N", $this->gamemode);
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \pack("N", $this->spawnX);
     $this->buffer .= \pack("N", $this->spawnY);
     $this->buffer .= \pack("N", $this->spawnZ);
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
 }
Exemplo n.º 22
0
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->clientID);
     $this->putString($this->username);
     $this->buffer .= pack("N", $this->eid);
     $this->buffer .= \ENDIANNESS === 0 ? pack("f", $this->x) : strrev(pack("f", $this->x));
     $this->buffer .= \ENDIANNESS === 0 ? pack("f", $this->y) : strrev(pack("f", $this->y));
     $this->buffer .= \ENDIANNESS === 0 ? pack("f", $this->z) : strrev(pack("f", $this->z));
     $this->buffer .= chr((int) ($this->yaw * (256 / 360)));
     $this->buffer .= chr((int) ($this->pitch * (256 / 360)));
     $this->buffer .= pack("n", $this->item);
     $this->buffer .= pack("n", $this->meta);
     $this->buffer .= Binary::writeMetadata($this->metadata);
 }
Exemplo n.º 23
0
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->yaw) : \strrev(\pack("f", $this->yaw));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->bodyYaw) : \strrev(\pack("f", $this->bodyYaw));
     //TODO
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->pitch) : \strrev(\pack("f", $this->pitch));
     $this->buffer .= \chr($this->mode);
     $this->buffer .= \chr($this->onGround > 0);
 }
 public function encode()
 {
     $this->reset();
     $this->buffer .= \pack("N", \count($this->entities));
     foreach ($this->entities as $d) {
         $this->buffer .= Binary::writeLong($d[0]);
         //eid
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $d[1]) : \strrev(\pack("f", $d[1]));
         //motX
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $d[2]) : \strrev(\pack("f", $d[2]));
         //motY
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $d[3]) : \strrev(\pack("f", $d[3]));
         //motZ
     }
 }
Exemplo n.º 25
0
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= \pack("N", $this->seed);
     $this->buffer .= \chr($this->dimension);
     $this->buffer .= \pack("N", $this->generator);
     $this->buffer .= \pack("N", $this->gamemode);
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \pack("N", $this->spawnX);
     $this->buffer .= \pack("N", $this->spawnY);
     $this->buffer .= \pack("N", $this->spawnZ);
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
     $this->buffer .= \chr(0);
 }
Exemplo n.º 26
0
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->buffer .= \chr($this->type);
     $this->buffer .= \pack("N", \count($this->entries));
     foreach ($this->entries as $d) {
         if ($this->type === self::TYPE_ADD) {
             $this->putUUID($d[0]);
             $this->buffer .= Binary::writeLong($d[1]);
             $this->putString($d[2]);
             $this->putString($d[3]);
             $this->putString($d[4]);
         } else {
             $this->putUUID($d[0]);
         }
     }
 }
Exemplo n.º 27
0
 public function encode()
 {
     $this->reset();
     $this->buffer .= \pack("N", \count($this->entities));
     foreach ($this->entities as $d) {
         $this->buffer .= Binary::writeLong($d[0]);
         //eid
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $d[1]) : \strrev(\pack("f", $d[1]));
         //x
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $d[2]) : \strrev(\pack("f", $d[2]));
         //y
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $d[3]) : \strrev(\pack("f", $d[3]));
         //z
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $d[4]) : \strrev(\pack("f", $d[4]));
         //yaw
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $d[5]) : \strrev(\pack("f", $d[5]));
         //headYaw
         $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $d[6]) : \strrev(\pack("f", $d[6]));
         //pitch
     }
 }
Exemplo n.º 28
0
 public function encode()
 {
     $this->buffer = \chr(self::NETWORK_ID);
     $this->offset = 0;
     $this->putUUID($this->uuid);
     $this->putString($this->username);
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedX) : \strrev(\pack("f", $this->speedX));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedY) : \strrev(\pack("f", $this->speedY));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedZ) : \strrev(\pack("f", $this->speedZ));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->yaw) : \strrev(\pack("f", $this->yaw));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->yaw) : \strrev(\pack("f", $this->yaw));
     //TODO headrot
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->pitch) : \strrev(\pack("f", $this->pitch));
     $this->putSlot($this->item);
     $meta = Binary::writeMetadata($this->metadata);
     $this->buffer .= $meta;
 }
Exemplo n.º 29
0
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \pack("N", $this->type);
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedX) : \strrev(\pack("f", $this->speedX));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedY) : \strrev(\pack("f", $this->speedY));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedZ) : \strrev(\pack("f", $this->speedZ));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->yaw) : \strrev(\pack("f", $this->yaw));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->pitch) : \strrev(\pack("f", $this->pitch));
     $meta = Binary::writeMetadata($this->metadata);
     $this->buffer .= $meta;
     $this->buffer .= \pack("n", \count($this->links));
     foreach ($this->links as $link) {
         $this->buffer .= Binary::writeLong($link[0]);
         $this->buffer .= Binary::writeLong($link[1]);
         $this->buffer .= \chr($link[2]);
     }
 }
Exemplo n.º 30
0
 public function encode()
 {
     $this->reset();
     $this->buffer .= Binary::writeLong($this->clientID);
     $this->putString($this->username);
     $this->buffer .= Binary::writeLong($this->eid);
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->x) : \strrev(\pack("f", $this->x));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->y) : \strrev(\pack("f", $this->y));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->z) : \strrev(\pack("f", $this->z));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedX) : \strrev(\pack("f", $this->speedX));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedY) : \strrev(\pack("f", $this->speedY));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->speedZ) : \strrev(\pack("f", $this->speedZ));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->yaw) : \strrev(\pack("f", $this->yaw));
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->yaw) : \strrev(\pack("f", $this->yaw));
     //TODO headrot
     $this->buffer .= \ENDIANNESS === 0 ? \pack("f", $this->pitch) : \strrev(\pack("f", $this->pitch));
     $this->buffer .= \pack("n", $this->item);
     $this->buffer .= \pack("n", $this->meta);
     $this->buffer .= \chr($this->slim ? 1 : 0);
     $this->putString($this->skin);
     $meta = Binary::writeMetadata($this->metadata);
     $this->buffer .= $meta;
 }