Time spent in world, world PC/Quest badge, fix Nuisance badge

This commit is contained in:
Natsumi
2022-01-01 00:10:08 +13:00
parent b8b996997a
commit b76858a960
3 changed files with 45 additions and 5 deletions

View File

@@ -751,6 +751,20 @@ class Database {
return ref;
}
async getTimeSpentInWorld(input) {
var worldId = input.replaceAll("'", '');
var ref = {
timeSpent: 0,
worldId: input
};
await sqliteService.execute((row) => {
if (typeof row[0] === 'number') {
ref.timeSpent += row[0];
}
}, `SELECT time FROM gamelog_location WHERE world_id = '${worldId}'`);
return ref;
}
async getLastSeen(input) {
var userId = input.id.replaceAll("'", '');
var displayName = input.displayName.replaceAll("'", "''");