mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2025-05-20 10:10:25 -04:00
passing test: pinging a real minecraft server
This commit is contained in:
parent
38194ee9b4
commit
150c89cc6d
2 changed files with 20 additions and 2 deletions
|
@ -4,7 +4,7 @@ var STRING_MAX_LENGTH = 240;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
version: 51,
|
version: 51,
|
||||||
minecraftVersion: '1.4.6',
|
minecraftVersion: '1.4.7',
|
||||||
sessionVersion: 13,
|
sessionVersion: 13,
|
||||||
parsePacket: parsePacket,
|
parsePacket: parsePacket,
|
||||||
createPacketBuffer: createPacketBuffer,
|
createPacketBuffer: createPacketBuffer,
|
||||||
|
|
20
test/test.js
20
test/test.js
|
@ -109,7 +109,25 @@ describe("client", function() {
|
||||||
after(function(done) {
|
after(function(done) {
|
||||||
rimraf(MC_SERVER_PATH, 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) {
|
it("connects successfully - online mode", function(done) {
|
||||||
startServer({ 'online-mode': 'true' }, function() {
|
startServer({ 'online-mode': 'true' }, function() {
|
||||||
var client = mc.createClient({
|
var client = mc.createClient({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue