huya-danma-listener
Version:
huya danmu module
1,492 lines (1,491 loc) • 185 kB
JavaScript
/* eslint-disable */
var Taf = Taf || {};
(Taf.INT8 = function () {
(this._clone = function () {
return 0;
}),
(this._write = function (t, e, i) {
return t.writeInt8(e, i);
}),
(this._read = function (t, e, i) {
return t.readInt8(e, !0, i);
}),
(this._className = function () {
return Taf.CHAR;
});
}),
(Taf.INT16 = function () {
(this._clone = function () {
return 0;
}),
(this._write = function (t, e, i) {
return t.writeInt16(e, i);
}),
(this._read = function (t, e, i) {
return t.readInt16(e, !0, i);
}),
(this._className = function () {
return Taf.SHORT;
});
}),
(Taf.INT32 = function () {
(this._clone = function () {
return 0;
}),
(this._write = function (t, e, i) {
return t.writeInt32(e, i);
}),
(this._read = function (t, e, i) {
return t.readInt32(e, !0, i);
}),
(this._className = function () {
return Taf.INT32;
});
}),
(Taf.INT64 = function () {
(this._clone = function () {
return 0;
}),
(this._write = function (t, e, i) {
return t.writeInt64(e, i);
}),
(this._read = function (t, e, i) {
return t.readInt64(e, !0, i);
}),
(this._className = function () {
return Taf.INT64;
});
}),
(Taf.UINT8 = function () {
(this._clone = function () {
return 0;
}),
(this._write = function (t, e, i) {
return t.writeInt16(e, i);
}),
(this._read = function (t, e, i) {
return t.readInt16(e, !0, i);
}),
(this._className = function () {
return Taf.SHORT;
});
}),
(Taf.UInt16 = function () {
(this._clone = function () {
return 0;
}),
(this._write = function (t, e, i) {
return t.writeInt32(e, i);
}),
(this._read = function (t, e, i) {
return t.readInt32(e, !0, i);
}),
(this._className = function () {
return Taf.INT32;
});
}),
(Taf.UInt32 = function () {
(this._clone = function () {
return 0;
}),
(this._write = function (t, e, i) {
return t.writeInt64(e, i);
}),
(this._read = function (t, e, i) {
return t.readInt64(e, !0, i);
}),
(this._className = function () {
return Taf.INT64;
});
}),
(Taf.Float = function () {
(this._clone = function () {
return 0;
}),
(this._write = function (t, e, i) {
return t.writeFloat(e, i);
}),
(this._read = function (t, e, i) {
return t.readFloat(e, !0, i);
}),
(this._className = function () {
return Taf.FLOAT;
});
}),
(Taf.Double = function () {
(this._clone = function () {
return 0;
}),
(this._write = function (t, e, i) {
return t.writeDouble(e, i);
}),
(this._read = function (t, e, i) {
return t.readDouble(e, !0, i);
}),
(this._className = function () {
return Taf.DOUBLE;
});
}),
(Taf.STRING = function () {
(this._clone = function () {
return 0;
}),
(this._write = function (t, e, i) {
return t.writeString(e, i);
}),
(this._read = function (t, e, i) {
return t.readString(e, !0, i);
}),
(this._className = function () {
return Taf.STRING;
});
}),
(Taf.BOOLEAN = function () {
(this._clone = function () {
return !1;
}),
(this._write = function (t, e, i) {
return t.writeBoolean(e, i);
}),
(this._read = function (t, e, i) {
return t.readBoolean(e, !0, i);
}),
(this._className = function () {
return Taf.BOOLEAN;
});
}),
(Taf.ENUM = function () {
(this._clone = function () {
return 0;
}),
(this._write = function (t, e, i) {
return t.writeInt32(e, i);
}),
(this._read = function (t, e, i) {
return t.readInt32(e, !0, i);
});
}),
(Taf.Vector = function (t) {
(this.proto = t), (this.value = new Array());
}),
(Taf.Vector.prototype._clone = function () {
return new Taf.Vector(this.proto);
}),
(Taf.Vector.prototype._write = function (t, e, i) {
return t.writeVector(e, i);
}),
(Taf.Vector.prototype._read = function (t, e, i) {
return t.readVector(e, !0, i);
}),
(Taf.Vector.prototype._className = function () {
return Taf.TypeHelp.VECTOR.replace("$t", this.proto._className());
}),
(Taf.Map = function (t, e) {
(this.kproto = t), (this.vproto = e), (this.value = new Object());
}),
(Taf.Map.prototype._clone = function () {
return new Taf.Map(this.kproto, this.vproto);
}),
(Taf.Map.prototype._write = function (t, e, i) {
return t.writeMap(e, i);
}),
(Taf.Map.prototype._read = function (t, e, i) {
return t.readMap(e, !0, i);
}),
(Taf.Map.prototype.put = function (t, e) {
this.value[t] = e;
}),
(Taf.Map.prototype.get = function (t) {
return this.value[t];
}),
(Taf.Map.prototype.remove = function (t) {
delete this.value[t];
}),
(Taf.Map.prototype.clear = function () {
this.value = new Object();
}),
(Taf.Map.prototype.size = function () {
var t = 0;
for (var e in this.value) t++;
return t;
}),
(Taf.Vector.prototype._className = function () {
return Taf.TypeHelp.Map.replace("$k", this.kproto._className()).replace(
"$v",
this.vproto._className(),
);
});
var Taf = Taf || {};
(Taf.DataHelp = {
EN_INT8: 0,
EN_INT16: 1,
EN_INT32: 2,
EN_INT64: 3,
EN_FLOAT: 4,
EN_DOUBLE: 5,
EN_STRING1: 6,
EN_STRING4: 7,
EN_MAP: 8,
EN_LIST: 9,
EN_STRUCTBEGIN: 10,
EN_STRUCTEND: 11,
EN_ZERO: 12,
EN_SIMPLELIST: 13,
}),
(Taf.TypeHelp = {
BOOLEAN: "bool",
CHAR: "char",
SHORT: "short",
INT32: "int32",
INT64: "int64",
FLOAT: "float",
DOUBLE: "double",
STRING: "string",
VECTOR: "list<$t>",
MAP: "map<$k, $v>",
}),
(Taf.BinBuffer = function (t) {
(this.buf = null),
(this.vew = null),
(this.len = 0),
(this.position = 0),
null != t &&
void 0 != t &&
t instanceof Taf.BinBuffer &&
((this.buf = t.buf),
(this.vew = new DataView(this.buf)),
(this.len = t.length),
(this.position = t.position)),
null != t &&
void 0 != t &&
t instanceof ArrayBuffer &&
((this.buf = t),
(this.vew = new DataView(this.buf)),
(this.len = this.vew.byteLength),
(this.position = 0)),
this.__defineGetter__("length", function () {
return this.len;
}),
this.__defineGetter__("buffer", function () {
return this.buf;
});
}),
(Taf.BinBuffer.prototype._write = function (t, e, i) {
return t.writeBytes(e, i);
}),
(Taf.BinBuffer.prototype._read = function (t, e, i) {
return t.readBytes(e, !0, i);
}),
(Taf.BinBuffer.prototype._clone = function () {
return new Taf.BinBuffer();
}),
(Taf.BinBuffer.prototype.allocate = function (t) {
if (((t = this.position + t), !(null != this.buf && this.buf.length > t))) {
var e = new ArrayBuffer(Math.max(256, 2 * t));
null != this.buf && (new Uint8Array(e).set(new Uint8Array(this.buf)), (this.buf = void 0)),
(this.buf = e),
(this.vew = void 0),
(this.vew = new DataView(this.buf));
}
}),
(Taf.BinBuffer.prototype.getBuffer = function () {
var t = new ArrayBuffer(this.len);
return new Uint8Array(t).set(new Uint8Array(this.buf, 0, this.len)), t;
}),
(Taf.BinBuffer.prototype.memset = function (t, e, i) {
this.allocate(i), new Uint8Array(this.buf).set(new Uint8Array(t, e, i), this.position);
}),
(Taf.BinBuffer.prototype.writeInt8 = function (t) {
this.allocate(1),
this.vew.setInt8(this.position, t),
(this.position += 1),
(this.len = this.position);
}),
(Taf.BinBuffer.prototype.writeUInt8 = function (t) {
this.allocate(1), this.vew.setUint8(this.position++, t), (this.len = this.position);
}),
(Taf.BinBuffer.prototype.writeInt16 = function (t) {
this.allocate(2),
this.vew.setInt16(this.position, t),
(this.position += 2),
(this.len = this.position);
}),
(Taf.BinBuffer.prototype.writeUInt16 = function (t) {
this.allocate(2),
this.vew.setUint16(this.position, t),
(this.position += 2),
(this.len = this.position);
}),
(Taf.BinBuffer.prototype.writeInt32 = function (t) {
this.allocate(4),
this.vew.setInt32(this.position, t),
(this.position += 4),
(this.len = this.position);
}),
(Taf.BinBuffer.prototype.writeUInt32 = function (t) {
this.allocate(4),
this.vew.setUint32(this.position, t),
(this.position += 4),
(this.len = this.position);
}),
(Taf.BinBuffer.prototype.writeInt64 = function (t) {
this.allocate(8),
this.vew.setUint32(this.position, parseInt(t / 4294967296)),
this.vew.setUint32(this.position + 4, t % 4294967296),
(this.position += 8),
(this.len = this.position);
}),
(Taf.BinBuffer.prototype.writeFloat = function (t) {
this.allocate(4),
this.vew.setFloat32(this.position, t),
(this.position += 4),
(this.len = this.position);
}),
(Taf.BinBuffer.prototype.writeDouble = function (t) {
this.allocate(8),
this.vew.setFloat64(this.position, t),
(this.position += 8),
(this.len = this.position);
}),
(Taf.BinBuffer.prototype.writeString = function (t) {
for (var e = [], i = 0; i < t.length; i++) e.push(255 & t.charCodeAt(i));
this.allocate(e.length),
new Uint8Array(this.buf).set(new Uint8Array(e), this.position),
(this.position += e.length),
(this.len = this.position);
}),
(Taf.BinBuffer.prototype.writeBytes = function (t) {
0 != t.length &&
null != t.buf &&
(this.allocate(t.length),
new Uint8Array(this.buf).set(new Uint8Array(t.buf, 0, t.length), this.position),
(this.position += t.length),
(this.len = this.position));
}),
(Taf.BinBuffer.prototype.readInt8 = function () {
return this.vew.getInt8(this.position++);
}),
(Taf.BinBuffer.prototype.readInt16 = function () {
return (this.position += 2), this.vew.getInt16(this.position - 2);
}),
(Taf.BinBuffer.prototype.readInt32 = function () {
return (this.position += 4), this.vew.getInt32(this.position - 4);
}),
(Taf.BinBuffer.prototype.readUInt8 = function () {
return (this.position += 1), this.vew.getUint8(this.position - 1);
}),
(Taf.BinBuffer.prototype.readUInt16 = function () {
return (this.position += 2), this.vew.getUint16(this.position - 2);
}),
(Taf.BinBuffer.prototype.readUInt32 = function () {
return (this.position += 4), this.vew.getUint32(this.position - 4);
}),
(Taf.BinBuffer.prototype.readInt64 = function () {
var t = this.vew.getUint32(this.position),
e = this.vew.getUint32(this.position + 4);
return (this.position += 8), 4294967296 * t + e;
}),
(Taf.BinBuffer.prototype.readFloat = function () {
var t = this.vew.getFloat32(this.position);
return (this.position += 4), t;
}),
(Taf.BinBuffer.prototype.readDouble = function () {
var t = this.vew.getFloat64(this.position);
return (this.position += 8), t;
}),
(Taf.BinBuffer.prototype.readString = function (t) {
for (var e = [], i = 0; t > i; i++)
e.push(String.fromCharCode(this.vew.getUint8(this.position++)));
var r = e.join("");
try {
r = decodeURIComponent(escape(r));
} catch (n) {}
return r;
}),
(Taf.BinBuffer.prototype.readBytes = function (t) {
var e = new Taf.BinBuffer();
return (
e.allocate(t),
e.memset(this.buf, this.position, t),
(e.position = 0),
(e.len = t),
(this.position = this.position + t),
e
);
}),
(Taf.JceOutputStream = function () {
(this.buf = new Taf.BinBuffer()),
(this.getBinBuffer = function () {
return this.buf;
}),
(this.getBuffer = function () {
return this.buf.getBuffer();
});
}),
(Taf.JceOutputStream.prototype.writeTo = function (t, e) {
15 > t ? this.buf.writeUInt8(((t << 4) & 240) | e) : this.buf.writeUInt16(((240 | e) << 8) | t);
}),
(Taf.JceOutputStream.prototype.writeBoolean = function (t, e) {
this.writeInt8(t, 1 == e ? 1 : 0);
}),
(Taf.JceOutputStream.prototype.writeInt8 = function (t, e) {
0 == e
? this.writeTo(t, Taf.DataHelp.EN_ZERO)
: (this.writeTo(t, Taf.DataHelp.EN_INT8), this.buf.writeInt8(e));
}),
(Taf.JceOutputStream.prototype.writeInt16 = function (t, e) {
e >= -128 && 127 >= e
? this.writeInt8(t, e)
: (this.writeTo(t, Taf.DataHelp.EN_INT16), this.buf.writeInt16(e));
}),
(Taf.JceOutputStream.prototype.writeInt32 = function (t, e) {
e >= -32768 && 32767 >= e
? this.writeInt16(t, e)
: (this.writeTo(t, Taf.DataHelp.EN_INT32), this.buf.writeInt32(e));
}),
(Taf.JceOutputStream.prototype.writeInt64 = function (t, e) {
e >= -2147483648 && 2147483647 >= e
? this.writeInt32(t, e)
: (this.writeTo(t, Taf.DataHelp.EN_INT64), this.buf.writeInt64(e));
}),
(Taf.JceOutputStream.prototype.writeUInt8 = function (t, e) {
this.writeInt16(t, e);
}),
(Taf.JceOutputStream.prototype.writeUInt16 = function (t, e) {
this.writeInt32(t, e);
}),
(Taf.JceOutputStream.prototype.writeUInt32 = function (t, e) {
this.writeInt64(t, e);
}),
(Taf.JceOutputStream.prototype.writeFloat = function (t, e) {
0 == e
? this.writeTo(t, Taf.DataHelp.EN_ZERO)
: (this.writeTo(t, Taf.DataHelp.EN_FLOAT), this.buf.writeFloat(e));
}),
(Taf.JceOutputStream.prototype.writeDouble = function (t, e) {
0 == e
? this.writeTo(t, Taf.DataHelp.EN_ZERO)
: (this.writeTo(t, Taf.DataHelp.EN_DOUBLE), this.buf.writeDouble(e));
}),
(Taf.JceOutputStream.prototype.writeStruct = function (t, e) {
if (void 0 == e.writeTo) throw Error("not defined writeTo Function");
this.writeTo(t, Taf.DataHelp.EN_STRUCTBEGIN),
e.writeTo(this),
this.writeTo(0, Taf.DataHelp.EN_STRUCTEND);
}),
(Taf.JceOutputStream.prototype.writeString = function (t, e) {
var i = e;
try {
i = unescape(encodeURIComponent(i));
} catch (r) {}
i.length > 255
? (this.writeTo(t, Taf.DataHelp.EN_STRING4), this.buf.writeUInt32(i.length))
: (this.writeTo(t, Taf.DataHelp.EN_STRING1), this.buf.writeUInt8(i.length)),
this.buf.writeString(i);
}),
(Taf.JceOutputStream.prototype.writeBytes = function (t, e) {
if (!(e instanceof Taf.BinBuffer)) throw Error("value not instanceof Taf.BinBuffer");
this.writeTo(t, Taf.DataHelp.EN_SIMPLELIST),
this.writeTo(0, Taf.DataHelp.EN_INT8),
this.writeInt32(0, e.length),
this.buf.writeBytes(e);
}),
(Taf.JceOutputStream.prototype.writeVector = function (t, e) {
this.writeTo(t, Taf.DataHelp.EN_LIST), this.writeInt32(0, e.value.length);
for (var i = 0; i < e.value.length; i++) e.proto._write(this, 0, e.value[i]);
}),
(Taf.JceOutputStream.prototype.writeMap = function (t, e) {
this.writeTo(t, Taf.DataHelp.EN_MAP), this.writeInt32(0, e.size());
for (var i in e.value) e.kproto._write(this, 0, i), e.vproto._write(this, 1, e.value[i]);
}),
(Taf.JceInputStream = function (t) {
this.buf = new Taf.BinBuffer(t);
}),
(Taf.JceInputStream.prototype.readFrom = function () {
var t = this.buf.readUInt8(),
e = (240 & t) >> 4,
i = 15 & t;
return (
e >= 15 && (e = this.buf.readUInt8()),
{
tag: e,
type: i,
}
);
}),
(Taf.JceInputStream.prototype.peekFrom = function () {
var t = this.buf.position,
e = this.readFrom();
return (
(this.buf.position = t),
{
tag: e.tag,
type: e.type,
size: e.tag >= 15 ? 2 : 1,
}
);
}),
(Taf.JceInputStream.prototype.skipField = function (type) {
switch (type) {
case Taf.DataHelp.EN_INT8:
this.buf.position += 1;
break;
case Taf.DataHelp.EN_INT16:
this.buf.position += 2;
break;
case Taf.DataHelp.EN_INT32:
this.buf.position += 4;
break;
case Taf.DataHelp.EN_INT64:
this.buf.position += 8;
break;
case Taf.DataHelp.EN_STRING1:
var a = this.buf.readUInt8();
this.buf.position += a;
break;
case Taf.DataHelp.EN_STRING4:
var b = this.buf.readInt32();
this.buf.position += b;
break;
case Taf.DataHelp.EN_STRUCTBEGIN:
this.skipToStructEnd();
break;
case Taf.DataHelp.EN_STRUCTEND:
case Taf.DataHelp.EN_ZERO:
break;
case Taf.DataHelp.EN_MAP: {
var size = this.readInt32(0, true);
for (var i = 0; i < size * 2; ++i) {
var head = this.readFrom();
this.skipField(head.type);
}
break;
}
case Taf.DataHelp.EN_SIMPLELIST: {
var head = this.readFrom();
if (head.type != Taf.DataHelp.EN_INT8) {
throw Error("skipField with invalid type, type value: " + type + "," + head.type);
}
var a = this.readInt32(0, true);
this.buf.position += a;
break;
}
case Taf.DataHelp.EN_LIST: {
var size = this.readInt32(0, true);
for (var i = 0; i < size; ++i) {
var head = this.readFrom();
this.skipField(head.type);
}
break;
}
default:
throw new Error("skipField with invalid type, type value: " + type);
}
}),
(Taf.JceInputStream.prototype.skipToStructEnd = function () {
for (;;) {
var t = this.readFrom();
if ((this.skipField(t.type), t.type == Taf.DataHelp.EN_STRUCTEND)) return;
}
}),
(Taf.JceInputStream.prototype.skipToTag = function (t, e) {
for (; this.buf.position < this.buf.length; ) {
var i = this.peekFrom();
if (t <= i.tag || i.type == Taf.DataHelp.EN_STRUCTEND)
return i.type == Taf.DataHelp.EN_STRUCTEND ? !1 : t == i.tag;
(this.buf.position += i.size), this.skipField(i.type);
}
if (e) throw Error("require field not exist, tag:" + t);
return !1;
}),
(Taf.JceInputStream.prototype.readBoolean = function (t, e, i) {
return 1 == this.readInt8(t, e, i) ? !0 : !1;
}),
(Taf.JceInputStream.prototype.readInt8 = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
switch (r.type) {
case Taf.DataHelp.EN_ZERO:
return 0;
case Taf.DataHelp.EN_INT8:
return this.buf.readInt8();
}
throw Error("read int8 type mismatch, tag:" + t + ", get type:" + r.type);
}),
(Taf.JceInputStream.prototype.readInt16 = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
switch (r.type) {
case Taf.DataHelp.EN_ZERO:
return 0;
case Taf.DataHelp.EN_INT8:
return this.buf.readInt8();
case Taf.DataHelp.EN_INT16:
return this.buf.readInt16();
}
throw Error("read int8 type mismatch, tag:" + t + ", get type:" + r.type);
}),
(Taf.JceInputStream.prototype.readInt32 = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
switch (r.type) {
case Taf.DataHelp.EN_ZERO:
return 0;
case Taf.DataHelp.EN_INT8:
return this.buf.readInt8();
case Taf.DataHelp.EN_INT16:
return this.buf.readInt16();
case Taf.DataHelp.EN_INT32:
return this.buf.readInt32();
}
throw Error("read int8 type mismatch, tag:" + t + ", get type:" + r.type);
}),
(Taf.JceInputStream.prototype.readInt64 = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
switch (r.type) {
case Taf.DataHelp.EN_ZERO:
return 0;
case Taf.DataHelp.EN_INT8:
return this.buf.readInt8();
case Taf.DataHelp.EN_INT16:
return this.buf.readInt16();
case Taf.DataHelp.EN_INT32:
return this.buf.readInt32();
case Taf.DataHelp.EN_INT64:
return this.buf.readInt64();
}
throw Error("read int64 type mismatch, tag:" + t + ", get type:" + h.type);
}),
(Taf.JceInputStream.prototype.readFloat = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
switch (r.type) {
case Taf.DataHelp.EN_ZERO:
return 0;
case Taf.DataHelp.EN_FLOAT:
return this.buf.readFloat();
}
throw Error("read float type mismatch, tag:" + t + ", get type:" + h.type);
}),
(Taf.JceInputStream.prototype.readDouble = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
switch (r.type) {
case Taf.DataHelp.EN_ZERO:
return 0;
case Taf.DataHelp.EN_DOUBLE:
return this.buf.readDouble();
}
throw Error("read double type mismatch, tag:" + t + ", get type:" + h.type);
}),
(Taf.JceInputStream.prototype.readUInt8 = function (t, e, i) {
return this.readInt16(t, e, i);
}),
(Taf.JceInputStream.prototype.readUInt16 = function (t, e, i) {
return this.readInt32(t, e, i);
}),
(Taf.JceInputStream.prototype.readUInt32 = function (t, e, i) {
return this.readInt64(t, e, i);
}),
(Taf.JceInputStream.prototype.readStruct = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
if (r.type != Taf.DataHelp.EN_STRUCTBEGIN)
throw Error("read struct type mismatch, tag: " + t + ", get type:" + r.type);
return i.readFrom(this), this.skipToStructEnd(), i;
}),
(Taf.JceInputStream.prototype.readString = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
if (r.type == Taf.DataHelp.EN_STRING1) return this.buf.readString(this.buf.readUInt8());
if (r.type == Taf.DataHelp.EN_STRING4) return this.buf.readString(this.buf.readUInt32());
throw Error("read 'string' type mismatch, tag: " + t + ", get type: " + r.type + ".");
}),
(Taf.JceInputStream.prototype.readString2 = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
if (r.type == Taf.DataHelp.EN_STRING1) return this.buf.readBytes(this.buf.readUInt8());
if (r.type == Taf.DataHelp.EN_STRING4) return this.buf.readBytes(this.buf.readUInt32());
throw Error("read 'string' type mismatch, tag: " + t + ", get type: " + r.type + ".");
}),
(Taf.JceInputStream.prototype.readBytes = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
if (r.type == Taf.DataHelp.EN_SIMPLELIST) {
var n = this.readFrom();
if (n.type != Taf.DataHelp.EN_INT8)
throw Error("type mismatch, tag:" + t + ",type:" + r.type + "," + n.type);
var s = this.readInt32(0, !0);
if (0 > s) throw Error("invalid size, tag:" + t + ",type:" + r.type + "," + n.type);
return this.buf.readBytes(s);
}
if (r.type == Taf.DataHelp.EN_LIST) {
var s = this.readInt32(0, !0);
return this.buf.readBytes(s);
}
throw Error("type mismatch, tag:" + t + ",type:" + r.type);
}),
(Taf.JceInputStream.prototype.readVector = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
if (r.type != Taf.DataHelp.EN_LIST)
throw Error("read 'vector' type mismatch, tag: " + t + ", get type: " + r.type);
var n = this.readInt32(0, !0);
if (0 > n) throw Error("invalid size, tag: " + t + ", type: " + r.type + ", size: " + n);
for (var s = 0; n > s; ++s) i.value.push(i.proto._read(this, 0, i.proto._clone()));
return i;
}),
(Taf.JceInputStream.prototype.readMap = function (t, e, i) {
if (0 == this.skipToTag(t, e)) return i;
var r = this.readFrom();
if (r.type != Taf.DataHelp.EN_MAP)
throw Error("read 'map' type mismatch, tag: " + t + ", get type: " + r.type);
var n = this.readInt32(0, !0);
if (0 > n) throw Error("invalid map, tag: " + t + ", size: " + n);
for (var s = 0; n > s; s++) {
var o = i.kproto._read(this, 0, i.kproto._clone()),
a = i.vproto._read(this, 1, i.vproto._clone());
i.put(o, a);
}
return i;
});
var Taf = Taf || {};
(Taf.Wup = function () {
(this.iVersion = 3),
(this.cPacketType = 0),
(this.iMessageType = 0),
(this.iRequestId = 0),
(this.sServantName = ""),
(this.sFuncName = ""),
(this.sBuffer = new Taf.BinBuffer()),
(this.iTimeout = 0),
(this.context = new Taf.Map(new Taf.STRING(), new Taf.STRING())),
(this.status = new Taf.Map(new Taf.STRING(), new Taf.STRING())),
(this.data = new Taf.Map(new Taf.STRING(), new Taf.Map(new Taf.STRING(), new Taf.BinBuffer()))),
(this.newdata = new Taf.Map(new Taf.STRING(), new Taf.BinBuffer()));
}),
(Taf.Wup.prototype.setVersion = function (t) {
this.iVersion = t;
}),
(Taf.Wup.prototype.getVersion = function () {
return this.iVersion;
}),
(Taf.Wup.prototype.setServant = function (t) {
this.sServantName = t;
}),
(Taf.Wup.prototype.setFunc = function (t) {
this.sFuncName = t;
}),
(Taf.Wup.prototype.setRequestId = function (t) {
this.iRequestId = t ? t : ++this.iRequestid;
}),
(Taf.Wup.prototype.getRequestId = function () {
return this.iRequestId;
}),
(Taf.Wup.prototype.setTimeOut = function (t) {
this.iTimeout = t;
}),
(Taf.Wup.prototype.getTimeOut = function () {
return this.iTimeout;
}),
(Taf.Wup.prototype.writeTo = function () {
var t = new Taf.JceOutputStream();
return (
t.writeInt16(1, this.iVersion),
t.writeInt8(2, this.cPacketType),
t.writeInt32(3, this.iMessageType),
t.writeInt32(4, this.iRequestId),
t.writeString(5, this.sServantName),
t.writeString(6, this.sFuncName),
t.writeBytes(7, this.sBuffer),
t.writeInt32(8, this.iTimeout),
t.writeMap(9, this.context),
t.writeMap(10, this.status),
new Taf.BinBuffer(t.getBuffer())
);
}),
(Taf.Wup.prototype.encode = function () {
var t = new Taf.JceOutputStream();
3 == this.iVersion ? t.writeMap(0, this.newdata) : t.writeMap(0, this.data),
(this.sBuffer = t.getBinBuffer());
var e = new Taf.BinBuffer();
e = this.writeTo();
var i = new Taf.BinBuffer();
return i.writeInt32(4 + e.len), i.writeBytes(e), i;
}),
(Taf.Wup.prototype.writeBoolean = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeBoolean(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBuffer()));
else {
var r = this.data.get(t),
n = TAF.TypeHelp.BOOLEAN;
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Taf.BinBuffer(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.writeInt8 = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeInt8(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBuffer()));
else {
var r = this.data.get(t),
n = TAF.TypeHelp.CHAR;
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Taf.BinBuffer(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.writeInt16 = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeInt16(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBuffer()));
else {
var r = this.data.get(t),
n = TAF.TypeHelp.SHORT;
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Uint8Array(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.writeInt32 = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeInt32(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBuffer()));
else {
var r = this.data.get(t),
n = TAF.TypeHelp.INT32;
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Uint8Array(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.writeInt64 = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeInt64(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBuffer()));
else {
var r = this.data.get(t),
n = TAF.TypeHelp.INT64;
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Uint8Array(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.writeFloat = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeFloat(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBuffer()));
else {
var r = this.data.get(t),
n = TAF.TypeHelp.FLOAT;
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Uint8Array(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.writeDouble = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeDouble(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBuffer()));
else {
var r = this.data.get(t),
n = TAF.TypeHelp.DOUBLE;
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Uint8Array(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.writeString = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeString(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBuffer()));
else {
var r = this.data.get(t),
n = Taf.TypeHelp.STRING;
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Uint8Array(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.writeVector = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeVector(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBinBuffer()));
else {
var r = this.data.get(t),
n = e._className();
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Uint8Array(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.writeStruct = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeStruct(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBuffer()));
else {
var r = this.data.get(t),
n = " ";
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Uint8Array(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.writeBytes = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeBytes(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBuffer()));
else {
var r = this.data.get(t),
n = "vec";
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Uint8Array(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.writeMap = function (t, e) {
var i = new Taf.JceOutputStream();
if ((i.writeMap(0, e), 3 == this.iVersion))
this.newdata.put(t, new Taf.BinBuffer(i.getBuffer()));
else {
var r = this.data.get(t),
n = Taf.Util.getClassType(e);
if (void 0 == r) {
var s = new Taf.Map(Taf.STRING, Taf.STRING);
r = s;
}
r.put(n, new Uint8Array(i.getBuffer())), this.data.put(t, r);
}
}),
(Taf.Wup.prototype.readFrom = function (t) {
(this.iVersion = t.readInt16(1, !0)),
(this.cPacketType = t.readInt8(2, !0)),
(this.iMessageType = t.readInt32(3, !0)),
(this.iRequestId = t.readInt32(4, !0)),
(this.sServantName = t.readString(5, !0)),
(this.sFuncName = t.readString(6, !0)),
(this.sBuffer = t.readBytes(7, !0)),
(this.iTimeout = t.readInt32(8, !0)),
(this.context = t.readMap(9, !0)),
(this.status = t.readMap(10, !0));
}),
(Taf.Wup.prototype.decode = function (t) {
var e = new Taf.JceInputStream(t),
i = e.buf.vew.getInt32(e.buf.position);
if (4 > i) throw Error("packet length too short");
(e.buf.position += 4),
this.readFrom(e),
(e = new Taf.JceInputStream(this.sBuffer.getBuffer())),
3 == this.iVersion
? (this.newdata.clear(), e.readMap(0, !0, this.newdata))
: (this.data.clear(), e.readMap(0, !0, this.newdata));
}),
(Taf.Wup.prototype.readBoolean = function (t) {
var e, i;
if (3 == this.iVersion) {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var r = new Taf.JceInputStream(e.buffer);
i = r.readBoolean(0, !0, i);
} else {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var n = Taf.TypeHelp.BOOLEAN,
s = e.get(n);
if (void 0 == s) throw Error("UniAttribute not found type:" + n);
var r = new Taf.JceInputStream(s);
i = r.readBoolean(0, !0, i);
}
return i;
}),
(Taf.Wup.prototype.readInt8 = function (t) {
var e, i;
if (3 == this.iVersion) {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var r = new Taf.JceInputStream(e.buffer);
i = r.readInt8(0, !0, i);
} else {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var n = Taf.TypeHelp.CHAR,
s = e.get(n);
if (void 0 == s) throw Error("UniAttribute not found type:" + n);
var r = new Taf.JceInputStream(s);
i = r.readInt8(0, !0, i);
}
return i;
}),
(Taf.Wup.prototype.readInt16 = function (t) {
var e, i;
if (3 == this.iVersion) {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var r = new Taf.JceInputStream(e.buffer);
i = r.readInt16(0, !0, i);
} else {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var n = Taf.TypeHelp.SHORT,
s = e.get(n),
r = new Taf.JceInputStream(s);
if (void 0 == s) throw Error("UniAttribute not found type:" + n);
i = r.readInt16(0, !0, i);
}
return i;
}),
(Taf.Wup.prototype.readInt32 = function (t) {
var e, i;
if (3 == this.iVersion) {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var r = new Taf.JceInputStream(e.buffer);
i = r.readInt32(0, !0, i);
} else {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var n = Taf.TypeHelp.INT32,
s = e.get(n);
if (void 0 == s) throw Error("UniAttribute not found type:" + n);
var r = new Taf.JceInputStream(s);
i = r.readInt32(0, !0, i);
}
return i;
}),
(Taf.Wup.prototype.readInt64 = function (t) {
var e, i;
if (3 == this.iVersion) {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var r = new Taf.JceInputStream(e.buffer);
i = r.readInt64(0, !0, i);
} else {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var n = Taf.TypeHelp.INT64,
s = e.get(n);
if (void 0 == s) throw Error("UniAttribute not found type:" + n);
var r = new Taf.JceInputStream(s);
i = r.readInt64(0, !0, i);
}
return i;
}),
(Taf.Wup.prototype.readFloat = function (t) {
var e, i;
if (3 == this.iVersion) {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var r = new Taf.JceInputStream(e.buffer);
i = r.readFloat(0, !0, i);
} else {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var n = Taf.TypeHelp.FLOAT,
s = e.get(n);
if (void 0 == s) throw Error("UniAttribute not found type:" + n);
var r = new Taf.JceInputStream(s);
i = r.readFloat(0, !0, i);
}
return i;
}),
(Taf.Wup.prototype.readDouble = function (t) {
var e;
if (3 == this.iVersion) {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var i = new Taf.JceInputStream(e.buffer);
def = i.readDouble(0, !0, def);
} else {
if (((e = this.newdata.get(t)), void 0 == e)) throw Error("UniAttribute not found key:" + t);
var r = Taf.TypeHelp.DOUBLE,
n = e.get(r);
if (void 0 == n) throw Error("UniAttribute not found type:" + r);
var i = new Taf.JceInputStream(n);
def = i.readDouble(0, !0, def);
}
return def;
}),
(Taf.Wup.prototype.readVector = function (t, e, i) {
var r;
if (3 == this.iVersion) {
if (((r = this.newdata.get(t)), void 0 == r)) throw Error("UniAttribute not found key:" + t);
var n = new Taf.JceInputStream(r.buffer);
e = n.readVector(0, !0, e);
} else {
if (((r = this.newdata.get(t)), void 0 == r)) throw Error("UniAttribute not found key:" + t);
var s = r.get(i);
if (void 0 == s) throw Error("UniAttribute not found type:" + i);
var n = new Taf.JceInputStream(s);
e = n.readVector(0, !0, e);
}
return e;
}),
(Taf.Wup.prototype.readStruct = function (t, e, i) {
var r;
if (3 == this.iVersion) {
if (((r = this.newdata.get(t)), void 0 == r)) throw Error("UniAttribute not found key:" + t);
var n = new Taf.JceInputStream(r.buffer);
e = n.readStruct(0, !0, e);
} else {
if (((r = this.newdata.get(t)), void 0 == r)) throw Error("UniAttribute not found key:" + t);
var s = r.get(i);
if (void 0 == s) throw Error("UniAttribute not found type:" + i);
var n = new Taf.JceInputStream(s);
e = n.readStruct(0, !0, e);
}
return e;
}),
(Taf.Wup.prototype.readMap = function (t, e, i) {
var r;
if (3 == this.iVersion) {
if (((r = this.newdata.get(t)), void 0 == r)) throw Error("UniAttribute not found key:" + t);
var n = new Taf.JceInputStream(r.buffer);
e = n.readMap(0, !0, e);
} else {
if (((r = this.newdata.get(t)), void 0 == r)) throw Error("UniAttribute not found key:" + t);
var s = r.get(i);
if (void 0 == s) throw Error("UniAttribute not found type:" + i);
var n = new Taf.JceInputStream(s);
e = n.readMap(0, !0, e);
}
return e;
}),
(Taf.Wup.prototype.readBytes = function (t, e, i) {
var r;
if (3 == this.iVersion) {
if (((r = this.newdata.get(t)), void 0 == r)) throw Error("UniAttribute not found key:" + t);
var n = new Taf.JceInputStream(r.buffer);
e = n.readBytes(0, !0, e);
} else {
if (((r = this.newdata.get(t)), void 0 == r)) throw Error("UniAttribute not found key:" + t);
var s = r.get(i);
if (void 0 == s) throw Error("UniAttribute not found type:" + i);
var n = new Taf.JceInputStream(s);
e = n.readBytes(0, !0, e);
}
return e;
});
var Taf = Taf || {};
(Taf.Util = Taf.Util || {}),
(Taf.Util.jcestream = function (t) {
if (null == t || void 0 == t)
return void console.log("Taf.Util.jcestream::value is null or undefined");
if (!(t instanceof ArrayBuffer))
return void console.log("Taf.Util.jcestream::value is not ArrayBuffer");
for (var e = new Uint8Array(t), i = "", r = 0; r < e.length; r++)
0 != r && r % 16 == 0 ? (i += "\n") : 0 != r && (i += " "),
(i += (e[r] > 15 ? "" : "0") + e[r].toString(16));
console.log(i.toUpperCase());
}),
(Taf.Util.str2ab = function (t) {
var e,
i = t.length,
r = new Array(i);
for (e = 0; i > e; ++e) r[e] = t.charCodeAt(e);
return new Uint8Array(r).buffer;
}),
(Taf.Util.ajax = function (t, e, i, r) {
var n = new XMLHttpRequest();
n.overrideMimeType("text/plain; charset=x-user-defined");
var s = function () {
4 === n.readyState &&
(200 === n.status || 304 === n.status ? i(Taf.Util.str2ab(n.response)) : r(n.status),
n.removeEventListener("readystatechange", s),
(n = void 0));
};
n.addEventListener("readystatechange", s), n.open("post", t), n.send(e);
});
var HUYA = HUYA || {};
(HUYA.EWebSocketCommandType = {
EWSCmd_NULL: 0,
EWSCmd_RegisterReq: 1,
EWSCmd_RegisterRsp: 2,
EWSCmd_WupReq: 3,
EWSCmd_WupRsp: 4,
EWSCmdC2S_HeartBeat: 5,
EWSCmdS2C_HeartBeatAck: 6,
EWSCmdS2C_MsgPushReq: 7,
EWSCmdC2S_DeregisterReq: 8,
EWSCmdS2C_DeRegisterRsp: 9,
EWSCmdC2S_VerifyCookieReq: 10,
EWSCmdS2C_VerifyCookieRsp: 11,
EWSCmdC2S_VerifyHuyaTokenReq: 12,
EWSCmdS2C_VerifyHuyaTokenRsp: 13,
}),
(HUYA.ELiveSource = {
PC_YY: 0,
PC_HUYA: 1,
MOBILE_HUYA: 2,
WEB_HUYA: 3,
}),
(HUYA.EGender = {
MALE: 0,
FEMALE: 1,
}),
(HUYA.EClientTemplateType = {
TPL_PC: 64,
TPL_WEB: 32,
TPL_JIEDAI: 16,
TPL_TEXAS: 8,
TPL_MATCH: 4,
TPL_HUYAAPP: 2,
TPL_MIRROR: 1,
}),
(HUYA.TemplateType = {
PRIMARY: 1,
RECEPTION: 2,
}),
(HUYA.EStreamLineType = {
STREAM_LINE_OLD_YY: 0,
STREAM_LINE_WS: 1,
STREAM_LINE_NEW_YY: 2,
STREAM_LINE_AL: 3,
STREAM_LINE_HUYA: 4,
}),
(HUYA.eUserOperation = {
USER_IN: 1,
USER_OUT: 2,
USER_MOVE: 3,
}),
(HUYA.WebSocketCommand = function () {
(this.iCmdType = 0), (this.vData = new Taf.BinBuffer());
}),
(HUYA.WebSocketCommand.prototype._clone = function () {
return new HUYA.WebSocketCommand();
}),
(HUYA.WebSocketCommand.prototype._write = function (t, e, i) {
t.writeStruct(e, i);
}),
(HUYA.WebSocketCommand.prototype._read = function (t, e, i) {
return t.readStruct(e, !0, i);
}),
(HUYA.WebSocketCommand.prototype.writeTo = function (t) {
t.writeInt32(0, this.iCmdType), t.writeBytes(1, this.vData);
}),
(HUYA.WebSocketCommand.prototype.readFrom = function (t) {
(this.iCmdType = t.readInt32(0, !1, this.iCmdType)),
(this.vData = t.readBytes(1, !1, this.vData));
}),
(HUYA.WSRegisterRsp = function () {
(this.iResCode = 0), (this.lRequestId = 0), (this.sMessage = "");
}),
(HUYA.WSRegisterRsp.prototype._clone = function () {
return new HUYA.WSRegisterRsp();
}),
(HUYA.WSRegisterRsp.prototype._write = function (t, e, i) {
t.writeStruct(e, i);
}),
(HUYA.WSRegisterRsp.prototype._read = function (t, e, i) {
return t.readStruct(e, !0, i);
}),
(HUYA.WSRegisterRsp.prototype.writeTo = function (t) {
t.writeInt32(0, this.iResCode),
t.writeInt64(1, this.lRequestId),
t.writeString(2, this.sMessage);
}),
(HUYA.WSRegisterRsp.prototype.readFrom = function (t) {
(this.iResCode = t.readInt32(0, !1, this.iResCode)),
(this.lRequestId = t.readInt64(1, !1, this.lRequestId)),
(this.sMessage = t.readString(2, !1, this.sMessage));
}),
(HUYA.WSPushMessage = function () {
(this.ePushType = 0),
(this.iUri = 0),
(this.sMsg = new Taf.BinBuffer()),
(this.iProtocolType = 0);
}),
(HUYA.WSPushMessage.prototype._clone = function () {
return new HUYA.WSPushMessage();
}),
(HUYA.WSPushMessage.prototype._write = function (t, e, i) {
t.writeStruct(e, i);
}),
(HUYA.WSPushMessage.prototype._read = function (t, e, i) {
return t.readStruct(e, !0, i);
}),
(HUYA.WSPushMessage.prototype.writeTo = function (t) {
t.writeInt32(0, this.ePushType),
t.writeInt64(1, this.iUri),
t.writeBytes(2, this.sMsg),
t.writeInt32(3, this.iProtocolType);
}),
(HUYA.WSPushMessage.prototype.readFrom = function (t) {
(this.ePushType = t.readInt32(0, !1, this.ePushType)),
(this.iUri = t.readInt64(1, !1, this.iUri)),
(this.sMsg = t.readBytes(2, !1, this.sMsg)),
(this.iProtocolType = t.readInt32(3, !1, this.iProtocolType));
}),
(HUYA.WSHeartBeat = function () {
this.iState = 0;
}),
(HUYA.WSHeartBeat.prototype._clone = function () {
return new HUYA.WSHeartBeat();
}),
(HUYA.WSHeartBeat.prototype._write = function (t, e, i) {
t.writeStruct(e, i);
}),
(HUYA.WSHeartBeat.prototype._read = function (t, e, i) {
return t.readStruct(e, !0, i);
}),
(HUYA.WSHeartBeat.prototype.writeTo = function (t) {
t.writeInt32(0, this.iState);
}),
(HUYA.WSHeartBeat.prototype.readFrom = function (t) {
this.iState = t.readInt32(0, !1, this.iState);
}),
(HUYA.WSUserInfo = function () {
(this.lUid = 0),
(this.bAnonymous = !0),
(this.sGuid = ""),
(this.sToken = ""),
(this.lTid = 0),
(this.lSid = 0),
(this.lGroupId = 0),
(this.lGroupType = 0);
}),
(HUYA.WSUserInfo.prototype._clone = function () {
return new HUYA.WSUserInfo();
}),
(HUYA.WSUserInfo.prototype._write = function (t, e, i) {
t.writeStruct(e, i);
}),
(HUYA.WSUserInfo.prototype._read = function (t, e, i) {
return t.readStruct(e, !0, i);
}),
(HUYA.WSUserInfo.prototype.writeTo = function (t) {
t.writeInt64(0, this.lUid),
t.writeBoolean(1, this.bAnonymous),
t.writeString(2, this.sGuid),
t.writeString(3, this.sToken),
t.writeInt64(4, this.lTid),
t.writeInt64(5, this.lSid),
t.writeInt64(6, this.lGroupId),
t.writeInt64(7, this.lGroupType);
}),
(HUYA.WSUserInfo.prototype.readFrom = function (t) {
(this.lUid = t.readInt64(0, !1, this.lUid)),
(this.bAnonymous = t.readBoolean(1, !1, this.bAnonymous)),
(this.sGuid = t.readString(2, !1, this.sGuid)),
(this.sToken = t.readString(3, !1, this.sToken)),
(this.lTid = t.readInt64(4, !1, this.lTid)),
(this.lSid = t.readInt64(5, !1, this.lSid)),
(this.lGroupId = t.readInt64(6, !1, this.lGroupId)),
(this.lGroupType = t.readInt64(7, !1, this.lGroupType));
}),
(HUYA.WSVerifyCookieReq = function () {
(this.lUid = 0), (this.sUA = ""), (this.sCookie = "");
}),
(HUYA.WSVerifyCookieReq.prototype._clone = function () {
return new HUYA.WSVerifyCookieReq();
}),
(HUYA.WSVerifyCookieReq.prototype._write = function (t, e, i) {
t.writeStruct(e, i);
}),
(HUYA.WSVerifyCookieReq.prototype._read = function (t, e, i) {
return t.readStruct(e, !0, i);
}),
(HUYA.WSVerifyCookieReq.prototype.writeTo = function (t) {
t.writeInt64(0, this.lUid), t.writeString(1, this.sUA), t.writeString(2, this.sCookie);
}),
(HUYA.WSVerifyCookieReq.prototype.readFrom = function (t) {
(this.lUid = t.readInt64(0, !1, this.lUid)),
(this.sUA = t.readString(1, !1, this.sUA)),
(this.sCookie = t.readString(2, !1, this.sCookie));
}),
(HUYA.WSVerifyCookieRsp = function () {
this.iValidate = 0;
}),
(HUYA.WSVerifyCookieRsp.prototype._clone = function () {
return new HUYA.WSVerifyCookieRsp();
}),
(HUYA.WSVerifyCookieRsp.prototype._write = function (t, e, i) {
t.writeStruct(e, i);
}),
(HUYA.WSVerifyCookieRsp.prototype._read = function (t, e, i) {
return t.readStruct(e, !0, i);
}),
(HUYA.WSVerifyCookieRsp.prototype.writeTo = function (t) {
t.writeInt32(0, this.iValidate);
}),
(HUYA.WSVerifyCookieRsp.prototype.readFrom = function (t) {
this.iValidate = t.readInt32(0, !1, this.iValidate);
}),
(HUYA.UserId = function () {
(this.lUid = 0),
(this.sGuid = ""),
(this.sToken = ""),
(this.sHuYaUA = ""),
(this.sCookie = "");
}),
(HUYA.UserId.prototype._clone = function () {
return new HUYA.UserId();
}),
(HUYA.UserId.prototype._write = function (t, e, i) {
t.writeStruct(e, i);
}),
(HUYA.UserId.prototype._read = function (t, e, i) {
return t.readStruct(e, !0, i);
}),
(HUYA.UserId.prototype.writeTo = function (t) {
t.writeInt64(0, this.lUid),
t.writeString(1, this.sGuid),
t.writeString(2, this.sToken),
t.writeString(3, this.sHuYaUA),
t.writeString(4, this.sCookie);
}),
(HUYA.UserId.prototype.readFrom = function (t) {
(this.lUid = t.readInt64(0, !1, this.lUid)),
(this.sGuid = t.readString(1, !1, this.sGuid)),
(this.sToken = t.readString(2, !1, this.sToken)),
(this.sHuYaUA = t.readString(3, !1, this.sHuYaUA)),
(this.sCookie = t.readString(4, !1, this.sCookie));
}),
(HUYA.UserEventReq = function () {
(this.tId = new HUYA.UserId()),
(this.lTid = 0),
(this.lSid = 0),
(this.lShortTid = 0),
(this.eOp = 0),
(this.sChan = ""),
(this.eSource = 0),
(this.lPid = 0),
(this.bWatchVideo = !1),
(this.bAnonymous = !1),
(this.eTemplateType = HUYA.TemplateType.PRIMARY);
}),
(HUYA.UserEventReq.prototype._clone = function () {
return new HUYA.UserEventReq();
}),
(HUYA.UserEventReq.prototype._write = function (t, e, i) {
t.writeStruct(e, i);
}),
(HUYA.UserEventReq.prototype._read = function (t, e, i) {
return t.readStruct(e, !0, i);
}),
(HUYA.UserEventReq.prototype.writeTo = function (t) {
t.writeStruct(0, this.tId),
t.writeInt64(1, this.lTid),
t.writeInt64(2, this.lSid),
t.writeInt64(3, this.lShortTid),
t.writeInt32(4, this.eOp),
t.writeString(5, this.sChan),
t.writeInt32(6, this.eSource),
t.writeInt64(7, this.lPid),
t.writeBoolean(8, this.bWatchVideo),
t.writeBoolean(9, this.bAnonymous),
t.writeInt32(10, this.eTemplateType);
}),
(HUYA.UserEventReq.prototype.readFrom = function (t) {
(this.