Skip to content

Commit 02e5093

Browse files
committed
Add support for Mists of Pandaria Classic
1 parent b89b835 commit 02e5093

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

release.sh

+26-10
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ if [[ ${BASH_VERSINFO[0]} -lt 4 ]] || [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VER
7575
fi
7676

7777
# Game versions for uploading
78-
declare -A game_flavor=( ["retail"]="retail" ["classic"]="classic" ["bcc"]="bcc" ["mainline"]="retail" ["tbc"]="bcc" ["vanilla"]="classic" ["wrath"]="wrath" ["wotlkc"]="wrath" ["cata"]="cata" )
78+
declare -A game_flavor=( ["retail"]="retail" ["classic"]="classic" ["bcc"]="bcc" ["mainline"]="retail" ["tbc"]="bcc" ["vanilla"]="classic" ["wrath"]="wrath" ["wotlkc"]="wrath" ["cata"]="cata" ["mists"]="mists" )
7979

8080
declare -A game_type_version=() # type -> version (: delim)
8181
declare -A game_type_interface=() # type -> toc (: delim)
@@ -123,7 +123,8 @@ filename_filter() {
123123
[[ "$game_type" != "classic" || "${si_project_version,,}" != *"-classic"* ]] &&\
124124
[[ "$game_type" != "bcc" || "${si_project_version,,}" != *"-bcc"* ]] &&\
125125
[[ "$game_type" != "wrath" || "${si_project_version,,}" != *"-wrath"* ]] &&\
126-
[[ "$game_type" != "cata" || "${si_project_version,,}" != *"-cata"* ]]
126+
[[ "$game_type" != "cata" || "${si_project_version,,}" != *"-cata"* ]] &&\
127+
[[ "$game_type" != "mists" || "${si_project_version,,}" != *"-mists"* ]]
127128
then
128129
# only append the game type if the tag doesn't include it
129130
classic="-$game_type"
@@ -175,6 +176,7 @@ toc_to_type() {
175176
20???) game_type="bcc" ;;
176177
30???) game_type="wrath" ;;
177178
40???) game_type="cata" ;;
179+
50???) game_type="mists" ;;
178180
*) game_type="retail"
179181
esac
180182
# return game_type
@@ -249,7 +251,7 @@ while getopts ":celLzusSop:dw:a:r:t:g:m:n:" opt; do
249251
g) # Set the game type or version
250252
OPTARG="${OPTARG,,}"
251253
case "$OPTARG" in
252-
retail|classic|bcc|wrath|cata) game_type="$OPTARG" ;; # game_version from toc
254+
retail|classic|bcc|wrath|cata|mists) game_type="$OPTARG" ;; # game_version from toc
253255
mainline) game_type="retail" ;;
254256
*)
255257
# Set game version (x.y.z)
@@ -269,6 +271,8 @@ while getopts ":celLzusSop:dw:a:r:t:g:m:n:" opt; do
269271
game_type="wrath"
270272
elif [[ ${BASH_REMATCH[1]} == "4" ]]; then
271273
game_type="cata"
274+
elif [[ ${BASH_REMATCH[1]} == "5" ]]; then
275+
game_type="mists"
272276
else
273277
game_type="retail"
274278
fi
@@ -1154,7 +1158,7 @@ set_info_toc_interface() {
11541158
si_game_root_interface="$toc_version"
11551159
fi
11561160

1157-
if [[ ${toc_name} =~ "$package_name"[-_](Mainline|Classic|Vanilla|BCC|TBC|Wrath|WOTLKC|Cata)\.toc$ ]]; then
1161+
if [[ ${toc_name} =~ "$package_name"[-_](Mainline|Classic|Vanilla|BCC|TBC|Wrath|WOTLKC|Cata|Mists)\.toc$ ]]; then
11581162
# Flavored, just validate the version
11591163
if [[ -z $toc_version ]]; then
11601164
echo "$toc_name is missing an interface version." >&2
@@ -1217,6 +1221,7 @@ set_info_toc_interface() {
12171221
bcc) game_type_toc_prefix="20" ;;
12181222
wrath) game_type_toc_prefix="30" ;;
12191223
cata) game_type_toc_prefix="40" ;;
1224+
mists) game_type_toc_prefix="50" ;;
12201225
*) game_type_toc_prefix=
12211226
esac
12221227
if [[ -n $game_type_toc_prefix ]]; then
@@ -1323,14 +1328,14 @@ if [[ -z "$package" ]]; then
13231328
exit 1
13241329
fi
13251330
package=${package%.toc}
1326-
if [[ $package =~ ^(.*)([-_](Mainline|Classic|Vanilla|BCC|TBC|Wrath|WOTLKC|Cata))$ ]]; then
1331+
if [[ $package =~ ^(.*)([-_](Mainline|Classic|Vanilla|BCC|TBC|Wrath|WOTLKC|Cata|Mists))$ ]]; then
13271332
echo "Ambiguous addon name. No fallback TOC file or addon name includes an expansion suffix (${BASH_REMATCH[2]}). Set 'package-as' in .pkgmeta" >&2
13281333
exit 1
13291334
fi
13301335
fi
13311336

