public function parseProfile($ID) { $this->log(__LINE__, 'function: parseProfile() - parsing profile: ' . $ID); if (!$ID) { echo "error: No ID Set."; } // Get the source $this->log(__LINE__, 'function: parseProfile() - get source'); $this->getSource($this->URL['character']['profile'] . $ID); $this->log(__LINE__, 'function: parseProfile() - obtained source'); if ($this->errorPage($ID)) { echo "error: Character page does not exist."; } else { $this->log(__LINE__, 'function: parseProfile() - starting parse'); // Create a new character object $Character = new Character(); $this->log(__LINE__, 'function: parseProfile() - new character object'); // Set Character Data $Character->setID(trim($ID), $this->URL['character']['profile'] . $ID); $Character->setNameServer($this->findRange('player_name_thumb', 15)); $this->log(__LINE__, 'function: parseProfile() - set id, name and server'); // Only process if character name set if (strlen($Character->getName()) > 3) { $this->log(__LINE__, 'function: parseProfile() - parsing chunk 1'); $Character->setTitle($this->findRange('chara_title', 2, NULL, false)); $Character->setAvatar($this->findRange('player_name_thumb', 10, NULL, false)); $Character->setPortrait($this->findRange('bg_chara_264', 2, NULL, false)); $Character->setRaceClan($this->find('chara_profile_title')); //$Character->setLegacy($this->find('bt_legacy_history')); $Character->setNamedayCityCompanyFC($this->findRange('chara_profile_left', null, "chara_class_box", false)); $Character->setCity($this->findRange('City-state', 5)); $Character->setBiography($this->findRange('txt_selfintroduction', 5)); $Character->setStats($this->findAll('param_left_area_inner', 12, null, false)); $Character->setHPMPTP($this->findRange('param_power_area', 10)); $Character->setActiveClassLevel($this->findAll('class_info', 5, null, false)); $this->log(__LINE__, 'function: parseProfile() - parsing chunk 2'); // Set Gear (Also sets Active Class and Job), then set item level from the gear $Character->setGear($this->findAll('-- ITEM Detail --', NULL, '-- //ITEM Detail --', false)); $Character->setItemLevel($this->GearSlots); #$this->segment('area_header_w358_inner'); $this->log(__LINE__, 'function: parseProfile() - parsing chunk 3'); // Set Minions $Minions = $this->findRange('-- Minion --', NULL, '//Minion', false); $Character->setMinions($Minions); // Set Mounts $this->log(__LINE__, 'function: parseProfile() - parsing chunk 4'); $Mounts = $this->findRange('-- Mount --', NULL, '//Mount', false); $Character->setMounts($Mounts); #$this->segment('class_fighter'); // Set ClassJob $this->log(__LINE__, 'function: parseProfile() - parsing chunk 5'); $Character->setClassJob($this->findRange('class_fighter', NULL, '//Class Contents', false)); // Validate data $Character->validate(); $this->log(__LINE__, 'function: parseProfile() - complete profile parse for: ' . $ID); // Append character to array $this->Characters[$ID] = $Character; } else { $this->Characters[$ID] = NULL; } } }