-
Notifications
You must be signed in to change notification settings - Fork 2
/
ManifestDB.php
104 lines (89 loc) · 3.22 KB
/
ManifestDB.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
namespace towa0131\deresute;
use towa0131\deresute\Cryptographer;
class ManifestDB
{
public const HTTP_SCHEME = "http://";
public const RESOURCE_SERVER_OLD = "storage.game.starlight-stage.jp/";
public const RESOURCE_SERVER = "asset-starlight-stage.akamaized.net/";
public const DB_NAME = "manifest.db";
public const MANIFEST_TABLE = "manifests";
public const DL_ROOT = "dl/";
public const QUALITY_HIGH_DIR = "High/";
public const QUALITY_LOW_DIR = "Low/";
public const GENERIC_DIR = "Generic/";
public const BLOB_DIR = "Blob/";
public const MASTER_DIR = "Master/";
public const COMMON_SOUND_DIR = "Common/";
public const RESOURCES_DIR = "resources/";
public const ASSETS_DIR = "AssetBundles/";
public const SOUND_DIR = "Sound/";
public const MOVIE_DIR = "Movie/";
public const MANIFESTS_DIR = "manifests/";
public const PLATFORM_ANDROID_DIR = "Android/";
public const PLATFORM_IOS_DIR = "iOS/";
public const PLATFORM_STANDALONE_DIR = "Standalone/";
public const SOUND_SINGLE = 0;
public const SOUND_BGM = 1;
public const SOUND_LIVE = 2;
public const SOUND_STORY = 3;
public const SOUND_ROOM = 4;
public const SOUND_VOICE = 5;
public const SOUND_SE = 6;
public static function getAssetBundleDirectory(): string
{
return self::getResourceServerURL() . self::DL_ROOT . self::RESOURCES_DIR . self::ASSETS_DIR;
}
public static function getManifestsDirectory(string $resVer): string
{
return self::getResourceServerURL() . self::DL_ROOT . $resVer . "/" . self::MANIFESTS_DIR;
}
public static function getSoundDirectory(): string
{
return self::getResourceServerURL() . self::DL_ROOT . self::RESOURCES_DIR . self::SOUND_DIR;
}
public static function getMovieDirectory(string $resVer): string
{
return self::getResourceServerURL() . self::DL_ROOT . $resVer . "/" . self::MOVIE_DIR . self::getPlatformDirectory();
}
public static function getBlobDBDirectory(): string
{
return self::getResourceServerURL(). self::DL_ROOT . self::RESOURCES_DIR . self::GENERIC_DIR;
}
public static function getMasterDBDirectory(): string
{
return self::getResourceServerURL(). self::DL_ROOT . self::RESOURCES_DIR . self::GENERIC_DIR;
}
public static function getScheme(): string
{
return self::HTTP_SCHEME;
}
public static function getResourceServerURL(): string
{
return self::getScheme() . self::RESOURCE_SERVER;
}
public static function getQualityDirectory(int $type = 0): string
{
switch ($type) {
case 0:
return self::QUALITY_HIGH_DIR;
case 1:
return self::QUALITY_LOW_DIR;
default:
return self::QUALITY_HIGH_DIR;
}
}
public static function getPlatformDirectory(int $type = 0): string
{
switch ($type) {
case 0:
return self::PLATFORM_ANDROID_DIR;
case 1:
return self::PLATFORM_IOS_DIR;
case 2:
return self::PLATFORM_STANDALONE_DIR;
default:
return self::PLATFORM_ANDROID_DIR;
}
}
}