passing test: pinging a real minecraft server

This commit is contained in:
Andrew Kelley 2013-01-04 21:42:31 -05:00
parent 38194ee9b4
commit 150c89cc6d
2 changed files with 20 additions and 2 deletions

View file

@ -4,7 +4,7 @@ var STRING_MAX_LENGTH = 240;
module.exports = {
version: 51,
minecraftVersion: '1.4.6',
minecraftVersion: '1.4.7',
sessionVersion: 13,
parsePacket: parsePacket,
createPacketBuffer: createPacketBuffer,

View file

@ -109,7 +109,25 @@ describe("client", function() {
after(function(done) {
rimraf(MC_SERVER_PATH, done);
});
it("pings the server");
it("pings the server", function(done) {
startServer({
motd: 'test1234',
'max-players': 120,
}, function() {
mc.ping({}, function(err, results) {
if (err) return done(err);
assert.deepEqual(results, {
prefix: "§1",
protocol: protocol.version,
version: protocol.minecraftVersion,
motd: 'test1234',
playerCount: 0,
maxPlayers: 120
});
done();
});
});
});
it("connects successfully - online mode", function(done) {
startServer({ 'online-mode': 'true' }, function() {
var client = mc.createClient({