This commit is contained in:
Natsumi
2025-07-24 21:42:59 +12:00
parent ab2b38000e
commit 96dfe2fcef

View File

@@ -874,15 +874,26 @@ const gameLog = {
await sqliteService.execute( await sqliteService.execute(
(dbRow) => { (dbRow) => {
var [created_at_iso, created_at_ts, location, time, worldName, groupName, eventId, eventType] = dbRow; var [
created_at_iso,
created_at_ts,
location,
time,
worldName,
groupName,
eventId,
eventType
] = dbRow;
if ( if (
!currentGroup !currentGroup ||
|| currentGroup.location !== location currentGroup.location !== location ||
|| ( (created_at_ts - currentGroup.last_ts >
(created_at_ts - currentGroup.last_ts) > groupingTimeTolerance // groups multiple OnPlayerJoined and OnPlayerLeft together if they are within time tolerance limit groupingTimeTolerance && // groups multiple OnPlayerJoined and OnPlayerLeft together if they are within time tolerance limit
&& !(prevEvent === "OnPlayerJoined" && eventType === "OnPlayerLeft") // allows OnPlayerLeft to connect with nearby OnPlayerJoined !(
) prevEvent === 'OnPlayerJoined' &&
eventType === 'OnPlayerLeft'
)) // allows OnPlayerLeft to connect with nearby OnPlayerJoined
) { ) {
currentGroup = { currentGroup = {
created_at: created_at_iso, created_at: created_at_iso,
@@ -891,7 +902,7 @@ const gameLog = {
worldName, worldName,
groupName, groupName,
events: [eventId], events: [eventId],
last_ts: created_at_ts, last_ts: created_at_ts
}; };
data.add(currentGroup); data.add(currentGroup);