-
Posts
4 -
Joined
-
Last visited
Posts posted by Xaviius
-
-
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();
-
@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!
-
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); steamClient.logOff(); });
Any clue why it does not work?
Thank you for this awesome lib!
globaloffensive - matchList multiple in a row
in General
Posted
Its basically what I did in the event before:
Even with once it does not work constantly. Sometimes it only works for 2 steamids and then again only for one, even though they are 8. steamids is an array of type SteamID of your other library.