rhythia-api 142.0.0 → 143.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/submitScore.ts +18 -3
- package/package.json +1 -1
package/api/submitScore.ts
CHANGED
|
@@ -111,13 +111,27 @@ export async function handler({
|
|
|
111
111
|
playcount: (beatmaps.playcount || 1) + 1,
|
|
112
112
|
});
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
let passed = true;
|
|
115
|
+
|
|
116
|
+
// Pass invalidation
|
|
117
|
+
if (data.misses + data.hits !== beatmaps.noteCount) {
|
|
118
|
+
passed = false;
|
|
119
|
+
}
|
|
120
|
+
|
|
116
121
|
const accurracy = data.hits / beatmaps.noteCount;
|
|
117
122
|
let awarded_sp = 0;
|
|
118
123
|
|
|
124
|
+
console.log(
|
|
125
|
+
data.misses + data.hits == beatmaps.noteCount,
|
|
126
|
+
data.misses + data.hits,
|
|
127
|
+
beatmaps.noteCount
|
|
128
|
+
);
|
|
129
|
+
|
|
119
130
|
if (beatmaps.starRating) {
|
|
120
|
-
awarded_sp = calculatePerformancePoints(
|
|
131
|
+
awarded_sp = calculatePerformancePoints(
|
|
132
|
+
data.speed * beatmaps.starRating,
|
|
133
|
+
accurracy
|
|
134
|
+
);
|
|
121
135
|
}
|
|
122
136
|
|
|
123
137
|
if (beatmapPages.status == "UNRANKED") {
|
|
@@ -133,6 +147,7 @@ export async function handler({
|
|
|
133
147
|
passed,
|
|
134
148
|
misses: data.misses,
|
|
135
149
|
awarded_sp: Math.round(awarded_sp * 100) / 100,
|
|
150
|
+
speed: data.speed,
|
|
136
151
|
});
|
|
137
152
|
console.log("p2");
|
|
138
153
|
|