Skip to content
Permalink
Browse files

Fixed bugs and give warnings for unreliable methods of scoring.

  • Loading branch information...
roncli committed Jul 10, 2015
1 parent 0e06b37 commit b056c84238cf2e9c1025688afabe252e95d7a0f9
Showing with 9 additions and 6 deletions.
  1. +7 −4 README.md
  2. +2 −2 index.js
@@ -116,9 +116,7 @@ The instantiated console object is an `EventEmitter`, and will emit events when

`playerinfo (info)` - Player information was received. `info` is an object that contains one or more key-value pairs. See the Player Info section for more details.

`playerscore (player, points, kills, deaths, suicides, ping)` - A player's current score. `player` is the name of the player, `points` is the number of points they have, `kills` is the number of kills they have, `deaths` is the number of deaths they have, `suicides` is the number of suicides they have, and `ping` is their ping to the server in milliseconds.

`playertotalscore (player, points, totalPoints, kills, totalKills, deaths, totalDeaths, suicides, totalSuicides, ping)` - A player's current score for both the current level and across all levels the server has hosted. `player` is the name of the player, `points` is the number of points they have this level, `totalPoints` is the number of points they have across all levels, `kills` is the number of kills they have this level, `totalKills` is the number of kills they have across all levels, `deaths` is the number of deaths they have this level, `totalDeaths` is the number of deaths they have across all levels, `suicides` is the number of suicides they have this level, `totalSuicides` is the number of suicides they have across all levels, and `ping` is their ping to the server in milliseconds.
`playerscore (player, points, kills, deaths, suicides, ping)` - A player's current score. `player` is the name of the player, `points` is the number of points they have, `kills` is the number of kills they have (unreliable in some modes when their kills exceed 9), `deaths` is the number of deaths they have (unreliable in some modes when their deaths exceed 9), `suicides` is the number of suicides they have (unreliable in some modes when their suicides exceed 9), and `ping` is their ping to the server in milliseconds.

`raw (line)` - Data was received from the server. `line` is the data that was received.

@@ -174,7 +172,7 @@ The instantiated console object is an `EventEmitter`, and will emit events when
`teamchange (player, team)` - A player changed teams. `player` is the name of the player who changed teams, and `team` is the name of the team they changed to.
`teamplayerscore (player, teamName, points, kills, deaths, suicides, ping)` - A player's current score in a team game. `player` is the name of the player, 'teamName' is the name of the team, `points` is the number of points they have, `kills` is the number of kills they have, `deaths` is the number of deaths they have, `suicides` is the number of suicides they have, and `ping` is their ping to the server in milliseconds.
`teamplayerscore (player, teamName, points, kills, deaths, suicides, ping)` - A player's current score in a team game. `player` is the name of the player, `teamName` is the name of the team, `kills` is the number of kills they have (unreliable in some modes when their kills exceed 9), `deaths` is the number of deaths they have (unreliable in some modes when their deaths exceed 9), `suicides` is the number of suicides they have (unreliable in some modes when their suicides exceed 9), and `ping` is their ping to the server in milliseconds.
`teamscore (teamName, score)` - A team's current score. `teamName` is the name of the team and `score` is the team's score.
@@ -312,6 +310,11 @@ Note that all instance methods return nothing. Any output from these methods is
## History
### Version 0.1.7 - 7/9/2015
* Removed `playertotalscore` due to bugs with the display.
* Added documentation warnings about `playerscore` values for `kills`, `deaths`, and `suicides` being incorrect for values above 9. Users should track these values on their own.
### Version 0.1.6 - 7/8/2015
* Fixed bug with anarchy scores being processed as monsterball scores.
@@ -667,8 +667,8 @@ Console.prototype.connect = function() {
}

// Hoard, Hyper-Anarchy
if (route(line, /^(.*): +(-?[1-9]?[0-9]+)\[(-?[1-9]?[0-9]+)\] +([1-9]?[0-9]+)\[([1-9]?[0-9]+)\] +([1-9]?[0-9]+)\[([1-9]?[0-9]+)\] +([1-9]?[0-9]+)\[([1-9]?[0-9]+)\] +([1-9]?[0-9]+) *$/, function(player, points, totalPoints, kills, totalKills, deaths, totalDeaths, suicides, totalSuicides, ping) {
d3console.emit("playertotalscore", player, +points, +totalPoints, +kills, +totalKills, +deaths, +totalDeaths, +suicides, +totalSuicides, +ping);
if (route(line, /^(.*): +(-?[1-9]?[0-9]+)(?:\[[^ ]*)? +([1-9]?[0-9]+)(?:\[[^ ]*)? +([1-9]?[0-9]+)(?:\[[^ ]*)? +([1-9]?[0-9]+)(?:\[[^ ]*)? +([1-9]?[0-9]+) *$/, function(player, points, kills, deaths, suicides, ping) {
d3console.emit("playerscore", player, +points, +kills, +deaths, +suicides, +ping);
return true;
})) {
return;

0 comments on commit b056c84

Please sign in to comment.
You can’t perform that action at this time.