function itemfind() { global $mode, $log, $itm0, $itmk0, $itms0, $itmsk0; if (!$itm0 || !$itmk0 || !$itms0) { $log .= '获取物品信息错误!'; $mode = 'command'; return; } if (strpos($itmk0, 'TO') === 0) { trap(); } else { if (CURSCRIPT == 'botservice') { echo "mode=itemfind\n"; echo "itm0={$itm0}\n"; echo "itms0={$itms0}\n"; echo "itmsk0={$itmsk0}\n"; } $mode = 'itemfind'; return; } }
function trapget($mi) { if (eval(__MAGIC__)) { return $___RET_VALUE; } eval(import_module('sys', 'player', 'trap')); $itm0 = $mi['itm']; $itmk0 = $mi['itmk']; $itme0 = $mi['itme']; $itms0 = $mi['itms']; $itmsk0 = $mi['itmsk']; $tid = $mi['tid']; $db->query("DELETE FROM {$tablepre}maptrap WHERE tid='{$tid}'"); $playerflag = is_numeric($itmsk0) ? true : false; $selflag = $playerflag && $itmsk0 == $pid ? true : false; if ($playerflag && !$selflag) { $wdata = \player\fetch_playerdata_by_pid($itmsk0); $trname = $wdata['name']; $trtype = $wdata['type']; $trperfix = '<span class="yellow">' . $trname . '</span>设置的'; } elseif ($selflag) { $trname = $name; $trtype = 0; $trperfix = '你自己设置的'; } else { $trname = $trtype = $trperfix = ''; } trap(); }
function _childElements($id = false, $arr = false) { $this->recursionCounter++; // increment recursionCounter if ($this->recursionCounter > 300) { trap('recursionCounter'); die; } // kill process if recursionCounter exceeds threshold $retval = false; if ($id !== false && is_array($arr)) { foreach ($arr as $v) { if ($v['E_P_ID'] == $id) { if (!is_array($retval)) { $retval = array(); // if retval isn't set to an array then set it here } //$cKey = array_push($retval, array($v['E_NAME'] => $v['E_VALUE'])) - 1; // set the name and value of this child $retval[$v['E_NAME']] = $v['E_VALUE']; // set the name and value of this child /*$hasChildren = $this->_childElements($v['E_ID'], $arr); // check and see if this child has any children if($hasChildren !== false) { foreach($hasChildren as $v) { list($name, $value) = each($v); $retval[$cKey][][$name] = $value; } $retval[$cKey][] = $hasChildren[0]; // if it has children then set it to the CHILDREN index //$retval['CHILDREN'] = $hasChildren; // if it has children then set it to the CHILDREN index }*/ } } } return $retval; }