项目作者: TJRoger

项目描述 :
Dota 2 Spectator Client in Node , based on [node-steam](https://github.com/seishun/node-steam) 1.0.0+
高级语言: JavaScript
项目地址: git://github.com/TJRoger/node-dota2-spectator.git
创建时间: 2015-07-30T18:14:17Z
项目社区:https://github.com/TJRoger/node-dota2-spectator

开源协议:MIT License

下载


Node Dota2 Spectator

NPM version
Build Status
Code Climate
Dependency Status
PayPal donate button
支付宝捐助按钮
A node-steam plugin for Dota 2 Spectator Client. Spectate dota2 games

How to install

  • download the package to your working directory
  • run npm install steam && npm install in the node-dota2-spectator directory

How to use

Initialiaztion

  1. var steam = require('steam'),
  2. dota = require('dota'),
  3. bot = new steam.SteamClient(),
  4. user = new steam.SteamUser(bot),
  5. gc = new steam.SteamGameCoordinator(bot, 570);
  6. dota2 = new dota.Dota2Client(user, gc, true);

How to use your old sentryfile(to avoid the one week trade limit)

I just found out that the old sentry file is a sha1 fingerprint of the new sentry

  • load old sentry
    1. if (fs.existsSync('sentryfile/'+logOnDetails.account_name)){
    2. logOnDetails.sha_sentryfile = fs.readFileSync('sentryfile/' + logOnDetails.account_name);
    3. util.log('sentry loaded');
    4. }
  • update sentry
    1. var onUserUpdateMachineAuth = function onUserUpdateMachineAuth(sentry, callback){
    2. var sentryfile = crypto.createHash('sha1').update(sentry.bytes).digest();
    3. fs.writeFileSync('sentryfile/'+config.steam_user, sentryfile);
    4. util.log("sentryfile saved");
    5. callback({ sha_file: sentryfile });
    6. }
    Test result: old sentrys are accept by steam
    If you find out any problem, feel free to contact with tjrogertj@gmail.com">me or open an issue.

Try it out

  • add your steam username and password in the config.js
  • add the auth-code from steam after first try to login
  • then you can login from now on

refer to the example.js for more

How to extend

Write a handler.js then import it to the index.js

license

This script is release under MIT license. Refer to the LICENSE file for more information.