diff --git a/src/equicordplugins/platformSpoofer/index.tsx b/src/equicordplugins/platformSpoofer/index.tsx index aab45545a..e15a5df17 100644 --- a/src/equicordplugins/platformSpoofer/index.tsx +++ b/src/equicordplugins/platformSpoofer/index.tsx @@ -62,18 +62,17 @@ export default definePlugin({ patches: [ { find: "_doIdentify(){", - replacement: { - match: /(\[IDENTIFY\].*let.{0,5}=\{.*properties:)(.*),presence/, - replace: "$1{...$2,...$self.getPlatform(true)},presence" - } + replacement: [ + { + match: /window._ws=null,null!=\i/, + replace: "false" + }, + { + match: /(?<="GatewaySocket"\)\}\),properties:)(\i)/, + replace: "{...$1,...$self.getPlatform(true)}" + }, + ] }, - { - find: '("AppSkeleton");', - replacement: { - match: /(?<=\.isPlatformEmbedded.{0,50}\i\)\)\}.{0,30})\i\?\i\.\i\.set\(.{0,10}:/, - replace: "" - } - } ], getPlatform(bypass, userId?: any) { const platform = settings.store.platform ?? "desktop"; diff --git a/src/equicordplugins/questify/index.tsx b/src/equicordplugins/questify/index.tsx index b9c9b41c3..616f3ab16 100644 --- a/src/equicordplugins/questify/index.tsx +++ b/src/equicordplugins/questify/index.tsx @@ -282,6 +282,14 @@ function QuestTileContextMenu(children: React.ReactNode[], props: { quest: any; clearInterval(interval.progressTimeout); clearTimeout(interval.rerenderTimeout); activeQuestIntervals.delete(props.quest.id); + + if (interval.type === "play") { + void reportPlayGameQuestProgress(refreshQuest(props.quest), true, QuestifyLogger, { + attempts: 3, + delay: 2500, + }); + } + resetQuestsToResume(props.quest); rerenderQuests(); } @@ -820,9 +828,18 @@ async function startPlayGameProgressTracking(quest: Quest, target: { raw: number } } - function handleQuestComplete(): void { + async function sendTerminalHeartbeat(): Promise { + await reportPlayGameQuestProgress(refreshQuest(quest), true, QuestifyLogger, { + attempts: 3, + delay: 2500, + }); + } + + async function handleQuestComplete(): Promise { clearTrackingTimers(); activeQuestIntervals.delete(quest.id); + + await sendTerminalHeartbeat(); QuestifyLogger.info(`[${getFormattedNow()}] Quest ${questName} completed.`); if (settings.store.notifyOnQuestComplete) { @@ -855,7 +872,7 @@ async function startPlayGameProgressTracking(quest: Quest, target: { raw: number } if (result.completed || result.progress >= questTarget) { - handleQuestComplete(); + await handleQuestComplete(); return; } @@ -899,7 +916,7 @@ async function startPlayGameProgressTracking(quest: Quest, target: { raw: number } if (initial.completed || initial.progress >= questTarget) { - handleQuestComplete(); + await handleQuestComplete(); return; } @@ -1988,6 +2005,15 @@ export default definePlugin({ } activeQuestIntervals.forEach((intervalData, questId) => { + const quest = QuestsStore.getQuest(questId); + + if (intervalData.type === "play" && quest) { + void reportPlayGameQuestProgress(refreshQuest(quest), true, QuestifyLogger, { + attempts: 3, + delay: 2500, + }); + } + clearInterval(intervalData.progressTimeout); clearTimeout(intervalData.rerenderTimeout); activeQuestIntervals.delete(questId); diff --git a/src/equicordplugins/questify/utils/misc.tsx b/src/equicordplugins/questify/utils/misc.tsx index fa91de5f3..7f7eb1b31 100644 --- a/src/equicordplugins/questify/utils/misc.tsx +++ b/src/equicordplugins/questify/utils/misc.tsx @@ -346,14 +346,14 @@ export async function reportPlayGameQuestProgress(quest: Quest, terminal: boolea if (!quest.userStatus?.enrolledAt) { logger?.warn(`[${getFormattedNow()}] Cannot send heartbeat for unenrolled Quest ${questName}.`); return { progress: null, completed: false }; - } else if (quest.userStatus?.completedAt) { + } else if (quest.userStatus?.completedAt && !terminal) { return { progress: null, completed: true }; } const maxAttempts = options?.attempts ?? 1; const delay = options?.delay ?? 2500; const timeout = options?.timeout ?? 10000; - const streamKey = options?.streamKey ?? `call:${quest.id}:1`; + const streamKey = options?.streamKey; const applicationId = options?.applicationId ?? quest.config.application.id; const questPlayType = quest.config.taskConfigV2?.tasks.PLAY_ON_DESKTOP || quest.config.taskConfigV2?.tasks.PLAY_ON_XBOX || quest.config.taskConfigV2?.tasks.PLAY_ON_PLAYSTATION || quest.config.taskConfigV2?.tasks.PLAY_ACTIVITY; diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx index 3e39182be..9c1802577 100644 --- a/src/plugins/experiments/index.tsx +++ b/src/plugins/experiments/index.tsx @@ -71,7 +71,7 @@ export default definePlugin({ replace: "$self.WarningCard()," }, { - match: /(?<=marginBottom:16)(?=\},)/, + match: /(?<=,marginBottom:16)(?=\},children:\[)/, replace: ',flexDirection:"row",alignItems:"center"' } ] diff --git a/src/plugins/reviewDB/components/ReviewsView.tsx b/src/plugins/reviewDB/components/ReviewsView.tsx index e858d13b8..2564eff20 100644 --- a/src/plugins/reviewDB/components/ReviewsView.tsx +++ b/src/plugins/reviewDB/components/ReviewsView.tsx @@ -66,10 +66,11 @@ export default function ReviewsView({ fallbackValue: null, deps: [refetchSignal, signal, page], onSuccess: data => { - if (settings.store.hideBlockedUsers) - data!.reviews = data!.reviews?.filter(r => !RelationshipStore.isBlocked(r.sender.discordID)); + if (settings.store.hideBlockedUsers) data!.reviews = data!.reviews?.filter(r => !RelationshipStore.isBlocked(r.sender.discordID)); + const systemReviews = data!.reviews.filter(r => r.type === ReviewType.System); + const normalReviews = data!.reviews.filter(r => r.type !== ReviewType.System); - data!.reviews.reverse(); + data!.reviews = [...systemReviews, ...normalReviews.reverse()]; scrollToTop?.(); onFetchReviews(data!); }