This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findArgs(acc, v, k) { | |
if (typeof v === "string" && v[0] === '$') | |
acc.push({ "path": k, "val": v.subst(1) }); | |
else if (Array.isArray(v) || typeof v === "object") | |
acc = acc.concat(_.map(_.reduce(v, findArgs, []), (v) => { "path": k + "." + v.path, "val": v.val })); | |
return acc; | |
} | |
function setField(path, val, into) { | |
var c = path.split('.').reverse(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# /etc/init.d/mcl | |
### BEGIN INIT INFO | |
# Provides: minecraft | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Should-Start: $network | |
# Should-Stop: $network | |
# Default-Start: 2 3 4 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C)2005-2012 Haxe Foundation | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a | |
* copy of this software and associated documentation files (the "Software"), | |
* to deal in the Software without restriction, including without limitation | |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
* and/or sell copies of the Software, and to permit persons to whom the | |
* Software is furnished to do so, subject to the following conditions: | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.Xna.Framework; | |
using Microsoft.Xna.Framework.Audio; | |
using Microsoft.Xna.Framework.Content; | |
using Microsoft.Xna.Framework.GamerServices; | |
using Microsoft.Xna.Framework.Graphics; | |
using Microsoft.Xna.Framework.Input; | |
using Microsoft.Xna.Framework.Media; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Http = require('http'); | |
var proxy = { | |
address: '192.168.1.1', | |
port: 80 | |
} | |
var server = { | |
host: "cmc.im", | |
port: 25565 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Protocols = require('../../index'); | |
var fs = require("fs"); | |
var yargs = require("yargs"); | |
// Because the JVM is completely f***'d up, we can't simply use a normal 'array'. | |
// Pretty much, tag.value 5 & 6 requires you to increment the index by 2. Why ? | |
// Only god knows. Leads to super-dirty code. | |
var readConstantPool = function(buffer, offset, fieldInfo, context) { | |
var results = { | |
size: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mc = require('../'); | |
var states = mc.protocol.states; | |
function print_help() { | |
console.log("usage: node proxy.js <target_srv> <user> [<password>]"); | |
} | |
if (process.argv.length < 4) { | |
console.log("Too few arguments!"); | |
print_help(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var jsonTransform = require("gulp-json-transform"); | |
gulp.task('removeGH', function() { | |
gulp | |
.src('package.json') | |
.pipe(jsonTransform(function(data) { | |
if (data.version.indexOf("-GH") === data.version.length - 3) | |
data.version = data.version.substring(0, data.version.length - 3); | |
return data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var readVarInt = require("../datatypes/utils").varint[0]; | |
var Transform = require("stream").Transform; | |
module.exports.createSplitter = function() { | |
return new Splitter(); | |
} | |
class Splitter extends Transform { | |
constructor() { | |
super(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createServer({ host = '0.0.0.0', | |
port = 25565, | |
'online-mode' : onlineMode = true, | |
kickTimeout = 10 * 1000, | |
checkTimeoutInterval = 4 * 1000, | |
beforePing = null, | |
keepAlive = true, | |
motd = "A Minecraft server", | |
'max-players' : maxPlayers = 20, | |
} = {}) { |
OlderNewer