-
-
Notifications
You must be signed in to change notification settings - Fork 135
Polling
node-steam-tradeoffer-manager
automatically polls the Steam API every 30 seconds (by default) for new and updated trade offers, allowing your app to simply listen for some events instead of you having to manually poll yourself.
Polling automatically occurs on a timer, the duration of which is set in the constructor as the pollInterval
parameter. If you pass -1
here, timed polling will be disabled.
If you pass a Steam.SteamClient
or SteamUser
object to the constructor, then polling will be done automatically when we receive a notification from Steam of new trade offers or new items (the latter only being available with node-steam-user
).
node-steam-tradeoffer-manager
has the capability to gracefully resume polling across app loads. This means that you won't get the newOffer
event for already-outstanding offers which the app has already received the event for in a previous session. To enable this support, you'll need to save a blob of JSON pollData
when you receive the pollData
event. This event will be called after each poll. You may want to save this to a file (JSON.stringify
) or a database.
On startup, just set the poll data to the pollData
property of your TradeOfferManager
and polling will resume from where it left off.