2025-07-05 16:16:50 +08:00

734 lines
29 KiB
JavaScript

/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";
var $protobuf = require("protobufjs/minimal");
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
$root.ChatUser = (function() {
/**
* Properties of a ChatUser.
* @exports IChatUser
* @interface IChatUser
* @property {Long|null} [userId] ChatUser userId
* @property {string|null} [nickname] ChatUser nickname
* @property {string|null} [avatar] ChatUser avatar
* @property {string|null} [avatarFrame] ChatUser avatarFrame
* @property {string|null} [vipLevel] ChatUser vipLevel
*/
/**
* Constructs a new ChatUser.
* @exports ChatUser
* @classdesc Represents a ChatUser.
* @implements IChatUser
* @constructor
* @param {IChatUser=} [properties] Properties to set
*/
function ChatUser(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ChatUser userId.
* @member {Long} userId
* @memberof ChatUser
* @instance
*/
ChatUser.prototype.userId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* ChatUser nickname.
* @member {string} nickname
* @memberof ChatUser
* @instance
*/
ChatUser.prototype.nickname = "";
/**
* ChatUser avatar.
* @member {string} avatar
* @memberof ChatUser
* @instance
*/
ChatUser.prototype.avatar = "";
/**
* ChatUser avatarFrame.
* @member {string} avatarFrame
* @memberof ChatUser
* @instance
*/
ChatUser.prototype.avatarFrame = "";
/**
* ChatUser vipLevel.
* @member {string} vipLevel
* @memberof ChatUser
* @instance
*/
ChatUser.prototype.vipLevel = "";
/**
* Creates a new ChatUser instance using the specified properties.
* @function create
* @memberof ChatUser
* @static
* @param {IChatUser=} [properties] Properties to set
* @returns {ChatUser} ChatUser instance
*/
ChatUser.create = function create(properties) {
return new ChatUser(properties);
};
/**
* Encodes the specified ChatUser message. Does not implicitly {@link ChatUser.verify|verify} messages.
* @function encode
* @memberof ChatUser
* @static
* @param {IChatUser} message ChatUser message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChatUser.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.userId != null && Object.hasOwnProperty.call(message, "userId"))
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.userId);
if (message.nickname != null && Object.hasOwnProperty.call(message, "nickname"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.nickname);
if (message.avatar != null && Object.hasOwnProperty.call(message, "avatar"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.avatar);
if (message.avatarFrame != null && Object.hasOwnProperty.call(message, "avatarFrame"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.avatarFrame);
if (message.vipLevel != null && Object.hasOwnProperty.call(message, "vipLevel"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.vipLevel);
return writer;
};
/**
* Encodes the specified ChatUser message, length delimited. Does not implicitly {@link ChatUser.verify|verify} messages.
* @function encodeDelimited
* @memberof ChatUser
* @static
* @param {IChatUser} message ChatUser message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChatUser.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ChatUser message from the specified reader or buffer.
* @function decode
* @memberof ChatUser
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {ChatUser} ChatUser
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChatUser.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ChatUser();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.userId = reader.int64();
break;
}
case 2: {
message.nickname = reader.string();
break;
}
case 3: {
message.avatar = reader.string();
break;
}
case 4: {
message.avatarFrame = reader.string();
break;
}
case 5: {
message.vipLevel = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ChatUser message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof ChatUser
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {ChatUser} ChatUser
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChatUser.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ChatUser message.
* @function verify
* @memberof ChatUser
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ChatUser.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.userId != null && message.hasOwnProperty("userId"))
if (!$util.isInteger(message.userId) && !(message.userId && $util.isInteger(message.userId.low) && $util.isInteger(message.userId.high)))
return "userId: integer|Long expected";
if (message.nickname != null && message.hasOwnProperty("nickname"))
if (!$util.isString(message.nickname))
return "nickname: string expected";
if (message.avatar != null && message.hasOwnProperty("avatar"))
if (!$util.isString(message.avatar))
return "avatar: string expected";
if (message.avatarFrame != null && message.hasOwnProperty("avatarFrame"))
if (!$util.isString(message.avatarFrame))
return "avatarFrame: string expected";
if (message.vipLevel != null && message.hasOwnProperty("vipLevel"))
if (!$util.isString(message.vipLevel))
return "vipLevel: string expected";
return null;
};
/**
* Creates a ChatUser message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof ChatUser
* @static
* @param {Object.<string,*>} object Plain object
* @returns {ChatUser} ChatUser
*/
ChatUser.fromObject = function fromObject(object) {
if (object instanceof $root.ChatUser)
return object;
var message = new $root.ChatUser();
if (object.userId != null)
if ($util.Long)
(message.userId = $util.Long.fromValue(object.userId)).unsigned = false;
else if (typeof object.userId === "string")
message.userId = parseInt(object.userId, 10);
else if (typeof object.userId === "number")
message.userId = object.userId;
else if (typeof object.userId === "object")
message.userId = new $util.LongBits(object.userId.low >>> 0, object.userId.high >>> 0).toNumber();
if (object.nickname != null)
message.nickname = String(object.nickname);
if (object.avatar != null)
message.avatar = String(object.avatar);
if (object.avatarFrame != null)
message.avatarFrame = String(object.avatarFrame);
if (object.vipLevel != null)
message.vipLevel = String(object.vipLevel);
return message;
};
/**
* Creates a plain object from a ChatUser message. Also converts values to other types if specified.
* @function toObject
* @memberof ChatUser
* @static
* @param {ChatUser} message ChatUser
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ChatUser.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.userId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.userId = options.longs === String ? "0" : 0;
object.nickname = "";
object.avatar = "";
object.avatarFrame = "";
object.vipLevel = "";
}
if (message.userId != null && message.hasOwnProperty("userId"))
if (typeof message.userId === "number")
object.userId = options.longs === String ? String(message.userId) : message.userId;
else
object.userId = options.longs === String ? $util.Long.prototype.toString.call(message.userId) : options.longs === Number ? new $util.LongBits(message.userId.low >>> 0, message.userId.high >>> 0).toNumber() : message.userId;
if (message.nickname != null && message.hasOwnProperty("nickname"))
object.nickname = message.nickname;
if (message.avatar != null && message.hasOwnProperty("avatar"))
object.avatar = message.avatar;
if (message.avatarFrame != null && message.hasOwnProperty("avatarFrame"))
object.avatarFrame = message.avatarFrame;
if (message.vipLevel != null && message.hasOwnProperty("vipLevel"))
object.vipLevel = message.vipLevel;
return object;
};
/**
* Converts this ChatUser to JSON.
* @function toJSON
* @memberof ChatUser
* @instance
* @returns {Object.<string,*>} JSON object
*/
ChatUser.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ChatUser
* @function getTypeUrl
* @memberof ChatUser
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ChatUser.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/ChatUser";
};
return ChatUser;
})();
$root.GameUser = (function() {
/**
* Properties of a GameUser.
* @exports IGameUser
* @interface IGameUser
* @property {Long|null} [userId] GameUser userId
* @property {string|null} [nickname] GameUser nickname
* @property {string|null} [avatar] GameUser avatar
* @property {string|null} [avatarFrame] GameUser avatarFrame
* @property {number|null} [vipLevel] GameUser vipLevel
* @property {number|null} [vipExp] GameUser vipExp
* @property {Long|null} [seat] GameUser seat
* @property {Long|null} [gold] GameUser gold
*/
/**
* Constructs a new GameUser.
* @exports GameUser
* @classdesc Represents a GameUser.
* @implements IGameUser
* @constructor
* @param {IGameUser=} [properties] Properties to set
*/
function GameUser(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* GameUser userId.
* @member {Long} userId
* @memberof GameUser
* @instance
*/
GameUser.prototype.userId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* GameUser nickname.
* @member {string} nickname
* @memberof GameUser
* @instance
*/
GameUser.prototype.nickname = "";
/**
* GameUser avatar.
* @member {string} avatar
* @memberof GameUser
* @instance
*/
GameUser.prototype.avatar = "";
/**
* GameUser avatarFrame.
* @member {string} avatarFrame
* @memberof GameUser
* @instance
*/
GameUser.prototype.avatarFrame = "";
/**
* GameUser vipLevel.
* @member {number} vipLevel
* @memberof GameUser
* @instance
*/
GameUser.prototype.vipLevel = 0;
/**
* GameUser vipExp.
* @member {number} vipExp
* @memberof GameUser
* @instance
*/
GameUser.prototype.vipExp = 0;
/**
* GameUser seat.
* @member {Long} seat
* @memberof GameUser
* @instance
*/
GameUser.prototype.seat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* GameUser gold.
* @member {Long} gold
* @memberof GameUser
* @instance
*/
GameUser.prototype.gold = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* Creates a new GameUser instance using the specified properties.
* @function create
* @memberof GameUser
* @static
* @param {IGameUser=} [properties] Properties to set
* @returns {GameUser} GameUser instance
*/
GameUser.create = function create(properties) {
return new GameUser(properties);
};
/**
* Encodes the specified GameUser message. Does not implicitly {@link GameUser.verify|verify} messages.
* @function encode
* @memberof GameUser
* @static
* @param {IGameUser} message GameUser message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
GameUser.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.userId != null && Object.hasOwnProperty.call(message, "userId"))
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.userId);
if (message.nickname != null && Object.hasOwnProperty.call(message, "nickname"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.nickname);
if (message.avatar != null && Object.hasOwnProperty.call(message, "avatar"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.avatar);
if (message.avatarFrame != null && Object.hasOwnProperty.call(message, "avatarFrame"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.avatarFrame);
if (message.vipLevel != null && Object.hasOwnProperty.call(message, "vipLevel"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.vipLevel);
if (message.vipExp != null && Object.hasOwnProperty.call(message, "vipExp"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.vipExp);
if (message.seat != null && Object.hasOwnProperty.call(message, "seat"))
writer.uint32(/* id 20, wireType 0 =*/160).int64(message.seat);
if (message.gold != null && Object.hasOwnProperty.call(message, "gold"))
writer.uint32(/* id 25, wireType 0 =*/200).int64(message.gold);
return writer;
};
/**
* Encodes the specified GameUser message, length delimited. Does not implicitly {@link GameUser.verify|verify} messages.
* @function encodeDelimited
* @memberof GameUser
* @static
* @param {IGameUser} message GameUser message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
GameUser.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a GameUser message from the specified reader or buffer.
* @function decode
* @memberof GameUser
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {GameUser} GameUser
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
GameUser.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.GameUser();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.userId = reader.int64();
break;
}
case 2: {
message.nickname = reader.string();
break;
}
case 3: {
message.avatar = reader.string();
break;
}
case 4: {
message.avatarFrame = reader.string();
break;
}
case 5: {
message.vipLevel = reader.int32();
break;
}
case 6: {
message.vipExp = reader.int32();
break;
}
case 20: {
message.seat = reader.int64();
break;
}
case 25: {
message.gold = reader.int64();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a GameUser message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof GameUser
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {GameUser} GameUser
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
GameUser.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a GameUser message.
* @function verify
* @memberof GameUser
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
GameUser.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.userId != null && message.hasOwnProperty("userId"))
if (!$util.isInteger(message.userId) && !(message.userId && $util.isInteger(message.userId.low) && $util.isInteger(message.userId.high)))
return "userId: integer|Long expected";
if (message.nickname != null && message.hasOwnProperty("nickname"))
if (!$util.isString(message.nickname))
return "nickname: string expected";
if (message.avatar != null && message.hasOwnProperty("avatar"))
if (!$util.isString(message.avatar))
return "avatar: string expected";
if (message.avatarFrame != null && message.hasOwnProperty("avatarFrame"))
if (!$util.isString(message.avatarFrame))
return "avatarFrame: string expected";
if (message.vipLevel != null && message.hasOwnProperty("vipLevel"))
if (!$util.isInteger(message.vipLevel))
return "vipLevel: integer expected";
if (message.vipExp != null && message.hasOwnProperty("vipExp"))
if (!$util.isInteger(message.vipExp))
return "vipExp: integer expected";
if (message.seat != null && message.hasOwnProperty("seat"))
if (!$util.isInteger(message.seat) && !(message.seat && $util.isInteger(message.seat.low) && $util.isInteger(message.seat.high)))
return "seat: integer|Long expected";
if (message.gold != null && message.hasOwnProperty("gold"))
if (!$util.isInteger(message.gold) && !(message.gold && $util.isInteger(message.gold.low) && $util.isInteger(message.gold.high)))
return "gold: integer|Long expected";
return null;
};
/**
* Creates a GameUser message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof GameUser
* @static
* @param {Object.<string,*>} object Plain object
* @returns {GameUser} GameUser
*/
GameUser.fromObject = function fromObject(object) {
if (object instanceof $root.GameUser)
return object;
var message = new $root.GameUser();
if (object.userId != null)
if ($util.Long)
(message.userId = $util.Long.fromValue(object.userId)).unsigned = false;
else if (typeof object.userId === "string")
message.userId = parseInt(object.userId, 10);
else if (typeof object.userId === "number")
message.userId = object.userId;
else if (typeof object.userId === "object")
message.userId = new $util.LongBits(object.userId.low >>> 0, object.userId.high >>> 0).toNumber();
if (object.nickname != null)
message.nickname = String(object.nickname);
if (object.avatar != null)
message.avatar = String(object.avatar);
if (object.avatarFrame != null)
message.avatarFrame = String(object.avatarFrame);
if (object.vipLevel != null)
message.vipLevel = object.vipLevel | 0;
if (object.vipExp != null)
message.vipExp = object.vipExp | 0;
if (object.seat != null)
if ($util.Long)
(message.seat = $util.Long.fromValue(object.seat)).unsigned = false;
else if (typeof object.seat === "string")
message.seat = parseInt(object.seat, 10);
else if (typeof object.seat === "number")
message.seat = object.seat;
else if (typeof object.seat === "object")
message.seat = new $util.LongBits(object.seat.low >>> 0, object.seat.high >>> 0).toNumber();
if (object.gold != null)
if ($util.Long)
(message.gold = $util.Long.fromValue(object.gold)).unsigned = false;
else if (typeof object.gold === "string")
message.gold = parseInt(object.gold, 10);
else if (typeof object.gold === "number")
message.gold = object.gold;
else if (typeof object.gold === "object")
message.gold = new $util.LongBits(object.gold.low >>> 0, object.gold.high >>> 0).toNumber();
return message;
};
/**
* Creates a plain object from a GameUser message. Also converts values to other types if specified.
* @function toObject
* @memberof GameUser
* @static
* @param {GameUser} message GameUser
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
GameUser.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.userId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.userId = options.longs === String ? "0" : 0;
object.nickname = "";
object.avatar = "";
object.avatarFrame = "";
object.vipLevel = 0;
object.vipExp = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.seat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.seat = options.longs === String ? "0" : 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.gold = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.gold = options.longs === String ? "0" : 0;
}
if (message.userId != null && message.hasOwnProperty("userId"))
if (typeof message.userId === "number")
object.userId = options.longs === String ? String(message.userId) : message.userId;
else
object.userId = options.longs === String ? $util.Long.prototype.toString.call(message.userId) : options.longs === Number ? new $util.LongBits(message.userId.low >>> 0, message.userId.high >>> 0).toNumber() : message.userId;
if (message.nickname != null && message.hasOwnProperty("nickname"))
object.nickname = message.nickname;
if (message.avatar != null && message.hasOwnProperty("avatar"))
object.avatar = message.avatar;
if (message.avatarFrame != null && message.hasOwnProperty("avatarFrame"))
object.avatarFrame = message.avatarFrame;
if (message.vipLevel != null && message.hasOwnProperty("vipLevel"))
object.vipLevel = message.vipLevel;
if (message.vipExp != null && message.hasOwnProperty("vipExp"))
object.vipExp = message.vipExp;
if (message.seat != null && message.hasOwnProperty("seat"))
if (typeof message.seat === "number")
object.seat = options.longs === String ? String(message.seat) : message.seat;
else
object.seat = options.longs === String ? $util.Long.prototype.toString.call(message.seat) : options.longs === Number ? new $util.LongBits(message.seat.low >>> 0, message.seat.high >>> 0).toNumber() : message.seat;
if (message.gold != null && message.hasOwnProperty("gold"))
if (typeof message.gold === "number")
object.gold = options.longs === String ? String(message.gold) : message.gold;
else
object.gold = options.longs === String ? $util.Long.prototype.toString.call(message.gold) : options.longs === Number ? new $util.LongBits(message.gold.low >>> 0, message.gold.high >>> 0).toNumber() : message.gold;
return object;
};
/**
* Converts this GameUser to JSON.
* @function toJSON
* @memberof GameUser
* @instance
* @returns {Object.<string,*>} JSON object
*/
GameUser.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for GameUser
* @function getTypeUrl
* @memberof GameUser
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
GameUser.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/GameUser";
};
return GameUser;
})();
module.exports = $root;