Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as path from 'path';
/* tslint:disable:no-require-imports */
const protobufjs = require('protobufjs');
const ByteBuffer = require('bytebuffer');
protobufjs.convertFieldsToCamelCase = true;
const DEBUG = false;
export function debug(...args: Array<{}>) {
if (DEBUG) console.error.apply(console, args);
}
/**
* Write a message to stderr, which appears in the bazel log and is visible to
* the end user.
*/
export function log(...args: Array<{}>) {
console.error.apply(console, args);
}
export function runAsWorker(args: string[]) {
const protobuf = require('protobufjs')
const path = require('path')
const builder = protobuf.newBuilder()
protobuf.convertFieldsToCamelCase = false
protobuf.loadProtoFile(path.join(__dirname, '/base_gcmessages.proto'), builder)
protobuf.loadProtoFile(path.join(__dirname, '/gcsdk_gcmessages.proto'), builder)
protobuf.loadProtoFile(path.join(__dirname, '/cstrike15_gcmessages.proto'), builder)
module.exports = builder.build()
var Protobuf = require('protobufjs');
Protobuf.convertFieldsToCamelCase = false;
var builder = Protobuf.newBuilder();
Protobuf.loadProtoFile(__dirname + "/../protos/base_gcmessages.proto", builder);
Protobuf.loadProtoFile(__dirname + "/../protos/gcsdk_gcmessages.proto", builder);
Protobuf.loadProtoFile(__dirname + "/../protos/cstrike15_gcmessages.proto", builder);
Protobuf.loadProtoFile(__dirname + "/../protos/custom.proto", builder);
module.exports = builder.build();
var builder_steam = Protobuf.newBuilder();
Protobuf.loadProtoFile(__dirname + "/../protos/steammessages_clientserver.proto", builder_steam);
Protobuf.loadProtoFile(__dirname + "/../protos/steammessages_clientserver_2.proto", builder_steam);
module.exports.schema = builder_steam.build();
exports.load = util.deprecate(function load(filename, format, options) {
const ProtoBuf = require('protobufjs');
options = Object.assign({}, common.defaultGrpcOptions, options);
options.protobufjsVersion = 5;
if (!format) {
format = 'proto';
}
var convertFieldsToCamelCaseOriginal = ProtoBuf.convertFieldsToCamelCase;
if(options && options.hasOwnProperty('convertFieldsToCamelCase')) {
ProtoBuf.convertFieldsToCamelCase = options.convertFieldsToCamelCase;
}
var builder;
try {
switch(format) {
case 'proto':
builder = ProtoBuf.loadProtoFile(filename);
break;
case 'json':
builder = ProtoBuf.loadJsonFile(filename);
break;
default:
throw new Error('Unrecognized format "' + format + '"');
}
} finally {
ProtoBuf.convertFieldsToCamelCase = convertFieldsToCamelCaseOriginal;
}
'use strict';
var _ = require('lodash');
var assert = require('assert');
var ProtoBuf = require('protobufjs');
var util = require('util');
var path = require('path');
ProtoBuf.convertFieldsToCamelCase = true;
var builder = ProtoBuf.loadProtoFile(path.resolve(__dirname, 'protobufs/cstrike15_usermessages.proto')).build();
assert(builder !== null);
function enumNetNameToClassName(enumName) {
var type = enumName.slice(0, 3);
assert(['net', 'svc'].indexOf(type) !== -1, 'unexpected message type');
return util.format('C%sMsg_%s', type.toUpperCase(), enumName.slice(4));
}
function enumUMNameToClassName(enumName) {
return util.format('CCSUsrMsg_%s', enumName.slice(6));
}
function processMessageEnum(messages, enumNameConverterFunc) {
return _.chain(_.invert(messages))
exports.load = util.deprecate(function load(filename, format, options) {
const ProtoBuf = require('protobufjs');
options = Object.assign({}, common.defaultGrpcOptions, options);
options.protobufjsVersion = 5;
if (!format) {
format = 'proto';
}
var convertFieldsToCamelCaseOriginal = ProtoBuf.convertFieldsToCamelCase;
if(options && options.hasOwnProperty('convertFieldsToCamelCase')) {
ProtoBuf.convertFieldsToCamelCase = options.convertFieldsToCamelCase;
}
var builder;
try {
switch(format) {
case 'proto':
builder = ProtoBuf.loadProtoFile(filename);
break;
case 'json':
builder = ProtoBuf.loadJsonFile(filename);
break;
default:
throw new Error('Unrecognized format "' + format + '"');
}
} finally {
var path = require('path')
, uuid = require('node-uuid')
, protobuf = require('protobufjs')
protobuf.convertFieldsToCamelCase = true
protobuf.populateAccessors = false
var builder = protobuf.loadProtoFile(path.resolve(__dirname, 'ges_client.proto'))
, messageNamespace = 'EventStore.Client.Messages.'
, messages = builder.build('EventStore').Client.Messages
module.exports = {
parse: parse
, serialize: serialize
}
function getMessageClass(messageName) {
return messages[messageName]
}
function parse(messageName, payload) {