A Twitch.tv viewer reward and games system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
613 B

12 years ago
  1. module.exports = EofPacket;
  2. function EofPacket(options) {
  3. options = options || {};
  4. this.fieldCount = undefined;
  5. this.warningCount = options.warningCount;
  6. this.serverStatus = options.serverStatus;
  7. }
  8. EofPacket.prototype.parse = function(parser) {
  9. this.fieldCount = parser.parseUnsignedNumber(1);
  10. this.warningCount = parser.parseUnsignedNumber(2);
  11. this.serverStatus = parser.parseUnsignedNumber(2);
  12. };
  13. EofPacket.prototype.write = function(writer) {
  14. writer.writeUnsignedNumber(1, 0xfe);
  15. writer.writeUnsignedNumber(2, this.warningCount);
  16. writer.writeUnsignedNumber(2, this.serverStatus);
  17. };