当前位置: 首页>>代码示例>>PHP>>正文


PHP Character::setAvatar方法代码示例

本文整理汇总了PHP中Character::setAvatar方法的典型用法代码示例。如果您正苦于以下问题:PHP Character::setAvatar方法的具体用法?PHP Character::setAvatar怎么用?PHP Character::setAvatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Character的用法示例。


在下文中一共展示了Character::setAvatar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parseProfile

 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)) {
         return "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('#62;City-state', 5));
             $Character->setBiography($this->findRange('txt_selfintroduction', 5));
             $Character->setHPMPTP($this->findRange('param_power_area', 10));
             $Character->setStats($this->findAll('param_left_area_inner', 12, null, false));
             $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;
         }
     }
 }
开发者ID:petarfitzpatrick,项目名称:FinalFantasyAPI,代码行数:62,代码来源:api.php


注:本文中的Character::setAvatar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。