gregstewart / hearthstone-tracker Goto Github PK
View Code? Open in Web Editor NEWAn electron based Hearthstone tracker
License: MIT License
An electron based Hearthstone tracker
License: MIT License
Regardless of win or loss, I think it would be interesting to show what the class breakdown would be for each category and against whom the outcome came:
Using a graph and being able to drill down would be good too: Wins -> Class -> Opponent
Warning: Shallow renderer has been moved to react-test-renderer/shallow. Update references to remove this warning.
Thinking long term if I decide to sync the data with a service later on so that users can log in and view their data whenever, I will need to uniquely identify them.
To get things rolling maybe use a service like Auth0.
Current records would need to be updated to associate a unique identifier, so some kind of migration scripts will need to be written as well.
New hero for Rogues: Maiev Shadowsong
When using devtron I get a linting error suggesting I start listening for uncaughtException
event on the main process
. Something like this should help fix the issue:
process.on('uncaughtException', () => {})
This will stop the nasty popup, so we can log it but we should still notify the user.
Maybe build something using Elastic Search or for now just use Log Entries
Would you be interested in including a mechanism to track pack openings?
I'm thinking of something that would track how close you are to hitting your pity timer limits for Legendaries, Epics, and golden cards.
I'd be available to help or lead out on coding this up if it's something you're willing to incorporate.
It looks like the the win condition is preserved from the first encounter. I.e. if I loose the first match, then play another one (which I win), then the win condition still shows that I have lost.
Getting these warnings recently:
The react/require-extension rule is deprecated. Please use the import/extensions rule from eslint-plugin-import instead.
The react/wrap-multilines rule is deprecated. Please use the react/jsx-wrap-multilines rule instead.
To speed up merges and Pull Requests, consider disabling a LGTM check if and only if the package.json
file was updated
When using devtron I get a linting error suggesting I bundle it as .asar
archive. Instructions are here.
Another security advisory has been published.
Throw an exception:
Uncaught Exception:
TypeError: _winston2.default.change is not a function
at Changes$1.<anonymous> (index.js:49:13)
at emitOne (events.js:77:13)
at Changes$1.emit (events.js:169:7)
at Object.Changes$1.opts.onChange (/Users/gregstewart/Projects/github/hearthstone-tracker/node_modules/pouchdb/lib/index.js:710:10)
at Changes$1.<anonymous> (/Users/gregstewart/Projects/github/hearthstone-tracker/node_modules/pouchdb/lib/index.js:6056:14)
at emitOne (events.js:77:13)
at Changes$1.emit (events.js:169:7)
at Object.Changes$1.opts.onChange (/Users/gregstewart/Projects/github/hearthstone-tracker/node_modules/pouchdb/lib/index.js:710:10)
at onGetWinningDoc (/Users/gregstewart/Projects/github/hearthstone-tracker/node_modules/pouchdb/lib/index.js:7851:20)
at onGetMetadata (/Users/gregstewart/Projects/github/hearthstone-tracker/node_modules/pouchdb/lib/index.js:7869:18)
at /Users/gregstewart/Projects/github/hearthstone-tracker/node_modules/pouchdb/lib/index.js:7893:9
at /Users/gregstewart/Projects/github/hearthstone-tracker/node_modules/pouchdb/node_modules/level-sublevel/shell.js:102:12
at /Users/gregstewart/Projects/github/hearthstone-tracker/node_modules/pouchdb/node_modules/level-sublevel/nut.js:121:19
Since switching to eslint-plugin-import
I get the following warnings:
/Users/gregstewart/Projects/GitHub/hearthstone-tracker/app/views/app.jsx
4:18 warning Unable to resolve path to module './main' import/no-unresolved
/Users/gregstewart/Projects/GitHub/hearthstone-tracker/app/views/game-stats-by-class.jsx
3:29 warning Unable to resolve path to module './game-stat-by-class' import/no-unresolved
/Users/gregstewart/Projects/GitHub/hearthstone-tracker/app/views/main.jsx
3:19 warning Unable to resolve path to module './stats' import/no-unresolved
4:24 warning Unable to resolve path to module './win-streaks' import/no-unresolved
5:28 warning Unable to resolve path to module './match-breakdown' import/no-unresolved
/Users/gregstewart/Projects/GitHub/hearthstone-tracker/app/views/match-breakdown.jsx
3:30 warning Unable to resolve path to module './game-stats-by-class' import/no-unresolved
/Users/gregstewart/Projects/GitHub/hearthstone-tracker/app/views/stats.jsx
3:18 warning Unable to resolve path to module './stat' import/no-unresolved
/Users/gregstewart/Projects/GitHub/hearthstone-tracker/app/views/win-streaks.jsx
3:23 warning Unable to resolve path to module './win-streak' import/no-unresolved
✖ 8 problems (0 errors, 8 warnings)
Show the stats for the current season only and maybe last seasons, that looks something like this:
Current season | Last season |
---|---|
Wins: x | Wins: x |
Losses: x | Losses: x |
Ratio: xx.xx% | Ratio: xx.xx% |
Remove the exception once this has been patched in:
Getting the following error. I tried with both latest node and also Node 8.2.1 listed in package.json. I am running on MacOSX 10.14.1
> electron .
App threw an error during load
Error: Invalid transport, must be an object with a log method.
at new LegacyTransportStream (/Users/vidalgraupera/code/2018/hearthstone-tracker/node_modul
es/winston-transport/legacy.js:18:11)
at DerivedLogger.add (/Users/vidalgraupera/code/2018/hearthstone-tracker/node_modules/winst
on/lib/winston/logger.js:245:9)
at Object.winston.(anonymous function).args [as add] (/Users/vidalgraupera/code/2018/hearth
stone-tracker/node_modules/winston/lib/winston.js:101:55)
at Object.<anonymous> (/Users/vidalgraupera/code/2018/hearthstone-tracker/index.js:34:9)
at Object.<anonymous> (/Users/vidalgraupera/code/2018/hearthstone-tracker/index.js:117:3)
at Module._compile (module.js:642:30)
at loader (/Users/vidalgraupera/code/2018/hearthstone-tracker/node_modules/babel-register/l
ib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/vidalgraupera/code/2018/
hearthstone-tracker/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:561:32)
Every time a new version of Electron is released I also need to update a few places of the package.json
file. I can improve this by referencing values in the file.
I show the percentage of wins by class, i.e. out of a 100% wins, 35% are with a warrior, etc... This is basically a breakdown of the wins/losses by class.
It would be good to show the win rate by class, i.e. out of 100% of matches played as a warrior, I win xx%.
Having watched this: https://www.youtube.com/watch?v=K-H2amwQ_pU
I wonder if I can use this to fetch data again, give that sometimes the data doesn't load on first load.
Remove exception once patched.
For some reason on Circle CI I get this when trying to run code coverage:
npm run coverage
> [email protected] coverage /home/ubuntu/hearthstone-tracker
> nyc --reporter=lcov --reporter=text ./node_modules/.bin/_mocha test
File [/home/ubuntu/hearthstone-tracker/src/parse-friendly-player.js] ignored, nothing could be mapped
File [/home/ubuntu/hearthstone-tracker/src/data-structures.js] ignored, nothing could be mapped
File [/home/ubuntu/hearthstone-tracker/src/find-class.js] ignored, nothing could be mapped
File [/home/ubuntu/hearthstone-tracker/src/win-condition.js] ignored, nothing could be mapped
/home/ubuntu/hearthstone-tracker/src/log-watcher.js:1
(function (exports, require, module, __filename, __dirname) { 'use strict';var __cov_ONYfe_P3ZtfWuOqICRtWaopgy90=function(){var path="/home/ubuntu/hearthstone-tracker/src/log-watcher.js",hash="86442683bb5ce726c8ba154cd6c26fcbfd7675ed",global=new Function('return this')(),gcv="__coverage__",coverageData={path:"/home/ubuntu/hearthstone-tracker/src/log-watcher.js",statementMap:{"1":{start:{line:3,column:0},end:{line:5,column:3}},"2":{start:{line:7,column:21},end:{line:7,column:663}},"3":{start:{line:7,column:79},end:{line:7,column:81}},"4":{start:{line:7,column:92},end:{line:7,column:96}},"5":{start:{line:7,column:107},end:{line:7,column:112}},"6":{start:{line:7,column:123},end:{line:7,column:132}},"7":{start:{line:7,column:134},end:{line:7,column:413}},"8":{start:{line:7,column:140},end:{line:7,column:283}},"9":{start:{line:7,column:226},end:{line:7,column:246}},"10":{start:{line:7,column:247},end:{line:7,column:281}},"11":{start:{line:7,column:275},end:{l
TypeError: Cannot read property '0' of undefined
at _slicedToArray (/home/ubuntu/hearthstone-tracker/src/log-watcher.js:1:15378)
Disabled it for now, maybe look into an alternative?
Consider using electron-release
(node:17410) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): TypeError: db.allDocs is not a function
(node:17410) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Currently the data structure for an encounter looks as follows:
{
matchId: "",
playerId: "",
for: "",
against: "",
log: [],
hasWon: ""
}
I would like to change it so that it includes the player's name as well. If I do that then then for/against key should store an object:
{
matchId: "",
for: {name: "bob": class:"Hunter", playerId: 1},
against: {name: "al": class:"Priest", playerId: 2},
log: [],
hasWon: ""
}
Currently we display the season stats as text. It would be great to display these as a pie chart instead.
🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
Just throwing some ideas out there...
generateResult().wins(2).as(‘Priest').against(‘Warlock’).and(‘Druid);
generateResult(
[ doc(for(‘rogue’), true, against(‘shaman’), 1453420291617, 10)]
)
class(‘druid’).beats().class(’Shaman’),
class(‘rogue’).looses().class(‘warlock’),
class(‘rogue’).beats().class(‘warlock’),
class(‘rogue’).beats().class(‘mage’),
class(‘rogue’).looses().class(‘rogue’),
class(‘priest’).beats().class(’Shaman’),
for = (className) => {
return {
name: randomName(),
id: 1,
class: className
}
}
against = (className) => {
return {
name: randomName(),
id: 2,
class: className
}
},
/**
for: Me
against: my opponent
started: unix time stamp
lasted: time in minutes the match lasted
*/
doc = (for, outcome, against, started, lasted) => {
startTime: toDate(started)
endTime: toDate(started).add(lasted)
for: for
against: against
log: []
hasWon: outcome
_id: toString(started)
_rev: ‘some pouch db value'
}
It would be nice to use something like:
To track errors
Is it worth using something like Readme.io to create documentation?
Need to update the hero list and map to the priest
class
As the title implies, should probably look into keeping a changelog
When using devtron I get a linting error suggesting I start listening for crashed
event on the webContents
property of the BrowserWindow
. Something like this should help fix the issue:
myWindow.webContents.on('crashed', () => {})
The other night while playing a match I got disconnected and as a result lost the game. The tracker did not catch this. Some other event must get fired when you log back in.
Isparta is no longer maintained and this is the preferred way now: babel-plugin-istanbul
Implement automatic updates => https://github.com/EvolveLabs/electron-updater/
When using devtron I get a linting error suggesting I start listening for unresponsive
event on the webContents
property of the BrowserWindow
. Something like this should help fix the issue:
myWindow.webContents.on('unresponsive', () => {})
103M seems excessive for what this is...
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.nvmrc
with the new onepackage.json
files was updated to the new Node.js versionIf you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Display the last 5 games played:
To make it look prettier we could use either the class colours or the hero avatars.
Another option would be to maybe use a simple Sparkeline graph:
info: no game start event
info: name=artaios, id=1, status=TIED
info: false
I was reading through this article and it made me wonder if some of the ideas here could be applied to updating the Redux stores.
This advisory has been published. I have added an exception to the project. Need to keep checking when this gets resolved.
Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.