Merge branch 'dev'
This commit is contained in:
commit
21755837f4
5 changed files with 46 additions and 20 deletions
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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<void> {
|
||||
await reportPlayGameQuestProgress(refreshQuest(quest), true, QuestifyLogger, {
|
||||
attempts: 3,
|
||||
delay: 2500,
|
||||
});
|
||||
}
|
||||
|
||||
async function handleQuestComplete(): Promise<void> {
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export default definePlugin({
|
|||
replace: "$self.WarningCard(),"
|
||||
},
|
||||
{
|
||||
match: /(?<=marginBottom:16)(?=\},)/,
|
||||
match: /(?<=,marginBottom:16)(?=\},children:\[)/,
|
||||
replace: ',flexDirection:"row",alignItems:"center"'
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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!);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue