<?php
$lid =1;
$sid = isset($_GET['sid'])?$_GET['sid']:1;
define('IN_WEB', true);
include (dirname(__FILE__)."/../com.php");
header('Access-Control-Allow-Origin:*');//允许跨域(临时)

$ret = oo::commonOprModel('readconfig')->getStaticConfigPath("",$sid);

$ret['Lang'] = oo::commonOprModel('readconfig')->getLangStaticConfigPath();

$md5 = oo::commonOprModel('readconfig')->getStaticMd5ConfigPath();
foreach ($md5 as $key=>$row){
    $ret[ucfirst($key)."Md5"] = $row;
}

oo::commonOprRedis('common')->incr(okeys::getVersionCount());//登陆成功率统计

if(!oo::compareVersion(funs::changeVersionLength($_GET['version']),oo::commonOprRedis('common')->get(okeys::CurForeVersion($sid)))){
    $ret['Version'] = str_replace('Version','VersionForce',$ret['Version']);
}

if(!oo::compareVersion($_GET['version'],'1.7.4')){
    $ret['VipConfig'] = 'VipConfig1599446560.json';
}

if(!oo::compareVersion($_GET['version'],'1.7.3')){
    $ret['LuckyDraw'] = 'LuckyDraw1585289352.json';
}

//签到进度 版本区分
if(!oo::compareVersion($_GET['version'],'1.7.0')){
    $ret['Signin'] = 'Signin1600949611.json';
}

//分享配置 版本区分
if(!oo::compareVersion($_GET['version'],'1.7.4')){
    $ret['Share'] = 'ShareConfig1584067106.json';
    $ret['LDE'] = "LDE.json";
    $ret['LEN'] = "LEN.json";
    $ret['LES'] = "LES.json";
    $ret['LFR'] = "LFR.json";
    $ret['LID'] = "LID.json";
    $ret['LNO'] = "LNO.json";
    $ret['LPT'] = "LPT.json";
    $ret['LTH'] = "LTH.json";
    $ret['LTW'] = "LTW.json";
    $ret['LVI'] = "LVI.json";
    $ret['LZH'] = "LZH.json";
}

if(!oo::compareVersion($_GET['version'],'1.7.3')){
    $ret['MiningGameConfig'] = 'MiningGameConfig1598514140.json';
}

if(!oo::compareVersion($_GET['version'],'1.7.8')){
    if(IS_DEBUF){
        $ret['RemoteAssets'] = 'RemoteAssets_1770.json';
        $ret['MainBgConfig'] = 'MainBgConfig1598320209.json';
    }else{
        $ret['RemoteAssets'] = 'RemoteAssets_1770.json';
        $ret['MainBgConfig'] = 'MainBgConfig1601470837.json';
    }
}else{
    if(!oo::compareVersion($_GET['version'],'1.8.3')){
        if(IS_DEBUF){
            $ret['RemoteAssets'] = 'RemoteAssets1615770897.json';
        }else{
            $ret['RemoteAssets'] = 'RemoteAssets1615607975.json';
        }
    }
}

if(strpos($_SERVER['HTTP_HOST'],"vivo") !== false){
    $ret['Version'] = "AndroidVersion1605767730.json"; //临时处理：vivo包不跟随Android更新
    $version = oo::commonOprModel('readconfig')->getStaticConfigPath("VivoVersion",$sid);
    if(!empty($version)){
        $ret['Version'] = $version;
    }
}

$ret["hotupdate"] = oo::commonOprModel('Gameupdate')->getGameUpdateHotfix($sid,funs::changeVersionLength($_GET['version'],3));

die(json_encode($ret,JSON_NUMERIC_CHECK));
?>
