<commit_before>var Steam = require('steam');
var SteamUser = require('../index.js');
var fs = require('fs');

SteamUser.protoype.setSentry = function(sentry) {
	this._sentry = sentry;
};

SteamUser.prototype._getSentryFilename = function() {
	if(this.options.singleSentryfile) {
		return this.options.dataDirectory + '/sentry.bin';
	} else {
		return this.options.dataDirectory + '/sentry.' + this._logOnDetails.account_name + '.bin';
	}
};

// Handlers

SteamUser.prototype._handlers[Steam.EMsg.ClientUpdateMachineAuth] = function(body, callback) {
	// TODO: Handle partial updates
	if(this.options.dataDirectory) {
		fs.writeFile(this._getSentryFilename(), body.bytes.toBuffer());
	}

	this.emit('sentry', body.bytes.toBuffer());

	// Accept the sentry
	var hash = require('crypto').createHash('sha1');
	hash.update(body.bytes.toBuffer());

	callback(Steam.EMsg.ClientUpdateMachineAuthResponse, {
		"sha_file": hash.digest()
	});<commit_msg>Fixed a dumb typo in setSentry<commit_after>var Steam = require('steam');
var SteamUser = require('../index.js');
var fs = require('fs');

SteamUser.prototype.setSentry = function(sentry) {
	this._sentry = sentry;
};

SteamUser.prototype._getSentryFilename = function() {
	if(this.options.singleSentryfile) {
		return this.options.dataDirectory + '/sentry.bin';
	} else {
		return this.options.dataDirectory + '/sentry.' + this._logOnDetails.account_name + '.bin';
	}
};

// Handlers

SteamUser.prototype._handlers[Steam.EMsg.ClientUpdateMachineAuth] = function(body, callback) {
	// TODO: Handle partial updates
	if(this.options.dataDirectory) {
		fs.writeFile(this._getSentryFilename(), body.bytes.toBuffer());
	}

	this.emit('sentry', body.bytes.toBuffer());

	// Accept the sentry
	var hash = require('crypto').createHash('sha1');
	hash.update(body.bytes.toBuffer());

	callback(Steam.EMsg.ClientUpdateMachineAuthResponse, {
		"sha_file": hash.digest()
	});
{'fraction_non_alphanumeric': 0.16281512605042017, 'fraction_numerical': 0.0010504201680672268, 'mean_word_length': 5.185064935064935, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4470841', 'n_tokens_mistral': 648, 'n_tokens_neox': 632, 'n_words': 101}