-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Stanislav Opletal edited this page Jul 25, 2017
·
1 revision
- Cache result
- Possible data:
- Profile
- Inventory
- Recent games
- Friends
- Simple syntax
The player class is the most important point. Because all the other data that is needed is loaded into it.
All variables has set and get function
/**
* @var int $steamid
*/
private $steamid;
/**
* @var string $personaname
*/
private $personaname;
/**
* @var string $profileurl
*/
private $profileurl;
/**
* @var string $avatar
* URL of image
*/
private $avatar;
/**
* @var string $avatarmedium
* URL of image
*/
private $avatarmedium;
/**
* @var string $avatarfull
* URL of image
*/
private $avatarfull;
/**
* @var int $personastate
*/
private $personastate;
/**
* @var int $state
* 1 private, friend only
* 3 public
*/
private $state;
/**
* @var int $profilestate
* if set indicates the user has a community proifle configured
*/
private $profilestate;
/**
* @var DateTime $lastlogof
* UNIX time
*/
private $lastlogof;
/**
* @var int $comment
* If set indicates the profile allows public comment
*/
private $comment;
/**
* @var Friends $friends
*/
private $friends;
/**
* @var Games $games
*/
private $games;
/**
* @var Inventory $inventory
*/
private $inventory;Inventory is very easy to use.
/**
* @var \stdClass $items
* Original source
*/
private $items;
/**
* @var \stdClass $description
* Original source
*/
private $description;
/**
* @var int $count
* Count of items
*/
private $count;
/**
* @var boolean
* If load of items was success
*/
private $success;
/**
* @var \stdClass $data
* Items with desciptions in class Item and ItemDesciption
*/
private $data;Firstly we load $player variable. Its described in readme file.
$player = new Player("76561198151608925");
$request = new Request();
$player = $request->getFullData($player);
$items = $player->getInventory()->getData(); Variable $items is stdClass (object array) full of Items class variables where is loaded single item with it description. ** Image of dump **
Then we can use foreach or just select few Items and we can use get methods.
/**
* @var Item $oneItem
*/
$oneItem = $player->getInventory()->getData()['11015679329'];
Dumper::dump($oneItem->getAmount());For example this code will return 1 because amount of item is 1. All methods can be find in next pages of wiki.
Then we can use foreach or just select few Items and we can use get methods.