示例#1
0
 function get_ids()
 {
     # order matters!!!!
     if (is_null($this->alliance_id)) {
         $this->alliance_id = get_alliance_id($this->alliance);
     }
     if (is_null($this->corp_id)) {
         $this->corp_id = get_corp_id($this->corp, $this->alliance_id);
     }
     if (is_null($this->pilot_id)) {
         $this->pilot_id = get_pilot_id($this->pilot, $this->corp_id);
     }
     if (is_null($this->char_id)) {
         $this->char_id = get_pilot_charid($this->pilot_id);
     }
     if (is_null($this->ship_id)) {
         $this->ship_id = get_item_id($this->ship);
     }
     if (is_null($this->group_id)) {
         $this->group_id = get_item_group_id($this->ship_id);
     }
     if (is_null($this->weapon_id)) {
         $this->weapon_id = get_item_id($this->weapon);
     }
 }
示例#2
0
function get_pilot_with_info($charid, $name, $corpname, $alliancename)
{
    # creates the pilot if needed
    $allid = get_alliance_id($alliancename);
    $corpid = get_corp_id($corpname, $allid);
    $pilotid = get_pilot_id($name, $corpid);
    $ocid = get_pilot_charid($pilotid);
    if ($ocid != $charid) {
        global $ft;
        $ft->dbh->_do_query('UPDATE tbl:pilots SET charid = ? WHERE pilotid = ?', array($charid, $pilotid));
    }
    return $pilotid;
}