✨ feat(录像): 修改录像上传逻辑
This commit is contained in:
@@ -4,6 +4,7 @@ import { md5 } from './sdkUtil';
|
||||
const BATTLE_CLASS_MOD = 100; // 存档分类模数
|
||||
const CDN_URL_PREFIX_SQ = 'https://download-sgzzyz.yev242.com'; // sq cdn 服务器地址前缀
|
||||
const CDN_URL_PREFIX_ZYZ = 'http://zyz-download.trgame.cn'; // 公司下载服务器地址前缀
|
||||
const CDN_URL_PREFIX_YJZ = 'https://yjz-cdn.yev242.com'; // 公司下载服务器地址前缀
|
||||
|
||||
// 将字符串 crc32 处理后取模,以将随机字符串分组
|
||||
function modStr(str: string, mod: number) {
|
||||
@@ -23,8 +24,10 @@ function getPrefixByEnv(env: string) {
|
||||
case 'sq4':
|
||||
case 'sq7':
|
||||
case 'sq9':
|
||||
default:
|
||||
return CDN_URL_PREFIX_SQ;
|
||||
case 'zy1':
|
||||
return CDN_URL_PREFIX_YJZ;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +37,9 @@ export function getLocalRplUrl(roleId: string, warType: number, battleCode: stri
|
||||
return writePath;
|
||||
}
|
||||
|
||||
export function getRemoteRplUrl(env: string, roleId: string, warType: number, battleCode: string) {
|
||||
export function getRemoteRplUrl(env: string, sshHost: string, roleId: string, warType: number, battleCode: string) {
|
||||
const battleClass = modStr(battleCode, BATTLE_CLASS_MOD); // 将存档文件按一定规则分批保存
|
||||
const rplUrl = `${getPrefixByEnv(env)}/rpls/${md5(env).substring(0, 4)}/${roleId}/${warType}/${battleClass}`;
|
||||
const rplUrl = `${getPrefixByEnv(env)}/rpls/${md5(sshHost).substring(0, 4)}/${roleId}/${warType}/${battleClass}`;
|
||||
return rplUrl;
|
||||
}
|
||||
|
||||
@@ -45,7 +48,8 @@ export function getRemoteRplPrefix(env: string) {
|
||||
return rplUrl;
|
||||
}
|
||||
|
||||
export function getRemoteRplFilePath(roleId: string, warType: number, battleCode: string) {
|
||||
export function getRemoteRplFilePath(remoteUrl: string, roleId: string, warType: number, battleCode: string) {
|
||||
if(remoteUrl) return remoteUrl;
|
||||
const battleClass = modStr(battleCode, BATTLE_CLASS_MOD); // 将存档文件按一定规则分批保存
|
||||
const rplUrl = `/${roleId}/${warType}/${battleClass}/${battleCode}.bin`;
|
||||
return rplUrl;
|
||||
|
||||
Reference in New Issue
Block a user