Merge branch 'master' into newads

This commit is contained in:
Miodec 2023-04-06 01:40:35 +02:00
commit 4262144c85
3 changed files with 5 additions and 0 deletions

View file

@ -322,6 +322,7 @@ export async function addResult(
delete result.keyOverlap;
delete result.lastKeyToEnd;
delete result.startToFirstKey;
delete result.charTotal;
if (req.ctx.configuration.users.lastHashesCheck.enabled) {
let lastHashes = user.lastReultHashes ?? [];

View file

@ -8,6 +8,7 @@ const RESULT_SCHEMA = joi
blindMode: joi.boolean().required(),
challenge: joi.string(),
charStats: joi.array().items(joi.number().min(0)).required(),
charTotal: joi.number().min(0),
chartData: joi
.alternatives()
.try(

View file

@ -1307,6 +1307,7 @@ interface CompletedEvent extends MonkeyTypes.Result<MonkeyTypes.Mode> {
keyOverlap: number;
lastKeyToEnd: number;
startToFirstKey: number;
charTotal: number;
}
type PartialCompletedEvent = Omit<Partial<CompletedEvent>, "chartData"> & {
@ -1359,6 +1360,7 @@ function buildCompletedEvent(difficultyFailed: boolean): CompletedEvent {
wpm: undefined,
rawWpm: undefined,
charStats: undefined,
charTotal: undefined,
acc: undefined,
mode: Config.mode,
mode2: undefined,
@ -1414,6 +1416,7 @@ function buildCompletedEvent(difficultyFailed: boolean): CompletedEvent {
stats.extraChars,
stats.missedChars,
];
completedEvent.charTotal = stats.allChars;
completedEvent.acc = stats.acc;
// if the last second was not rounded, add another data point to the history