-
Notifications
You must be signed in to change notification settings - Fork 495
JobCallback Transition
Beginning with SteamKit version 1.6, the syntax for declaring and using JobCallback
s has been tweaked to be more developer friendly. Unfortunately, this syntax is a significant breaking change, but this wiki article should help you quickly and easily transition your code to the new API.
In short, you now directly use the Callback
class instead of having a separate JobCallback
class for job based callbacks. This should simplify working with callbacks and either having to guess or dig through the documentation for which callback class to use.
For example, previously declarations for JobCallback
looked like this
...
new JobCallback<SteamApps.AppInfoCallback>( OnAppInfo, callbackMgr );
...
void OnAppInfo( SteamApps.AppInfoCallback callback, JobID jobId )
{
// do something with this info
}
Beginning with version 1.6 of SteamKit, the syntax has been simplified to this:
...
new Callback<SteamApps.AppInfoCallback>( OnAppInfo, callbackMgr );
...
void OnAppInfo( SteamApps.AppInfoCallback callback )
{
// the jobid is available as a member of the |callback| object
}
As the comment states, you now get at the JobID
value of the AppInfoCallback
(or any callback) as a member property of the callback object.