Skip to content

Commit

Permalink
[update] DX 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
Diving-Fish committed Jun 5, 2024
1 parent 4708aaa commit a5791bc
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
node_modules
dist
database/config.json
database/advertisement.json


# local env files
Expand Down
3 changes: 2 additions & 1 deletion database/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
from app import app
import asyncio

app.run(host='0.0.0.0', port=8333, loop=asyncio.get_event_loop(), use_reloader=False)
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8333, loop=asyncio.get_event_loop(), use_reloader=False)
8 changes: 7 additions & 1 deletion database/models/maimai.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,15 @@ def get_plate_name(version, plate_type):
"maimai MiLK": "白",
"MiLK PLUS": "雪",
"maimai FiNALE": "輝",
"ALL FiNALE": "舞",
"maimai でらっくす": "熊",
"maimai でらっくす PLUS": "華",
"maimai でらっくす Splash": "爽",
"maimai でらっくす Splash PLUS": "煌",
"maimai でらっくす UNiVERSE": "宙",
"maimai でらっくす UNiVERSE PLUS": "星"
"maimai でらっくす UNiVERSE PLUS": "星",
"maimai でらっくす FESTiVAL": "祭",
"maimai でらっくす FESTiVAL PLUS": "祝"
}[version]+{
1: "極",
2: "将",
Expand Down Expand Up @@ -173,6 +176,9 @@ def record_json(record: NewRecord, masked: bool):
"ds": record.ds,
"song_id": record.id
}
if data["song_id"] >= 100000:
data["ra"] = 0
data["level_label"] = "Utage"
return data


Expand Down
21 changes: 20 additions & 1 deletion database/routes/maimai.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,25 @@ async def get_records():
}


@app.route("/player/test_data", methods=['GET'])
async def get_records_test():
r = NewRecord.raw('select newrecord.achievements, newrecord.fc, newrecord.fs, newrecord.dxScore, chart.ds as ds, chart.level as level, chart.difficulty as diff, music.type as `type`, music.id as `id`, music.is_new as is_new, music.title as title from newrecord, chart, music where player_id = %s and chart_id = chart.id and chart.music_id = music.id', '636')
user = Player.get(Player.id == 636)
await compute_ra(user)
records = []
for record in r:
elem = record_json(record, False)
records.append(elem)
return {
"username": "DivingFish",
"rating": user.rating,
"additional_rating": user.additional_rating,
"nickname": user.nickname,
"plate": user.plate,
"records": records
}


@app.route("/dev/player/records", methods=['GET'])
@developer_required
async def dev_get_records():
Expand Down Expand Up @@ -270,7 +289,7 @@ def get_dx_and_sd(player):


