diff --git a/jubeat@asphyxia/README.md b/jubeat@asphyxia/README.md index 418a4a3..3954e0e 100644 --- a/jubeat@asphyxia/README.md +++ b/jubeat@asphyxia/README.md @@ -1,43 +1,18 @@ -# Jubeat +# jubeat -Plugin Version: **v1.5.0** +Plugin Version: **v1.0.0** -### Supported Versions +--- -*** +**jubeat** is music simulation game. +Touch the panel on a screen at the right timing and rhythm to the music. -- knit -- knit APPEND -- copious -- copious APPEND -- saucer -- saucer fulfill +## Supported Versions -### Changelogs +- ripples -*** +## Changelog -#### 1.5.0 - -- saucer fulfill support - -#### 1.4.1 - -- saucer support -- Change profile structure - -#### 1.3.0 - -- Matching Support (Experimental) - -#### 1.2.0 - -- copious (APPEND) support - -#### 1.1.0 - -- Fix profile structure - -#### 1.0.0 +### 1.0.0 - Initial Release diff --git a/jubeat@asphyxia/data/fulfill_courses.json b/jubeat@asphyxia/data/fulfill_courses.json deleted file mode 100644 index 49a810b..0000000 --- a/jubeat@asphyxia/data/fulfill_courses.json +++ /dev/null @@ -1,1624 +0,0 @@ -{ - "courses": [ - { - "course_id": 1, - "course_name": "溢れ出した記憶、特別なあなたにありがとう。", - "course_level": 1, - "norma": { - "norma_id": [ - 1, - 2, - 0 - ], - "bronze": [ - 850000, - 0, - 0 - ], - "silver": [ - 900000, - 1, - 0 - ], - "gold": [ - 950000, - 2, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000241, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 10000052, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 30000042, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000085, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000144, - "seq_id": 2 - } - ] - }, - { - "course_id": 2, - "course_name": "コースモードが怖い?ばっかお前TAGがついてるだろ", - "course_level": 1, - "norma": { - "norma_id": [ - 1, - 2, - 0 - ], - "bronze": [ - 800000, - 0, - 0 - ], - "silver": [ - 850000, - 1, - 0 - ], - "gold": [ - 900000, - 2, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000121, - "seq_id": 1 - }, - { - "index": 1, - "music_id": 30000122, - "seq_id": 1 - }, - { - "index": 2, - "music_id": 40000159, - "seq_id": 1 - }, - { - "index": 3, - "music_id": 50000089, - "seq_id": 1 - }, - { - "index": 4, - "music_id": 40000051, - "seq_id": 2 - } - ] - }, - { - "course_id": 3, - "course_name": "満月の鐘踊り響くは虚空から成る恋の歌", - "course_level": 2, - "norma": { - "norma_id": [ - 1, - 2, - 0 - ], - "bronze": [ - 850000, - 1, - 0 - ], - "silver": [ - 900000, - 2, - 0 - ], - "gold": [ - 950000, - 3, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 40000121, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000188, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 30000047, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000237, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000176, - "seq_id": 2 - } - ] - }, - { - "course_id": 4, - "course_name": "スミスゼミナール 夏の陣開講記念 基本編", - "course_level": 2, - "norma": { - "norma_id": [ - 3, - 2, - 0 - ], - "bronze": [ - 85, - 1, - 0 - ], - "silver": [ - 90, - 2, - 0 - ], - "gold": [ - 95, - 3, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000267, - "seq_id": 1 - }, - { - "index": 1, - "music_id": 50000233, - "seq_id": 1 - }, - { - "index": 2, - "music_id": 50000228, - "seq_id": 1 - }, - { - "index": 3, - "music_id": 50000268, - "seq_id": 1 - }, - { - "index": 4, - "music_id": 50000291, - "seq_id": 1 - } - ] - }, - { - "course_id": 5, - "course_name": "HARDモードじゃないから、絶対、大丈夫だよっ!", - "course_level": 2, - "norma": { - "norma_id": [ - 1, - 2, - 0 - ], - "bronze": [ - 850000, - 0, - 0 - ], - "silver": [ - 900000, - 1, - 0 - ], - "gold": [ - 950000, - 3, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000144, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000188, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000070, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000151, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000152, - "seq_id": 2 - } - ] - }, - { - "course_id": 6, - "course_name": "星明かりの下、愛という名の日替わりランチを君と", - "course_level": 3, - "norma": { - "norma_id": [ - 3, - 0, - 0 - ], - "bronze": [ - 70, - 0, - 0 - ], - "silver": [ - 80, - 0, - 0 - ], - "gold": [ - 90, - 0, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000196, - "seq_id": 1 - }, - { - "index": 1, - "music_id": 50000151, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000060, - "seq_id": 1 - }, - { - "index": 3, - "music_id": 40000048, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 10000051, - "seq_id": 2 - } - ] - }, - { - "course_id": 7, - "course_name": "輝く北極星と幸せなヒーロー", - "course_level": 4, - "norma": { - "norma_id": [ - 1, - 2, - 0 - ], - "bronze": [ - 900000, - 1, - 0 - ], - "silver": [ - 950000, - 2, - 0 - ], - "gold": [ - 980000, - 3, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000079, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 20000044, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000109, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 10000043, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 10000042, - "seq_id": 2 - } - ] - }, - { - "course_id": 8, - "course_name": "花-鳥-藻-夏", - "course_level": 4, - "norma": { - "norma_id": [ - 3, - 0, - 0 - ], - "bronze": [ - 70, - 0, - 0 - ], - "silver": [ - 80, - 0, - 0 - ], - "gold": [ - 90, - 0, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 10000068, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 40000154, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000123, - "seq_id": 1 - }, - { - "index": 3, - "music_id": 40000051, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 30000045, - "seq_id": 2 - } - ] - }, - { - "course_id": 9, - "course_name": "TAG生誕祭2014 俺の記録を抜いてみろ!", - "course_level": 4, - "norma": { - "norma_id": [ - 1, - 2, - 0 - ], - "bronze": [ - 900000, - 0, - 0 - ], - "silver": [ - 950000, - 0, - 0 - ], - "gold": [ - 967252, - 1, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 30000122, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000086, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000121, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000196, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 40000051, - "seq_id": 2 - } - ] - }, - { - "course_id": 10, - "course_name": "さよなら、亡くした恋と蝶の舞うヒストリア", - "course_level": 5, - "norma": { - "norma_id": [ - 3, - 0, - 0 - ], - "bronze": [ - 80, - 0, - 0 - ], - "silver": [ - 85, - 0, - 0 - ], - "gold": [ - 90, - 0, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 20000041, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 30000044, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000037, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 20000124, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000033, - "seq_id": 2 - } - ] - }, - { - "course_id": 11, - "course_name": "きらきらほしふるまぼろしなぎさちゃん", - "course_level": 5, - "norma": { - "norma_id": [ - 4, - 1, - 0 - ], - "bronze": [ - 0, - 700000, - 0 - ], - "silver": [ - 0, - 800000, - 0 - ], - "gold": [ - 0, - 900000, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 30000050, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 30000049, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000235, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000157, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000038, - "seq_id": 2 - } - ] - }, - { - "course_id": 12, - "course_name": "The Memorial Third: 僕みたいに演奏してね", - "course_level": 5, - "norma": { - "norma_id": [ - 3, - 0, - 0 - ], - "bronze": [ - 75, - 0, - 0 - ], - "silver": [ - 80, - 0, - 0 - ], - "gold": [ - 85, - 0, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 10000037, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 20000048, - "seq_id": 1 - }, - { - "index": 2, - "music_id": 50000253, - "seq_id": 1 - }, - { - "index": 3, - "music_id": 20000121, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000133, - "seq_id": 2 - } - ] - }, - { - "course_id": 13, - "course_name": "Enjoy! 4thKAC ~Memories of saucer~", - "course_level": 5, - "norma": { - "norma_id": [ - 1, - 2, - 0 - ], - "bronze": [ - 900000, - 1, - 0 - ], - "silver": [ - 950000, - 2, - 0 - ], - "gold": [ - 980000, - 4, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000206, - "seq_id": 1 - }, - { - "index": 1, - "music_id": 50000023, - "seq_id": 1 - }, - { - "index": 2, - "music_id": 50000078, - "seq_id": 1 - }, - { - "index": 3, - "music_id": 50000203, - "seq_id": 1 - }, - { - "index": 4, - "music_id": 50000323, - "seq_id": 1 - } - ] - }, - { - "course_id": 14, - "course_name": "風に吹かれるキケンなシロクマダンス", - "course_level": 6, - "norma": { - "norma_id": [ - 1, - 2, - 0 - ], - "bronze": [ - 900000, - 1, - 0 - ], - "silver": [ - 950000, - 2, - 0 - ], - "gold": [ - 980000, - 3, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000059, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000197, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 30000037, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000182, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 20000038, - "seq_id": 2 - } - ] - }, - { - "course_id": 15, - "course_name": "君主は視線で友との愛を語るめう", - "course_level": 6, - "norma": { - "norma_id": [ - 3, - 0, - 0 - ], - "bronze": [ - 85, - 0, - 0 - ], - "silver": [ - 90, - 0, - 0 - ], - "gold": [ - 95, - 0, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 40000052, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000152, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000090, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 20000040, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000184, - "seq_id": 2 - } - ] - }, - { - "course_id": 16, - "course_name": "スミスゼミナール 夏の陣開講記念 応用編", - "course_level": 6, - "norma": { - "norma_id": [ - 4, - 1, - 0 - ], - "bronze": [ - 0, - 750000, - 0 - ], - "silver": [ - 0, - 850000, - 0 - ], - "gold": [ - 0, - 900000, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000233, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000267, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000268, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000228, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000291, - "seq_id": 2 - } - ] - }, - { - "course_id": 17, - "course_name": "天から降り注ぐ星はまるで甘いキャンディ", - "course_level": 7, - "norma": { - "norma_id": [ - 3, - 0, - 0 - ], - "bronze": [ - 85, - 0, - 0 - ], - "silver": [ - 90, - 0, - 0 - ], - "gold": [ - 95, - 0, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 20000044, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 30000050, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000080, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 40000126, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 10000067, - "seq_id": 2 - } - ] - }, - { - "course_id": 18, - "course_name": "てんとう虫が囁いている「Wow Wow…」", - "course_level": 7, - "norma": { - "norma_id": [ - 3, - 0, - 0 - ], - "bronze": [ - 85, - 0, - 0 - ], - "silver": [ - 90, - 0, - 0 - ], - "gold": [ - 95, - 0, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000132, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 40000128, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 10000036, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000119, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000030, - "seq_id": 2 - } - ] - }, - { - "course_id": 19, - "course_name": "HARDモードでも大丈夫だよ!絶対、大丈夫だよっ!", - "course_level": 7, - "norma": { - "norma_id": [ - 4, - 1, - 0 - ], - "bronze": [ - 0, - 850000, - 0 - ], - "silver": [ - 0, - 900000, - 0 - ], - "gold": [ - 0, - 950000, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000144, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000070, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000188, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000151, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000152, - "seq_id": 2 - } - ] - }, - { - "course_id": 20, - "course_name": "こんなHARDモード、滅べばいい…", - "course_level": 7, - "norma": { - "norma_id": [ - 4, - 1, - 0 - ], - "bronze": [ - 0, - 850000, - 0 - ], - "silver": [ - 0, - 900000, - 0 - ], - "gold": [ - 0, - 950000, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000294, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000295, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000234, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000245, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000282, - "seq_id": 2 - } - ] - }, - { - "course_id": 21, - "course_name": "Challenge! 4thKAC ~Memories of saucer~", - "course_level": 7, - "norma": { - "norma_id": [ - 1, - 0, - 0 - ], - "bronze": [ - 900000, - 0, - 0 - ], - "silver": [ - 950000, - 0, - 0 - ], - "gold": [ - 980000, - 0, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000206, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000023, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000078, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000203, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000323, - "seq_id": 2 - } - ] - }, - { - "course_id": 22, - "course_name": "サヨナラ・キングコング ~恋のつぼみは愛の虹へ~", - "course_level": 8, - "norma": { - "norma_id": [ - 4, - 1, - 0 - ], - "bronze": [ - 0, - 900000, - 0 - ], - "silver": [ - 0, - 950000, - 0 - ], - "gold": [ - 0, - 980000, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000148, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000101, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 10000064, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000171, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000070, - "seq_id": 2 - } - ] - }, - { - "course_id": 23, - "course_name": "風に舞う白鳥の翼と花弁、さながら万華鏡のよう", - "course_level": 8, - "norma": { - "norma_id": [ - 3, - 0, - 0 - ], - "bronze": [ - 90, - 0, - 0 - ], - "silver": [ - 95, - 0, - 0 - ], - "gold": [ - 98, - 0, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 30000036, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000122, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 10000062, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000199, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 40000153, - "seq_id": 2 - } - ] - }, - { - "course_id": 24, - "course_name": "The 小さなおぼろガチョウ♪", - "course_level": 8, - "norma": { - "norma_id": [ - 1, - 2, - 0 - ], - "bronze": [ - 970000, - 2, - 0 - ], - "silver": [ - 980000, - 3, - 0 - ], - "gold": [ - 990000, - 4, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000049, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000071, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 10000041, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000031, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 40000129, - "seq_id": 2 - } - ] - }, - { - "course_id": 25, - "course_name": "TAG生誕祭2014 俺の記録を抜いてみろ!~HARD編~", - "course_level": 8, - "norma": { - "norma_id": [ - 4, - 1, - 0 - ], - "bronze": [ - 0, - 800000, - 0 - ], - "silver": [ - 0, - 900000, - 0 - ], - "gold": [ - 0, - 931463, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000089, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000083, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000210, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000030, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 40000159, - "seq_id": 2 - } - ] - }, - { - "course_id": 26, - "course_name": "凍る世界で見る鳳凰の火の花", - "course_level": 9, - "norma": { - "norma_id": [ - 4, - 1, - 0 - ], - "bronze": [ - 0, - 920000, - 0 - ], - "silver": [ - 0, - 950000, - 0 - ], - "gold": [ - 0, - 980000, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 30000043, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 10000039, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 20000048, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000096, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 20000038, - "seq_id": 2 - } - ] - }, - { - "course_id": 27, - "course_name": "真実の桜が乱れしとき、キルト纏いし君は修羅となる", - "course_level": 9, - "norma": { - "norma_id": [ - 4, - 3, - 0 - ], - "bronze": [ - 0, - 80, - 0 - ], - "silver": [ - 0, - 85, - 0 - ], - "gold": [ - 0, - 90, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000113, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000184, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000177, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 30000124, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000078, - "seq_id": 2 - } - ] - }, - { - "course_id": 28, - "course_name": "THE FINAL01 ~雷光に月、乙女に花散る祝福を~", - "course_level": 10, - "norma": { - "norma_id": [ - 4, - 1, - 0 - ], - "bronze": [ - 0, - 920000, - 0 - ], - "silver": [ - 0, - 950000, - 0 - ], - "gold": [ - 0, - 980000, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 10000038, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 20000051, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 30000048, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 40000060, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000023, - "seq_id": 2 - } - ] - }, - { - "course_id": 29, - "course_name": "The Memorial Third: assimilated all into Nature", - "course_level": 10, - "norma": { - "norma_id": [ - 4, - 1, - 0 - ], - "bronze": [ - 0, - 920000, - 0 - ], - "silver": [ - 0, - 950000, - 0 - ], - "gold": [ - 0, - 980000, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000135, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000029, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 40000047, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 40000046, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000253, - "seq_id": 2 - } - ] - }, - { - "course_id": 30, - "course_name": "4thKAC ~Memories of saucer~", - "course_level": 10, - "norma": { - "norma_id": [ - 4, - 1, - 0 - ], - "bronze": [ - 0, - 920000, - 0 - ], - "silver": [ - 0, - 950000, - 0 - ], - "gold": [ - 0, - 980000, - 0 - ] - }, - "music_list": [ - { - "index": 0, - "music_id": 50000206, - "seq_id": 2 - }, - { - "index": 1, - "music_id": 50000023, - "seq_id": 2 - }, - { - "index": 2, - "music_id": 50000078, - "seq_id": 2 - }, - { - "index": 3, - "music_id": 50000203, - "seq_id": 2 - }, - { - "index": 4, - "music_id": 50000323, - "seq_id": 2 - } - ] - } - ] -} diff --git a/jubeat@asphyxia/handlers/common.ts b/jubeat@asphyxia/handlers/common.ts index c3a1a1d..0d941a9 100644 --- a/jubeat@asphyxia/handlers/common.ts +++ b/jubeat@asphyxia/handlers/common.ts @@ -1,52 +1,22 @@ -import {getVersion, VersionRange} from "../utils"; +import { getVersion } from '../utils'; -export const gameInfo: EPR = (info, data, send) => { - const locId = $(data).content("shop.locationid"); - const version = getVersion(info); - if (version === 0) return send.deny(); +export const shopRegist: EPR = (i, data, send) => { + const locId = $(data).content('shop.locationid'); + const cabId = $(data).number('shop.testmode.network.cabinet_id', 1); + const version = getVersion(i); + if (version <= 0) return send.deny(); return send.object({ data: { - ...info.module === "shopinfo" && { - cabid: K.ITEM("u32", _.random(1, 10)), - locationid: K.ITEM("str", locId), - ...VersionRange(version, 3, 6) && { is_send: K.ITEM("u8", 1) }, - tax_phase: K.ITEM("u8", 0), - facility: { - exist: K.ITEM("u32", 1) - } - }, + cabid: K.ITEM('u32', cabId), + locationid: K.ITEM('str', locId), - ...VersionRange(version, 5, 6) && { - white_music_list: K.ARRAY("s32", Array(32).fill(-1)) - } - } + ...(version >= 1 && version <= 3 && { is_send: K.ITEM('u8', 1) }), + }, }); }; export const demodata = { - getNews: (_, __, send) => send.object({ data: { officialnews: K.ATTR({ count: "0" }) } }), - getData: (_, data, send) => { - const newsId = $(data).number("officialnews.newsid"); - return send.object({ - data: { - officialnews: { - data: { - newsid: K.ITEM("s16", newsId), - image: K.ITEM("u8", 0, { size: "0" }) - } - } - } - }); - }, - getHitchart: (_, __, send) => send.object({ - data: { - hitchart: { - update: K.ITEM("str", ""), - - hitchart_lic: K.ATTR({ count: "0" }), - hitchart_org: K.ATTR({ count: "0" }), - } - } - }), + getNews: (_, __, send) => + send.object({ data: { officialnews: K.ATTR({ count: '0' }) } }), }; diff --git a/jubeat@asphyxia/handlers/matching.ts b/jubeat@asphyxia/handlers/matching.ts index e200f43..d291f73 100644 --- a/jubeat@asphyxia/handlers/matching.ts +++ b/jubeat@asphyxia/handlers/matching.ts @@ -1,147 +1,55 @@ -import {Room} from '../models/matching'; +import { getVersion } from '../utils'; -export const check: EPR = async (info, data, send) => { - const enter = $(data).bool('data.enter'); - const time = $(data).number('data.time'); +export const lobby = { + check: (info, data, send) => { + const version = getVersion(info); + if (version <= 0) return send.deny(); - // enter - // 0 - game is loading - // 1 - music select screen - - return send.object({ - data: { - entrant_nr: K.ITEM('u32', 1, { time: String(time) }), - interval: K.ITEM('s16', 5), - entry_timeout: K.ITEM('s16', 30), - waitlist: K.ATTR({ count: '0' }) - } - }); -}; - -export const entry: EPR = async (info, data, send) => { - const localMatchingNode = $(data).element('data.local_matching'); - const connectNode = $(data).element('data.connect'); - const musicNode = $(data).element('data.music'); - - const localKey = localMatchingNode.numbers('key'); - const connectKey = connectNode.numbers('key'); - - let matchRoom = await DB.FindOne({ - collection: 'matching_rooms', - musicId: musicNode.number('id'), - seqId: musicNode.number('seq'), - isMatchEnd: false, - isFull: false - }); - - if (!matchRoom) { - matchRoom = { - collection: 'matching_rooms', - - version: $(data).number('data.version'), - roomId: _.random(1, 999999999), - masterKey: connectKey, - masterGlobal: connectNode.str('global'), - masterPrivate: connectNode.str('private'), - localKey, - musicId: musicNode.number('id'), - seqId: musicNode.number('seq'), - members: [ - { - cabid: $(data).number('data.cabid'), - addr: connectNode.str('private') - } - ], - isFull: false, - isMatchEnd: false - }; - - await DB.Upsert({ - collection: 'matching_rooms', localKey, - musicId: musicNode.number('id'), - seqId: musicNode.number('seq'), - isMatchEnd: false, - isFull: false - }, matchRoom); - } - - return send.object({ - data: { - roomid: K.ITEM('s64', BigInt(matchRoom.roomId), { master: matchRoom.masterKey === connectKey ? '1' : '0' }), - ...matchRoom.masterKey === connectKey && { - refresh_intr: K.ITEM('s16', 10), + return send.object({ + data: { + entrant_nr: K.ITEM('u32', 1, { time: 0 + '' }), + interval: K.ITEM('s16', 3), + entry_timeout: K.ITEM('s16', 15), + waitlist: K.ATTR({ count: '0' }), }, - ...matchRoom.masterKey !== connectKey && { - connect: { - key: K.ARRAY('u8', matchRoom.masterKey), - global: K.ITEM('str', matchRoom.masterGlobal), - private: K.ITEM('str', matchRoom.masterPrivate), - } - }, - music: { - id: K.ITEM('u32', matchRoom.musicId), - seq: K.ITEM('u8', matchRoom.seqId), - } - } - }); -}; - -export const refresh: EPR = async (info, data, send) => { - const roomId = Number($(data).bigint('data.roomid')); - const pcbinfos = $(data).elements('data.joined.pcbinfo'); - - const room = await DB.FindOne({ collection: 'matching_rooms', roomId }); - - if (room) { - for (const i of pcbinfos) { - const cabid = i.number('cabid'); - const addr = i.str('addr'); - - for (const i of room.members) { - if (i.addr === addr) continue; - - room.members.push({ - cabid, - addr - }); - } - } - - await DB.Update({ collection: 'matching_rooms', roomId: Number(roomId) }, { - $set: { - members: room.members - } }); + }, + entry: (info, data, send) => { + const version = getVersion(info); + if (version <= 0) return send.deny(); - if (room.members.length >= 4) { - await DB.Update({ collection: 'matching_rooms', roomId: Number(roomId) }, { - $set: { - isFull: true - } - }); - } - } + const musicId = $(data).number('data.music.id', 20000037); + const musicSeq = $(data).number('data.music', 0); - return send.object({ - data: { - refresh_intr: K.ITEM('s16', 5), - start: K.ITEM('bool', room.isFull) - } - }); -}; - -export const report: EPR = async (info, data, send) => { - const roomId = $(data).bigint('data.roomid'); - - await DB.Update({ collection: 'matching_rooms', roomId: Number(roomId) }, { - $set: { - isMatchEnd: true - } - }); - - return send.object({ - data: { - refresh_intr: K.ITEM('s16', 3), - } - }); + return send.object({ + data: { + roomid: K.ITEM('s64', BigInt(1), { master: '1' }), + refresh_intr: K.ITEM('s16', 5), + music: { + id: K.ITEM('u32', musicId), + seq: K.ITEM('u8', musicSeq), + }, + }, + }); + }, + refresh: (info, data, send) => { + const version = getVersion(info); + if (version <= 0) return send.deny(); + + return send.object({ + data: { + refresh_intr: K.ITEM('s16', 3), + }, + }); + }, + report: (info, data, send) => { + const version = getVersion(info); + if (version <= 0) return send.deny(); + + return send.object({ + data: { + refresh_intr: K.ITEM('s16', 3), + }, + }); + }, }; diff --git a/jubeat@asphyxia/handlers/profile.ts b/jubeat@asphyxia/handlers/profile.ts index 6ea0bd7..4350fbd 100644 --- a/jubeat@asphyxia/handlers/profile.ts +++ b/jubeat@asphyxia/handlers/profile.ts @@ -1,516 +1,232 @@ -import {getVersion, getVersionName, VersionRange} from "../utils"; -import Profile from "../models/profile"; -import {Score} from "../models/score"; -import {CourseResult} from "../models/course"; +import { getVersion } from '../utils'; +import Profile from '../models/profile'; +import { Score } from '../models/score'; -export const profile: EPR = async (info, data, send) => { - let refId = $(data).str("data.player.pass.refid"); - if (!refId) return send.deny(); +export const profile: { regist: EPR; get: EPR; meeting: EPR; save: EPR } = { + regist: async (info, data, send) => { + const version = getVersion(info); + const refId = $(data).str('data.player.pass.refid'); + const newName = $(data).str('data.player.name', 'JUBEAT'); - const version = getVersion(info); - if (version === 0) return send.deny(); + if (version <= 0) return send.deny(); + if (!refId || !newName) return send.deny(); - const name = $(data).str("data.player.name"); + let profile = await DB.FindOne(refId, { collection: 'profile' }); - let profile = await DB.FindOne(refId, { collection: "profile" }); + if (profile) return send.deny(); - if (!profile) { - if (!name) return send.deny(); - - const newProfile: Profile = { - collection: "profile", - jubeatId: _.random(1, 99999999), - name: name, - - lastShopname: "NONE", - lastAreaname: "NONE" - }; - - await DB.Upsert(refId, { collection: "profile" }, newProfile); - - profile = newProfile; - } - - return send.object({ - data: { - ...version === 5 && require("../templates/gameInfos/saucer.ts")(profile), - ...version === 6 && require("../templates/gameInfos/fulfill.ts")(profile), - - player: { - name: K.ITEM("str", profile.name), - jid: K.ITEM("s32", profile.jubeatId), - refid: K.ITEM("str", profile.__refid), - session_id: K.ITEM("s32", 1), - event_flag: K.ITEM("u64", BigInt(0)), - - ...version === 3 && require("../templates/profiles/knit.ts")(profile), - ...version === 4 && require("../templates/profiles/copious.ts")(profile), - ...version === 5 && require("../templates/profiles/saucer.ts")(profile), - ...version === 6 && require("../templates/profiles/fulfill.ts")(profile), - } - } - }); -}; - -export const saveProfile: EPR = async (info, { data }, send) => { - console.log(U.toXML({ - call: K.ATTR({ model: info.model }, { - [info.module]: K.ATTR({ method: info.method }, { data }) - }) - })); - - const refId = $(data).str("player.refid"); - if (!refId) return send.deny(); - - const version = getVersion(info); - if (version === 0) return send.deny(); - - const profile = await DB.FindOne(refId, { collection: "profile" }); - if (!profile) return send.deny(); - - let lastMarker = 0; - let lastTheme = 0; - let lastTitle = 0; - let lastParts = 0; - let lastSort = 0; - let lastFilter = 0; - let lastCategory = 0; - let lastMselStat = 0; - - const result = $(data).element("result"); - - if (result) { - const tunes = result.elements("tune"); - const historys = {}; - const historyNode = $(data).elements("player.history.tune"); - - if (historyNode) { - for (const history of historyNode) { - historys[history.attr().log_id] = { - timestamp: history.bigint("timestamp"), - isHard: history.bool("player.result.is_hard_mode") - }; - } - } - - for (const tune of tunes) { - const tuneId = tune.attr().id; - - profile.musicId = tune.number("music"); - profile.seqId = parseInt(tune.attr("player.score").seq); - lastMarker = tune.number("marker"); - lastTheme = tune.number("theme"); - lastTitle = tune.number("title"); - lastParts = tune.number("parts"); - lastSort = tune.number("sort"); - lastFilter = tune.number("filter"); - lastCategory = tune.number("category"); - lastMselStat = tune.number("msel_stat"); - profile.rankSort = tune.number("rank_sort"); - profile.comboDisp = tune.number("combo_disp"); - - await updateScore(refId, { - musicId: tune.number("music"), - seq: parseInt(tune.attr("player.score").seq), - score: tune.number("player.score"), - clear: parseInt(tune.attr("player.score").clear), - isHard: historys[tuneId]?.isHard || false, - bestScore: tune.number("player.best_score"), - bestClear: tune.number("player.best_clear"), - playCount: tune.number("player.play_cnt"), - clearCount: tune.number("player.clear_cnt"), - fullcomboCount: tune.number("player.fc_cnt"), - excellentCount: tune.number("player.exc_cnt"), - ...tune.element("player.mbar") && { mbar: tune.numbers("player.mbar") } - }); - } - } - - profile.lastPlayTime = Number($(data).bigint("player.time_gameend")); - profile.lastShopname = $(data).str("player.shopname"); - profile.lastAreaname = $(data).str("player.areaname"); - - if (version === 3) { - if (!profile.knit) profile.knit = {}; - profile.knit.jubility = $(data).number("player.info.jubility"); - profile.knit.jubilityYday = $(data).number("player.info.jubility_yday"); - profile.knit.acvProg = $(data).number("player.info.acv_prog"); - profile.knit.acvPoint = $(data).number("player.info.acv_point"); - profile.knit.acvWool = $(data).number("player.info.acv_wool"); - profile.knit.acvRouteProg = $(data).numbers("player.info.acv_route_prog"); - profile.knit.tuneCount = $(data).number("player.info.tune_cnt"); - profile.knit.saveCount = $(data).number("player.info.save_cnt"); - profile.knit.savedCount = $(data).number("player.info.saved_cnt"); - profile.knit.fcCount = $(data).number("player.info.fc_cnt"); - profile.knit.fcSeqCount = $(data).number("player.info.fc_seq_cnt"); - profile.knit.exCount = $(data).number("player.info.exc_cnt"); - profile.knit.exSeqCount = $(data).number("player.info.exc_seq_cnt"); - profile.knit.matchCount = $(data).number("player.info.match_cnt"); - profile.knit.conSelCount = $(data).number("player.info.con_sel_cnt"); - - profile.knit.marker = lastMarker; - profile.knit.theme = lastTheme; - profile.knit.title = lastTitle; - profile.knit.sort = lastSort; - profile.knit.filter = lastFilter; - profile.knit.mselStat = lastMselStat; - profile.knit.conSuggestId = $(data).number("player.info.con_suggest_id"); - - profile.knit.secretList = $(data).numbers("player.item.secret_list"); - profile.knit.themeList = $(data).number("player.item.theme_list"); - profile.knit.markerList = $(data).numbers("player.item.marker_list"); - profile.knit.titleList = $(data).numbers("player.item.title_list"); - - profile.knit.secretListNew = $(data).numbers("player.item.secret_new"); - profile.knit.themeListNew = $(data).number("player.item.theme_new"); - profile.knit.markerListNew = $(data).numbers("player.item.marker_new"); - profile.knit.titleListNew = $(data).numbers("player.item.title_new"); - } - - if (version === 4) { - if (!profile.copious) profile.copious = {}; - profile.copious.jubility = $(data).number("player.info.jubility"); - profile.copious.jubilityYday = $(data).number("player.info.jubility_yday"); - profile.copious.acvState = $(data).number("player.info.acv_state"); - profile.copious.acvPoint = $(data).number("player.info.acv_point"); - profile.copious.acvOwn = $(data).number("player.info.acv_own"); - profile.copious.acvThrow = $(data).numbers("player.info.acv_throw"); - profile.copious.tuneCount = $(data).number("player.info.tune_cnt"); - profile.copious.saveCount = $(data).number("player.info.save_cnt"); - profile.copious.savedCount = $(data).number("player.info.saved_cnt"); - profile.copious.fcCount = $(data).number("player.info.fc_cnt"); - profile.copious.fcSeqCount = $(data).number("player.info.fc_seq_cnt"); - profile.copious.exCount = $(data).number("player.info.exc_cnt"); - profile.copious.exSeqCount = $(data).number("player.info.exc_seq_cnt"); - profile.copious.matchCount = $(data).number("player.info.match_cnt"); - profile.copious.totalBestScore = $(data).number("player.info.total_best_score"); - - profile.copious.marker = lastMarker; - profile.copious.theme = lastTheme; - profile.copious.title = lastTitle; - profile.copious.parts = lastParts; - profile.copious.sort = lastSort; - profile.copious.category = lastCategory; - profile.copious.mselStat = lastMselStat; - - profile.copious.secretList = $(data).numbers("player.item.secret_list"); - profile.copious.themeList = $(data).number("player.item.theme_list"); - profile.copious.markerList = $(data).numbers("player.item.marker_list"); - profile.copious.titleList = $(data).numbers("player.item.title_list"); - profile.copious.partsList = $(data).numbers("player.item.parts_list"); - - profile.copious.secretListNew = $(data).numbers("player.item.secret_new"); - profile.copious.themeListNew = $(data).number("player.item.theme_new"); - profile.copious.markerListNew = $(data).numbers("player.item.marker_new"); - profile.copious.titleListNew = $(data).numbers("player.item.title_new"); - } - - if (version === 5) { - if (!profile.saucer) profile.saucer = {}; - profile.saucer.jubility = $(data).number("player.info.jubility"); - profile.saucer.jubilityYday = $(data).number("player.info.jubility_yday"); - profile.saucer.tuneCount = $(data).number("player.info.tune_cnt"); - profile.saucer.clearCount = $(data).number("player.info.clear_cnt"); - profile.saucer.saveCount = $(data).number("player.info.save_cnt"); - profile.saucer.savedCount = $(data).number("player.info.saved_cnt"); - profile.saucer.fcCount = $(data).number("player.info.fc_cnt"); - profile.saucer.exCount = $(data).number("player.info.exc_cnt"); - profile.saucer.matchCount = $(data).number("player.info.match_cnt"); - profile.saucer.totalBestScore = $(data).number("player.info.total_best_score"); - - profile.saucer.marker = lastMarker; - profile.saucer.theme = lastTheme; - profile.saucer.title = lastTitle; - profile.saucer.parts = lastParts; - profile.saucer.sort = lastSort; - profile.saucer.category = lastCategory; - - profile.saucer.secretList = $(data).numbers("player.item.secret_list"); - profile.saucer.themeList = $(data).number("player.item.theme_list"); - profile.saucer.markerList = $(data).numbers("player.item.marker_list"); - profile.saucer.titleList = $(data).numbers("player.item.title_list"); - profile.saucer.partsList = $(data).numbers("player.item.parts_list"); - - profile.saucer.secretListNew = $(data).numbers("player.item.secret_new"); - profile.saucer.themeListNew = $(data).number("player.item.theme_new"); - profile.saucer.markerListNew = $(data).numbers("player.item.marker_new"); - profile.saucer.titleListNew = $(data).numbers("player.item.title_new"); - - if (!profile.saucer.bistro) profile.saucer.bistro = {}; - profile.saucer.bistro.carry_over = $(data).number("player.bistro.carry_over"); - } - - if (version === 6) { - if (!profile.fulfill) profile.fulfill = {}; - profile.fulfill.jubility = $(data).number("player.info.jubility"); - profile.fulfill.jubilityYday = $(data).number("player.info.jubility_yday"); - profile.fulfill.tuneCount = $(data).number("player.info.tune_cnt"); - profile.fulfill.saveCount = $(data).number("player.info.save_cnt"); - profile.fulfill.savedCount = $(data).number("player.info.saved_cnt"); - profile.fulfill.fcCount = $(data).number("player.info.fc_cnt"); - profile.fulfill.exCount = $(data).number("player.info.exc_cnt"); - profile.fulfill.clearCount = $(data).number("player.info.clear_cnt"); - profile.fulfill.matchCount = $(data).number("player.info.match_cnt"); - profile.fulfill.expertOption = $(data).number("player.info.expert_option"); - profile.fulfill.matching = $(data).number("player.info.matching"); - profile.fulfill.hazard = $(data).number("player.info.hazard"); - profile.fulfill.hard = $(data).number("player.info.hard"); - profile.fulfill.extraPoint = $(data).number("player.info.extra_point"); - profile.fulfill.isExtraPlayed = $(data).bool("player.info.is_extra_played"); - profile.fulfill.totalBestScore = $(data).number("player.info.total_best_score"); - profile.fulfill.clearMaxLevel = $(data).number("player.info.clear_max_level"); - profile.fulfill.fcMaxLevel = $(data).number("player.info.fc_max_level"); - profile.fulfill.exMaxLevel = $(data).number("player.info.exc_max_level"); - - profile.fulfill.marker = lastMarker; - profile.fulfill.theme = lastTheme; - profile.fulfill.title = lastTitle; - profile.fulfill.parts = lastParts; - profile.fulfill.sort = lastSort; - profile.fulfill.category = lastCategory; - - profile.fulfill.secretList = $(data).numbers("player.item.secret_list"); - profile.fulfill.themeList = $(data).number("player.item.theme_list"); - profile.fulfill.markerList = $(data).numbers("player.item.marker_list"); - profile.fulfill.titleList = $(data).numbers("player.item.title_list"); - profile.fulfill.partsList = $(data).numbers("player.item.parts_list"); - profile.fulfill.secretListNew = $(data).numbers("player.item.secret_new"); - profile.fulfill.themeListNew = $(data).number("player.item.theme_new"); - profile.fulfill.markerListNew = $(data).numbers("player.item.marker_new"); - profile.fulfill.titleListNew = $(data).numbers("player.item.title_new"); - - const courseNode = $(data).element("course"); - if (courseNode) { - profile.fulfill.lastCourseId = courseNode.number("course_id"); - - await DB.Upsert(refId, { - collection: "course_results", - courseId: courseNode.number("course_id"), - version: 6 - }, { - $set: { - rating: courseNode.number("rating"), - scores: courseNode.elements("music").map(m => m.number("score")) - } - }); - } - } - - try { - await DB.Update(refId, { collection: "profile" }, profile); - - return send.object({ - data: { - player: { session_id: K.ITEM("s32", 1) }, - ...version === 4 && { collabo: { deller: K.ITEM("s32", 0) } } - } + await DB.Insert(refId, { + collection: 'profile', + jid: _.random(1, 99999999), + name: newName.toUpperCase(), }); - } catch (e) { - console.error(`Profile save failed: ${e.message}`); - return send.deny(); - } -}; -export const loadScore: EPR = async (info, data, send) => { - const jubeatId = $(data).number("data.player.jid"); - if (!jubeatId) return send.deny(); + profile = await DB.FindOne(refId, { collection: 'profile' }); - const profile = await DB.FindOne(null, { collection: "profile", jubeatId }); - if (!profile) return send.deny(); + if (version === 2) + return send.pugFile('templates/profile/ripples.pug', { + profile, + scores: [], + }); + }, + get: async (info, data, send) => { + const version = getVersion(info); + const refId = $(data).str('data.player.pass.refid'); - const version = getVersion(info); - if (version === 0) return send.deny(); + if (version <= 0) return send.deny(); + if (!refId) return send.deny(); - const scores = await DB.Find(profile.__refid, { collection: "score" }); - const scoreData: { [musicId: number]: { score: number[], clear: number[], playCnt: number[], clearCnt: number[], fcCnt: number[], exCnt: number[], bar: number[][] } } = {}; + const profile = await DB.FindOne(refId, { collection: 'profile' }); - for (const score of scores) { - if (!scoreData[score.musicId]) { - scoreData[score.musicId] = { - playCnt: [0, 0, 0], - clearCnt: [0, 0, 0], - fcCnt: [0, 0, 0], - exCnt: [0, 0, 0], - clear: [0, 0, 0], - score: [0, 0, 0], - bar: [Array(30).fill(0), Array(30).fill(0), Array(30).fill(0)] + if (!profile) return send.deny(); + + const playerScores = await DB.Find(refId, { collection: 'score' }); + const scores = {}; + + console.dir(playerScores, { depth: null }); + + playerScores.map(v => { + if (!scores[v.musicId]) scores[v.musicId] = [{}, {}, {}]; + + scores[v.musicId][v.seqId] = { + score: v.score, + clearFlag: v.clearFlag, + mbar: v.musicBar, }; - } - - const data = scoreData[score.musicId]; - data.playCnt[score.seq] = score.playCount; - data.clearCnt[score.seq] = score.clearCount; - data.fcCnt[score.seq] = score.fullcomboCount; - data.exCnt[score.seq] = score.excellentCount; - data.clear[score.seq] = score.clear; - data.score[score.seq] = score.score; - data.bar[score.seq] = score.bar; - } - - return send.object({ - data: { - player: { - jid: K.ITEM("s32", jubeatId), - - ...version >= 3 && { - playdata: K.ATTR({ count: String(Object.keys(scoreData).length) }, { - musicdata: Object.keys(scoreData).map(musicId => K.ATTR({ music_id: String(musicId) }, { - score: K.ARRAY("s32", scoreData[musicId].score), - clear: K.ARRAY("s8", scoreData[musicId].clear), - play_cnt: K.ARRAY("s32", scoreData[musicId].playCnt), - clear_cnt: K.ARRAY("s32", scoreData[musicId].clearCnt), - fc_cnt: K.ARRAY("s32", scoreData[musicId].fcCnt), - ex_cnt: K.ARRAY("s32", scoreData[musicId].exCnt), - bar: scoreData[musicId].bar.map((bar, seq) => K.ARRAY("u8", bar, { seq: String(seq) })) - })) - }) - } - } - } - }); -}; - -const updateScore = async (refId: string, data: any): Promise => { - try { - await DB.Upsert(refId, { - collection: "score", - musicId: data.musicId, - seq: data.seq, - isHardMode: data.isHard - }, { - $set: { - musicId: data.musicId, - seq: data.seq, - score: data.bestScore, - clear: data.bestClear, - musicRate: 0, - ...data.mbar && { bar: data.mbar, }, - playCount: data.playCount, - clearCount: data.clearCount, - fullcomboCount: data.fullcomboCount, - excellentCount: data.excellentCount, - isHardMode: data.isHard - } }); - return true; - } catch (e) { - console.error("Score saving failed: ", e.stack); - return false; - } -}; + console.dir(scores, { depth: null }); -export const getCourse: EPR = async (info, data, send) => { - const version = getVersion(info); - if (version === 0) return send.deny(); + if (version === 2) + return send.pugFile('templates/profile/ripples.pug', { profile, scores }); + }, + meeting: async (info, data, send) => { + const version = getVersion(info); + if (version <= 0) return send.deny(); - const jubeatId = $(data).number("data.player.jid"); - if (!jubeatId) return send.deny(); + if (version === 2) + return send.object({ + data: { + entryinfo: K.ATTR( + { count: '0' }, + { + meeting: [], + } + ), + holdinfo: { + meeting: [], + }, + reward: { + total: K.ITEM('s32', 0), + point: K.ITEM('s32', 0), + }, + }, + }); + }, + save: async (info, data, send) => { + const version = getVersion(info); + if (version <= 0) return send.deny(); - const profile = await DB.FindOne(null, { collection: "profile", jubeatId }); - if (!profile) return send.deny(); + const retry = $(data).number('retry', 0); + if (retry > 0) return send.deny(); - if (version === 6) { - const results = await DB.Find(profile.__refid, { collection: "course_results", version: 6 }); + const refId = $(data).str('data.player.refid'); + if (!refId) return send.deny(); - const { courses } = require("../data/fulfill_courses.json"); + const profile = await DB.FindOne(refId, { collection: 'profile' }); + if (!profile) return send.deny(); - const validCourseIds: number[] = courses.map(course => course.course_id); + if (version === 2) { + let lastMusicId: number; + let lastSeqId: number; + let lastUsedMarker: number; + let lastUsedTheme: number; + let lastUsedTitle: number; + let lastUsedSort: number; + let lastUsedFilter: number; + let lastShowRankSort: number; + let lastComboDisp: number; - return send.object({ - data: { - course_list: { - course: courses.map(course => ({ - id: K.ITEM("s32", course.course_id), - name: K.ITEM("str", course.course_name), - level: K.ITEM("u8", course.course_level), + const tunes = $(data).elements('data.result.tune'); - norma: { - norma_id: K.ARRAY("s32", course.norma.norma_id), - bronze_value: K.ARRAY("s32", course.norma.bronze), - silver_value: K.ARRAY("s32", course.norma.silver), - gold_value: K.ARRAY("s32", course.norma.gold) + for (let i = 0; i < tunes.length; i++) { + const musicId = tunes[i].number('music'); + const seqId = Number(tunes[i].attr('music')?.seq); + const marker = tunes[i].number('marker'); + const theme = tunes[i].number('theme'); + const title = tunes[i].number('title'); + const sort = tunes[i].number('sort'); + const filter = tunes[i].number('filter'); + const rankSort = tunes[i].number('rank_sort'); + const comboDisp = tunes[i].number('combo_disp'); + const score = tunes[i].number('player.score'); + const clearFlag = Number(tunes[i].attr('player.score')?.clear); + const maxCombo = Number(tunes[i].attr('player.score')?.combo); + const mbar = tunes[i].numbers('player.mbar'); + + lastMusicId = musicId; + lastSeqId = seqId; + lastUsedMarker = marker; + lastUsedTheme = theme; + lastUsedTitle = title; + lastUsedSort = sort; + lastUsedFilter = filter; + lastShowRankSort = rankSort; + lastComboDisp = comboDisp; + + let oldScore = await DB.FindOne(refId, { + collection: 'score', + musicId, + seqId, + }); + + if (!oldScore) { + await DB.Insert(refId, { + collection: 'score', + musicId, + seqId, + score: 0, + clearFlag: 0, + maxCombo: 0, + marker: 0, + theme: 0, + musicBar: new Array(20).fill(0), + playCount: 0, + clearCount: 0, + fullComboCount: 0, + excCount: 0, + }); + + oldScore = await DB.FindOne(refId, { + collection: 'score', + musicId, + seqId, + }); + } + + await DB.Update( + refId, + { collection: 'score', musicId, seqId }, + { + $set: { + score: Math.max(oldScore.score, score), + clearFlag: Math.max(oldScore.clearFlag, clearFlag), + maxCombo: Math.max(oldScore.maxCombo, maxCombo), + marker, + theme, + ...(score > oldScore.score && { musicBar: mbar }), }, + $inc: { + playCount: 1, + ...(clearFlag === 2 && { clearCount: 1 }), + ...(clearFlag === 4 && { fullComboCount: 1 }), + ...(clearFlag === 8 && { excCount: 1 }), + }, + } + ); + } - music_list: { - music: course.music_list.map(music => (K.ATTR({ index: music.index }, { - music_id: K.ITEM("s32", music.music_id), - seq: K.ITEM("u8", music.seq_id) - }))) - } - })) - }, + const mode = $(data).number('data.player.mode', 0); - player_list: { + await DB.Update( + refId, + { collection: 'profile' }, + { + $set: { + 'ripples.info': { + grade: $(data).number('data.player.grade', 0), + gradePoint: $(data).number('data.player.grade_point', 0), + }, + 'ripples.last': { + mode, + musicId: lastMusicId, + seqId: lastSeqId, + marker: lastUsedMarker, + title: lastUsedTitle, + theme: lastUsedTheme, + sort: lastUsedSort, + filter: lastUsedFilter, + rankSort: lastShowRankSort, + comboDisp: lastComboDisp, + }, + }, + $inc: { + ...(mode === 1 && { 'ripples.info.onlineCount': 1 }), + ...(mode === 0 && { 'ripples.info.multiCount': 1 }), + }, + } + ); + + return send.object({ + data: { player: { - jid: K.ITEM("s32", jubeatId), - - result_list: { - result: results.filter(e => validCourseIds.find(valid => valid === e.courseId)).map(result => ({ - id: K.ITEM("s32", result.courseId), - rating: K.ITEM("u8", result.rating), - score: K.ARRAY("s32", result.scores) - })) - } - } + session_id: K.ITEM('u32', 1), + ranking: K.ITEM('u32', 0), + }, }, - - last_course_id: K.ITEM("s32", profile.fulfill?.lastCourseId || 0) - } - }); - } - - return send.deny(); -}; - -export const meeting: EPR = (info, data, send) => { - return send.object({ - data: { - meeting: { - single: K.ATTR({ count: "0" }), - tag: K.ATTR({ count: "0" }), - }, - reward: { - total: K.ITEM("s32", 0), - point: K.ITEM("s32", 0) - } + }); } - }); -}; - -export const getCollabo: EPR = (info, data, send) => { - const version = getVersion(info); - if (version === 0) return send.deny(); - - if (version === 3) { - return send.object({ - data: { - collabo: { - played: { - iidx: K.ITEM("s8", 1), - popn: K.ITEM("s8", 1), - ddr: K.ITEM("s8", 1), - reflec: K.ITEM("s8", 1), - gfdm: K.ITEM("s8", 1), - } - } - } - }); - } - - if (version === 4) { - return send.object({ - data: { - player: { - collabo: { - reward: K.ITEM("s32", 0), - dellar: K.ITEM("s32", 0), - music_id: K.ITEM("s32", 0), - wonder_state: K.ITEM("u32", 2), - yellow_state: K.ITEM("u32", 2), - } - } - } - }); - } + + return send.deny(); + }, }; diff --git a/jubeat@asphyxia/index.ts b/jubeat@asphyxia/index.ts index 4c9f434..ef89dbf 100644 --- a/jubeat@asphyxia/index.ts +++ b/jubeat@asphyxia/index.ts @@ -1,37 +1,38 @@ -import {demodata, gameInfo} from "./handlers/common"; -import {check, entry, refresh, report} from "./handlers/matching"; -import {getCollabo, getCourse, loadScore, meeting, profile, saveProfile} from "./handlers/profile"; +// nodemon --exec "asphyxia-core-x64 --dev" -e ts --watch plugins + +import { demodata, shopRegist } from './handlers/common'; +import { lobby } from './handlers/matching'; +import { profile } from './handlers/profile'; export function register() { if (CORE_VERSION_MAJOR <= 1 && CORE_VERSION_MINOR < 31) { - console.error("The current version of Asphyxia Core is not supported. Requires version '1.31' or later."); + console.error( + "The current version of Asphyxia Core is not supported. Requires version '1.31' or later." + ); return; } - R.GameCode("J44"); - R.GameCode("K44"); - R.GameCode("L44"); - R.Route("gametop.regist", profile); - R.Route("gametop.get_info", gameInfo); - R.Route("gametop.get_pdata", profile); - R.Route("gametop.get_mdata", loadScore); - R.Route("gametop.get_course", getCourse); - R.Route("gametop.get_meeting", meeting); - R.Route("gametop.get_collabo", getCollabo); + R.Contributor('Kirito', 'https://github.com/Kirito3481'); - R.Route("gameend.regist", saveProfile); - R.Route("gameend.log", true); - R.Route("gameend.set_collabo", true); + R.GameCode('I44'); - R.Route("shopinfo.regist", gameInfo); - R.Route("demodata.get_news", demodata.getNews); - R.Route("demodata.get_data", demodata.getData); - R.Route("demodata.get_hitchart", demodata.getHitchart); - R.Route("lobby.check", check); - R.Route("lobby.entry", entry); - R.Route("lobby.refresh", refresh); - R.Route("lobby.report", report); + R.Route('shopinfo.regist', shopRegist); - R.Route("netlog.send", true); - R.Route("logger.report", true); + R.Route('demodata.getnews', demodata.getNews); + + R.Route('gametop.regist', profile.regist); + R.Route('gametop.get', profile.get); + R.Route('meeting.get', profile.meeting); + + R.Route('gameend.regist', profile.save); + R.Route('gameend.log', true); + + R.Route('lobby.check', lobby.check); + R.Route('lobby.entry', lobby.entry); + R.Route('lobby.refresh', lobby.refresh); + R.Route('lobby.report', lobby.report); + + R.Route('netlog.send', true); + + R.Unhandled(); } diff --git a/jubeat@asphyxia/models/course.ts b/jubeat@asphyxia/models/course.ts deleted file mode 100644 index 8f07c59..0000000 --- a/jubeat@asphyxia/models/course.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface CourseResult { - collection: "course_results"; - - version: number; - - courseId: number; - rating: number; - scores: number[]; -} diff --git a/jubeat@asphyxia/models/matching.ts b/jubeat@asphyxia/models/matching.ts deleted file mode 100644 index 79597a4..0000000 --- a/jubeat@asphyxia/models/matching.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface Room { - collection: 'matching_rooms'; - - version: number; - roomId: number; - masterKey: number[]; - masterGlobal: string; - masterPrivate: string; - localKey: number[]; - musicId: number; - seqId: number; - members: { - cabid: number; - addr: string; - }[]; - isFull: boolean; - isMatchEnd: boolean; -} diff --git a/jubeat@asphyxia/models/profile.ts b/jubeat@asphyxia/models/profile.ts index c2f4e88..5490839 100644 --- a/jubeat@asphyxia/models/profile.ts +++ b/jubeat@asphyxia/models/profile.ts @@ -1,167 +1,34 @@ export default interface Profile { - collection: "profile"; + collection: 'profile'; - jubeatId: number; + jid: number; name: string; - lastPlayTime?: number; - lastShopname: string; - lastAreaname: string; + ripples?: Ripples; +} - musicId?: number; - seqId?: number; - rankSort?: number; - comboDisp?: number; - - knit?: { - jubility?: number; - jubilityYday?: number; - acvProg?: number; - acvWool?: number; - acvRouteProg?: number[]; - acvPoint?: number; - tuneCount?: number; - saveCount?: number; - savedCount?: number; - fcCount?: number; - fcSeqCount?: number; - exCount?: number; - exSeqCount?: number; - matchCount?: number; - conSelCount?: number; - - marker?: number; - theme?: number; - title?: number; - sort?: number; - filter?: number; - mselStat?: number; - conSuggestId?: number; - - secretList?: number[]; - themeList?: number; - markerList?: number[]; - titleList?: number[]; - - secretListNew?: number[]; - themeListNew?: number; - markerListNew?: number[]; - titleListNew?: number[]; +export interface Ripples { + info?: { + onlineCount: number; + multiCount: number; + matchCount: number; + beatCount: number; + saveCount: number; + savedCount: number; + grade: number; + gradePoint: number; }; - copious?: { - jubility?: number; - jubilityYday?: number; - acvPoint?: number; - acvState?: number; - acvThrow?: number[]; - acvOwn?: number; - tuneCount?: number; - saveCount?: number; - savedCount?: number; - fcCount?: number; - fcSeqCount?: number; - exCount?: number; - exSeqCount?: number; - matchCount?: number; - totalBestScore?: number; - - marker?: number; - theme?: number; - title?: number; - parts?: number; - sort?: number; - category?: number; - mselStat?: number; - - secretList?: number[]; - themeList?: number; - markerList?: number[]; - titleList?: number[]; - partsList?: number[]; - - secretListNew?: number[]; - themeListNew?: number; - markerListNew?: number[]; - titleListNew?: number[]; - }; - - saucer?: { - jubility?: number; - jubilityYday?: number; - tuneCount?: number; - clearCount?: number; - saveCount?: number; - savedCount?: number; - fcCount?: number; - exCount?: number; - matchCount?: number; - totalBestScore?: number; - - marker?: number; - theme?: number; - title?: number; - parts?: number; - sort?: number; - category?: number; - - secretList?: number[]; - themeList?: number; - markerList?: number[]; - titleList?: number[]; - partsList?: number[]; - - secretListNew?: number[]; - themeListNew?: number; - markerListNew?: number[]; - titleListNew?: number[]; - - bistro?: { - carry_over?: number; - } - }; - - fulfill?: { - jubility?: number; - jubilityYday?: number; - tuneCount?: number; - clearCount?: number; - saveCount?: number; - savedCount?: number; - fcCount?: number; - exCount?: number; - matchCount?: number; - extraPoint?: number; - isExtraPlayed?: boolean; - totalBestScore?: number; - clearMaxLevel?: number; - fcMaxLevel?: number; - exMaxLevel?: number; - - marker?: number; - theme?: number; - title?: number; - parts?: number; - sort?: number; - category?: number; - expertOption?: number; - matching?: number; - hazard?: number; - hard?: number; - - secretList?: number[]; - themeList?: number; - markerList?: number[]; - titleList?: number[]; - partsList?: number[]; - - secretListNew?: number[]; - themeListNew?: number; - markerListNew?: number[]; - titleListNew?: number[]; - - lastCourseId?: number; - - + last?: { + mode: number; + musicId: number; + seqId: number; + marker: number; + title: number; + theme: number; + sort: number; + filter: number; + rankSort: number; + comboDisp: number; }; } diff --git a/jubeat@asphyxia/models/score.ts b/jubeat@asphyxia/models/score.ts index f520cd3..7ce519f 100644 --- a/jubeat@asphyxia/models/score.ts +++ b/jubeat@asphyxia/models/score.ts @@ -1,15 +1,16 @@ export interface Score { - collection: "score"; + collection: 'score'; musicId: number; - seq: number; + seqId: number; score: number; - clear: number; - musicRate: number; - bar: number[]; + clearFlag: number; + maxCombo: number; + marker: number; + theme: number; + musicBar: number[]; playCount: number; clearCount: number; - fullcomboCount: number; - excellentCount: number; - isHardMode: boolean; + fullComboCount: number; + excCount: number; } diff --git a/jubeat@asphyxia/templates/gameInfos/fulfill.ts b/jubeat@asphyxia/templates/gameInfos/fulfill.ts deleted file mode 100644 index 3c706a7..0000000 --- a/jubeat@asphyxia/templates/gameInfos/fulfill.ts +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = () => ({ - termver: K.ITEM("u8", 0), - season_etime: K.ITEM("u32", 0), - white_music_list: K.ARRAY("s32", Array(32).fill(-1)), - open_music_list: K.ARRAY("s32", Array(32).fill(0)), - - collabo_info: { - collabo: [ - K.ATTR({ type: "1" }, { state: K.ITEM("u8", 0) }), - K.ATTR({ type: "2" }, { state: K.ITEM("u8", 0) }), - K.ATTR({ type: "3" }, { state: K.ITEM("u8", 0) }), - K.ATTR({ type: "4" }, { state: K.ITEM("u8", 0) }), - K.ATTR({ type: "5" }, { state: K.ITEM("u8", 0) }), - K.ATTR({ type: "8" }, { state: K.ITEM("u8", 0) }) - ], - - policy_break: { - is_report_end: K.ITEM("bool", true) - } - }, - - lab: { - is_open: K.ITEM("bool", false) - }, - - share_music: K.ATTR({ count: "0" }), - bonus_music: K.ATTR({ count: "0" }) -}); diff --git a/jubeat@asphyxia/templates/gameInfos/saucer.ts b/jubeat@asphyxia/templates/gameInfos/saucer.ts deleted file mode 100644 index 28a8a59..0000000 --- a/jubeat@asphyxia/templates/gameInfos/saucer.ts +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = () => ({ - termver: K.ITEM("u8", 0), - season_etime: K.ITEM("u32", 0), - bistro_last_music_id: K.ITEM("s32", 0), - white_music_list: K.ARRAY("s32", Array(32).fill(-1)), - old_music_list: K.ARRAY("s32", Array(32).fill(0)), - open_music_list: K.ARRAY("s32", Array(32).fill(0)), - - collabo_info: { - collabo: [ - K.ATTR({ type: "1" }, { state: K.ITEM("u8", 0) }), - K.ATTR({ type: "2" }, { state: K.ITEM("u8", 0) }), - K.ATTR({ type: "3" }, { state: K.ITEM("u8", 0) }), - K.ATTR({ type: "4" }, { state: K.ITEM("u8", 0) }), - K.ATTR({ type: "5" }, { state: K.ITEM("u8", 0) }), - K.ATTR({ type: "8" }, { state: K.ITEM("u8", 0) }) - ], - - run_run_marathon: { - is_report_end: K.ITEM("bool", true) - }, - - policy_break: { - is_report_end: K.ITEM("bool", true) - } - } -}); diff --git a/jubeat@asphyxia/templates/profile/ripples.pug b/jubeat@asphyxia/templates/profile/ripples.pug new file mode 100644 index 0000000..320a938 --- /dev/null +++ b/jubeat@asphyxia/templates/profile/ripples.pug @@ -0,0 +1,55 @@ +gametop + data + player + session_id(__type="u32") 1 + jid(__type="u32") #{profile.jid} + name(__type="str") #{profile.name} + + info + online_cnt(__type="s32") #{profile.ripples ? (profile.ripples.info ? profile.ripples.info.onlineCount : 0) : 0} + multi_cnt(__type="s32") #{profile.ripples ? (profile.ripples.info ? profile.ripples.info.multiCount : 0) : 0} + match_cnt(__type="s32") #{profile.ripples ? (profile.ripples.info ? profile.ripples.info.matchCount : 0) : 0} + beat_cnt(__type="s32") #{profile.ripples ? (profile.ripples.info ? profile.ripples.info.beatCount : 0) : 0} + save_cnt(__type="s32") #{profile.ripples ? (profile.ripples.info ? profile.ripples.info.saveCount : 0) : 0} + saved_cnt(__type="s32") #{profile.ripples ? (profile.ripples.info ? profile.ripples.info.savedCount : 0) : 0} + grade(__type="u8") #{profile.ripples ? (profile.ripples.info ? profile.ripples.info.grade : 0) : 0} + grade_point(__type="s32") #{profile.ripples ? (profile.ripples.info ? profile.ripples.info.gradePoint : 0) : 0} + + item + secret_list(__type="u32" __count="2") -1 -1 + marker_list(__type="u32") -1 + theme_list(__type="u8") -1 + title_list(__type="u32" __count="20") -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 + + new + secret_list(__type="u32" __count="2") 0 0 + marker_list(__type="u32") 0 + theme_list(__type="u8") 0 + title_list(__type="u32" __count="20") 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + + bm2dx(__type="u8") 0 + + last + mode(__type="u8") #{profile.ripples ? (profile.ripples.last ? profile.ripples.last.mode : 0) : 0} + music_id(__type="u32") #{profile.ripples ? (profile.ripples.last ? profile.ripples.last.musicId : 0) : 0} + seq_id(__type="u8") #{profile.ripples ? (profile.ripples.last ? profile.ripples.last.seqId : 0) : 0} + marker(__type="u8") #{profile.ripples ? (profile.ripples.last ? profile.ripples.last.marker : 0) : 0} + title(__type="s16") #{profile.ripples ? (profile.ripples.last ? profile.ripples.last.title : 0) : 0} + theme(__type="u8") #{profile.ripples ? (profile.ripples.last ? profile.ripples.last.theme : 0) : 0} + sort(__type="u8") #{profile.ripples ? (profile.ripples.last ? profile.ripples.last.sort : 0) : 0} + filter(__type="u32") #{profile.ripples ? (profile.ripples.last ? profile.ripples.last.filter : 0) : 0} + rank_sort(__type="u8") #{profile.ripples ? (profile.ripples.last ? profile.ripples.last.rankSort : 0) : 0} + combo_disp(__type="u8") #{profile.ripples ? (profile.ripples.last ? profile.ripples.last.comboDisp : 0) : 0} + + playdata + each v, k in scores + musicdata(music_id=k) + score(__type="s32" __count="3") #{(v[0].score || 0) + " " + (v[1].score || 0) + " " + (v[2].score || 0)} + clear(__type="u8" __count="3") #{(v[0].clearFlag || 0) + " " + (v[1].clearFlag || 0) + " " + (v[2].clearFlag || 0)} + bar(__type="u8" __count="30" seq="0") #{v[0].mbar ? v[0].mbar.join(" ") : new Array(30).fill(0).join(" ")} + bar(__type="u8" __count="30" seq="1") #{v[1].mbar ? v[1].mbar.join(" ") : new Array(30).fill(0).join(" ")} + bar(__type="u8" __count="30" seq="2") #{v[2].mbar ? v[2].mbar.join(" ") : new Array(30).fill(0).join(" ")} + + today_music + music_id(__type="u32") 0 + rate(__type="float") 1.0 \ No newline at end of file diff --git a/jubeat@asphyxia/templates/profiles/copious.ts b/jubeat@asphyxia/templates/profiles/copious.ts deleted file mode 100644 index e9a00a6..0000000 --- a/jubeat@asphyxia/templates/profiles/copious.ts +++ /dev/null @@ -1,71 +0,0 @@ -import Profile from "../../models/profile"; - -module.exports = (data: Profile) => ({ - info: { - jubility: K.ITEM("s16", data.copious?.jubility || 0), - jubility_yday: K.ITEM("s16", data.copious?.jubilityYday || 0), - acv_point: K.ITEM("s32", data.copious?.acvPoint || 0), - acv_state: K.ITEM("s8", data.copious?.acvState || 0), - acv_throw: K.ARRAY("s32", data.copious?.acvThrow || [0, 0, 0]), - acv_own: K.ITEM("s32", data.copious?.acvOwn || 0), - tune_cnt: K.ITEM("s32", data.copious?.tuneCount || 0), - save_cnt: K.ITEM("s32", data.copious?.saveCount || 0), - saved_cnt: K.ITEM("s32", data.copious?.savedCount || 0), - fc_cnt: K.ITEM("s32", data.copious?.fcCount || 0), - ex_cnt: K.ITEM("s32", data.copious?.exCount || 0), - match_cnt: K.ITEM("s32", data.copious?.matchCount || 0), - beat_cnt: K.ITEM("s32", 0), - mynews_cnt: K.ITEM("s32", 0), - mtg_entry_cnt: K.ITEM("s32", 0), - mtg_hold_cnt: K.ITEM("s32", 0), - mtg_result: K.ITEM("u8", 0) - }, - - last: { - play_time: K.ITEM("s64", BigInt(0)), - shopname: K.ITEM("str", data.lastShopname), - areaname: K.ITEM("str", data.lastAreaname), - title: K.ITEM("s16", data.copious?.title || 0), - parts: K.ITEM("s16", data.copious?.parts || 0), - theme: K.ITEM("s8", data.copious?.theme || 0), - marker: K.ITEM("s8", data.copious?.marker || 0), - rank_sort: K.ITEM("s8", data.rankSort || 1), - combo_disp: K.ITEM("s8", data.comboDisp || 1), - music_id: K.ITEM("s32", data.musicId || 0), - seq_id: K.ITEM("s8", data.seqId || 0), - sort: K.ITEM("s8", data.copious?.sort || 0), - category: K.ITEM("s8", data.copious?.category || 0), - msel_stat: K.ITEM("s8", data.copious?.mselStat || 0) - }, - - item: { - secret_list: K.ARRAY("s32", data.copious?.secretList || Array(12).fill(0)), - theme_list: K.ITEM("s16", data.copious?.themeList || 0), - marker_list: K.ARRAY("s32", data.copious?.markerList || [0, 0]), - title_list: K.ARRAY("s32", data.copious?.titleList || Array(32).fill(0)), - parts_list: K.ARRAY("s32", data.copious?.partsList || Array(96).fill(0)), - - new: { - secret_list: K.ARRAY("s32", data.copious?.secretListNew || Array(12).fill(0)), - theme_list: K.ITEM("s16", data.copious?.themeListNew || 0), - marker_list: K.ARRAY("s32", data.copious?.markerListNew || [0, 0]), - title_list: K.ARRAY("s32", data.copious?.titleListNew || Array(32).fill(0)) - } - }, - - challenge: { - today: { - music_id: K.ITEM("s32", 0) - }, - onlynow: { - magic_no: K.ITEM("s32", 0), - cycle: K.ITEM("s16", 0) - } - }, - - news: { - checked: K.ITEM("s16", 0) - }, - - rivallist: K.ATTR({ count: "0" }) -}); diff --git a/jubeat@asphyxia/templates/profiles/fulfill.ts b/jubeat@asphyxia/templates/profiles/fulfill.ts deleted file mode 100644 index 5148786..0000000 --- a/jubeat@asphyxia/templates/profiles/fulfill.ts +++ /dev/null @@ -1,117 +0,0 @@ -import Profile from "../../models/profile"; - -module.exports = (data: Profile) => ({ - info: { - jubility: K.ITEM("s16", data.fulfill?.jubility || 0), - jubility_yday: K.ITEM("s16", data.fulfill?.jubilityYday || 0), - tune_cnt: K.ITEM("s32", data.fulfill?.tuneCount || 31), - save_cnt: K.ITEM("s32", data.fulfill?.saveCount || 0), - saved_cnt: K.ITEM("s32", data.fulfill?.savedCount || 0), - fc_cnt: K.ITEM("s32", data.fulfill?.fcCount || 0), - ex_cnt: K.ITEM("s32", data.fulfill?.exCount || 0), - clear_cnt: K.ITEM("s32", data.fulfill?.clearCount || 0), - pf_cnt: K.ITEM("s32", 0), - match_cnt: K.ITEM("s32", data.fulfill?.matchCount || 0), - beat_cnt: K.ITEM("s32", 0), - mynews_cnt: K.ITEM("s32", 0), - mtg_entry_cnt: K.ITEM("s32", 0), - mtg_hold_cnt: K.ITEM("s32", 0), - mtg_result: K.ITEM("u8", 0), - extra_point: K.ITEM("s32", data.fulfill?.extraPoint || 0), - is_extra_played: K.ITEM("bool", data.fulfill?.isExtraPlayed || false) - }, - - last: { - play_time: K.ITEM("s64", BigInt(0)), - shopname: K.ITEM("str", data.lastShopname), - areaname: K.ITEM("str", data.lastAreaname), - title: K.ITEM("s16", data.fulfill?.title || 0), - parts: K.ITEM("s16", data.fulfill?.parts || 0), - theme: K.ITEM("s8", data.fulfill?.theme || 0), - marker: K.ITEM("s8", data.fulfill?.marker || 0), - rank_sort: K.ITEM("s8", data.rankSort || 1), - combo_disp: K.ITEM("s8", data.comboDisp || 1), - music_id: K.ITEM("s32", data.musicId || 0), - seq_id: K.ITEM("s8", data.seqId || 0), - sort: K.ITEM("s8", data.fulfill?.sort || 0), - category: K.ITEM("s8", data.fulfill?.category || 0), - expert_option: K.ITEM("s8", data.fulfill?.category || 0), - matching: K.ITEM("s8", data.fulfill?.category || 1), - hazard: K.ITEM("s8", data.fulfill?.category || 0), - hard: K.ITEM("s8", data.fulfill?.category || 0) - }, - - item: { - secret_list: K.ARRAY("s32", Array(32).fill(-1)), - theme_list: K.ITEM("s16", -1), - marker_list: K.ARRAY("s32", Array(2).fill(-1)), - title_list: K.ARRAY("s32", Array(96).fill(-1)), - parts_list: K.ARRAY("s32", Array(96).fill(-1)), - - new: { - secret_list: K.ARRAY("s32", Array(32).fill(0)), - theme_list: K.ITEM("s16", 0), - marker_list: K.ARRAY("s32", Array(2).fill(0)), - title_list: K.ARRAY("s32", Array(96).fill(0)) - } - }, - - history: K.ATTR({ count: "0" }), - - challenge: { - today: { - music_id: K.ITEM("s32", 0), - state: K.ITEM("u8", 0) - } - }, - - news: { - checked: K.ITEM("s16", 0) - }, - - macchiato: { - pack_id: K.ITEM("s32", 0), - bean_num: K.ITEM("u16", 0), - daily_milk_num: K.ITEM("s32", 1200), - is_received_daily_milk: K.ITEM("bool", true), - today_tune_cnt: K.ITEM("s32", 0), - daily_milk_bonus: K.ARRAY("s32", [100, 100, 1000, 200, 200, 200, 200, 200, 1000]), - daily_play_burst: K.ITEM("s32", 300), - - sub_menu_is_completed: K.ITEM("bool", true), - compensation_milk: K.ITEM("s32", 0), - - macchiato_music_list: K.ATTR({ count: "0" }, { - music: [] - }), - - sub_pack_id: K.ITEM("s32", 0), - - sub_macchiato_music_list: K.ATTR({ count: "0" }, { - music: [] - }), - - season_music_list: K.ATTR({ count: "0" }), - - match_cnt: K.ITEM("s32", 0), - - achievement_list: K.ATTR({ count: "0" }, { - achievement: [] - }), - - cow_list: K.ATTR({ count: "0" }), - }, - - rivallist: K.ATTR({ count: "0" }), - - only_now_music: K.ATTR({ count: "0" }), - lab_edit_seq: K.ATTR({ count: "0" }), - kac_music: K.ATTR({ count: "0" }), - - memorial: { - latest_event_id: K.ITEM("u8", 1), - player_event_id: K.ITEM("u8", 1), - flag: K.ITEM("u32", 0), - params: K.ARRAY("u32", Array(15).fill(0)) - } -}); diff --git a/jubeat@asphyxia/templates/profiles/knit.ts b/jubeat@asphyxia/templates/profiles/knit.ts deleted file mode 100644 index 8ebb2aa..0000000 --- a/jubeat@asphyxia/templates/profiles/knit.ts +++ /dev/null @@ -1,75 +0,0 @@ -import Profile from "../../models/profile"; - -module.exports = (data: Profile) => ({ - info: { - jubility: K.ITEM("s16", data.knit?.jubility || 0), - jubility_yday: K.ITEM("s16", data.knit?.jubilityYday || 0), - acv_prog: K.ITEM("s8", data.knit?.acvProg || 0), - acv_wool: K.ITEM("s8", data.knit?.acvWool || 0), - acv_route_prog: K.ARRAY("s8", data.knit?.acvRouteProg || [0, 0, 0, 0]), - acv_point: K.ITEM("s32", data.knit?.acvPoint || 0), - tune_cnt: K.ITEM("s32", data.knit?.tuneCount || 0), - save_cnt: K.ITEM("s32", data.knit?.saveCount || 0), - saved_cnt: K.ITEM("s32", data.knit?.savedCount || 0), - fc_cnt: K.ITEM("s32", data.knit?.fcCount || 0), - ex_cnt: K.ITEM("s32", data.knit?.exCount || 0), - match_cnt: K.ITEM("s32", data.knit?.matchCount || 0), - beat_cnt: K.ITEM("s32", 0), - mynews_cnt: K.ITEM("s32", 0), - con_sel_cnt: K.ITEM("s32", data.knit?.conSelCount || 0), - tag_cnt: K.ITEM("s32", 0), - mtg_entry_cnt: K.ITEM("s32", 0), - tag_entry_cnt: K.ITEM("s32", 0), - mtg_hold_cnt: K.ITEM("s32", 0), - tag_hold_cnt: K.ITEM("s32", 0), - mtg_result: K.ITEM("u8", 0) - }, - - last: { - play_time: K.ITEM("s64", BigInt(0)), - shopname: K.ITEM("str", data.lastShopname), - areaname: K.ITEM("str", data.lastAreaname), - title: K.ITEM("s16", data.knit?.title || 0), - theme: K.ITEM("s8", data.knit?.theme || 0), - marker: K.ITEM("s8", data.knit?.marker || 0), - rank_sort: K.ITEM("s8", data.rankSort || 1), - combo_disp: K.ITEM("s8", data.comboDisp || 1), - music_id: K.ITEM("s32", data.musicId || 0), - seq_id: K.ITEM("s8", data.seqId || 0), - sort: K.ITEM("s8", data.knit?.sort || 0), - filter: K.ITEM("s32", data.knit?.filter || 0), - msel_stat: K.ITEM("s8", data.knit?.mselStat || 0), - con_suggest_id: K.ITEM("s8", data.knit?.conSuggestId || 0) - }, - - item: { - secret_list: K.ARRAY("s32", data.knit?.secretList || [0, 0]), - theme_list: K.ITEM("s16", data.knit?.themeList || 0), - marker_list: K.ARRAY("s32", data.knit?.markerList || [0, 0]), - title_list: K.ARRAY("s32", data.knit?.titleList || Array(24).fill(0)), - - new: { - secret_list: K.ARRAY("s32", data.knit?.secretListNew || [0, 0]), - theme_list: K.ITEM("s16", data.knit?.themeListNew || 0), - marker_list: K.ARRAY("s32", data.knit?.markerListNew || [0, 0]), - title_list: K.ARRAY("s32", data.knit?.titleListNew || Array(24).fill(0)) - } - }, - - today_music: { - music_id: K.ITEM("s32", 0) - }, - - news: { - checked: K.ITEM("s16", 0) - }, - - friendlist: K.ATTR({ count: "0" }), - - mylist: K.ATTR({ count: "0" }), - - collabo: { - success: K.ITEM("bool", true), - completed: K.ITEM("bool", true) - } -}); diff --git a/jubeat@asphyxia/templates/profiles/saucer.ts b/jubeat@asphyxia/templates/profiles/saucer.ts deleted file mode 100644 index 025e844..0000000 --- a/jubeat@asphyxia/templates/profiles/saucer.ts +++ /dev/null @@ -1,101 +0,0 @@ -import Profile from "../../models/profile"; - -module.exports = (data: Profile) => ({ - info: { - jubility: K.ITEM("s16", data.saucer?.jubility || 0), - jubility_yday: K.ITEM("s16", data.saucer?.jubilityYday || 0), - tune_cnt: K.ITEM("s32", data.saucer?.tuneCount || 0), - save_cnt: K.ITEM("s32", data.saucer?.saveCount || 0), - saved_cnt: K.ITEM("s32", data.saucer?.savedCount || 0), - fc_cnt: K.ITEM("s32", data.saucer?.fcCount || 0), - ex_cnt: K.ITEM("s32", data.saucer?.exCount || 0), - clear_cnt: K.ITEM("s32", data.saucer?.clearCount || 0), - pf_cnt: K.ITEM("s32", 0), - match_cnt: K.ITEM("s32", data.saucer?.matchCount || 0), - beat_cnt: K.ITEM("s32", 0), - mynews_cnt: K.ITEM("s32", 0), - mtg_entry_cnt: K.ITEM("s32", 0), - mtg_hold_cnt: K.ITEM("s32", 0), - mtg_result: K.ITEM("u8", 0) - }, - - last: { - play_time: K.ITEM("s64", BigInt(0)), - shopname: K.ITEM("str", data.lastShopname), - areaname: K.ITEM("str", data.lastAreaname), - title: K.ITEM("s16", data.saucer?.title || 0), - parts: K.ITEM("s16", data.saucer?.parts || 0), - theme: K.ITEM("s8", data.saucer?.theme || 0), - marker: K.ITEM("s8", data.saucer?.marker || 0), - rank_sort: K.ITEM("s8", data.rankSort || 1), - combo_disp: K.ITEM("s8", data.comboDisp || 1), - music_id: K.ITEM("s32", data.musicId || 0), - seq_id: K.ITEM("s8", data.seqId || 0), - sort: K.ITEM("s8", data.saucer?.sort || 0), - category: K.ITEM("s8", data.saucer?.category || 0) - }, - - item: { - secret_list: K.ARRAY("s32", Array(32).fill(-1)), - theme_list: K.ITEM("s16", -1), - marker_list: K.ARRAY("s32", Array(2).fill(-1)), - title_list: K.ARRAY("s32", Array(96).fill(-1)), - parts_list: K.ARRAY("s32", Array(96).fill(-1)), - - new: { - secret_list: K.ARRAY("s32", Array(32).fill(0)), - theme_list: K.ITEM("s16", 0), - marker_list: K.ARRAY("s32", Array(2).fill(0)), - title_list: K.ARRAY("s32", Array(96).fill(0)) - } - }, - - history: K.ATTR({ count: "0" }), - - challenge: { - today: { - music_id: K.ITEM("s32", 0), - state: K.ITEM("u8", 0) - } - }, - - news: { - checked: K.ITEM("s16", 0) - }, - - bistro: { - info: { - delicious_rate: K.ITEM("float", 1.0), - favorite_rate: K.ITEM("float", 1.0) - }, - - chef: { - id: K.ITEM("s32", 0), - ability: K.ITEM("u8", 0), - remain: K.ITEM("u8", 0), - rate: K.ARRAY("u8", [0, 0, 0, 0]) - }, - - carry_over: K.ITEM("s32", data.saucer?.bistro?.carry_over || 0), - - route: Array(9).fill(0).map((v, i) => (K.ATTR({ no: String(i) }, { - music: { - id: K.ITEM("s32", 0), - price_s32: K.ITEM("s32", 0) - }, - - gourmates: { - id: K.ITEM("s32", 0), - favorite: K.ARRAY("u8", Array(30).fill(0)), - satisfaction_s32: K.ITEM("s32", 0) - } - }))) - }, - - rivallist: K.ATTR({ count: "0" }), - - only_now_music: K.ATTR({ count: "0" }), - requested_music: K.ATTR({ count: "0" }), - lab_edit_seq: K.ATTR({ count: "0" }), - kac_music: K.ATTR({ count: "0" }), -}); diff --git a/jubeat@asphyxia/utils.ts b/jubeat@asphyxia/utils.ts index 222560c..1985db7 100644 --- a/jubeat@asphyxia/utils.ts +++ b/jubeat@asphyxia/utils.ts @@ -1,30 +1,6 @@ -export function getVersion({ model }: EamuseInfo) { - const dateCode = parseInt(model.split(":")[4]); +export function getVersion({ model }: EamuseInfo): number { + if (model.startsWith('H44')) return 1; + if (model.startsWith('I44')) return 2; - if (model.startsWith("J44")) return 3; - if (model.startsWith("K44")) return 4; - if (model.startsWith("L44")) { - if (dateCode >= 2012082400 && dateCode <= 2014022400) return 5; - if (dateCode >= 2014030303 && dateCode <= 2014121802) return 6; - return 0; - } return 0; } - -export function getVersionName({ model }: EamuseInfo) { - const dateCode = parseInt(model.split(":")[4]); - - if (model.startsWith("J44")) return "knit"; - if (model.startsWith("K44")) return "copious"; - if (model.startsWith("L44")) { - if (dateCode >= 2012082400 && dateCode <= 2014022400) return "saucer"; - if (dateCode >= 2014030303 && dateCode <= 2014121802) return "fulfill"; - return null; - } - return null; -} - -export function VersionRange(version: number, start: number, end: number = -1) { - if (end === -1) return version >= start; - return version >= start && version <= end; -}