Files
jdt-fish-client/assets/FishSingle/script/engine/config/ManifestConfig.ts
2024-05-01 19:13:01 +08:00

37 lines
1.3 KiB
TypeScript

import DateUtil from '../utils/DateUtil'
import NetConfig from './NetConfig'
export default class ManifestConfig {
public static packageUrl: string = ''
public static remoteManifestUrl: string = ''
public static remoteVersionUrl: string = ''
public static version: string = '1.0.0' // 更新包要更新这里
public static assets: object = {}
public static searchPaths: Array<any> = []
public static getManifestStr(key: string) {
const obj: {
packageUrl?: string
remoteManifestUrl?: string
remoteVersionUrl?: string
version?: string
assets?: object
searchPaths?: Array<any>
} = {}
obj.packageUrl = `${NetConfig.hotupdateUrl}/hotupdate/${key}/`
obj.remoteManifestUrl = `${NetConfig.hotupdateUrl}/hotupdate/${key}/project.manifest?t=${DateUtil.now()}`
obj.remoteManifestUrl = `${
NetConfig.hotupdateUrl
}/hotupdate/${key}/project.manifest?t=${DateUtil.now()}`
obj.remoteVersionUrl = `${NetConfig.hotupdateUrl}/hotupdate/${key}/version.manifest?t=${DateUtil.now()}`
obj.remoteVersionUrl = `${
NetConfig.hotupdateUrl
}/hotupdate/${key}/version.manifest?t=${DateUtil.now()}`
obj.version = ManifestConfig.version
obj.assets = {}
obj.searchPaths = []
return JSON.stringify(obj)
}
}