/// <summary> /// Attempt to logon to the UFS and authorize the client for the given AppIDs. /// The <see cref="UFSClient"/> should be connected before this point. /// Results are returned in a <see cref="LoggedOnCallback"/>. /// </summary> /// <param name="appIds">The AppIDs to authorize when connecting to the UFS.</param> /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="LoggedOnCallback"/>.</returns> public JobID Logon(IEnumerable <uint> appIds) { if (appIds == null) { throw new ArgumentNullException(nameof(appIds)); } var jobId = steamClient.GetNextJobID(); if (!steamClient.IsConnected) { var callback = new LoggedOnCallback(jobId, EResult.NoConnection); steamClient.PostCallback(callback); return(jobId); } var loginReq = new ClientMsgProtobuf <CMsgClientUFSLoginRequest>(EMsg.ClientUFSLoginRequest); loginReq.SourceJobID = jobId; loginReq.Body.apps.AddRange(appIds); loginReq.Body.protocol_version = MsgClientLogon.CurrentProtocol; loginReq.Body.am_session_token = steamClient.SessionToken; Send(loginReq); return(loginReq.SourceJobID); }
void HandleLogOnResponse(IPacketMsg packetMsg) { if (packetMsg.IsProto) { var logonResp = new ClientMsgProtobuf <CMsgClientLogonResponse>(packetMsg); #if STATIC_CALLBACKS var callback = new LoggedOnCallback(Client, logonResp.Body); SteamClient.PostCallback(callback); #else var callback = new LoggedOnCallback(logonResp.Body); this.Client.PostCallback(callback); #endif } else { var logonResp = new ClientMsg <MsgClientLogOnResponse>(packetMsg); #if STATIC_CALLBACKS var callback = new LoggedOnCallback(Client, logonResp.Body); SteamClient.PostCallback(callback); #else var callback = new LoggedOnCallback(logonResp.Body); this.Client.PostCallback(callback); #endif } }
void HandleLoginResponse(IPacketMsg packetMsg) { var loginResp = new ClientMsgProtobuf <CMsgClientUFSLoginResponse>(packetMsg); var callback = new LoggedOnCallback(loginResp.TargetJobID, loginResp.Body); steamClient.PostCallback(callback); }
void HandleLogOnResponse(IPacketMsg packetMsg) { if (packetMsg.IsProto) { var logonResp = new ClientMsgProtobuf <CMsgClientLogonResponse>(packetMsg); var callback = new LoggedOnCallback(logonResp.Body); this.Client.PostCallback(callback); } else { var logonResp = new ClientMsg <MsgClientLogOnResponse>(packetMsg); var callback = new LoggedOnCallback(logonResp.Body); this.Client.PostCallback(callback); } }
/// <summary> /// Attempt to logon to the UFS and authorize the client for the given AppIDs. /// The <see cref="UFSClient"/> should be connected before this point. /// Results are returned in a <see cref="LoggedOnCallback"/>. /// </summary> /// <param name="appIds">The AppIDs to authorize when connecting to the UFS.</param> /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="SteamClient.JobCallback<T>"/>.</returns> public JobID Logon(IEnumerable <uint> appIds) { var jobId = steamClient.GetNextJobID(); if (!steamClient.IsConnected) { var cb = new LoggedOnCallback(EResult.NoConnection); var jobCb = new SteamClient.JobCallback <LoggedOnCallback>(jobId, cb); steamClient.PostCallback(jobCb); return(jobId); } var loginReq = new ClientMsgProtobuf <CMsgClientUFSLoginRequest>(EMsg.ClientUFSLoginRequest); loginReq.SourceJobID = jobId; loginReq.Body.apps.AddRange(appIds); loginReq.Body.protocol_version = MsgClientLogon.CurrentProtocol; loginReq.Body.am_session_token = steamClient.SessionToken; Send(loginReq); return(loginReq.SourceJobID); }
void HandleLoginResponse( IPacketMsg packetMsg ) { var loginResp = new ClientMsgProtobuf<CMsgClientUFSLoginResponse>( packetMsg ); var callback = new LoggedOnCallback( loginResp.TargetJobID, loginResp.Body); steamClient.PostCallback( callback ); }
/// <summary> /// Attempt to logon to the UFS and authorize the client for the given AppIDs. /// The <see cref="UFSClient"/> should be connected before this point. /// Results are returned in a <see cref="LoggedOnCallback"/>. /// </summary> /// <param name="appIds">The AppIDs to authorize when connecting to the UFS.</param> /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="LoggedOnCallback"/>.</returns> public JobID Logon( IEnumerable<uint> appIds ) { var jobId = steamClient.GetNextJobID(); if ( !steamClient.IsConnected ) { var callback = new LoggedOnCallback( jobId, EResult.NoConnection ); steamClient.PostCallback( callback ); return jobId; } var loginReq = new ClientMsgProtobuf<CMsgClientUFSLoginRequest>( EMsg.ClientUFSLoginRequest ); loginReq.SourceJobID = jobId; loginReq.Body.apps.AddRange( appIds ); loginReq.Body.protocol_version = MsgClientLogon.CurrentProtocol; loginReq.Body.am_session_token = steamClient.SessionToken; Send( loginReq ); return loginReq.SourceJobID; }
void HandleLogOnResponse( IPacketMsg packetMsg ) { if ( packetMsg.IsProto ) { var logonResp = new ClientMsgProtobuf<CMsgClientLogonResponse>( packetMsg ); var callback = new LoggedOnCallback( logonResp.Body ); this.Client.PostCallback( callback ); } else { var logonResp = new ClientMsg<MsgClientLogOnResponse>( packetMsg ); var callback = new LoggedOnCallback( logonResp.Body ); this.Client.PostCallback( callback ); } }
void HandleLogOnResponse( IPacketMsg packetMsg ) { if ( packetMsg.IsProto ) { var logonResp = new ClientMsgProtobuf<CMsgClientLogonResponse>( packetMsg ); #if STATIC_CALLBACKS var callback = new LoggedOnCallback( Client, logonResp.Body ); SteamClient.PostCallback( callback ); #else var callback = new LoggedOnCallback( logonResp.Body ); this.Client.PostCallback( callback ); #endif } }