1116 lines
52 KiB
TypeScript
1116 lines
52 KiB
TypeScript
/* Metro module 16218; source: modules/quests/managers/QuestProgressManager.tsx; dependencies: [57, 5, 6, 7, 15, 17, 18, 1378, 8065, 4266, 4492, 4267, 4300, 7093, 15385, 6528, 672, 7099, 7091, 9511, 9524, 6529, 9484, 6531, 7120, 4484, 4483, 6535, 7116, 4285, 1360, 4482, 7114, 4860, 2] */
|
|
function _fun125360(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#125360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:6, offset: 0x025d60ea, size: 584 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_125366 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importDefault(57) /* metro dependency 57 */;
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_4 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_5 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_6 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_7 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_8 = importDefault(18) /* metro dependency 18 */;
|
|
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
|
|
const framesStore = importDefault(8065) /* metro dependency 8065: FramesStore */;
|
|
const runningGameStoreNative = importDefault(4266) /* metro dependency 4266: RunningGameStoreNative */;
|
|
const applicationStreamingStore = importDefault(4492) /* metro dependency 4492: ApplicationStreamingStore */;
|
|
const detectableGameStore = importDefault(4267) /* metro dependency 4267: DetectableGameStore */;
|
|
const sortedVoiceStateStore = importDefault(4300) /* metro dependency 4300: SortedVoiceStateStore */;
|
|
const questStore = importDefault(7093) /* metro dependency 7093: QuestStore */;
|
|
const unenrolledActivityQuestStore = importDefault(15385) /* metro dependency 15385: UnenrolledActivityQuestStore */;
|
|
let value = require(6528) /* metro dependency 6528: QuestConstants */;
|
|
const env0_17 = value.DISCORD_APPLICATION_ID;
|
|
const QuestsExperimentLocations = value.QuestsExperimentLocations;
|
|
let Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const MINUTE = Millis.MINUTE;
|
|
const env0_19 = 1 * MINUTE;
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const SECOND = Millis.SECOND;
|
|
const env0_20 = 1 * SECOND;
|
|
value = require(7099) /* metro dependency 7099: getQuestLogger */;
|
|
const getQuestLogger = value.getQuestLogger;
|
|
const QUESTS_MANAGER = QuestsExperimentLocations.QUESTS_MANAGER;
|
|
const env0_21 = Reflect.apply(getQuestLogger, value, [{location: QUESTS_MANAGER}]);
|
|
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
|
|
value = _fun125372(value);
|
|
value = new value();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/managers/QuestProgressManager.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_125361() { // fn#125361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:322, offset: 0x025d6332, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_125361_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_125364(a0, a1) { // fn#125364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:515, offset: 0x025d6394, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun125365;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_125366(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_125366(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_125366(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun125365;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function isQuestProgressable(a0) { // fn#125367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:1539, offset: 0x025d6508, size: 101 bytes, params: 2, frame: 12
|
|
let value = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
value = value.isQuestExpired(a0);
|
|
return !value && a0.userStatus != null && a0.userStatus.enrolledAt != null && a0.userStatus.completedAt == null;
|
|
}
|
|
|
|
function handleEmbeddedActivityLaunchSuccess(a0) { // fn#125368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:1689, offset: 0x025d656d, size: 359 bytes, params: 2, frame: 20
|
|
var r4;
|
|
var value4;
|
|
var config;
|
|
var features;
|
|
var includes;
|
|
var QuestVariants;
|
|
var MOBILE_ACTIVITY_QUEST;
|
|
var value5;
|
|
var enrollInQuest;
|
|
var id;
|
|
const QuestContent = (require(6531) /* metro dependency 6531: QuestTypes */).QuestContent;
|
|
var RUNNING_ACTIVITY;
|
|
let value = environment;
|
|
const getState = UnenrolledActivityQuestStore.getState;
|
|
const autoEnroll = Reflect.apply(getState, UnenrolledActivityQuestStore, []).autoEnroll;
|
|
const DesktopActivityQuestHeaderExperiment = (require(9511) /* metro dependency 9511: experiments */).DesktopActivityQuestHeaderExperiment;
|
|
const getConfig = DesktopActivityQuestHeaderExperiment.getConfig;
|
|
let object2 = {};
|
|
const QUEST_ACTIVITY_HEADER = QuestsExperimentLocations.QUEST_ACTIVITY_HEADER;
|
|
object2.location = QUEST_ACTIVITY_HEADER;
|
|
Reflect.apply(getConfig, DesktopActivityQuestHeaderExperiment, [object2]).enabled;
|
|
const quests = QuestStore.quests;
|
|
const _createForOfIteratorHelperLoose_125364Binding = _createForOfIteratorHelperLoose_125364;
|
|
const questMatchingUtilsModule = require(9524) /* metro dependency 9524: QuestMatchingUtils */;
|
|
const getEligibleQuestsForApplicationId = questMatchingUtilsModule.getEligibleQuestsForApplicationId;
|
|
const value2 = _createForOfIteratorHelperLoose_125364Binding(Reflect.apply(getEligibleQuestsForApplicationId,
|
|
questMatchingUtilsModule, [quests, a0]));
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r4 = value3;
|
|
reducibleLoop1: while (true) {
|
|
value4 = r4.value;
|
|
if (autoEnroll) {
|
|
config = value4.config;
|
|
features = config.features;
|
|
includes = features.includes;
|
|
QuestVariants = (require(6529) /* metro dependency 6529: QuestVariants */).QuestVariants;
|
|
MOBILE_ACTIVITY_QUEST = QuestVariants.MOBILE_ACTIVITY_QUEST;
|
|
reducibleJoin3: while (true) {
|
|
if (Reflect.apply(includes, features, [MOBILE_ACTIVITY_QUEST])) {
|
|
value = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
enrollInQuest = value.enrollInQuest;
|
|
id = value4.id;
|
|
object2 = {};
|
|
RUNNING_ACTIVITY = QuestContent.RUNNING_ACTIVITY;
|
|
object2.questContent = RUNNING_ACTIVITY;
|
|
object2.questContentCTA = (require(7120) /* metro dependency 7120: AnalyticsTypes */).QuestContentCTA.START_QUEST;
|
|
RUNNING_ACTIVITY = QuestContent.RUNNING_ACTIVITY;
|
|
object2.sourceQuestContent = RUNNING_ACTIVITY;
|
|
return Reflect.apply(enrollInQuest, value, [id, object2]);
|
|
}
|
|
break reducibleJoin3;
|
|
}
|
|
}
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
return undefined;
|
|
}
|
|
r4 = value5;
|
|
continue reducibleLoop1;
|
|
}
|
|
}
|
|
}
|
|
|
|
function isQuestRobloxRelated(a0, a1) { // fn#125369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:2287, offset: 0x025d66d4, size: 79 bytes, params: 3, frame: 14
|
|
var r1;
|
|
var r0;
|
|
let value = a1 != null;
|
|
if (value) {
|
|
value = a0.some(function(a0) {
|
|
var ROBLOX_APPLICATION_ID = require(dependencyMap[25]).ROBLOX_APPLICATION_ID;
|
|
return a0 === ROBLOX_APPLICATION_ID;
|
|
});
|
|
if (value) {
|
|
value = require(4483) /* metro dependency 4483: RobloxSubgameUtils */;
|
|
value = value.isRobloxSubgame(a1);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function manualHeartbeatInitializationQuest(a0) { // fn#125371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:2419, offset: 0x025d674b, size: 73 bytes, params: 2, frame: 14
|
|
return a0 != null && a0.config.features.includes((require(6529) /* metro dependency 6529: QuestVariants */).QuestVariants.MANUAL_HEARTBEAT_INITIALIZATION);
|
|
}
|
|
|
|
function _fun125372(a0) { // fn#125372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:2572, offset: 0x025d6794, size: 180 bytes, params: 2, frame: 16
|
|
const closure = QuestProgressManager;
|
|
env0_8(closure, a0);
|
|
return env0_5(closure, [{key: 'syncHeartbeats', value: function(a0, a1, a2) {
|
|
}}, {key: 'getActivelyProgressingQuests', value: value_125402}, {key: 'getActivelyProgressingPlayOnDesktopQuests',
|
|
value: value_125403}, {key: 'getActivelyProgressingStreamOnDesktopQuests', value: value_125406},
|
|
{key: 'getActivelyProgressingActivityQuests', value: value_125407}]);
|
|
}
|
|
|
|
function QuestProgressManager(a0) { // fn#125373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:2584, offset: 0x025d6848, size: 608 bytes, params: 2, frame: 22
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_4;
|
|
binding(this, QuestProgressManager);
|
|
let object = [];
|
|
arraySpread(object, value, 0, undefined);
|
|
value = env1_7(QuestProgressManager);
|
|
binding = env1_6;
|
|
if (_isNativeReflectConstruct_125361()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, object, env1_7(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, object);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
object = {};
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const PLAY_ON_DESKTOP = FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP;
|
|
let Map = global.Map;
|
|
const value4 = Object.create(Map.prototype, {constructor: {value: Map}});
|
|
let map = new Map();
|
|
object[PLAY_ON_DESKTOP] = map instanceof Object ? map : value4;
|
|
const STREAM_ON_DESKTOP = FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP;
|
|
Map = global.Map;
|
|
const value6 = Object.create(Map.prototype, {constructor: {value: Map}});
|
|
map = new Map();
|
|
object[STREAM_ON_DESKTOP] = map instanceof Object ? map : value6;
|
|
let PLAY_ACTIVITY = FirstPartyQuestTaskTypes.PLAY_ACTIVITY;
|
|
Map = global.Map;
|
|
const value8 = Object.create(Map.prototype, {constructor: {value: Map}});
|
|
map = new Map();
|
|
object[PLAY_ACTIVITY] = map instanceof Object ? map : value8;
|
|
value.heartbeats = object;
|
|
value.calculateHeartbeatDurationMs = calculateHeartbeatDurationMs;
|
|
value.initiateHeartbeat = initiateHeartbeat;
|
|
value.terminateHeartbeat = terminateHeartbeat;
|
|
value.handleSendHeartbeatSuccess = handleSendHeartbeatSuccess;
|
|
value.handleSendHeartbeatFailure = handleSendHeartbeatFailure;
|
|
object = {QUESTS_FETCH_CURRENT_QUESTS_SUCCESS: QUESTS_FETCH_CURRENT_QUESTS_SUCCESS_125380,
|
|
QUESTS_ENROLL_SUCCESS: QUESTS_ENROLL_SUCCESS_125381};
|
|
var handleSendHeartbeatSuccess = value.handleSendHeartbeatSuccess;
|
|
object.QUESTS_SEND_HEARTBEAT_SUCCESS = handleSendHeartbeatSuccess;
|
|
var handleSendHeartbeatFailure = value.handleSendHeartbeatFailure;
|
|
object.QUESTS_SEND_HEARTBEAT_FAILURE = handleSendHeartbeatFailure;
|
|
object.QUESTS_PREVIEW_UPDATE_SUCCESS = QUESTS_PREVIEW_UPDATE_SUCCESS_125383;
|
|
object.RUNNING_GAMES_CHANGE = RUNNING_GAMES_CHANGE_125384;
|
|
object.RUNNING_NON_GAMES_CHANGE = RUNNING_NON_GAMES_CHANGE;
|
|
object.STREAM_START = STREAM_START_125386;
|
|
object.STREAM_CREATE = STREAM_CREATE_125387;
|
|
object.STREAM_CLOSE = STREAM_CLOSE_125388;
|
|
object.PASSIVE_UPDATE_V2 = PASSIVE_UPDATE_V2_125389;
|
|
object.VOICE_STATE_UPDATES = VOICE_STATE_UPDATES_125390;
|
|
object.EMBEDDED_ACTIVITY_LAUNCH_SUCCESS = function({applicationId}) {
|
|
handleEmbeddedActivityLaunchSuccess(applicationId);
|
|
};
|
|
const env0_1 = env1_3(_fun125393);
|
|
object.FRAME_LAUNCH = FRAME_LAUNCH_125395;
|
|
object.FRAME_STOP = FRAME_STOP_125396;
|
|
object.EMBEDDED_ACTIVITY_UPDATE_V2 = EMBEDDED_ACTIVITY_UPDATE_V2_125397;
|
|
object.QUEST_APPLICATION_START_TIMER = function({questId}) {
|
|
var binding = questId;
|
|
var PLAY_ACTIVITY = require(dependencyMap[27]).FirstPartyQuestTaskTypes.PLAY_ACTIVITY;
|
|
binding.syncHeartbeats([PLAY_ACTIVITY], 'QUEST_APPLICATION_START_TIMER', _fun125400);
|
|
};
|
|
value.actions = object;
|
|
return value;
|
|
}
|
|
|
|
function value_125402(a0) { // fn#125402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:8330, offset: 0x025d762d, size: 191 bytes, params: 2, frame: 15
|
|
const value = environment.__proto__;
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const PLAY_ON_DESKTOP = FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP;
|
|
if (PLAY_ON_DESKTOP === a0) {
|
|
return this.getActivelyProgressingPlayOnDesktopQuests();
|
|
}
|
|
const STREAM_ON_DESKTOP = FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP;
|
|
if (STREAM_ON_DESKTOP === a0) {
|
|
return this.getActivelyProgressingStreamOnDesktopQuests();
|
|
}
|
|
const PLAY_ACTIVITY = FirstPartyQuestTaskTypes.PLAY_ACTIVITY;
|
|
if (PLAY_ACTIVITY === a0) {
|
|
return this.getActivelyProgressingActivityQuests();
|
|
}
|
|
(require(1360) /* metro dependency 1360: GlobalUtils */).assertNever(a0);
|
|
}
|
|
|
|
function value_125403() { // fn#125403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:8776, offset: 0x025d76ec, size: 480 bytes, params: 1, frame: 30
|
|
var r11;
|
|
var id;
|
|
var r6;
|
|
var r4;
|
|
var value8;
|
|
var isLauncher;
|
|
var getOverrideForGame;
|
|
var value9;
|
|
var distributor;
|
|
var findGame;
|
|
var game;
|
|
var value10;
|
|
var value13;
|
|
var value14;
|
|
var value17;
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
const runningGames = RunningGameStoreNative.getRunningGames();
|
|
const runningNonGames = RunningGameStoreNative.getRunningNonGames();
|
|
const env0_1 = QuestStore.quests;
|
|
let binding = env1_21;
|
|
let log = binding.log;
|
|
Reflect.apply(log, binding, ['~ getActivelyProgressingPlayOnDesktopQuestIds -> Running games: ', runningGames,
|
|
'Running non-games: ', runningNonGames]);
|
|
const object2 = {};
|
|
const _createForOfIteratorHelperLoose_125364Binding = _createForOfIteratorHelperLoose_125364;
|
|
const value5 = undefined;
|
|
const value6 = _createForOfIteratorHelperLoose_125364Binding(runningGames);
|
|
const value7 = value6();
|
|
let done = value7.done;
|
|
if (!done) {
|
|
r11 = value7;
|
|
reducibleLoop1: while (true) {
|
|
value8 = r11.value;
|
|
isLauncher = value8.isLauncher;
|
|
reducibleJoin10: while (true) {
|
|
if (isLauncher) {
|
|
break reducibleJoin10;
|
|
}
|
|
id = value8.id;
|
|
if (id == null) {
|
|
getOverrideForGame = RunningGameStoreNative.getOverrideForGame;
|
|
value9 = Reflect.apply(getOverrideForGame, RunningGameStoreNative, [value8]);
|
|
distributor = value8.distributor;
|
|
if (distributor == null) {
|
|
if (value9 != null) {
|
|
break reducibleJoin10;
|
|
}
|
|
}
|
|
findGame = DetectableGameStore.findGame;
|
|
game = Reflect.apply(findGame, DetectableGameStore, [value8]);
|
|
reducibleJoin8: while (true) {
|
|
if (game == null) {
|
|
id = value5;
|
|
break reducibleJoin8;
|
|
}
|
|
id = game.id;
|
|
break reducibleJoin8;
|
|
}
|
|
if (id == null) {
|
|
break reducibleJoin10;
|
|
}
|
|
id = game.id;
|
|
object2[id] = value8;
|
|
break reducibleJoin10;
|
|
}
|
|
id = value8.id;
|
|
object2[id] = value8;
|
|
break reducibleJoin10;
|
|
}
|
|
value10 = value6();
|
|
done = value10.done;
|
|
if (done) {
|
|
break reducibleLoop1;
|
|
}
|
|
r11 = value10;
|
|
continue reducibleLoop1;
|
|
}
|
|
}
|
|
const value11 = _createForOfIteratorHelperLoose_125364(runningNonGames);
|
|
const value12 = value11();
|
|
done = value12.done;
|
|
if (!done) {
|
|
r6 = value12;
|
|
reducibleLoop12: while (true) {
|
|
value13 = r6.value;
|
|
id = value13.id;
|
|
reducibleJoin14: while (true) {
|
|
if (id == null) {
|
|
break reducibleJoin14;
|
|
}
|
|
id = value13.id;
|
|
object2[id] = value13;
|
|
break reducibleJoin14;
|
|
}
|
|
value14 = value11();
|
|
done = value14.done;
|
|
if (done) {
|
|
break reducibleLoop12;
|
|
}
|
|
r6 = value14;
|
|
continue reducibleLoop12;
|
|
}
|
|
}
|
|
const closure = value_125403_loop;
|
|
const Object = global.Object;
|
|
const value15 = Object.keys(object2);
|
|
let length = value15.length;
|
|
const value16 = 0;
|
|
if (value16 < length) {
|
|
r4 = value16;
|
|
reducibleLoop16: while (true) {
|
|
closure(value15[r4]);
|
|
value17 = typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1;
|
|
length = value15.length;
|
|
if (value17 < length) {
|
|
r4 = value17;
|
|
continue reducibleLoop16;
|
|
}
|
|
break reducibleLoop16;
|
|
}
|
|
}
|
|
binding = env1_21;
|
|
log = binding.log;
|
|
const Array = global.Array;
|
|
Reflect.apply(log, binding, ['~ getActivelyProgressingPlayOnDesktopQuestIds -> Actively progressing questIds: ',
|
|
Array.from(map.keys())]);
|
|
return map;
|
|
}
|
|
|
|
function value_125406() { // fn#125406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:10066, offset: 0x025d7a29, size: 334 bytes, params: 1, frame: 22
|
|
var r4;
|
|
var r11;
|
|
var value9;
|
|
var moduleValue;
|
|
var streamingApplicationId;
|
|
var isQuestProgressable2;
|
|
var value11;
|
|
var set;
|
|
var id2;
|
|
var value12;
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
const currentUserActiveStream = ApplicationStreamingStore.getCurrentUserActiveStream();
|
|
if (currentUserActiveStream != null) {
|
|
if (SortedVoiceStateStore.countVoiceStatesForChannel(currentUserActiveStream.channelId) < 2) {
|
|
return map;
|
|
}
|
|
var streamerActiveStreamMetadata = ApplicationStreamingStore.getStreamerActiveStreamMetadata();
|
|
if (streamerActiveStreamMetadata == null) {
|
|
return map;
|
|
}
|
|
var binding = env1_21;
|
|
var log = binding.log;
|
|
Reflect.apply(log, binding, ['~ getActivelyProgressingStreamOnDesktopQuestIds -> Active stream metadata: ',
|
|
streamerActiveStreamMetadata]);
|
|
var id = streamerActiveStreamMetadata.id;
|
|
if (id == null) {
|
|
return map;
|
|
}
|
|
var value7 = _createForOfIteratorHelperLoose_125364(QuestStore.quests.values());
|
|
var value8 = value7();
|
|
var done = value8.done;
|
|
if (!done) {
|
|
r4 = value8;
|
|
while (true) {
|
|
value9 = r4.value;
|
|
moduleValue = require(7116) /* metro dependency 7116: QuestTaskUtils */;
|
|
streamingApplicationId = moduleValue.getStreamingApplicationId(value9);
|
|
isQuestProgressable2 = isQuestProgressable(value9);
|
|
if (isQuestProgressable2) {
|
|
value11 = streamingApplicationId != null;
|
|
r11 = value11;
|
|
} else {
|
|
r11 = isQuestProgressable2;
|
|
}
|
|
if (!r11) {
|
|
continue;
|
|
}
|
|
if (streamingApplicationId !== id) {
|
|
continue;
|
|
}
|
|
set = map.set;
|
|
id2 = value9.id;
|
|
Reflect.apply(set, map, [id2, {applicationId: id}]);
|
|
value12 = value7();
|
|
done = value12.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r4 = value12;
|
|
continue;
|
|
}
|
|
}
|
|
binding = env1_21;
|
|
log = binding.log;
|
|
var Array = global.Array;
|
|
Reflect.apply(log, binding,
|
|
['~ getActivelyProgressingStreamOnDesktopQuestIds -> Actively progressing questIds: ',
|
|
Array.from(map.keys())]);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
function value_125407() { // fn#125407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:10804, offset: 0x025d7b77, size: 538 bytes, params: 1, frame: 29
|
|
var r8;
|
|
var r12;
|
|
var r3;
|
|
var r4;
|
|
var value11;
|
|
var values;
|
|
var value12;
|
|
var value13;
|
|
var value14;
|
|
var moduleValue;
|
|
var playActivityApplicationId;
|
|
var isQuestProgressable2;
|
|
var value16;
|
|
var id;
|
|
var value17;
|
|
var value18;
|
|
var value21;
|
|
var isQuestProgressable3;
|
|
var moduleValue2;
|
|
var isPlayAnyActivityQuest2;
|
|
var value22;
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
const selfEmbeddedActivities = EmbeddedActivitiesStore.getSelfEmbeddedActivities();
|
|
const connectedFrame = FramesStore.getConnectedFrame();
|
|
const Set = global.Set;
|
|
let set = new Set(selfEmbeddedActivities.keys());
|
|
if (connectedFrame != null) {
|
|
set.add(connectedFrame.applicationId);
|
|
}
|
|
let binding = env1_21;
|
|
let log = binding.log;
|
|
let Array = global.Array;
|
|
Reflect.apply(log, binding, ['~ getActivelyProgressingActivityQuestIds -> Running activity applicationIds: ',
|
|
Array.from(set)]);
|
|
if (set.size !== 0) {
|
|
var quests = QuestStore.quests;
|
|
var value9 = _createForOfIteratorHelperLoose_125364(set);
|
|
var value10 = value9();
|
|
var done = value10.done;
|
|
if (!done) {
|
|
r8 = value10;
|
|
while (true) {
|
|
value11 = r8.value;
|
|
_createForOfIteratorHelperLoose_125364Binding = _createForOfIteratorHelperLoose_125364;
|
|
values = quests.values;
|
|
value12 = _createForOfIteratorHelperLoose_125364Binding(Reflect.apply(values, quests, []));
|
|
value13 = value12();
|
|
done = value13.done;
|
|
if (!done) {
|
|
r12 = value13;
|
|
while (true) {
|
|
value14 = r12.value;
|
|
moduleValue = require(7116) /* metro dependency 7116: QuestTaskUtils */;
|
|
playActivityApplicationId = moduleValue.getPlayActivityApplicationId(value14);
|
|
isQuestProgressable2 = isQuestProgressable(value14);
|
|
if (isQuestProgressable2) {
|
|
value16 = playActivityApplicationId != null;
|
|
r3 = value16;
|
|
} else {
|
|
r3 = isQuestProgressable2;
|
|
}
|
|
if (!r3) {
|
|
continue;
|
|
}
|
|
if (playActivityApplicationId !== value11) {
|
|
continue;
|
|
}
|
|
set = map.set;
|
|
id = value14.id;
|
|
Reflect.apply(set, map, [id, {applicationId: value11}]);
|
|
value17 = value12();
|
|
done = value17.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r12 = value17;
|
|
continue;
|
|
}
|
|
}
|
|
value18 = value9();
|
|
done = value18.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r8 = value18;
|
|
continue;
|
|
}
|
|
}
|
|
var value19 = _createForOfIteratorHelperLoose_125364(quests.values());
|
|
var value20 = value19();
|
|
done = value20.done;
|
|
if (!done) {
|
|
r4 = value20;
|
|
while (true) {
|
|
value21 = r4.value;
|
|
isQuestProgressable3 = isQuestProgressable(value21);
|
|
if (isQuestProgressable3) {
|
|
moduleValue2 = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
isPlayAnyActivityQuest2 = moduleValue2.isPlayAnyActivityQuest(value21);
|
|
r8 = isPlayAnyActivityQuest2;
|
|
} else {
|
|
r8 = isQuestProgressable3;
|
|
}
|
|
if (!r8) {
|
|
continue;
|
|
}
|
|
set = map.set;
|
|
id = value21.id;
|
|
Reflect.apply(set, map, [id, {applicationId: DISCORD_APPLICATION_ID}]);
|
|
value22 = value19();
|
|
done = value22.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r4 = value22;
|
|
continue;
|
|
}
|
|
}
|
|
binding = env1_21;
|
|
log = binding.log;
|
|
Array = global.Array;
|
|
Reflect.apply(log, binding, ['~ getActivelyProgressingActivityQuestIds -> Actively progressing questIds: ',
|
|
Array.from(map.keys())]);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
function calculateHeartbeatDurationMs(a0) { // fn#125374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:3061, owner: QuestProgressManager.calculateHeartbeatDurationMs, offset: 0x025d6aa8, size: 218 bytes, params: 2, frame: 17
|
|
const value = environment.__proto__.__proto__;
|
|
const value2 = QuestStore.quests.get(a0);
|
|
if (value2 == null) {
|
|
return env2_19;
|
|
}
|
|
if (value2.config == null) {
|
|
return env2_19;
|
|
}
|
|
const userStatus = value2.userStatus;
|
|
if (userStatus == null) {
|
|
return env2_19;
|
|
}
|
|
const questTaskUtilsModule = require(7116) /* metro dependency 7116: QuestTaskUtils */;
|
|
const getQuestTaskDetails = questTaskUtilsModule.getQuestTaskDetails;
|
|
const FirstPartyQuestTaskTypesSets = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypesSets;
|
|
const DESKTOP = FirstPartyQuestTaskTypesSets.DESKTOP;
|
|
const {progressSeconds, targetSeconds} = Reflect.apply(getQuestTaskDetails, questTaskUtilsModule, [value2, DESKTOP]);
|
|
const Math = global.Math;
|
|
const max = Math.max;
|
|
const value4 = targetSeconds - progressSeconds;
|
|
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const SECOND = Millis.SECOND;
|
|
const value5 = Reflect.apply(max, Math, [0, value4 * SECOND]);
|
|
return value5 <= env2_19 ? value5 + env2_20 : env2_19;
|
|
}
|
|
|
|
function initiateHeartbeat(a0, a1, a2) { // fn#125375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:3349, owner: QuestProgressManager.initiateHeartbeat, offset: 0x025d6b82, size: 161 bytes, params: 4, frame: 15
|
|
var closure;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
if (env0_0.heartbeats[a1].has(a0)) {
|
|
env2_21.log('~ initiateHeartbeat -> Heartbeat already initiated for questId: ' + a0);
|
|
} else {
|
|
closure = maybeSendHeartbeat;
|
|
env2_21.log('~ initiateHeartbeat -> Initiating heartbeat for Quest ' + a0);
|
|
closure();
|
|
}
|
|
}
|
|
|
|
function terminateHeartbeat(a0, a1) { // fn#125377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:4870, owner: QuestProgressManager.terminateHeartbeat, offset: 0x025d6ef7, size: 240 bytes, params: 3, frame: 19
|
|
var value3;
|
|
const property = env0_0.heartbeats[a1];
|
|
const value = environment.__proto__.__proto__;
|
|
const quests = QuestStore.quests;
|
|
const value2 = property.get(a0);
|
|
if (value2 != null) {
|
|
env2_21.log('~ terminateHeartbeat -> Terminating heartbeat for questId: ' + a0);
|
|
global.window.clearTimeout(value2);
|
|
property.delete(a0);
|
|
value3 = quests.get(a0);
|
|
if (value3 != null && isQuestProgressable(value3)) {
|
|
env2_21.log('~ terminateHeartbeat -> Sending terminal heartbeat for questId: ' + a0);
|
|
(require(9484) /* metro dependency 9484: QuestActionCreators */).sendHeartbeat({questId: a0,
|
|
terminal: true});
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleSendHeartbeatSuccess({questId, userStatus}) { // fn#125378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:5250, owner: QuestProgressManager.handleSendHeartbeatSuccess, offset: 0x025d6fe7, size: 199 bytes, params: 2, frame: 18
|
|
var r1;
|
|
var Object;
|
|
var keys;
|
|
var heartbeats;
|
|
var value2;
|
|
var length;
|
|
var value3;
|
|
var property;
|
|
var terminateHeartbeat;
|
|
var value4;
|
|
let binding = env2_21;
|
|
let log = binding.log;
|
|
let HermesInternal = global.HermesInternal;
|
|
Reflect.apply(log, binding, ['~ handleSendHeartbeatSuccess -> Heartbeat succeeded for questId: ' + questId + ')']);
|
|
reducibleJoin3: while (true) {
|
|
if (userStatus.completedAt == null) {
|
|
break reducibleJoin3;
|
|
}
|
|
binding = env2_21;
|
|
log = binding.log;
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
Reflect.apply(log, binding,
|
|
['~ handleSendHeartbeatSuccess -> Quest ' + questId + ' completed, terminating any heartbeats for it']);
|
|
Object = global.Object;
|
|
keys = Object.keys;
|
|
value = environment;
|
|
heartbeats = env0_0.heartbeats;
|
|
value2 = Reflect.apply(keys, Object, [heartbeats]);
|
|
length = value2.length;
|
|
value3 = 0;
|
|
if (!(value3 < length)) {
|
|
break reducibleJoin3;
|
|
}
|
|
r1 = value3;
|
|
reducibleLoop2: while (true) {
|
|
property = value2[r1];
|
|
binding = env0_0;
|
|
terminateHeartbeat = binding.terminateHeartbeat;
|
|
Reflect.apply(terminateHeartbeat, binding, [questId, property]);
|
|
value4 = typeof r1 === 'bigint' ? r1 + 1n : +r1 + 1;
|
|
length = value2.length;
|
|
if (value4 < length) {
|
|
r1 = value4;
|
|
continue reducibleLoop2;
|
|
}
|
|
break reducibleJoin3;
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleSendHeartbeatFailure({questId}) { // fn#125379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:5605, owner: QuestProgressManager.handleSendHeartbeatFailure, offset: 0x025d70ae, size: 55 bytes, params: 2, frame: 13
|
|
env2_21.log('~ handleSendHeartbeatFailure -> Heartbeat failed for questId: ' + questId);
|
|
}
|
|
|
|
function QuestProgressManagerQUESTS_FETCH_CURRENT_QUESTS_SUCCESS() { // fn#125380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:5745, owner: QuestProgressManager.QUESTS_FETCH_CURRENT_QUESTS_SUCCESS, offset: 0x025d70e5, size: 95 bytes, params: 1, frame: 17
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const {PLAY_ON_DESKTOP,
|
|
STREAM_ON_DESKTOP} = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
return Reflect.apply(syncHeartbeats, binding, [[PLAY_ON_DESKTOP, STREAM_ON_DESKTOP],
|
|
'QUESTS_FETCH_CURRENT_QUESTS_SUCCESS']);
|
|
}
|
|
|
|
function QuestProgressManagerQUESTS_ENROLL_SUCCESS() { // fn#125381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:5933, owner: QuestProgressManager.QUESTS_ENROLL_SUCCESS, offset: 0x025d7144, size: 130 bytes, params: 1, frame: 18
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const {PLAY_ON_DESKTOP, STREAM_ON_DESKTOP,
|
|
PLAY_ACTIVITY} = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
return Reflect.apply(syncHeartbeats, binding, [[PLAY_ON_DESKTOP, STREAM_ON_DESKTOP, PLAY_ACTIVITY],
|
|
'QUESTS_ENROLL_SUCCESS', function(a0) {
|
|
return !manualHeartbeatInitializationQuest(a0);
|
|
}]);
|
|
}
|
|
|
|
function QuestProgressManagerQUESTS_PREVIEW_UPDATE_SUCCESS() { // fn#125383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:6326, owner: QuestProgressManager.QUESTS_PREVIEW_UPDATE_SUCCESS, offset: 0x025d71dc, size: 120 bytes, params: 1, frame: 17
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const {PLAY_ON_DESKTOP, STREAM_ON_DESKTOP,
|
|
PLAY_ACTIVITY} = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
return Reflect.apply(syncHeartbeats, binding, [[PLAY_ON_DESKTOP, STREAM_ON_DESKTOP, PLAY_ACTIVITY],
|
|
'QUESTS_PREVIEW_UPDATE_SUCCESS']);
|
|
}
|
|
|
|
function QuestProgressManagerRUNNING_GAMES_CHANGE() { // fn#125384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:6556, owner: QuestProgressManager.RUNNING_GAMES_CHANGE, offset: 0x025d7254, size: 70 bytes, params: 1, frame: 14
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const PLAY_ON_DESKTOP = FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP;
|
|
return Reflect.apply(syncHeartbeats, binding, [[PLAY_ON_DESKTOP], 'RUNNING_GAMES_CHANGE']);
|
|
}
|
|
|
|
function RUNNING_NON_GAMES_CHANGE() { // fn#125385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:6679, owner: QuestProgressManager.RUNNING_NON_GAMES_CHANGE, offset: 0x025d729a, size: 70 bytes, params: 1, frame: 14
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const PLAY_ON_DESKTOP = FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP;
|
|
return Reflect.apply(syncHeartbeats, binding, [[PLAY_ON_DESKTOP], 'RUNNING_NON_GAMES_CHANGE']);
|
|
}
|
|
|
|
function QuestProgressManagerSTREAM_START() { // fn#125386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:6794, owner: QuestProgressManager.STREAM_START, offset: 0x025d72e0, size: 70 bytes, params: 1, frame: 14
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const STREAM_ON_DESKTOP = FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP;
|
|
return Reflect.apply(syncHeartbeats, binding, [[STREAM_ON_DESKTOP], 'STREAM_START']);
|
|
}
|
|
|
|
function QuestProgressManagerSTREAM_CREATE() { // fn#125387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:6900, owner: QuestProgressManager.STREAM_CREATE, offset: 0x025d7326, size: 70 bytes, params: 1, frame: 14
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const STREAM_ON_DESKTOP = FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP;
|
|
return Reflect.apply(syncHeartbeats, binding, [[STREAM_ON_DESKTOP], 'STREAM_CREATE']);
|
|
}
|
|
|
|
function QuestProgressManagerSTREAM_CLOSE() { // fn#125388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:7006, owner: QuestProgressManager.STREAM_CLOSE, offset: 0x025d736c, size: 70 bytes, params: 1, frame: 14
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const STREAM_ON_DESKTOP = FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP;
|
|
return Reflect.apply(syncHeartbeats, binding, [[STREAM_ON_DESKTOP], 'STREAM_CLOSE']);
|
|
}
|
|
|
|
function QuestProgressManagerPASSIVE_UPDATE_V2() { // fn#125389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:7116, owner: QuestProgressManager.PASSIVE_UPDATE_V2, offset: 0x025d73b2, size: 70 bytes, params: 1, frame: 14
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const STREAM_ON_DESKTOP = FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP;
|
|
return Reflect.apply(syncHeartbeats, binding, [[STREAM_ON_DESKTOP], 'PASSIVE_UPDATE_V2']);
|
|
}
|
|
|
|
function QuestProgressManagerVOICE_STATE_UPDATES() { // fn#125390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:7233, owner: QuestProgressManager.VOICE_STATE_UPDATES, offset: 0x025d73f8, size: 70 bytes, params: 1, frame: 14
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const STREAM_ON_DESKTOP = FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP;
|
|
return Reflect.apply(syncHeartbeats, binding, [[STREAM_ON_DESKTOP], 'VOICE_STATE_UPDATES']);
|
|
}
|
|
|
|
async function _fun125393({applicationId}) { // fn#125393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:7446, offset: 0x025d746a, size: 137 bytes, params: 2, frame: 19
|
|
var environment;
|
|
if (true) {
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
await env3_26(applicationId);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
var syncHeartbeats = QuestProgressManager.syncHeartbeats;
|
|
var FirstPartyQuestTaskTypes = env3_0(env3_2[27]).FirstPartyQuestTaskTypes;
|
|
var PLAY_ACTIVITY = FirstPartyQuestTaskTypes.PLAY_ACTIVITY;
|
|
Reflect.apply(syncHeartbeats, QuestProgressManager, [[PLAY_ACTIVITY], 'FRAME_LAUNCH', _fun125394]);
|
|
}
|
|
}
|
|
|
|
function QuestProgressManagerFRAME_STOP() { // fn#125396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:7706, owner: QuestProgressManager.FRAME_STOP, offset: 0x025d7509, size: 70 bytes, params: 1, frame: 14
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const PLAY_ACTIVITY = FirstPartyQuestTaskTypes.PLAY_ACTIVITY;
|
|
Reflect.apply(syncHeartbeats, binding, [[PLAY_ACTIVITY], 'FRAME_STOP']);
|
|
}
|
|
|
|
function QuestProgressManagerEMBEDDED_ACTIVITY_UPDATE_V2() { // fn#125397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:7822, owner: QuestProgressManager.EMBEDDED_ACTIVITY_UPDATE_V2, offset: 0x025d754f, size: 80 bytes, params: 1, frame: 16
|
|
const binding = env0_0;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const PLAY_ACTIVITY = FirstPartyQuestTaskTypes.PLAY_ACTIVITY;
|
|
Reflect.apply(syncHeartbeats, binding, [[PLAY_ACTIVITY], 'EMBEDDED_ACTIVITY_UPDATE_V2', function(a0) {
|
|
return !manualHeartbeatInitializationQuest(a0);
|
|
}]);
|
|
}
|
|
|
|
function QUEST_APPLICATION_START_TIMER({questId}) { // fn#125399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:8001, owner: QuestProgressManager.QUEST_APPLICATION_START_TIMER, offset: 0x025d759f, size: 95 bytes, params: 2, frame: 16
|
|
const binding = questId;
|
|
const syncHeartbeats = binding.syncHeartbeats;
|
|
const FirstPartyQuestTaskTypes = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes;
|
|
const PLAY_ACTIVITY = FirstPartyQuestTaskTypes.PLAY_ACTIVITY;
|
|
Reflect.apply(syncHeartbeats, binding, [[PLAY_ACTIVITY], 'QUEST_APPLICATION_START_TIMER', _fun125400]);
|
|
}
|
|
|
|
function value_125403_loop(a0) { // fn#125404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:9328, owner: value_125403._loop, offset: 0x025d78cc, size: 349 bytes, params: 2, frame: 30
|
|
var r3;
|
|
var value6;
|
|
var moduleValue2;
|
|
var desktopApplicationIds;
|
|
var value8;
|
|
var binding;
|
|
var set;
|
|
var id;
|
|
var ROBLOX_APPLICATION_ID;
|
|
var executableFingerprint;
|
|
var value9;
|
|
const env0_0 = a0;
|
|
const property = env0_2[a0];
|
|
const gameAnalyticsUtilsModule = require(4482) /* metro dependency 4482: GameAnalyticsUtils */;
|
|
const value3 = gameAnalyticsUtilsModule.removeExecutablePathPrefix(property.exePath);
|
|
const _createForOfIteratorHelperLoose_125364Binding = _createForOfIteratorHelperLoose_125364;
|
|
const questsBinding = quests;
|
|
const value4 = _createForOfIteratorHelperLoose_125364Binding(questsBinding.values());
|
|
const value5 = value4();
|
|
let done = value5.done;
|
|
if (!done) {
|
|
r3 = value5;
|
|
while (true) {
|
|
value6 = r3.value;
|
|
moduleValue2 = require(7116) /* metro dependency 7116: QuestTaskUtils */;
|
|
desktopApplicationIds = moduleValue2.getDesktopApplicationIds(value6);
|
|
if (isQuestProgressable(value6)) {
|
|
if (desktopApplicationIds == null) {
|
|
break;
|
|
}
|
|
value8 = desktopApplicationIds.find(_fun125405);
|
|
if (value8 != null) {
|
|
binding = env0_0;
|
|
set = binding.set;
|
|
id = value6.id;
|
|
executableFingerprint = property.executableFingerprint;
|
|
Reflect.apply(set, binding, [id, {applicationId: value8, executablePath: value3,
|
|
executableFingerprint: executableFingerprint}]);
|
|
break;
|
|
}
|
|
if (isQuestRobloxRelated(desktopApplicationIds, property)) {
|
|
binding = env0_0;
|
|
set = binding.set;
|
|
id = value6.id;
|
|
ROBLOX_APPLICATION_ID = (require(4484) /* metro dependency 4484: RobloxSubgameTypes */).ROBLOX_APPLICATION_ID;
|
|
executableFingerprint = property.executableFingerprint;
|
|
Reflect.apply(set, binding, [id, {applicationId: ROBLOX_APPLICATION_ID, executablePath: value3,
|
|
executableFingerprint: executableFingerprint}]);
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
value9 = value4();
|
|
done = value9.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r3 = value9;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
|
|
function maybeSendHeartbeat() { // fn#125376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:3499, owner: QuestProgressManager.initiateHeartbeat.maybeSendHeartbeat, offset: 0x025d6c23, size: 724 bytes, params: 1, frame: 24
|
|
var r8;
|
|
var r6;
|
|
var r7;
|
|
var log;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var QuestHeartbeatExecutableFingerprintExperiment;
|
|
var binding3;
|
|
var currentUserActiveStream;
|
|
var value9;
|
|
var binding4;
|
|
var moduleValue3;
|
|
var calculateHeartbeatDurationMs;
|
|
var binding5;
|
|
var window;
|
|
var binding6;
|
|
let value = environment.__proto__;
|
|
let binding = env1_0;
|
|
const activelyProgressingQuests = binding.getActivelyProgressingQuests(require);
|
|
if (activelyProgressingQuests.has(env0_0)) {
|
|
value5 = activelyProgressingQuests.get(env0_0);
|
|
value6 = undefined;
|
|
r8 = (value5 == null ? value6 : value5.applicationId) ?? (importDefault == null ? value6 : importDefault.applicationId);
|
|
value7 = environment.__proto__.__proto__.__proto__;
|
|
QuestHeartbeatExecutableFingerprintExperiment = (require(9511) /* metro dependency 9511: experiments */).QuestHeartbeatExecutableFingerprintExperiment;
|
|
r6 = QuestHeartbeatExecutableFingerprintExperiment.getConfig({location: QuestsExperimentLocations.QUESTS_MANAGER}).enabled ? value5 == null ? value6 : value5.executableFingerprint : value6;
|
|
r7 = (value5 == null ? value6 : value5.executablePath) ?? (importDefault == null ? value6 : importDefault.executablePath);
|
|
if (require === (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP) {
|
|
currentUserActiveStream = ApplicationStreamingStore.getCurrentUserActiveStream();
|
|
if (currentUserActiveStream == null) {
|
|
binding = env3_21;
|
|
log = binding.log;
|
|
binding6 = env0_0;
|
|
Reflect.apply(log, binding,
|
|
['~ initiateHeartbeat -> Attempted to beat for stream quest but no active stream, terminating heartbeat for questId: ' + binding6]);
|
|
binding = env1_0;
|
|
binding.terminateHeartbeat(binding6, require);
|
|
return value6;
|
|
}
|
|
value9 = (require(4285) /* metro dependency 4285: StreamKeyUtils */).encodeStreamKey(currentUserActiveStream);
|
|
binding = env3_21;
|
|
log = binding.log;
|
|
binding4 = env0_0;
|
|
Reflect.apply(log, binding, ['~ initiateHeartbeat -> Sending heartbeat for questId: ' + binding4]);
|
|
moduleValue3 = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
moduleValue3.sendHeartbeat({questId: binding4, streamKey: value9, applicationId: r8, executablePath: r7,
|
|
executableFingerprint: r6});
|
|
binding = env1_0;
|
|
calculateHeartbeatDurationMs = binding.calculateHeartbeatDurationMs;
|
|
binding5 = env0_0;
|
|
value = Reflect.apply(calculateHeartbeatDurationMs, binding, [binding5]);
|
|
window = global.window;
|
|
value = window.setTimeout(maybeSendHeartbeat, value);
|
|
binding = env0_3;
|
|
binding.set(binding5, value);
|
|
return undefined;
|
|
}
|
|
binding = env3_21;
|
|
log = binding.log;
|
|
binding3 = env0_0;
|
|
Reflect.apply(log, binding, ['~ initiateHeartbeat -> Sending heartbeat for questId: ' + binding3]);
|
|
(require(9484) /* metro dependency 9484: QuestActionCreators */).sendHeartbeat({questId: binding3,
|
|
applicationId: r8, executablePath: r7, executableFingerprint: r6});
|
|
binding = env1_0;
|
|
calculateHeartbeatDurationMs = binding.calculateHeartbeatDurationMs;
|
|
binding5 = env0_0;
|
|
value = Reflect.apply(calculateHeartbeatDurationMs, binding, [binding5]);
|
|
window = global.window;
|
|
value = window.setTimeout(maybeSendHeartbeat, value);
|
|
binding = env0_3;
|
|
binding.set(binding5, value);
|
|
} else {
|
|
binding = env3_21;
|
|
log = binding.log;
|
|
var binding2 = env0_0;
|
|
Reflect.apply(log, binding,
|
|
['~ initiateHeartbeat -> Quest ' + binding2 + ' is no longer actively progressing, terminating heartbeat']);
|
|
binding = env1_0;
|
|
binding.terminateHeartbeat(binding2, require);
|
|
}
|
|
}
|
|
|
|
function _fun125394(a0) { // fn#125394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:7604, offset: 0x025d74f3, size: 22 bytes, params: 2, frame: 11
|
|
return !env4_28(a0);
|
|
}
|
|
|
|
function _fun125400(a0) { // fn#125400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16426:8118, offset: 0x025d75fe, size: 47 bytes, params: 2, frame: 12
|
|
let value = a0 != null;
|
|
let r0 = value && a0.id === questId;
|
|
if (r0) {
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
value = manualHeartbeatInitializationQuest(a0);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|