@@ -222,7 +222,8 @@ public SteamID? SteamID
222222 /// <param name="details">The details to use for logging on.</param>
223223 /// <exception cref="ArgumentNullException">No logon details were provided.</exception>
224224 /// <exception cref="ArgumentException">Username or password are not set within <paramref name="details"/>.</exception>
225- public void LogOn ( LogOnDetails details )
225+ /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="LoggedOnCallback"/>.</returns>
226+ public AsyncJob < LoggedOnCallback > LogOn ( LogOnDetails details )
226227 {
227228 ArgumentNullException . ThrowIfNull ( details ) ;
228229
@@ -231,14 +232,14 @@ public void LogOn( LogOnDetails details )
231232 throw new ArgumentException ( "LogOn requires a username and password or access token to be set in 'details'." ) ;
232233 }
233234
235+ var logon = new ClientMsgProtobuf < CMsgClientLogon > ( EMsg . ClientLogon ) ;
236+
234237 if ( ! this . Client . IsConnected )
235238 {
236239 this . Client . PostCallback ( new LoggedOnCallback ( EResult . NoConnection ) ) ;
237- return ;
240+ return new AsyncJob < LoggedOnCallback > ( this . Client , logon . SourceJobID ) ;
238241 }
239242
240- var logon = new ClientMsgProtobuf < CMsgClientLogon > ( EMsg . ClientLogon ) ;
241-
242243 SteamID steamId = new SteamID ( details . AccountID , details . AccountInstance , Client . Universe , EAccountType . Individual ) ;
243244
244245 if ( details . LoginID . HasValue )
@@ -302,34 +303,39 @@ public void LogOn( LogOnDetails details )
302303 logon . Body . access_token = details . AccessToken ;
303304
304305 this . Client . Send ( logon ) ;
306+
307+ return new AsyncJob < LoggedOnCallback > ( this . Client , logon . SourceJobID ) ;
305308 }
306309
307310 /// <summary>
308311 /// Logs the client into the Steam3 network as an anonymous user.
309312 /// The client should already have been connected at this point.
310313 /// Results are returned in a <see cref="LoggedOnCallback"/>.
311314 /// </summary>
312- public void LogOnAnonymous ( )
315+ /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="LoggedOnCallback"/>.</returns>
316+ public AsyncJob < LoggedOnCallback > LogOnAnonymous ( )
313317 {
314- LogOnAnonymous ( new AnonymousLogOnDetails ( ) ) ;
318+ return LogOnAnonymous ( new AnonymousLogOnDetails ( ) ) ;
315319 }
316320 /// <summary>
317321 /// Logs the client into the Steam3 network as an anonymous user.
318322 /// The client should already have been connected at this point.
319323 /// Results are returned in a <see cref="LoggedOnCallback"/>.
320324 /// </summary>
321325 /// <param name="details">The details to use for logging on.</param>
322- public void LogOnAnonymous ( AnonymousLogOnDetails details )
326+ /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="LoggedOnCallback"/>.</returns>
327+ public AsyncJob < LoggedOnCallback > LogOnAnonymous ( AnonymousLogOnDetails details )
323328 {
324329 ArgumentNullException . ThrowIfNull ( details ) ;
325330
331+ var logon = new ClientMsgProtobuf < CMsgClientLogon > ( EMsg . ClientLogon ) ;
332+
326333 if ( ! this . Client . IsConnected )
327334 {
328335 this . Client . PostCallback ( new LoggedOnCallback ( EResult . NoConnection ) ) ;
329- return ;
330- }
331336
332- var logon = new ClientMsgProtobuf < CMsgClientLogon > ( EMsg . ClientLogon ) ;
337+ return new AsyncJob < LoggedOnCallback > ( this . Client , logon . SourceJobID ) ;
338+ }
333339
334340 SteamID auId = new SteamID ( 0 , 0 , Client . Universe , EAccountType . AnonUser ) ;
335341
@@ -344,6 +350,8 @@ public void LogOnAnonymous( AnonymousLogOnDetails details )
344350 logon . Body . machine_id = HardwareUtils . GetMachineID ( Client . Configuration . MachineInfoProvider ) ;
345351
346352 this . Client . Send ( logon ) ;
353+
354+ return new AsyncJob < LoggedOnCallback > ( this . Client , logon . SourceJobID ) ;
347355 }
348356
349357 /// <summary>
0 commit comments