<?php

class AddPlayerPacket extends RakNetDataPacket{
	public $clientID;
	public $username;
	public $eid;
	public $x;
	public $y;
	public $z;
	public $pitch;
	public $yaw;
	public $itemID;
	public $itemAuxValue;
	/**
	 *@deprecated use $itemID instead
	 */
	public $unknown1;
	/**
	 *@deprecated use $itemAuxValue instead
	 */
	public $unknown2;
	/**
	 *@var array
	 */
	public $metadata;
	
	public function pid(){
		return ProtocolInfo::ADD_PLAYER_PACKET;
	}
	
	public function decode(){

	}
	
	public function encode(){
		$this->reset();
		$this->putLong($this->clientID);
		$this->putString($this->username);
		$this->putInt($this->eid);
		$this->putFloat($this->x);
		$this->putFloat($this->y);
		$this->putFloat($this->z);
		$this->putByte($this->yaw);
		$this->putByte($this->pitch);
		$this->putShort($this->itemID);
		$this->putShort($this->itemAuxValue); //Example: bow shooting power
		$this->put(Utils::writeMetadata($this->metadata));
	}

}