<?php

require '../base/Config.php';
Config::init();
$service = new ZoneService();
if (isset($_POST["game"]) === false || isset($_POST["type"]) === false || isset($_POST["platform"]) === false) {
    $service->error("zoneinfo", 1);
}
$game = $_POST["game"];
$type = $_POST["type"];
$platform = $_POST["platform"];
if (!is_numeric($game) || !is_numeric($type)) {
    $service->error("zoneinfo", 2);
}
$service->init();
$cache_service = new CacheService();
$cache_service->init();
$file_name = "../bin/cache/zoneinfo_" . $game . "_" . $type . "_" . $platform . ".txt";
$array = $cache_service->getCacheInfo($file_name);
if (null == $array) {
    $array = $service->getZoneInfo($game, $type, $platform);
    if (count($array)) {
        $cache_service->setCacheInfo($file_name, $array);
    }
}
if (count($array)) {
    $service->response(array("zoneinfo" => $array));
} else {
    $service->error("zoneinfo", 3);
}
예제 #2
0
<?php

require '../../base/Config.php';
Config::init();
$service = new PayNoticeService();
$service->init();
Common::logPayRequest($_SERVER, $_POST);
$params = $_POST;
if (isset($_POST['server_id']) === false || isset($_POST['private_data']) === false) {
    $service->error('pay', -1);
}
$remote_ip = $_SERVER['REMOTE_ADDR'];
if ($service->checkAnySDKSever($remote_ip) === false) {
    $service->error('pay', 1);
} else {
    $zone_service = new ZoneService();
    $zone_service->init();
    $zone_id = $params['server_id'];
    $platform = $params['private_data'];
    $slave_url = $zone_service->getZoneWebInfo($zone_id, $platform);
    if ($slave_url == '') {
        $service->error('pay', 2);
    } else {
        $service->payNotice($params, $slave_url . 'anysdk/pay.php');
    }
}