def get_dx_and_sd_for50(player):
l = NewRecord.raw('select newrecord.achievements, newrecord.fc, newrecord.fs, newrecord.dxScore, chart.ds as ds, chart.level as level, chart.difficulty as diff, music.type as `type`, music.id as `id`, music.is_new as is_new, music.title as title from newrecord, chart, music where player_id = %s and chart_id = chart.id and chart.music_id = music.id', player.id)
l = NewRecord.raw('select newrecord.achievements, newrecord.fc, newrecord.fs, newrecord.dxScore, chart.ds as ds, chart.level as level, chart.difficulty as diff, music.type as `type`, music.id as `id`, music.is_new as is_new, music.title as title from newrecord, chart, music where player_id = %s and chart_id = chart.id and chart.music_id = music.id and chart.music_id < 100000', player.id)
l1 = []
l2 = []
for r in l:
Expand Down
29 changes: 17 additions & 12 deletions web/src/components/ChartTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,44 +140,44 @@
:color="getLevel(item.level_index)"
dark
>
{{ item.level_label }} {{ item.level }}
{{ item.level_label }} {{ item.level }}{{ item.song_id > 100000 ? '?' : '' }}
</v-chip>
</template>
<span v-if="music_data_dict[item.song_id]">
Charter:
{{ music_data_dict[item.song_id].charts[item.level_index].charter }}
{{ music_data_dict[item.song_id].charts[getActualLevelIndex(item)].charter }}
<br />
Tap:
{{
music_data_dict[item.song_id].charts[item.level_index].notes[0]
music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[0]
}}
<br />
Hold:
{{
music_data_dict[item.song_id].charts[item.level_index].notes[1]
music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[1]
}}
<br />
Slide:
{{
music_data_dict[item.song_id].charts[item.level_index].notes[2]
music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[2]
}}
<br />
<span v-if="music_data_dict[item.song_id].type == 'DX'">
Touch:
{{
music_data_dict[item.song_id].charts[item.level_index].notes[3]
music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[3]
}}
<br />
Break:
{{
music_data_dict[item.song_id].charts[item.level_index].notes[4]
music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[4]
}}
<br />
</span>
<span v-else>
Break:
{{
music_data_dict[item.song_id].charts[item.level_index].notes[3]
music_data_dict[item.song_id].charts[getActualLevelIndex(item)].notes[3]
}}
<br />
</span>
Expand Down Expand Up @@ -211,7 +211,7 @@
</v-tooltip>
</template>
<template #item.fit_diff="{ item }">
<v-tooltip top v-if="chart_stats.charts[item.song_id] && chart_stats.charts[item.song_id][item.level_index]">
<v-tooltip top v-if="chart_stats.charts[item.song_id] && chart_stats.charts[item.song_id][getActualLevelIndex(item)]">
<template v-slot:activator="{ on, attrs }">
<span
v-bind="attrs"
Expand Down Expand Up @@ -337,7 +337,7 @@ export default {
return (i + "").padStart(5, "0") + ".png";
},
getLevel(index) {
return ["#22bb5b", "#fb9c2d", "#f64861", "#9e45e2", "#ba67f8"][index];
return ["#22bb5b", "#fb9c2d", "#f64861", "#9e45e2", "#ba67f8", "#ff70ff"][index];
},
getFC(str) {
if (str.startsWith("fc")) return "green";
Expand All @@ -347,6 +347,11 @@ export default {
if (str.startsWith("fsd")) return "orange";
return "blue";
},
getActualLevelIndex(record)
{
if (record.song_id > 100000) return 0;
return record.level_index;
},
getName(str) {
const map = {
fc: "FC",
Expand All @@ -369,7 +374,7 @@ export default {
showChart(item) {
if (this.chart_stats.charts[item.song_id] == undefined) return;
this.item = item;
this.chart_stat = this.chart_stats.charts[item.song_id][item.level_index];
this.chart_stat = this.chart_stats.charts[item.song_id][this.getActualLevelIndex(item)];
this.diff_stat = this.chart_stats.diff_data[item.level];
const ach_name_map = [
"D",
Expand Down Expand Up @@ -652,7 +657,7 @@ export default {
"bpm" + this.music_data_dict[item.song_id].basic_info.bpm + "$",
"^" + this.music_data_dict[item.song_id].basic_info.bpm + "$",
"^" +
this.music_data_dict[item.song_id].charts[item.level_index]
this.music_data_dict[item.song_id].charts[this.getActualLevelIndex(item)]
.charter +
"$",
"^" + item.ra + "$",
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/PlateQualifier.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export default {
// Just verify master level.
let res = {};
for (const ver of this.versions) {
if (ver == "maimai でらっくす FESTiVAL")
if (ver == "maimai でらっくす BUDDiES")
continue;
let d = this.filter_version(ver).filter((elem) => elem.title != 'ジングルベル')
.map((elem) => {
Expand Down
5 changes: 3 additions & 2 deletions web/src/components/ProSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export default {
{ text: "Expert", value: 2 },
{ text: "Master", value: 3 },
{ text: "Re:MASTER", value: 4 },
{ text: "Utage", value: 5 }
],
rate_filter_items: [
{ text: "SSS+", value: "sssp" },
Expand Down Expand Up @@ -376,7 +377,7 @@ export default {
this.$vuetify.theme.dark = this.darkTheme;
},
getLevel(index) {
return ["#22bb5b", "#fb9c2d", "#f64861", "#9e45e2", "#ba67f8"][index];
return ["#22bb5b", "#fb9c2d", "#f64861", "#9e45e2", "#ba67f8", "#ff70ff"][index];
},
getFC(str) {
if (!str) return "grey";
Expand Down Expand Up @@ -410,7 +411,7 @@ export default {
reset() {
this.fc_filter = [0, "fc", "fcp", "ap", "app"];
this.fs_filter = [0, "fs", "fsp", "fsd", "fsdp"];
this.diff_filter = [0, 1, 2, 3, 4];
this.diff_filter = [0, 1, 2, 3, 4, 5];
this.rate_filter = [
"sssp",
"sss",
Expand Down
4 changes: 4 additions & 0 deletions web/src/components/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ export default {
"maimai でらっくす Splash PLUS",
"maimai でらっくす UNiVERSE",
"maimai でらっくす UNiVERSE PLUS",
"maimai でらっくす FESTiVAL",
"maimai でらっくす FESTiVAL PLUS",
],
t2n: { 1: "", 2: "", 4: "舞舞", 8: "", "": 8, "舞舞": 4, "": 2, "": 1},
versions: [],
Expand Down Expand Up @@ -450,6 +452,8 @@ export default {
["maimai でらっくす Splash PLUS", ""],
["maimai でらっくす UNiVERSE", ""],
["maimai でらっくす UNiVERSE PLUS", ""],
["maimai でらっくす FESTiVAL", ""],
["maimai でらっくす FESTiVAL PLUS", ""],
]) {
this.v2n[elem[1]] = elem[0];
this.v2n[elem[0]] = elem[1];
Expand Down
12 changes: 10 additions & 2 deletions web/src/pages/MainPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ export default {
chuni_records: [],
chuni_data: [],
chuni_data_dict: {},
level_label: ["Basic", "Advanced", "Expert", "Master", "Re:MASTER"],
level_label: ["Basic", "Advanced", "Expert", "Master", "Re:MASTER", "Utage"],
feedbackText: "",
feedbackVisible: false,
loginVisible: false,
Expand Down Expand Up @@ -593,6 +593,7 @@ export default {
},
dxDisplay: function () {
const that = this;
console.log(this.dxData);
return this.dxData.filter((elem) => {
return (
that.$refs.filterSlider.f(elem) &&
Expand Down Expand Up @@ -939,8 +940,15 @@ export default {
record.level = arr[0];
}
}
if (record.song_id >= 100000)
{
record.ra = 0;
record.level_index = 5
}
else {
record.ra = new ScoreCoefficient(record.achievements).ra(record.ds);
}
record.level_label = this.level_label[record.level_index];
record.ra = new ScoreCoefficient(record.achievements).ra(record.ds);
if (isNaN(record.ra)) record.ra = 0;
// Update Rate
if (record.achievements < 50) {
Expand Down

0 comments on commit a5791bc

Please sign in to comment.