Skip to content

Commit

Permalink
Merge pull request #130 from Cr4xy/master
Browse files Browse the repository at this point in the history
Fixes #129
  • Loading branch information
pulviscriptor committed Apr 1, 2016
2 parents 3b3172e + bf6d3bf commit e1c78ce
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions agario-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ Client.prototype = {
this.send(buf);
}
if(this.auth_token) {
buf = new Buffer(2 + this.auth_token.length);
buf.writeUInt8(82, 0);
buf.writeUInt8(this.auth_provider, 1);
for (i=1;i<=this.auth_token.length;++i) {
buf.writeUInt8(this.auth_token.charCodeAt(i-1), i+1);
var bytes = [102, 8, 1, 18, this.auth_token.length + 25, 1, 8, 10, 82, this.auth_token.length + 20, 1, 10, 13, 8, 5, 18, 5, 49, 46, 52, 46, 57, 24, 0, 32, 0, 16, 2, 26, this.auth_token.length, 1];
for (var i = 0; i <= this.auth_token.length - 1; i++) {
bytes.push(this.auth_token.charCodeAt(i));
}
buf = new Buffer(bytes.length);
for (var i = 0; i <= bytes.length - 1; i++) {
buf.writeUInt8(bytes[i], i);
}
this.send(buf);
}
Expand Down

0 comments on commit e1c78ce

Please # to comment.