13321337
# Parse the project root TOC files for info first
1333-
for toc_path in "$topdir/$package"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC,-Wrath,_Wrath,-WOTLKC,_WOTLKC,-Cata,_Cata}.toc; do
1338+
for toc_path in "$topdir/$package"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC,-Wrath,_Wrath,-WOTLKC,_WOTLKC,-Cata,_Cata,-Mists,_Mists}.toc; do
13341339
if [[ -f "$toc_path" ]]; then
13351340
set_toc_project_info "$toc_path"
13361341
toc_paths+=("$toc_path")
@@ -1340,7 +1345,7 @@ done
13401345
# Try parsing the project addon in move-folders for info next
13411346
for path in "${!toc_root_paths[@]}"; do
13421347
if [[ ${toc_root_paths[$path]} == "$package" && $path != "$topdir" ]]; then
1343-
for toc_path in "$path/$package"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC,-Wrath,_Wrath,-WOTLKC,_WOTLKC,-Cata,_Cata}.toc; do
1348+
for toc_path in "$path/$package"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC,-Wrath,_Wrath,-WOTLKC,_WOTLKC,-Cata,_Cata,-Mists,_Mists}.toc; do
13441349
if [[ -f "$toc_path" ]]; then
13451350
set_toc_project_info "$toc_path"
13461351
fi
@@ -1350,7 +1355,7 @@ done
13501355

13511356
# Parse project TOC files
13521357
for path in "${!toc_root_paths[@]}"; do
1353-
for toc_path in "$path/${toc_root_paths[$path]}"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC,-Wrath,_Wrath,-WOTLKC,_WOTLKC,-Cata,_Cata}.toc; do
1358+
for toc_path in "$path/${toc_root_paths[$path]}"{,-Mainline,_Mainline,-Classic,_Classic,-Vanilla,_Vanilla,-BCC,_BCC,-TBC,_TBC,-Wrath,_Wrath,-WOTLKC,_WOTLKC,-Cata,_Cata,-Mists,_Mists}.toc; do
13541359
if [[ -f "$toc_path" ]]; then
13551360
set_toc_project_info "$toc_path"
13561361
set_info_toc_interface "$toc_path" "${toc_root_paths[$path]}"
@@ -1824,6 +1829,7 @@ copy_directory_tree() {
18241829
[[ $_cdt_file_gametype != "bcc" ]] && _cdt_filters+="|lua_filter version-bcc"
18251830
[[ $_cdt_file_gametype != "wrath" ]] && _cdt_filters+="|lua_filter version-wrath"
18261831
[[ $_cdt_file_gametype != "cata" ]] && _cdt_filters+="|lua_filter version-cata"
1832+
[[ $_cdt_file_gametype != "mists" ]] && _cdt_filters+="|lua_filter version-mists"
18271833
fi
18281834
[[ -n $_cdt_localization ]] && grep -q "@localization" "$_cdt_source_file" && _cdt_filters+="|localization_filter"
18291835
;;
@@ -1838,6 +1844,7 @@ copy_directory_tree() {
18381844
[[ $_cdt_file_gametype != "bcc" ]] && _cdt_filters+="|xml_filter version-bcc"
18391845
[[ $_cdt_file_gametype != "wrath" ]] && _cdt_filters+="|xml_filter version-wrath"
18401846
[[ $_cdt_file_gametype != "cata" ]] && _cdt_filters+="|xml_filter version-cata"
1847+
[[ $_cdt_file_gametype != "mists" ]] && _cdt_filters+="|xml_filter version-mists"
18411848
fi
18421849
;;
18431850
*.toc)
@@ -1863,6 +1870,7 @@ copy_directory_tree() {
18631870
_cdt_filters+="|toc_filter version-bcc $([[ "$_cdt_file_gametype" != "bcc" ]] && echo "true")"
18641871
_cdt_filters+="|toc_filter version-wrath $([[ "$_cdt_file_gametype" != "wrath" ]] && echo "true")"
18651872
_cdt_filters+="|toc_filter version-cata $([[ "$_cdt_file_gametype" != "cata" ]] && echo "true")"
1873+
_cdt_filters+="|toc_filter version-mists $([[ "$_cdt_file_gametype" != "mists" ]] && echo "true")"
18661874
fi
18671875
# Rewrite the interface line if necessary
18681876
_cdt_filters+="|toc_interface_filter '${si_game_type_interface_all[${_cdt_file_gametype:- }]}' '${toc_root_interface["$_cdt_source_file"]}'"
@@ -1881,10 +1889,10 @@ copy_directory_tree() {
18811889
echo " Copying: $file${_cdt_external_slug:+ (embedded: "$_cdt_external_slug")}"
18821890

18831891
# Make sure we're not causing any surprises
1884-
if [[ -z $_cdt_file_gametype && ( $file == *".lua" || $file == *".xml" || ( -z $_cdt_external && $file == *".toc" ) ) ]] && grep -q '@\(non-\)\?version-\(retail\|classic\|vanilla\|bcc\|wrath\|cata\)@' "$_cdt_source_file"; then
1892+
if [[ -z $_cdt_file_gametype && ( $file == *".lua" || $file == *".xml" || ( -z $_cdt_external && $file == *".toc" ) ) ]] && grep -q '@\(non-\)\?version-\(retail\|classic\|vanilla\|bcc\|wrath\|cata\|mists\)@' "$_cdt_source_file"; then
18851893
echo " Error! Build type version keywords are not allowed in a multi-version build." >&2
18861894
echo " These should be replaced with lua conditional statements:" >&2
1887-
grep -n '@\(non-\)\?version-\(retail\|classic\|vanilla\|bcc\|wrath\|cata\)@' "$_cdt_source_file" | sed 's/^/ /' >&2
1895+
grep -n '@\(non-\)\?version-\(retail\|classic\|vanilla\|bcc\|wrath\|cata\|mists\)@' "$_cdt_source_file" | sed 's/^/ /' >&2
18881896
echo " See https://wowpedia.fandom.com/wiki/WOW_PROJECT_ID" >&2
18891897
exit 1
18901898
fi
@@ -1905,6 +1913,7 @@ copy_directory_tree() {
19051913
bcc) new_file+="_TBC.toc" ;;
19061914
wrath) new_file+="_Wrath.toc" ;;
19071915
cata) new_file+="_Cata.toc" ;;
1916+
mists) new_file+="_Mists.toc" ;;
19081917
esac
19091918

