|
|
|
@ -9,6 +9,7 @@ use Base\Tool\PlistDemo;
|
|
|
|
|
class GameSourceService {
|
|
|
|
|
|
|
|
|
|
const IS_FIXED_IOS13 = true;
|
|
|
|
|
const DEBUG = true;
|
|
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
@ -219,6 +220,8 @@ class GameSourceService {
|
|
|
|
|
*/
|
|
|
|
|
public function channelPack($gameSource, $game, $apply, $launchCount = 0)
|
|
|
|
|
{
|
|
|
|
|
$debugTime1 = microtime(true);
|
|
|
|
|
|
|
|
|
|
$gameSourceUrl = $this->getGameSourceUrl($gameSource);
|
|
|
|
|
if ($gameSource == null || !file_exists($gameSourceUrl)) {
|
|
|
|
|
M('apply', 'tab_')->where(['id' => $apply['id']])->setField('enable_status', -1);
|
|
|
|
@ -242,8 +245,13 @@ class GameSourceService {
|
|
|
|
|
}
|
|
|
|
|
$relativePath = './' . $savePath;
|
|
|
|
|
$localPath = ROOTTT . $savePath;
|
|
|
|
|
|
|
|
|
|
$debugTime2 = microtime(true);
|
|
|
|
|
|
|
|
|
|
copy($gameSourceUrl, $localPath);
|
|
|
|
|
|
|
|
|
|
$debugTime3 = microtime(true);
|
|
|
|
|
|
|
|
|
|
$status = $this->packChannel($localPath, $game, $gameSource, $apply);
|
|
|
|
|
if (!$status) {
|
|
|
|
|
return [
|
|
|
|
@ -251,6 +259,9 @@ class GameSourceService {
|
|
|
|
|
'message' => '打包失败,加入渠道信息失败!',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$debugTime4 = microtime(true);
|
|
|
|
|
|
|
|
|
|
$distFilePath = 'GamePack/' . $fileName;
|
|
|
|
|
$result = $this->uploadPackage($localPath, $distFilePath, false);
|
|
|
|
|
if ($result['status']) {
|
|
|
|
@ -262,6 +273,9 @@ class GameSourceService {
|
|
|
|
|
'message' => '打包失败,上传OSS失败!' . $result['message'],
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$debugTime5 = microtime(true);
|
|
|
|
|
|
|
|
|
|
$plistInfo = ['game_id' => $apply['game_id'], 'promote_id' => $apply['promote_id']];
|
|
|
|
|
$plistUrl = '';
|
|
|
|
|
if ($apply['sdk_version'] == 2) {
|
|
|
|
@ -286,6 +300,18 @@ class GameSourceService {
|
|
|
|
|
}
|
|
|
|
|
$applyService = new ApplyService();
|
|
|
|
|
$applyService->updateAfterPack($apply, $packageUrl, $plistUrl);
|
|
|
|
|
|
|
|
|
|
$debugTime6 = microtime(true);
|
|
|
|
|
$debugInfo = '';
|
|
|
|
|
if (self::DEBUG) {
|
|
|
|
|
$debugInfo .= '[' .
|
|
|
|
|
'总计:' . ($debugTime6 - $debugTime1) .
|
|
|
|
|
' 复制:' . ($debugTime3 - $debugTime2) .
|
|
|
|
|
' 打包:' . ($debugTime4 - $debugTime3) .
|
|
|
|
|
' 上传:' . ($debugTime5 - $debugTime4) .
|
|
|
|
|
']';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
'status' => true,
|
|
|
|
|
'message' => '打包成功!',
|
|
|
|
|