require_once '../../incl/incl.php'; require_once '../../incl/memcache.incl.php'; require_once '../../incl/api.incl.php'; if (!isset($_GET['house']) || !isset($_GET['id'])) { json_return(array()); } $house = intval($_GET['house'], 10); $page = preg_replace('/[^a-z]/', '', strtolower(trim($_GET['id']))); $resultFunc = 'TransmogResult_' . $page; if (!function_exists($resultFunc)) { json_return(array()); } $canCache = true; BotCheck(); if ($canCache) { HouseETag($house); } json_return($resultFunc($house)); function TransmogResult_cloth($house) { return TransmogArmor($house, 'i.class = 4 and i.subclass = 1'); } function TransmogResult_leather($house) { return TransmogArmor($house, 'i.class = 4 and i.subclass = 2'); } function TransmogResult_mail($house) { return TransmogArmor($house, 'i.class = 4 and i.subclass = 3'); } function TransmogResult_plate($house)
<?php require_once '../../incl/incl.php'; require_once '../../incl/memcache.incl.php'; require_once '../../incl/api.incl.php'; if (!isset($_GET['house'])) { json_return(array()); } $house = intval($_GET['house'], 10); HouseETag($house, true); $json = array('timestamps' => HouseTimestamps($house), 'sellers' => HouseTopSellers($house), 'mostAvailable' => HouseMostAvailable($house), 'deals' => HouseDeals($house), 'sellerbots' => HouseBotSellers($house)); $json = json_encode($json, JSON_NUMERIC_CHECK); json_return($json); function HouseTimestamps($house) { global $db; $cacheKey = MCGet('housecheck_' . $house); if ($cacheKey === false) { $cacheKey = 0; } $cacheKey = 'house_timestamps_' . $cacheKey; if (($tr = MCGetHouse($house, $cacheKey)) !== false) { return $tr; } DBConnect(); $tr = ['scheduled' => 0, 'delayednext' => 0, 'lastupdate' => 0, 'mindelta' => 0, 'avgdelta' => 0, 'maxdelta' => 0, 'lastcheck' => ['ts' => 0, 'json' => 0], 'lastsuccess' => ['ts' => 0, 'json' => 0]]; $sql = <<<EOF select unix_timestamp(timestampadd(second, least(ifnull(min(delta)+15, 45*60), 150*60), max(deltas.updated))) scheduled, unix_timestamp(hc.nextcheck), unix_timestamp(max(deltas.updated)) lastupdate, min(delta) mindelta,