Skip to content

Commit

Permalink
Add error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewgdewar committed Dec 15, 2024
1 parent 8be8384 commit 97c65cc
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/LoadoutChanges/LocationUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,30 @@ export const LocationUpdater = (container: DependencyContainer): undefined => {
url: "/client/match/local/start",
action: async (_url, info, sessionId, output) => {
const time = weatherController.generate().time;
// const timestamp =
// weatherController.generate().weather.sptInRaidTimestamp;
// console.log(
// timestamp,
// timestamp / 360000,
// timestamp / 3600,
// timestamp / 6000,
// timestamp / 24,
// timestamp / 24 / 60
// );

const hours = getTime(time, info.timeVariant === "PAST" ? 12 : 0);
// console.log("hours", hours);
globalValues.setValuesForLocation(info.location.toLowerCase(), hours);
if (enableNonPMCBotChanges) {
const pmcData = globalValues.profileHelper.getPmcProfile(sessionId);
globalValues.updateInventory(
pmcData?.Info?.Level || 1,
info.location.toLowerCase()
try {
globalValues.setValuesForLocation(
info.location.toLowerCase(),
hours
);
if (enableNonPMCBotChanges) {
const pmcData =
globalValues.profileHelper.getPmcProfile(sessionId);
globalValues.updateInventory(
pmcData?.Info?.Level || 1,
info.location.toLowerCase()
);
}
console.log("Algorthimic LevelProgression: Loaded");
} catch (error) {
console.log(
`"Algorthimic LevelProgression: failed to make equipment changes.
` + error?.message
);
}
console.log("Algorthimic LevelProgression: Loaded");

return output;
},
},
Expand Down

0 comments on commit 97c65cc

Please sign in to comment.