Compare commits
2 Commits
afdaa9eb3e
...
9d25aaf4ea
Author | SHA1 | Date |
---|---|---|
Timofey Gelazoniya | 9d25aaf4ea | |
Timofey Gelazoniya | c735604c38 |
|
@ -40,7 +40,7 @@ const readStringFromBuffer = (buffer, offset) => {
|
|||
*/
|
||||
const parseAdvertiseString = (advertiseStr) => {
|
||||
const parts = advertiseStr.split(';');
|
||||
return {
|
||||
const parsedParts = {
|
||||
gameId: parts[0],
|
||||
description: parts[1],
|
||||
protocolVersion: parts[2],
|
||||
|
@ -50,6 +50,8 @@ const parseAdvertiseString = (advertiseStr) => {
|
|||
name: parts[7],
|
||||
mode: parts[8]
|
||||
};
|
||||
|
||||
return parsedParts;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -144,8 +146,9 @@ const ping = (host, port = 19132, cb, timeout = 5000) => {
|
|||
case 0x1c: {
|
||||
const pong = UNCONNECTED_PONG(msg);
|
||||
const clientData = {
|
||||
version: {
|
||||
name: pong.name,
|
||||
version: {
|
||||
gameVersion: pong.gameVersion,
|
||||
protocol: pong.protocolVersion
|
||||
},
|
||||
players: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@minescope/mineping",
|
||||
"version": "1.2.2",
|
||||
"version": "1.3.0",
|
||||
"description": "Ping both Minecraft Bedrock and Java servers.",
|
||||
"main": "index.js",
|
||||
"types": "types/index.d.ts",
|
||||
|
|
|
@ -8,8 +8,9 @@ export type BedrockPingOptions = {
|
|||
};
|
||||
|
||||
export type BedrockPingResponse = {
|
||||
version: {
|
||||
name: string;
|
||||
version: {
|
||||
gameVersion: string;
|
||||
protocol: string;
|
||||
};
|
||||
players: {
|
||||
|
|
Loading…
Reference in New Issue