config_new.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. define('IN_WEB', true);
  3. class ConfigNew {
  4. public function start($aRequest) {
  5. $startTime = intval(microtime(TRUE) * 1000);
  6. if(empty($aRequest['version'])){
  7. $aRequest['version'] = '1.0.0.0';
  8. }
  9. $sid = isset($aRequest['sid'])?$aRequest['sid']:1;
  10. //include (dirname(__FILE__)."/../com.php");
  11. //header('Access-Control-Allow-Origin:*');//允许跨域(临时)
  12. $ret = oo::commonOprModel('readconfig')->getStaticConfigPath("",$sid);
  13. $ret['Lang'] = oo::commonOprModel('readconfig')->getLangStaticConfigPath();
  14. $md5 = oo::commonOprModel('readconfig')->getStaticMd5ConfigPath();
  15. foreach ($md5 as $key=>$row){
  16. $ret[ucfirst($key)."Md5"] = $row;
  17. }
  18. oo::commonOprRedis('common')->incr(okeys::getVersionCount());//登陆成功率统计
  19. if(!oo::compareVersion(funs::changeVersionLength($aRequest['version']),oo::commonOprRedis('common')->get(okeys::CurForeVersion($sid)))){
  20. $ret['Version'] = str_replace('Version','VersionForce',$ret['Version']);
  21. }
  22. if(!oo::compareVersion($aRequest['version'],'1.7.4')){
  23. $ret['VipConfig'] = 'VipConfig1599446560.json';
  24. }elseif(!oo::compareVersion($aRequest['version'], '1.8.5')){
  25. //1.8.5版本vip功能修改
  26. $ret['VipConfig'] = 'VipConfig1612259276.json';
  27. }
  28. if(!oo::compareVersion($aRequest['version'],'1.7.3')){
  29. $ret['LuckyDraw'] = 'LuckyDraw1585289352.json';
  30. }
  31. //签到进度 版本区分
  32. if(!oo::compareVersion($aRequest['version'],'1.7.0')){
  33. $ret['Signin'] = 'Signin1600949611.json';
  34. }
  35. //分享配置 版本区分
  36. if(!oo::compareVersion($aRequest['version'],'1.7.4')){
  37. $ret['Share'] = 'ShareConfig1584067106.json';
  38. $ret['LDE'] = "LDE.json";
  39. $ret['LEN'] = "LEN.json";
  40. $ret['LES'] = "LES.json";
  41. $ret['LFR'] = "LFR.json";
  42. $ret['LID'] = "LID.json";
  43. $ret['LNO'] = "LNO.json";
  44. $ret['LPT'] = "LPT.json";
  45. $ret['LTH'] = "LTH.json";
  46. $ret['LTW'] = "LTW.json";
  47. $ret['LVI'] = "LVI.json";
  48. $ret['LZH'] = "LZH.json";
  49. }
  50. if(!oo::compareVersion($aRequest['version'],'1.7.3')){
  51. $ret['MiningGameConfig'] = 'MiningGameConfig1598514140.json';
  52. }
  53. if(!oo::compareVersion($aRequest['version'],'1.7.8')){
  54. if(IS_DEBUF){
  55. $ret['RemoteAssets'] = 'RemoteAssets_1770.json';
  56. $ret['MainBgConfig'] = 'MainBgConfig1598320209.json';
  57. }else{
  58. $ret['RemoteAssets'] = 'RemoteAssets_1770.json';
  59. $ret['MainBgConfig'] = 'MainBgConfig1601470837.json';
  60. }
  61. }else{
  62. if(!oo::compareVersion($aRequest['version'],'1.8.3')){
  63. if(IS_DEBUF){
  64. $ret['RemoteAssets'] = 'RemoteAssets1615770897.json';
  65. }else{
  66. $ret['RemoteAssets'] = 'RemoteAssets1615607975.json';
  67. }
  68. }
  69. }
  70. if(!oo::compareVersion($aRequest['version'],'1.8.4')){
  71. if(IS_DEBUF){
  72. $ret['RecommendConfig'] = "RecommendConfig1615557861.json";
  73. }else{
  74. $ret['RecommendConfig'] = "RecommendConfig1614071352.json";
  75. }
  76. }
  77. if(!oo::compareVersion($aRequest['version'],'1.10')){
  78. if(IS_DEBUF){
  79. }else{
  80. $ret['Share'] = "ShareConfig1618415073.json";
  81. }
  82. }
  83. $ret["hotupdate"] = oo::commonOprModel('Gameupdate')->getGameUpdateHotfix($sid,funs::changeVersionLength($aRequest['version'],3));
  84. $endTime = intval(microtime(TRUE) * 1000);
  85. $runTime = $endTime - $startTime;
  86. if(IS_DEBUF){
  87. oo::logs()->debug3(['startTime'=>$startTime,'endTime'=>$endTime,'runTime'=> $runTime], 'configRuntimeDetail');
  88. }else{
  89. $runTime >= 500 && oo::logs()->debug3(['startTime'=>$startTime,'endTime'=>$endTime,'runTime'=> $runTime], 'configRuntimeDetail');
  90. }
  91. return json_encode($ret,JSON_NUMERIC_CHECK);
  92. }
  93. }