feat: Add online overlap visualization in user activity tab

This commit is contained in:
pa
2026-03-19 16:15:27 +09:00
parent 41ff04b49f
commit 6c1058a9d5
6 changed files with 1061 additions and 43 deletions

View File

@@ -1372,6 +1372,23 @@ const gameLog = {
return instances;
},
/**
* Get current user's online sessions from gamelog_location
* Each row has created_at (leave time) and time (duration in ms)
* Session start = created_at - time, Session end = created_at
* @returns {Promise<Array<{created_at: string, time: number}>>}
*/
async getCurrentUserOnlineSessions() {
const data = [];
await sqliteService.execute(
(dbRow) => {
data.push({ created_at: dbRow[0], time: dbRow[1] || 0 });
},
`SELECT created_at, time FROM gamelog_location ORDER BY created_at`
);
return data;
},
async getUserIdFromDisplayName(displayName) {
var userId = '';
await sqliteService.execute(