19101919
echo " Creating $new_file [${toc_version//:/, }]"
@@ -1921,6 +1930,7 @@ copy_directory_tree() {
19211930
_cdt_filters+="|toc_filter version-bcc $([[ "$type" != "bcc" ]] && echo "true")"
19221931
_cdt_filters+="|toc_filter version-wrath $([[ "$type" != "wrath" ]] && echo "true")"
19231932
_cdt_filters+="|toc_filter version-cata $([[ "$type" != "cata" ]] && echo "true")"
1933+
_cdt_filters+="|toc_filter version-mists $([[ "$type" != "mists" ]] && echo "true")"
19241934
_cdt_filters+="|toc_interface_filter '$toc_version' '$root_toc_version'"
19251935
_cdt_filters+="|line_ending_filter"
19261936

@@ -2742,6 +2752,7 @@ upload_curseforge() {
27422752
bcc) game_id=73246 ;;
27432753
wrath) game_id=73713 ;;
27442754
cata) game_id=77522 ;;
2755+
mists) game_id=79434 ;;
27452756
*) game_id=517
27462757
esac
27472758
IFS=':' read -ra V <<< "${game_type_version[$type]}"
@@ -2860,6 +2871,7 @@ upload_wowinterface() {
28602871
bcc) wowi_type="TBC-Classic" ;;
28612872
wrath) wowi_type="WOTLK-Classic" ;;
28622873
cata) wowi_type="Cata-Classic" ;;
2874+
mists) wowi_type="MOP-Classic" ;; # XXX nyi
28632875
*) wowi_type="Retail"
28642876
esac
28652877
IFS=':' read -ra V <<< "${game_type_version[$type]}"
@@ -2870,6 +2882,9 @@ upload_wowinterface() {
28702882
# use the next highest version (try to avoid testing versions)
28712883
version=$( echo "$_wowi_versions" | jq -r --arg v "$invalid_version" --arg t "$wowi_type" 'map(select(.game == $t and .id < $v)) | max_by(.id) | .id // empty' )
28722884
if [[ -z $version ]]; then
2885+
if [[ $wowi_type == "MOP-Classic" ]]; then # XXX compat: not supported yet or I guessed the wrong name
2886+
wowi_type="Cata-Classic"
2887+
fi
28732888
# just grab the highest version
28742889
version=$( echo "$_wowi_versions" | jq -r --arg t "$wowi_type" 'map(select(.game == $t)) | max_by(.id) | .id // empty' )
28752890
fi
@@ -2970,6 +2985,7 @@ upload_wago() {
29702985
case $type in
29712986
bcc) wago_type="bc" ;;
29722987
wrath) wago_type="wotlk" ;;
2988+
mists) wago_type="mop" ;;
29732989
*) wago_type="$type"
29742990
esac
29752991
wago_game_type_version=

0 commit comments

Comments
 (0)