SteamKit2.SteamUser.LogOnAnonymous C# (CSharp) Method

LogOnAnonymous() public method

Logs the client into the Steam3 network as an anonymous user. The client should already have been connected at this point. Results are returned in a LoggedOnCallback.
public LogOnAnonymous ( ) : void
return void
        public void LogOnAnonymous()
        {
            var logon = new ClientMsgProtobuf<CMsgClientLogon>( EMsg.ClientLogon );

            SteamID auId = new SteamID( 0, 0, Client.ConnectedUniverse, EAccountType.AnonUser );

            logon.ProtoHeader.client_sessionid = 0;
            logon.ProtoHeader.steamid = auId.ConvertToUInt64();

            logon.Body.protocol_version = MsgClientLogon.CurrentProtocol;
            logon.Body.client_os_type = ( uint )Utils.GetOSType();

            // this is not a proper machine id that Steam accepts
            // but it's good enough for identifying a machine
            logon.Body.machine_id = Utils.GenerateMachineID();

            this.Client.Send( logon );
        }