Move to base64 encoded data

This commit is contained in:
DitFranXX 2020-12-22 17:55:12 +09:00
parent df715e7ad2
commit 3bd785b0ea
10 changed files with 74 additions and 2752 deletions

View File

@ -1,3 +1,3 @@
*.json
!forte_mdb.json
forte_mdb.xml
*.json
*.xml

View File

@ -1,5 +1,12 @@
import { CommonMusicDataField, readB64JSON, readXML } from "./helper";
export async function processData() {
return await readJSONOrXML("data/forte_mdb.json", "data/forte_mdb.xml")
if (IO.Exists("data/forte_mdb.json.b64")) {
return await readB64JSON("data/forte_mdb.json.b64");
}
const data = await readJSONOrXML("data/forte_mdb.json", "data/forte_mdb.xml")
// await IO.WriteFile("data/forte_mdb.json.b64", Buffer.from(JSON.stringify(data)).toString("base64"))
return data
}
export async function processMdbData(path: string): Promise<CommonMusicData> {
@ -43,32 +50,16 @@ export async function processMdbData(path: string): Promise<CommonMusicData> {
});
}
export interface CommonMusicDataField {
basename: KITEM<"str">;
title: KITEM<"str">;
title_kana: KITEM<"str">;
artist: KITEM<"str">;
artist_kana: KITEM<"str">
priority: KITEM<"s8">;
category_flag: KARRAY<"s32">;
primary_category: KITEM<"s8">;
level_normal: KITEM<"s8">;
level_hard: KITEM<"s8">;
level_extreme: KITEM<"s8">;
demo_popular: KITEM<"bool">;
demo_bemani: KITEM<"bool">
destination_j: KITEM<"bool">;
destination_a: KITEM<"bool">;
destination_y: KITEM<"bool">;
destination_k: KITEM<"bool">;
unlock_type: KITEM<"s8">;
offline: KITEM<"bool">;
volume_bgm: KITEM<"s8">;
volume_key: KITEM<"s8">;
start_date: KITEM<"str">;
end_date: KITEM<"str">;
description: KITEM<"str">;
export async function readJSONOrXML(jsonPath: string, xmlPath: string): Promise<CommonMusicData> {
if (!IO.Exists(jsonPath)) {
const data = await processMdbData(xmlPath)
await IO.WriteFile(jsonPath, JSON.stringify(data))
await IO.WriteFile(jsonPath.replace(".json", ".json.b64"), Buffer.from((JSON.stringify(data))).toString('base64'));
return data
} else {
const json = JSON.parse(await IO.ReadFile(jsonPath, 'utf-8'))
return json
}
}
interface CommonMusicData {
@ -77,28 +68,4 @@ interface CommonMusicData {
release_code: string
}
music_spec: CommonMusicDataField[]
}
export async function readXML(path: string) {
const xml = await IO.ReadFile(path, 'utf-8');
const json = U.parseXML(xml, false)
return json
}
export async function readJSON(path: string) {
const str = await IO.ReadFile(path, 'utf-8');
const json = JSON.parse(str)
return json
}
export async function readJSONOrXML(jsonPath: string, xmlPath: string): Promise<CommonMusicData> {
if (!IO.Exists(jsonPath)) {
const data = await processMdbData(xmlPath)
await IO.WriteFile(jsonPath, JSON.stringify(data))
return data
} else {
const json = JSON.parse(await IO.ReadFile(jsonPath, 'utf-8'))
return json
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,699 +0,0 @@
<?xml version="1.0" encoding="shift_jis"?>
<course_data_list release_code="2019022700">
<course_data index="1">
<name __type="str">ベーシック10級検定</name>
<priority __type="s32">40</priority>
<req_nos __type="s32">1000</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">80000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">140</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">850000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">225</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">1725000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">170</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">2625000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="2">
<name __type="str">ベーシック9級検定</name>
<priority __type="s32">39</priority>
<req_nos __type="s32">1500</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">120000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">199</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">875000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">209</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">1775000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">212</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">2700000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="3">
<name __type="str">ベーシック8級検定</name>
<priority __type="s32">38</priority>
<req_nos __type="s32">2000</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">200000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">220</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">900000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">232</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">1825000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">82</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">2775000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="4">
<name __type="str">ベーシック7級検定</name>
<priority __type="s32">37</priority>
<req_nos __type="s32">2500</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">300000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">186</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">925000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">141</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">1875000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">32</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">2850000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="5">
<name __type="str">ベーシック6級検定</name>
<priority __type="s32">36</priority>
<req_nos __type="s32">3000</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">400000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">36</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">925000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">87</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">1875000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">242</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">2850000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="6">
<name __type="str">ベーシック5級検定</name>
<priority __type="s32">35</priority>
<req_nos __type="s32">3500</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">450000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">122</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">925000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">40</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">1875000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">85</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">2850000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="7">
<name __type="str">ベーシック4級検定</name>
<priority __type="s32">34</priority>
<req_nos __type="s32">4000</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">500000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">7</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">925000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">28</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">1875000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">49</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">2850000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2020-01-21 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="8">
<name __type="str">ベーシック3級検定</name>
<priority __type="s32">33</priority>
<req_nos __type="s32">4500</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">525000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">8</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">925000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">29</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">1875000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">50</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">2850000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2020-01-21 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="9">
<name __type="str">ベーシック2級検定</name>
<priority __type="s32">32</priority>
<req_nos __type="s32">5000</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">540000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">9</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">925000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">30</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">1875000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">51</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">2850000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2020-01-21 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="10">
<name __type="str">ベーシック1級検定</name>
<priority __type="s32">31</priority>
<req_nos __type="s32">6000</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">550000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">10</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">925000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">31</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">1875000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">52</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">2850000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2020-01-21 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="11">
<name __type="str">リサイタル10級検定</name>
<priority __type="s32">30</priority>
<req_nos __type="s32">1000</req_nos>
<mode_type __type="s32">2</mode_type>
<req_grade __type="s32">80000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">7</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">34000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">238</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">72000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">227</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">114000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="12">
<name __type="str">リサイタル9級検定</name>
<priority __type="s32">29</priority>
<req_nos __type="s32">1500</req_nos>
<mode_type __type="s32">2</mode_type>
<req_grade __type="s32">120000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">19</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">36000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">220</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">76000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">214</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">120000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="13">
<name __type="str">リサイタル8級検定</name>
<priority __type="s32">28</priority>
<req_nos __type="s32">2000</req_nos>
<mode_type __type="s32">2</mode_type>
<req_grade __type="s32">200000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">8</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">38000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">63</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">80000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">86</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">126000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="14">
<name __type="str">リサイタル7級検定</name>
<priority __type="s32">27</priority>
<req_nos __type="s32">2500</req_nos>
<mode_type __type="s32">2</mode_type>
<req_grade __type="s32">300000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">72</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">40000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">71</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">84000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">70</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">132000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="15">
<name __type="str">リサイタル6級検定</name>
<priority __type="s32">26</priority>
<req_nos __type="s32">3000</req_nos>
<mode_type __type="s32">2</mode_type>
<req_grade __type="s32">400000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">105</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">40000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">101</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">84000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">186</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">132000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="16">
<name __type="str">リサイタル5級検定</name>
<priority __type="s32">25</priority>
<req_nos __type="s32">3500</req_nos>
<mode_type __type="s32">2</mode_type>
<req_grade __type="s32">450000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">26</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">40000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">160</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">84000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">133</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">132000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2019-01-01 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="17">
<name __type="str">リサイタル4級検定</name>
<priority __type="s32">24</priority>
<req_nos __type="s32">4000</req_nos>
<mode_type __type="s32">2</mode_type>
<req_grade __type="s32">500000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">17</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">40000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">38</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">84000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">59</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">132000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2020-01-21 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="18">
<name __type="str">リサイタル3級検定</name>
<priority __type="s32">23</priority>
<req_nos __type="s32">4500</req_nos>
<mode_type __type="s32">2</mode_type>
<req_grade __type="s32">525000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">18</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">40000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">39</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">84000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">60</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">132000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2020-01-21 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="19">
<name __type="str">リサイタル2級検定</name>
<priority __type="s32">22</priority>
<req_nos __type="s32">5000</req_nos>
<mode_type __type="s32">2</mode_type>
<req_grade __type="s32">540000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">19</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">40000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">40</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">84000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">61</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">132000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2020-01-21 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="20">
<name __type="str">リサイタル1級検定</name>
<priority __type="s32">21</priority>
<req_nos __type="s32">6000</req_nos>
<mode_type __type="s32">2</mode_type>
<req_grade __type="s32">550000</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">20</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">40000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">41</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">84000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">62</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">132000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">0</unlock_music>
<unlock_item_list />
<start_date __type="str">2020-01-21 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="21">
<name __type="str">KACスペシャル検定(Normal)</name>
<priority __type="s32">60</priority>
<req_nos __type="s32">2000</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">0</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">261</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">900000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">262</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">1800000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">263</index>
<difficulty __type="s32">0</difficulty>
<clear_point __type="s32">2750000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">263</unlock_music>
<unlock_item_list>
<unlock_item unlock_item_no="0">
<type __type="s32">1</type>
<index __type="s32">263</index>
<unlock_condition __type="s32">2</unlock_condition>
</unlock_item>
</unlock_item_list>
<start_date __type="str">2019-02-28 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="22">
<name __type="str">KACスペシャル検定(Hard)</name>
<priority __type="s32">59</priority>
<req_nos __type="s32">2000</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">0</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">261</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">925000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">262</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">1875000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">263</index>
<difficulty __type="s32">1</difficulty>
<clear_point __type="s32">2850000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">263</unlock_music>
<unlock_item_list>
<unlock_item unlock_item_no="0">
<type __type="s32">1</type>
<index __type="s32">263</index>
<unlock_condition __type="s32">2</unlock_condition>
</unlock_item>
</unlock_item_list>
<start_date __type="str">2019-02-28 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="23">
<name __type="str">KACスペシャル検定(Expert)</name>
<priority __type="s32">58</priority>
<req_nos __type="s32">2000</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">0</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">261</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">925000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">262</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">1875000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">263</index>
<difficulty __type="s32">2</difficulty>
<clear_point __type="s32">2850000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">263</unlock_music>
<unlock_item_list>
<unlock_item unlock_item_no="0">
<type __type="s32">1</type>
<index __type="s32">263</index>
<unlock_condition __type="s32">2</unlock_condition>
</unlock_item>
</unlock_item_list>
<start_date __type="str">2019-02-28 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
<course_data index="24">
<name __type="str">KACスペシャル検定(Real)</name>
<priority __type="s32">57</priority>
<req_nos __type="s32">2000</req_nos>
<mode_type __type="s32">1</mode_type>
<req_grade __type="s32">0</req_grade>
<seq_list>
<tune tune_no="0">
<index __type="s32">261</index>
<difficulty __type="s32">3</difficulty>
<clear_point __type="s32">925000</clear_point>
</tune>
<tune tune_no="1">
<index __type="s32">262</index>
<difficulty __type="s32">3</difficulty>
<clear_point __type="s32">1875000</clear_point>
</tune>
<tune tune_no="2">
<index __type="s32">263</index>
<difficulty __type="s32">3</difficulty>
<clear_point __type="s32">2850000</clear_point>
</tune>
</seq_list>
<unlock_music __type="s32">263</unlock_music>
<unlock_item_list>
<unlock_item unlock_item_no="0">
<type __type="s32">1</type>
<index __type="s32">263</index>
<unlock_condition __type="s32">2</unlock_condition>
</unlock_item>
</unlock_item_list>
<start_date __type="str">2019-02-28 10:00</start_date>
<end_date __type="str">9999-01-01 00:00</end_date>
</course_data>
</course_data_list>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,43 @@
export interface CommonMusicDataField {
basename: KITEM<"str">;
title: KITEM<"str">;
title_kana: KITEM<"str">;
artist: KITEM<"str">;
artist_kana: KITEM<"str">
priority: KITEM<"s8">;
category_flag: KARRAY<"s32">;
primary_category: KITEM<"s8">;
level_normal: KITEM<"s8">;
level_hard: KITEM<"s8">;
level_extreme: KITEM<"s8">;
demo_popular: KITEM<"bool">;
demo_bemani: KITEM<"bool">
destination_j: KITEM<"bool">;
destination_a: KITEM<"bool">;
destination_y: KITEM<"bool">;
destination_k: KITEM<"bool">;
unlock_type: KITEM<"s8">;
offline: KITEM<"bool">;
volume_bgm: KITEM<"s8">;
volume_key: KITEM<"s8">;
start_date: KITEM<"str">;
end_date: KITEM<"str">;
description: KITEM<"str">;
}
export async function readXML(path: string) {
const xml = await IO.ReadFile(path, 'utf-8');
const json = U.parseXML(xml, false)
return json
}
export async function readJSON(path: string) {
const str = await IO.ReadFile(path, 'utf-8');
const json = JSON.parse(str)
return json
}
export async function readB64JSON(b64path: string) {
const buff = await IO.ReadFile(b64path, 'utf-8');
return JSON.parse(Buffer.from(buff, 'base64').toString('utf-8'));
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
import * as path from "path";
import { processData } from "../data/ForteMusic";
import { readB64JSON } from "../data/helper";
export const permitted_list = {
flag: [
@ -19,9 +20,13 @@ export const forte_permitted_list = {
}
async function ReadData(filename: string) {
const xml = await IO.ReadFile(`data/${filename}.xml`, { encoding: 'utf-8' });
const json = U.parseXML(xml, false)
return json
if (!IO.Exists(`data/${filename}.xml`)) {
const xml = await IO.ReadFile(`data/${filename}.xml`, 'utf-8');
const json = U.parseXML(xml, false)
// await IO.WriteFile(`data/${filename}.json.b64`, Buffer.from(JSON.stringify(json)).toString('base64'));
return json
}
return readB64JSON(`data/${filename}.json.b64`)
}
async function processIslandData() {