Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        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
            }
        }
Ejemplo n.º 3
0
        void HandleLoginResponse(IPacketMsg packetMsg)
        {
            var loginResp = new ClientMsgProtobuf <CMsgClientUFSLoginResponse>(packetMsg);

            var callback = new LoggedOnCallback(loginResp.TargetJobID, loginResp.Body);

            steamClient.PostCallback(callback);
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        /// <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&lt;T&gt;"/>.</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);
        }
Ejemplo n.º 6
0
        void HandleLoginResponse( IPacketMsg packetMsg )
        {
            var loginResp = new ClientMsgProtobuf<CMsgClientUFSLoginResponse>( packetMsg );

            var callback = new LoggedOnCallback( loginResp.TargetJobID, loginResp.Body);
            steamClient.PostCallback( callback );
        }
Ejemplo n.º 7
0
        /// <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;
        }
Ejemplo n.º 8
0
        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 );
            }
        }
Ejemplo n.º 9
0
        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
            }
        }