Jump to content
McKay Development

Xaviius

Member
  • Content Count

    4
  • Joined

  • Last visited

  1. Its basically what I did in the event before: async function matchList(matches: Array<IMatch>) { console.log(matches) if (matches[0]) { matches[0].roundstats_legacy.reservation.account_ids.forEach(async (accid: number) => { if (await monitoringRepository.findOne(SteamID.fromIndividualAccountID(accid).getSteamID64()) === undefined && await mmRepository.findOne(SteamID.fromIndividualAccountID(accid).getSteamID64()) === undefined) { var steamid_db = { id: SteamID.fromIndividualAccountID(accid).getSteamID64(),
  2. I already tried to use it with Promise like this: await new Promise((resolve) => { csgoUser.on('matchList', resolve); }) The first time it works and the second it awaits and never finishes... the whole important code looks like this at the moment: for (let steamid of steamids) { if (!searchedids.some((searched) => searched === steamid.getSteamID64())) { csgoUser.requestLiveGameForUser(steamid.getSteamID64()); await matchList(await new Promise((resolve) => { csgoUser.on('matchList', resolve); })); await sleep(1000); } } steamClient.logOff();
  3. @Dr. McKay Yeah well there was the error. Thank you! Is there any way to await requestLiveGameForUser event? So I don't have to use: await sleep(10000) Thank you!
  4. Hey, is there any possibility to repeat the requestLiveGameForUser method? If I call the method the first time it works, but the second, third... time it does not. Here is the important code: csgoUser.on('connectedToGC', async () => { searchedids = [] for (let steamid of steamids) { if (!searchedids.some((searched) => searched === steamid.getSteamID64())) { csgoUser.requestLiveGameForUser(steamid.getSteamID64()); await sleep(10000) } } }); csgoUser.on('matchList', async (response) => { console.log(response); steamC
×
×
  • Create New...