<?php
defined('IN_WEB') or die('Include Error!');
mb_internal_encoding("UTF-8");
date_default_timezone_set('UTC');
define('WWWROOT', dirname(__FILE__).'/');
require_once WWWROOT  . 'config/config.sids.php';
require_once WWWROOT  . 'config/config.php';
if(isset($sid)){
    $_REQUEST['sid'] = $sid;
}
if(isset($lid)){
    $_REQUEST['lid'] = $lid;
}
//平台选择
IS_DEBUF?$n=1:$n=0;
$sid = (isset($_REQUEST['sid']) == false) ? $n : $_REQUEST['sid'];
$lid = (isset($_REQUEST['lid']) == false) ? $n : $_REQUEST['lid'];

if ($sid <= 0) {
    die('sid not null');
}
if ((!isset($sid)) || (!array_key_exists((int)$sid, $config['sidlist']))){
    die('sidError');
}
if ((!isset($lid)) || (!in_array( $lid, $config['lidlist']))){
//	die('lidError');
}

require_once WWWROOT  . 'core.php';

define('SGSID', $sid);
define('SGLID', $lid);
define('DEVICEID', $config['device'][SGSID]);//平台
define( 'PATH_CFG', WWWROOT . 'config/crazyGod_tl'.$isTset.'/');
require_once PATH_CFG . 'config.inc.php';
oo::setConfig( $config); //设置全局变量
oo::functions()->header();

$_GET = oo::functions()->magic_quote( $_GET); //安全控制
$_POST = oo::functions()->magic_quote( $_POST);
$_COOKIE = oo::functions()->magic_quote( $_COOKIE);