Created
February 13, 2012 06:31
-
-
Save mappum/1814257 to your computer and use it in GitHub Desktop.
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
Minecraft.BetaClient = function(args) { | |
if(Minecraft.ENVIRONMENT == 'node') { | |
if(typeof Minecraft.node.net == 'undefined') Minecraft.node.net = require('net'); | |
this.host = args.host; | |
this.port = args.port || 25565; | |
this.username = args.username || 'Player'; | |
this.status = 0; | |
if(typeof args.onLogin == 'function') this.onLogin = args.onLogin; | |
this.socket = new Minecraft.node.net.Socket(); | |
this.socket.on('data', function(data) { | |
console.log(data); | |
}).connect(this.port, this.host, function() { | |
this.socket.write('\2' + args.username); | |
this.status = 1; | |
}); | |
} else { | |
throw new Error('Only compatible in node'); | |
} | |
}; |
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
TypeError: undefined is not a function | |
at repl:1:9 | |
at REPLServer.eval (repl.js:80:21) | |
at repl.js:190:20 | |
at REPLServer.eval (repl.js:87:5) | |
at Interface.<anonymous> (repl.js:182:12) | |
at Interface.emit (events.js:67:17) | |
at Interface._onLine (readline.js:162:10) | |
at Interface._line (readline.js:426:8) | |
at Interface._ttyWrite (readline.js:603:14) | |
at ReadStream.<anonymous> (readline.js:82:12) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment