Esempio n. 1
0
function backpack_viewer($sid)
{
    globalSchemas(440);
    $profile = json_decode(get_data('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=' . AKey() . '&steamids=' . $sid . '&format=json'), true);
    $profile = $profile['response']['players'][0];
    $bp = '';
    $hours = getHours($sid);
    $backpack = json_decode(get_data('http://api.steampowered.com/IEconItems_440/GetPlayerItems/v0001/?key=' . AKey() . '&SteamID=' . $sid . '&format=json'), true);
    if (isset($backpack) && $backpack['result']['status'] == 1) {
        usort($backpack['result']['items'], "sortInvPos");
        $mplace = '';
        $itemCount = array();
        //misplaced items
        foreach ($backpack['result']['items'] as $key => $item) {
            if ($item['inventory'] == 3221225475) {
                item_prepare($item);
                item_price($item);
                $mplace .= item_image($item);
                $itemCount[$item['defindex']] = 1;
            }
        }
        if ($mplace != '') {
            $bp .= '<div class="bp-mplaced">' . $mplace . '</div><br>';
        }
        $inv_pos = 2147483649;
        $total_items = 0;
        //start normal items
        foreach ($backpack['result']['items'] as $key => $item) {
            if ($item['inventory'] == 3221225475) {
                //end-of-backpack handler, writes out empty slots until we reach the max slots in the backpack.
                while ($backpack['result']['num_backpack_slots'] >= $total_items) {
                    $bp .= '<div><img alt="empty" class="mt" src="img/mt.gif"></div>';
                    $total_items++;
                    $bp .= pg_chk($total_items);
                    // echoes empty backpack slots.
                }
                break;
            }
            while ($item['inventory'] > $inv_pos + 1) {
                $bp .= '<div><img alt="empty" class="mt" src="img/mt.gif"></div>';
                $total_items++;
                $inv_pos++;
                $bp .= pg_chk($total_items);
            }
            item_prepare($item);
            item_price($item);
            $bp .= item_image($item);
            $inv_pos = $item['inventory'];
            $total_items++;
            $bp .= pg_chk($total_items);
            $itemCount[$item['defindex']] = 1;
        }
    } else {
        $bp .= 'problem retrieving backpack.';
    }
    echo '<div class="bp-container w800">', '<div class="bp-head">', '<img src=', $profile['avatarfull'], ' />', '<h1>', htmlspecialchars($profile['personaname']), '</h1>', '<h3>TF2: ', $hours[440], ' / DOTA 2: ', $hours[570], ' / CSGO: ', $hours[730], '</h3>', '</div>', '<div class="bp-mweapons">';
    fav_class_weapons_box($sid, $itemCount);
    echo '</div>', '<div class="bp-info">', '</div>', '<div class="bp-content">', $bp, '</div></div>';
    //end bp container.
}
Esempio n. 2
0
function scan_570_single($content, $profile)
{
    $f2p = false;
    if ($profile['steamid'] == 76561198035413737) {
        echo profileBlockArea($profile, 440, array(440 => 99999999, 730 => 99999999, 570 => 99999999)) . '<td><div class="zitms">THIS USER BELONGS TO DIGITS, HANDS OFF.</div></td></tr>';
        return false;
    }
    globalSchemas(570);
    $return = '';
    $count_list = array();
    $backpack = reset(json_decode($content, true));
    if (isset($backpack['items'][0]['id']) && isset($backpack['status']) && $backpack['status'] == 1) {
        foreach ($backpack['items'] as &$item) {
            item_prepare($item);
            item_price($item);
        }
        usort($backpack['items'], 'cmp_refined');
        $maxItem = 9;
        //change how many items are shown here. Will break the layout if there are too many.
        $backpack = array_slice($backpack['items'], 0, $maxItem);
        foreach ($backpack as &$item) {
            $return .= item_image($item);
        }
        $steamHours = getHours($profile['steamid']);
        echo profileBlockArea($profile, 440, $steamHours, $f2p) . '<td class="pitms">' . $return . '</td></tr>';
    }
}
Esempio n. 3
0
function scan_start($input, $gid)
{
    increment_scan($gid);
    $GLOBALS['users_hidden']['hours'] = 0;
    $GLOBALS['users_hidden']['worthless'] = 0;
    $GLOBALS['users_hidden']['private'] = 0;
    $GLOBALS['users_hidden']['f2p'] = 0;
    $time_start = time();
    if (!isset($input) || empty($input) && !is_array($input)) {
        echo 'No data submitted';
        return false;
    }
    if (!is_array($input)) {
        //look for steamid32s in this string to make into an array.
        $userlist = steamidFormatConvert($input);
    } else {
        if (is_numeric($input[0])) {
            $userlist = $input;
        }
    }
    if (!isset($userlist[0]) || empty($userlist[0]) || !is_array($userlist) || !is_numeric($userlist[0])) {
        echo 'no steamids detected...';
        return false;
    }
    $small = 0;
    $large = 99;
    $profiles100 = array();
    globalSchemas($gid);
    if ($gid == 440) {
        preference_get();
    }
    //ob_start();
    echo '<table class="sres" ><thead><tr><th data-sort="float">player</th><th>items</th></tr></thead><tbody>';
    while ($small <= count($userlist)) {
        $profiles100 = array_slice($userlist, $small, $large);
        // slice it from point 0 to point 99 (100 total)
        $small += 100;
        $large += 100;
        $playerURL = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=' . AKey() . '&steamids=' . implode(",", $profiles100) . '&format=json';
        $playerData = json_decode(get_data($playerURL), true);
        if (isset($playerData['response']['players'][0]['steamid'])) {
            echo scan_queue($playerData['response']['players'], $gid);
        } else {
            $playerData = json_decode(get_data($playerURL), true);
            if (isset($playerData['response']['players'][0]['steamid'])) {
                echo scan_queue($playerData['response']['players'], $gid);
            } else {
                echo '</tbody></table>Something went wrong with steam!<br>';
                break;
            }
        }
    }
    echo '</tbody></table>';
    //ob_end_flush();
    echo $GLOBALS['users_hidden']['hours'] + $GLOBALS['users_hidden']['worthless'] + $GLOBALS['users_hidden']['private'] + $GLOBALS['users_hidden']['f2p'], ' users hidden. ( ', $GLOBALS['users_hidden']['hours'], ' hours. ', $GLOBALS['users_hidden']['worthless'], ' worthless. ', $GLOBALS['users_hidden']['private'], ' private. ', $GLOBALS['users_hidden']['f2p'], ' F2P.', ' )<br>';
    echo 'Scan took ' . (time() - $time_start) . ' second' . (time() - $time_start > 1 ? 's' : '') . '. Bugs? Report them <a target=blank href=/bug.php>here</a>';
}
Esempio n. 4
0
function price_730($item)
{
    globalSchemas(730);
    if (isset($GLOBALS['schemas_730'][$item['market_hash_name']]['price']) && $GLOBALS['schemas_730'][$item['market_hash_name']]['price'] != 0) {
        return $GLOBALS['schemas_730'][$item['market_hash_name']]['price'];
    } else {
        if (strpos($item['type'], 'Knife')) {
            return 70;
        }
    }
    return false;
}
Esempio n. 5
0
function recipe_handler(&$item)
{
    globalSchemas(440);
    $total_price = 0;
    $notes = '';
    //echo $GLOBALS['schemas_440']['schema']['items'][$item['defindex']]['item_name'] . '<br>';
    foreach ($item['attributes'] as $attr) {
        if (isset($attr['is_output']) && $attr['is_output'] === false && $attr['defindex'] != 2000) {
            $item_name = $GLOBALS['schemas_440']['schema']['items'][$attr['itemdef']]['item_name'];
            $notes .= ($attr['quality'] != 6 ? $GLOBALS['schemas_440']['schema']['quality'][$attr['quality']]['display_name'] . ' ' : '') . $item_name . ' x' . $attr['quantity'] . "\n";
            $p = item_price_simple(array('name' => $item_name, 'quality' => $attr['quality']));
            $total_price = $total_price + $p * $attr['quantity'];
        }
    }
    foreach ($item['attributes'] as $attr) {
        if (isset($attr['is_output']) && $attr['is_output'] == true) {
            if (isset($attr['attributes'])) {
                foreach ($attr['attributes'] as $LLAttr) {
                    if ($LLAttr['defindex'] == 2012) {
                        $notes .= 'Output: ' . $GLOBALS['schemas_440']['schema']['items'][$LLAttr['float_value']]['item_name'] . ' ' . $GLOBALS['schemas_440']['schema']['items'][$attr['itemdef']]['item_name'];
                    }
                }
            } else {
                $notes .= 'Output: ' . $GLOBALS['schemas_440']['schema']['items'][$attr['itemdef']]['item_name'];
            }
        }
    }
    $notes .= "\n" . 'Completion cost: ' . $total_price . ' Ref';
    $item['notes'] = $notes;
}