GithubHelp home page GithubHelp logo

jimersylee / node-dota2-spectator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tjroger/node-dota2-spectator

0.0 2.0 0.0 523 KB

Dota 2 Spectator Client in Node , based on [node-steam](https://github.com/seishun/node-steam) 1.0.0+

License: MIT License

JavaScript 81.48% Batchfile 17.89% Shell 0.63%

node-dota2-spectator's Introduction

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

var steam = require('steam'),
    dota = require('dota'),
    bot = new steam.SteamClient(),
    user = new steam.SteamUser(bot),
    gc = new steam.SteamGameCoordinator(bot, 570);
    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
if (fs.existsSync('sentryfile/'+logOnDetails.account_name)){
    logOnDetails.sha_sentryfile  = fs.readFileSync('sentryfile/' + logOnDetails.account_name);
    util.log('sentry loaded');
}
  • update sentry
var onUserUpdateMachineAuth = function onUserUpdateMachineAuth(sentry, callback){
    var sentryfile = crypto.createHash('sha1').update(sentry.bytes).digest();
    fs.writeFileSync('sentryfile/'+config.steam_user, sentryfile);
    util.log("sentryfile saved");
    callback({ sha_file: sentryfile });
}

Test result: old sentrys are accept by steam
If you find out any problem, feel free to contact with [me](mailto: [email protected]) 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.

node-dota2-spectator's People

Contributors

tjroger avatar lemkova avatar

Watchers

James Cloos avatar Jimmy Lee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.