/** * @TODO Document me! */ private function configure() { $char = Player::find(SessionFactory::getSession()->get('player_id')); $peers = $char ? $this->getNearbyPeers($char->id()) : []; $active_ninjas = Player::findActive(5, true); $char_info = $char ? $char->data() : []; $other_npcs = NpcFactory::npcsData(); $npcs = NpcFactory::customNpcs(); $enemy_list = $char ? $this->getCurrentEnemies($char->id()) : []; $recent_attackers = $char ? $this->getRecentAttackers($char) : []; return ['logged_in' => (bool) $char, 'enemy_list' => $enemy_list, 'char_name' => $char ? $char->name() : '', 'npcs' => $npcs, 'other_npcs' => $other_npcs, 'char_info' => $char_info, 'active_ninjas' => $active_ninjas, 'recent_attackers' => $recent_attackers, 'enemy_list' => $enemy_list, 'peers' => $peers]; }
/** * Obtain the npcs data. * * @return Array */ private function npcs() { return ['abstract_npcs' => NpcFactory::npcsData(), 'custom_npcs' => NpcFactory::customNpcs()]; }