Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
var mcversion = require('./mcversion.js');
var minecraft_protocol = require('minecraft-protocol/src');
var autoVersionForge = require('minecraft-protocol-forge').autoVersionForge;
var minecraft_data = require('minecraft-data')(mcversion);
var protodef = require('protodef');
var readVarInt = protodef.types.varint[0];
var writeVarInt = protodef.types.varint[1];
var sizeOfVarInt = protodef.types.varint[2];
var hex = require('hex');
var WebSocketServer = (require('ws')).Server;
var websocket_stream = require('websocket-stream');
var argv = (require('optimist'))
.default('wshost', '')
.default('wsport', 24444)
.default('mchost', 'localhost')
.default('mcport', 25565)
.default('prefix', 'webuser-')
.argv;
var PACKET_DEBUG = process.env.NODE_DEBUG && /wsmc/.test(process.env.NODE_DEBUG);
var FIXED_MC_VERSION = false; // either a version string, or false to auto-detect
console.log('WS('+argv.wshost+':'+argv.wsport+') <--> MC('+argv.mchost+':'+argv.mcport+')');
var ids = minecraft_data.protocol.states.play.toClient;
var sids = minecraft_data.protocol.states.play.toServer;
_logStream = new logging.StreamFormatter(_loggerManager),
_logger = _loggerManager.createLogger("app");
// For backwards compatibility, set the logStream on the generator object
// even though I believe the only place this was previously referenced was in this file
generator.logStream = _logStream;
// On Windows, the bullet character is sometimes replaced with the bell character BEL (0x07).
// This causes Windows to make a beeping noise every time • is printed to the console.
// Use · instead. This needs to happen before adding stdlog to not affect the log files.
if (process.platform === "win32") {
utils.filterWriteStream(process.stdout, utils.replaceBullet);
utils.filterWriteStream(process.stderr, utils.replaceBullet);
}
var optionParser = optimist["default"]({
"p" : 49494,
"h" : "127.0.0.1",
"P" : "password",
"i" : null,
"o" : null,
"f" : null,
"photoshopVersion": null,
"photoshopPath": null,
"photoshopBinaryPath": null,
"photoshopLogPath": null,
"whiteListedPlugins": null
});
var argv = optionParser
.usage("Run generator service.\nUsage: $0")
.describe({
#!/usr/bin/env node
var argv = require('optimist')
.default({ x : 10, y : 10 })
.argv
;
console.log(argv.x + argv.y);
#!/usr/bin/env node
var argv = require('optimist')
.default({ x : 10, y : 10 })
.argv
;
console.log(argv.x + argv.y);
#!/usr/bin/env node
var argv = require('optimist')
.default('x', 10)
.default('y', 10)
.argv
;
console.log(argv.x + argv.y);
#!/usr/bin/env node
var argv = require('optimist')
.default('x', 10)
.default('y', 10)
.argv
;
console.log(argv.x + argv.y);
#!/usr/bin/env node
var argv = require('optimist')
.default({ x : 10, y : 10 })
.argv
;
console.log(argv.x + argv.y);
#!/usr/bin/env node
var argv = require('optimist')
.default({ x : 10, y : 10 })
.argv
;
console.log(argv.x + argv.y);
#!/usr/bin/env node
var argv = require('optimist')
.default('x', 10)
.default('y', 10)
.argv
;
console.log(argv.x + argv.y);
#!/usr/bin/env node
var argv = require('optimist')
.default({ x : 10, y : 10 })
.argv
;
console.log(argv.x + argv.y);