tf2
Version:
Exposes a simple API for interacting with the Team Fortress 2 game coordinator
1,067 lines (990 loc) • 2.46 MB
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*/
(function(global, factory) { /* global define, require, module */
/* AMD */ if (typeof define === 'function' && define.amd)
define(["protobufjs/minimal"], factory);
/* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
module.exports = factory(require("protobufjs/minimal"));
})(this, function($protobuf) {
"use strict";
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
/**
* EGCBaseMsg enum.
* @exports EGCBaseMsg
* @enum {string}
* @property {number} k_EMsgGCSystemMessage=4001 k_EMsgGCSystemMessage value
* @property {number} k_EMsgGCReplicateConVars=4002 k_EMsgGCReplicateConVars value
* @property {number} k_EMsgGCConVarUpdated=4003 k_EMsgGCConVarUpdated value
* @property {number} k_EMsgGCServerAvailable=4506 k_EMsgGCServerAvailable value
* @property {number} k_EMsgGCClientConnectToServer=4507 k_EMsgGCClientConnectToServer value
* @property {number} k_EMsgGCGameServerInfo=4508 k_EMsgGCGameServerInfo value
* @property {number} k_EMsgGCError=4509 k_EMsgGCError value
* @property {number} k_EMsgGCReplay_UploadedToYouTube=4510 k_EMsgGCReplay_UploadedToYouTube value
* @property {number} k_EMsgGCLANServerAvailable=4511 k_EMsgGCLANServerAvailable value
*/
$root.EGCBaseMsg = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[4001] = "k_EMsgGCSystemMessage"] = 4001;
values[valuesById[4002] = "k_EMsgGCReplicateConVars"] = 4002;
values[valuesById[4003] = "k_EMsgGCConVarUpdated"] = 4003;
values[valuesById[4506] = "k_EMsgGCServerAvailable"] = 4506;
values[valuesById[4507] = "k_EMsgGCClientConnectToServer"] = 4507;
values[valuesById[4508] = "k_EMsgGCGameServerInfo"] = 4508;
values[valuesById[4509] = "k_EMsgGCError"] = 4509;
values[valuesById[4510] = "k_EMsgGCReplay_UploadedToYouTube"] = 4510;
values[valuesById[4511] = "k_EMsgGCLANServerAvailable"] = 4511;
return values;
})();
/**
* EGCBaseProtoObjectTypes enum.
* @exports EGCBaseProtoObjectTypes
* @enum {string}
* @property {number} k_EProtoObjectPartyInvite=1001 k_EProtoObjectPartyInvite value
* @property {number} k_EProtoObjectLobbyInvite=1002 k_EProtoObjectLobbyInvite value
*/
$root.EGCBaseProtoObjectTypes = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1001] = "k_EProtoObjectPartyInvite"] = 1001;
values[valuesById[1002] = "k_EProtoObjectLobbyInvite"] = 1002;
return values;
})();
/**
* GCGoodbyeReason enum.
* @exports GCGoodbyeReason
* @enum {string}
* @property {number} GCGoodbyeReason_GC_GOING_DOWN=1 GCGoodbyeReason_GC_GOING_DOWN value
* @property {number} GCGoodbyeReason_NO_SESSION=2 GCGoodbyeReason_NO_SESSION value
*/
$root.GCGoodbyeReason = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[1] = "GCGoodbyeReason_GC_GOING_DOWN"] = 1;
values[valuesById[2] = "GCGoodbyeReason_NO_SESSION"] = 2;
return values;
})();
$root.CGCStorePurchaseInit_LineItem = (function() {
/**
* Properties of a CGCStorePurchaseInit_LineItem.
* @exports ICGCStorePurchaseInit_LineItem
* @interface ICGCStorePurchaseInit_LineItem
* @property {number|null} [item_def_id] CGCStorePurchaseInit_LineItem item_def_id
* @property {number|null} [quantity] CGCStorePurchaseInit_LineItem quantity
* @property {number|null} [cost_in_local_currency] CGCStorePurchaseInit_LineItem cost_in_local_currency
* @property {number|null} [purchase_type] CGCStorePurchaseInit_LineItem purchase_type
*/
/**
* Constructs a new CGCStorePurchaseInit_LineItem.
* @exports CGCStorePurchaseInit_LineItem
* @classdesc Represents a CGCStorePurchaseInit_LineItem.
* @implements ICGCStorePurchaseInit_LineItem
* @constructor
* @param {ICGCStorePurchaseInit_LineItem=} [properties] Properties to set
*/
function CGCStorePurchaseInit_LineItem(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]];
}
/**
* CGCStorePurchaseInit_LineItem item_def_id.
* @member {number} item_def_id
* @memberof CGCStorePurchaseInit_LineItem
* @instance
*/
CGCStorePurchaseInit_LineItem.prototype.item_def_id = 0;
/**
* CGCStorePurchaseInit_LineItem quantity.
* @member {number} quantity
* @memberof CGCStorePurchaseInit_LineItem
* @instance
*/
CGCStorePurchaseInit_LineItem.prototype.quantity = 0;
/**
* CGCStorePurchaseInit_LineItem cost_in_local_currency.
* @member {number} cost_in_local_currency
* @memberof CGCStorePurchaseInit_LineItem
* @instance
*/
CGCStorePurchaseInit_LineItem.prototype.cost_in_local_currency = 0;
/**
* CGCStorePurchaseInit_LineItem purchase_type.
* @member {number} purchase_type
* @memberof CGCStorePurchaseInit_LineItem
* @instance
*/
CGCStorePurchaseInit_LineItem.prototype.purchase_type = 0;
/**
* Creates a new CGCStorePurchaseInit_LineItem instance using the specified properties.
* @function create
* @memberof CGCStorePurchaseInit_LineItem
* @static
* @param {ICGCStorePurchaseInit_LineItem=} [properties] Properties to set
* @returns {CGCStorePurchaseInit_LineItem} CGCStorePurchaseInit_LineItem instance
*/
CGCStorePurchaseInit_LineItem.create = function create(properties) {
return new CGCStorePurchaseInit_LineItem(properties);
};
/**
* Encodes the specified CGCStorePurchaseInit_LineItem message. Does not implicitly {@link CGCStorePurchaseInit_LineItem.verify|verify} messages.
* @function encode
* @memberof CGCStorePurchaseInit_LineItem
* @static
* @param {ICGCStorePurchaseInit_LineItem} message CGCStorePurchaseInit_LineItem message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CGCStorePurchaseInit_LineItem.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.item_def_id != null && message.hasOwnProperty("item_def_id"))
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.item_def_id);
if (message.quantity != null && message.hasOwnProperty("quantity"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.quantity);
if (message.cost_in_local_currency != null && message.hasOwnProperty("cost_in_local_currency"))
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.cost_in_local_currency);
if (message.purchase_type != null && message.hasOwnProperty("purchase_type"))
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.purchase_type);
return writer;
};
/**
* Encodes the specified CGCStorePurchaseInit_LineItem message, length delimited. Does not implicitly {@link CGCStorePurchaseInit_LineItem.verify|verify} messages.
* @function encodeDelimited
* @memberof CGCStorePurchaseInit_LineItem
* @static
* @param {ICGCStorePurchaseInit_LineItem} message CGCStorePurchaseInit_LineItem message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CGCStorePurchaseInit_LineItem.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CGCStorePurchaseInit_LineItem message from the specified reader or buffer.
* @function decode
* @memberof CGCStorePurchaseInit_LineItem
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CGCStorePurchaseInit_LineItem} CGCStorePurchaseInit_LineItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CGCStorePurchaseInit_LineItem.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CGCStorePurchaseInit_LineItem();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.item_def_id = reader.uint32();
break;
case 2:
message.quantity = reader.uint32();
break;
case 3:
message.cost_in_local_currency = reader.uint32();
break;
case 4:
message.purchase_type = reader.uint32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CGCStorePurchaseInit_LineItem message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CGCStorePurchaseInit_LineItem
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CGCStorePurchaseInit_LineItem} CGCStorePurchaseInit_LineItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CGCStorePurchaseInit_LineItem.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CGCStorePurchaseInit_LineItem message.
* @function verify
* @memberof CGCStorePurchaseInit_LineItem
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CGCStorePurchaseInit_LineItem.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.item_def_id != null && message.hasOwnProperty("item_def_id"))
if (!$util.isInteger(message.item_def_id))
return "item_def_id: integer expected";
if (message.quantity != null && message.hasOwnProperty("quantity"))
if (!$util.isInteger(message.quantity))
return "quantity: integer expected";
if (message.cost_in_local_currency != null && message.hasOwnProperty("cost_in_local_currency"))
if (!$util.isInteger(message.cost_in_local_currency))
return "cost_in_local_currency: integer expected";
if (message.purchase_type != null && message.hasOwnProperty("purchase_type"))
if (!$util.isInteger(message.purchase_type))
return "purchase_type: integer expected";
return null;
};
/**
* Creates a CGCStorePurchaseInit_LineItem message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CGCStorePurchaseInit_LineItem
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CGCStorePurchaseInit_LineItem} CGCStorePurchaseInit_LineItem
*/
CGCStorePurchaseInit_LineItem.fromObject = function fromObject(object) {
if (object instanceof $root.CGCStorePurchaseInit_LineItem)
return object;
var message = new $root.CGCStorePurchaseInit_LineItem();
if (object.item_def_id != null)
message.item_def_id = object.item_def_id >>> 0;
if (object.quantity != null)
message.quantity = object.quantity >>> 0;
if (object.cost_in_local_currency != null)
message.cost_in_local_currency = object.cost_in_local_currency >>> 0;
if (object.purchase_type != null)
message.purchase_type = object.purchase_type >>> 0;
return message;
};
/**
* Creates a plain object from a CGCStorePurchaseInit_LineItem message. Also converts values to other types if specified.
* @function toObject
* @memberof CGCStorePurchaseInit_LineItem
* @static
* @param {CGCStorePurchaseInit_LineItem} message CGCStorePurchaseInit_LineItem
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CGCStorePurchaseInit_LineItem.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.item_def_id = 0;
object.quantity = 0;
object.cost_in_local_currency = 0;
object.purchase_type = 0;
}
if (message.item_def_id != null && message.hasOwnProperty("item_def_id"))
object.item_def_id = message.item_def_id;
if (message.quantity != null && message.hasOwnProperty("quantity"))
object.quantity = message.quantity;
if (message.cost_in_local_currency != null && message.hasOwnProperty("cost_in_local_currency"))
object.cost_in_local_currency = message.cost_in_local_currency;
if (message.purchase_type != null && message.hasOwnProperty("purchase_type"))
object.purchase_type = message.purchase_type;
return object;
};
/**
* Converts this CGCStorePurchaseInit_LineItem to JSON.
* @function toJSON
* @memberof CGCStorePurchaseInit_LineItem
* @instance
* @returns {Object.<string,*>} JSON object
*/
CGCStorePurchaseInit_LineItem.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CGCStorePurchaseInit_LineItem;
})();
$root.CMsgGCStorePurchaseInit = (function() {
/**
* Properties of a CMsgGCStorePurchaseInit.
* @exports ICMsgGCStorePurchaseInit
* @interface ICMsgGCStorePurchaseInit
* @property {string|null} [country] CMsgGCStorePurchaseInit country
* @property {number|null} [language] CMsgGCStorePurchaseInit language
* @property {number|null} [currency] CMsgGCStorePurchaseInit currency
* @property {Array.<ICGCStorePurchaseInit_LineItem>|null} [line_items] CMsgGCStorePurchaseInit line_items
*/
/**
* Constructs a new CMsgGCStorePurchaseInit.
* @exports CMsgGCStorePurchaseInit
* @classdesc Represents a CMsgGCStorePurchaseInit.
* @implements ICMsgGCStorePurchaseInit
* @constructor
* @param {ICMsgGCStorePurchaseInit=} [properties] Properties to set
*/
function CMsgGCStorePurchaseInit(properties) {
this.line_items = [];
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]];
}
/**
* CMsgGCStorePurchaseInit country.
* @member {string} country
* @memberof CMsgGCStorePurchaseInit
* @instance
*/
CMsgGCStorePurchaseInit.prototype.country = "";
/**
* CMsgGCStorePurchaseInit language.
* @member {number} language
* @memberof CMsgGCStorePurchaseInit
* @instance
*/
CMsgGCStorePurchaseInit.prototype.language = 0;
/**
* CMsgGCStorePurchaseInit currency.
* @member {number} currency
* @memberof CMsgGCStorePurchaseInit
* @instance
*/
CMsgGCStorePurchaseInit.prototype.currency = 0;
/**
* CMsgGCStorePurchaseInit line_items.
* @member {Array.<ICGCStorePurchaseInit_LineItem>} line_items
* @memberof CMsgGCStorePurchaseInit
* @instance
*/
CMsgGCStorePurchaseInit.prototype.line_items = $util.emptyArray;
/**
* Creates a new CMsgGCStorePurchaseInit instance using the specified properties.
* @function create
* @memberof CMsgGCStorePurchaseInit
* @static
* @param {ICMsgGCStorePurchaseInit=} [properties] Properties to set
* @returns {CMsgGCStorePurchaseInit} CMsgGCStorePurchaseInit instance
*/
CMsgGCStorePurchaseInit.create = function create(properties) {
return new CMsgGCStorePurchaseInit(properties);
};
/**
* Encodes the specified CMsgGCStorePurchaseInit message. Does not implicitly {@link CMsgGCStorePurchaseInit.verify|verify} messages.
* @function encode
* @memberof CMsgGCStorePurchaseInit
* @static
* @param {ICMsgGCStorePurchaseInit} message CMsgGCStorePurchaseInit message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgGCStorePurchaseInit.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.country != null && message.hasOwnProperty("country"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.country);
if (message.language != null && message.hasOwnProperty("language"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.language);
if (message.currency != null && message.hasOwnProperty("currency"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.currency);
if (message.line_items != null && message.line_items.length)
for (var i = 0; i < message.line_items.length; ++i)
$root.CGCStorePurchaseInit_LineItem.encode(message.line_items[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
return writer;
};
/**
* Encodes the specified CMsgGCStorePurchaseInit message, length delimited. Does not implicitly {@link CMsgGCStorePurchaseInit.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgGCStorePurchaseInit
* @static
* @param {ICMsgGCStorePurchaseInit} message CMsgGCStorePurchaseInit message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgGCStorePurchaseInit.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgGCStorePurchaseInit message from the specified reader or buffer.
* @function decode
* @memberof CMsgGCStorePurchaseInit
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgGCStorePurchaseInit} CMsgGCStorePurchaseInit
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgGCStorePurchaseInit.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgGCStorePurchaseInit();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.country = reader.string();
break;
case 2:
message.language = reader.int32();
break;
case 3:
message.currency = reader.int32();
break;
case 4:
if (!(message.line_items && message.line_items.length))
message.line_items = [];
message.line_items.push($root.CGCStorePurchaseInit_LineItem.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgGCStorePurchaseInit message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgGCStorePurchaseInit
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgGCStorePurchaseInit} CMsgGCStorePurchaseInit
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgGCStorePurchaseInit.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgGCStorePurchaseInit message.
* @function verify
* @memberof CMsgGCStorePurchaseInit
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgGCStorePurchaseInit.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.country != null && message.hasOwnProperty("country"))
if (!$util.isString(message.country))
return "country: string expected";
if (message.language != null && message.hasOwnProperty("language"))
if (!$util.isInteger(message.language))
return "language: integer expected";
if (message.currency != null && message.hasOwnProperty("currency"))
if (!$util.isInteger(message.currency))
return "currency: integer expected";
if (message.line_items != null && message.hasOwnProperty("line_items")) {
if (!Array.isArray(message.line_items))
return "line_items: array expected";
for (var i = 0; i < message.line_items.length; ++i) {
var error = $root.CGCStorePurchaseInit_LineItem.verify(message.line_items[i]);
if (error)
return "line_items." + error;
}
}
return null;
};
/**
* Creates a CMsgGCStorePurchaseInit message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgGCStorePurchaseInit
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgGCStorePurchaseInit} CMsgGCStorePurchaseInit
*/
CMsgGCStorePurchaseInit.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgGCStorePurchaseInit)
return object;
var message = new $root.CMsgGCStorePurchaseInit();
if (object.country != null)
message.country = String(object.country);
if (object.language != null)
message.language = object.language | 0;
if (object.currency != null)
message.currency = object.currency | 0;
if (object.line_items) {
if (!Array.isArray(object.line_items))
throw TypeError(".CMsgGCStorePurchaseInit.line_items: array expected");
message.line_items = [];
for (var i = 0; i < object.line_items.length; ++i) {
if (typeof object.line_items[i] !== "object")
throw TypeError(".CMsgGCStorePurchaseInit.line_items: object expected");
message.line_items[i] = $root.CGCStorePurchaseInit_LineItem.fromObject(object.line_items[i]);
}
}
return message;
};
/**
* Creates a plain object from a CMsgGCStorePurchaseInit message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgGCStorePurchaseInit
* @static
* @param {CMsgGCStorePurchaseInit} message CMsgGCStorePurchaseInit
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgGCStorePurchaseInit.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.line_items = [];
if (options.defaults) {
object.country = "";
object.language = 0;
object.currency = 0;
}
if (message.country != null && message.hasOwnProperty("country"))
object.country = message.country;
if (message.language != null && message.hasOwnProperty("language"))
object.language = message.language;
if (message.currency != null && message.hasOwnProperty("currency"))
object.currency = message.currency;
if (message.line_items && message.line_items.length) {
object.line_items = [];
for (var j = 0; j < message.line_items.length; ++j)
object.line_items[j] = $root.CGCStorePurchaseInit_LineItem.toObject(message.line_items[j], options);
}
return object;
};
/**
* Converts this CMsgGCStorePurchaseInit to JSON.
* @function toJSON
* @memberof CMsgGCStorePurchaseInit
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgGCStorePurchaseInit.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgGCStorePurchaseInit;
})();
$root.CMsgGCStorePurchaseInitResponse = (function() {
/**
* Properties of a CMsgGCStorePurchaseInitResponse.
* @exports ICMsgGCStorePurchaseInitResponse
* @interface ICMsgGCStorePurchaseInitResponse
* @property {number|null} [result] CMsgGCStorePurchaseInitResponse result
* @property {number|Long|null} [txn_id] CMsgGCStorePurchaseInitResponse txn_id
*/
/**
* Constructs a new CMsgGCStorePurchaseInitResponse.
* @exports CMsgGCStorePurchaseInitResponse
* @classdesc Represents a CMsgGCStorePurchaseInitResponse.
* @implements ICMsgGCStorePurchaseInitResponse
* @constructor
* @param {ICMsgGCStorePurchaseInitResponse=} [properties] Properties to set
*/
function CMsgGCStorePurchaseInitResponse(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]];
}
/**
* CMsgGCStorePurchaseInitResponse result.
* @member {number} result
* @memberof CMsgGCStorePurchaseInitResponse
* @instance
*/
CMsgGCStorePurchaseInitResponse.prototype.result = 0;
/**
* CMsgGCStorePurchaseInitResponse txn_id.
* @member {number|Long} txn_id
* @memberof CMsgGCStorePurchaseInitResponse
* @instance
*/
CMsgGCStorePurchaseInitResponse.prototype.txn_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* Creates a new CMsgGCStorePurchaseInitResponse instance using the specified properties.
* @function create
* @memberof CMsgGCStorePurchaseInitResponse
* @static
* @param {ICMsgGCStorePurchaseInitResponse=} [properties] Properties to set
* @returns {CMsgGCStorePurchaseInitResponse} CMsgGCStorePurchaseInitResponse instance
*/
CMsgGCStorePurchaseInitResponse.create = function create(properties) {
return new CMsgGCStorePurchaseInitResponse(properties);
};
/**
* Encodes the specified CMsgGCStorePurchaseInitResponse message. Does not implicitly {@link CMsgGCStorePurchaseInitResponse.verify|verify} messages.
* @function encode
* @memberof CMsgGCStorePurchaseInitResponse
* @static
* @param {ICMsgGCStorePurchaseInitResponse} message CMsgGCStorePurchaseInitResponse message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgGCStorePurchaseInitResponse.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.result != null && message.hasOwnProperty("result"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result);
if (message.txn_id != null && message.hasOwnProperty("txn_id"))
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.txn_id);
return writer;
};
/**
* Encodes the specified CMsgGCStorePurchaseInitResponse message, length delimited. Does not implicitly {@link CMsgGCStorePurchaseInitResponse.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgGCStorePurchaseInitResponse
* @static
* @param {ICMsgGCStorePurchaseInitResponse} message CMsgGCStorePurchaseInitResponse message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgGCStorePurchaseInitResponse.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgGCStorePurchaseInitResponse message from the specified reader or buffer.
* @function decode
* @memberof CMsgGCStorePurchaseInitResponse
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgGCStorePurchaseInitResponse} CMsgGCStorePurchaseInitResponse
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgGCStorePurchaseInitResponse.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgGCStorePurchaseInitResponse();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.result = reader.int32();
break;
case 2:
message.txn_id = reader.uint64();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgGCStorePurchaseInitResponse message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgGCStorePurchaseInitResponse
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgGCStorePurchaseInitResponse} CMsgGCStorePurchaseInitResponse
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgGCStorePurchaseInitResponse.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgGCStorePurchaseInitResponse message.
* @function verify
* @memberof CMsgGCStorePurchaseInitResponse
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgGCStorePurchaseInitResponse.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.result != null && message.hasOwnProperty("result"))
if (!$util.isInteger(message.result))
return "result: integer expected";
if (message.txn_id != null && message.hasOwnProperty("txn_id"))
if (!$util.isInteger(message.txn_id) && !(message.txn_id && $util.isInteger(message.txn_id.low) && $util.isInteger(message.txn_id.high)))
return "txn_id: integer|Long expected";
return null;
};
/**
* Creates a CMsgGCStorePurchaseInitResponse message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgGCStorePurchaseInitResponse
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgGCStorePurchaseInitResponse} CMsgGCStorePurchaseInitResponse
*/
CMsgGCStorePurchaseInitResponse.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgGCStorePurchaseInitResponse)
return object;
var message = new $root.CMsgGCStorePurchaseInitResponse();
if (object.result != null)
message.result = object.result | 0;
if (object.txn_id != null)
if ($util.Long)
(message.txn_id = $util.Long.fromValue(object.txn_id)).unsigned = true;
else if (typeof object.txn_id === "string")
message.txn_id = parseInt(object.txn_id, 10);
else if (typeof object.txn_id === "number")
message.txn_id = object.txn_id;
else if (typeof object.txn_id === "object")
message.txn_id = new $util.LongBits(object.txn_id.low >>> 0, object.txn_id.high >>> 0).toNumber(true);
return message;
};
/**
* Creates a plain object from a CMsgGCStorePurchaseInitResponse message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgGCStorePurchaseInitResponse
* @static
* @param {CMsgGCStorePurchaseInitResponse} message CMsgGCStorePurchaseInitResponse
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgGCStorePurchaseInitResponse.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.result = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, true);
object.txn_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.txn_id = options.longs === String ? "0" : 0;
}
if (message.result != null && message.hasOwnProperty("result"))
object.result = message.result;
if (message.txn_id != null && message.hasOwnProperty("txn_id"))
if (typeof message.txn_id === "number")
object.txn_id = options.longs === String ? String(message.txn_id) : message.txn_id;
else
object.txn_id = options.longs === String ? $util.Long.prototype.toString.call(message.txn_id) : options.longs === Number ? new $util.LongBits(message.txn_id.low >>> 0, message.txn_id.high >>> 0).toNumber(true) : message.txn_id;
return object;
};
/**
* Converts this CMsgGCStorePurchaseInitResponse to JSON.
* @function toJSON
* @memberof CMsgGCStorePurchaseInitResponse
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgGCStorePurchaseInitResponse.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgGCStorePurchaseInitResponse;
})();
$root.CMsgSystemBroadcast = (function() {
/**
* Properties of a CMsgSystemBroadcast.
* @exports ICMsgSystemBroadcast
* @interface ICMsgSystemBroadcast
* @property {string|null} [message] CMsgSystemBroadcast message
*/
/**
* Constructs a new CMsgSystemBroadcast.
* @exports CMsgSystemBroadcast
* @classdesc Represents a CMsgSystemBroadcast.
* @implements ICMsgSystemBroadcast
* @constructor
* @param {ICMsgSystemBroadcast=} [properties] Properties to set
*/
function CMsgSystemBroadcast(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]];
}
/**
* CMsgSystemBroadcast message.
* @member {string} message
* @memberof CMsgSystemBroadcast
* @instance
*/
CMsgSystemBroadcast.prototype.message = "";
/**
* Creates a new CMsgSystemBroadcast instance using the specified properties.
* @function create
* @memberof CMsgSystemBroadcast
* @static
* @param {ICMsgSystemBroadcast=} [properties] Properties to set
* @returns {CMsgSystemBroadcast} CMsgSystemBroadcast instance
*/
CMsgSystemBroadcast.create = function create(properties) {
return new CMsgSystemBroadcast(properties);
};
/**
* Encodes the specified CMsgSystemBroadcast message. Does not implicitly {@link CMsgSystemBroadcast.verify|verify} messages.
* @function encode
* @memberof CMsgSystemBroadcast
* @static
* @param {ICMsgSystemBroadcast} message CMsgSystemBroadcast message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgSystemBroadcast.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.message != null && message.hasOwnProperty("message"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.message);
return writer;
};
/**
* Encodes the specified CMsgSystemBroadcast message, length delimited. Does not implicitly {@link CMsgSystemBroadcast.verify|verify} messages.
* @function encodeDelimited
* @memberof CMsgSystemBroadcast
* @static
* @param {ICMsgSystemBroadcast} message CMsgSystemBroadcast message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CMsgSystemBroadcast.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CMsgSystemBroadcast message from the specified reader or buffer.
* @function decode
* @memberof CMsgSystemBroadcast
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CMsgSystemBroadcast} CMsgSystemBroadcast
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgSystemBroadcast.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CMsgSystemBroadcast();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.message = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CMsgSystemBroadcast message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CMsgSystemBroadcast
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CMsgSystemBroadcast} CMsgSystemBroadcast
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CMsgSystemBroadcast.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CMsgSystemBroadcast message.
* @function verify
* @memberof CMsgSystemBroadcast
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CMsgSystemBroadcast.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.message != null && message.hasOwnProperty("message"))
if (!$util.isString(message.message))
return "message: string expected";
return null;
};
/**
* Creates a CMsgSystemBroadcast message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CMsgSystemBroadcast
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CMsgSystemBroadcast} CMsgSystemBroadcast
*/
CMsgSystemBroadcast.fromObject = function fromObject(object) {
if (object instanceof $root.CMsgSystemBroadcast)
return object;
var message = new $root.CMsgSystemBroadcast();
if (object.message != null)
message.message = String(object.message);
return message;
};
/**
* Creates a plain object from a CMsgSystemBroadcast message. Also converts values to other types if specified.
* @function toObject
* @memberof CMsgSystemBroadcast
* @static
* @param {CMsgSystemBroadcast} message CMsgSystemBroadcast
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CMsgSystemBroadcast.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.message = "";
if (message.message != null && message.hasOwnProperty("message"))
object.message = message.message;
return object;
};
/**
* Converts this CMsgSystemBroadcast to JSON.
* @function toJSON
* @memberof CMsgSystemBroadcast
* @instance
* @returns {Object.<string,*>} JSON object
*/
CMsgSystemBroadcast.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return CMsgSystemBroadcast;
})();
$root.CMsgClientHello = (function() {
/**
* Properties of a CMsgClientHello.
* @exports ICMsgClientHello
* @interface ICMsgClientHello
* @property {number|null} [version] CMsgClientHello version
*/
/**
* Constructs a new CMsgClientHello.
* @exports CMsgClientHello
* @classdesc Represents a CMsgClientHello.
* @implements ICMsgClientHello
* @constructor
* @param {ICMsgClientHello=} [properties] Properties to set
*/
function CMsgClientHello(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]];
}
/**
* CMsgClientHello version.
* @member {number} version
* @memberof CMsgClientHello
* @instance
*/
CMsgClientHello.prototype.version = 0;
/**
* Creates a new CMsgClientHello instance using the specified properties.
* @function create
* @memberof CMsgClientHello
* @static
* @param {ICMsgClientHello=} [properties] Properties to set
* @returns {CMsgClientHello} CMsgClientHello instance
*/
CMsgClientHello.create = function create(properties) {
return new CMsgClientHello(properties);
};
/**
* Encodes the specified CMsgClientHello message. Does not implicitly {@link CMsgClientHello.verify|verify} messages.
* @function encode
* @memberof CMsgClientHello
* @static
* @param {ICMsgClientHello} message CMsgClientHello message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {