Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uber-ping/meta-ping: try different or all pings, return what works #4

Open
deathcap opened this issue Jan 28, 2016 · 2 comments
Open

Comments

@deathcap
Copy link
Owner

The default operation of this module should be to, given nothing but a server address, return generally useful information about it. Including if possible the protocol/game version (for nmp-auto).

FE01 therefore is a good default since it supports 1.4.4-1.9, but if it fails, maybe try the FEFD pings or FE00? (GH-2). If it can make a good guess, detecting the failure mode where a Minecraft server is likely listening, but does not understand FE01.

Of course, individual ping types should still be available on their own.

What about the "modern ping" (status handshake state) on 1.8 (and thereabout)? Maybe if FE01 detects a compatible version, it could send another ping, the modern ping, to get more info. Could be useful since the JSON response may include modinfo, Forge mods, for nmp-forge. Or maybe try a handshake status ping first, if can reliably detect when should instead try FE01 ping. Or try both simultaneously.

@deathcap
Copy link
Owner Author

The demo script tries all the pings. Here's what happens:

node-minecraft-ping $ node demo.js localhost 12500
ended
received ping_fe { pingVersion: -1,
  motd: 'Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
^C

node-minecraft-ping $ node demo.js localhost 13200
ended
received ping_fe { pingVersion: -1,
  motd: 'Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
^C

node-minecraft-ping $ node demo.js localhost 14400
received ping_fe01 { pingVersion: 1,
  protocolVersion: 49,
  gameVersion: '1.4.4',
  motd: 'A Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
(delay)
received ping_fe { pingVersion: -1,
  motd: 'Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
ended
^C

node-minecraft-ping $ node demo.js localhost 15200
received ping_fe01 { pingVersion: 1,
  protocolVersion: 61,
  gameVersion: '1.5.2',
  motd: 'A Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
(delay)
received ping_fe { pingVersion: -1,
  motd: 'Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
ended
^C

node-minecraft-ping $ node demo.js localhost 16400
received ping_fe01 { pingVersion: 1,
  protocolVersion: 78,
  gameVersion: '1.6.4',
  motd: 'A Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
(delay)
received ping_fe { pingVersion: -1,
  motd: 'Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
ended
^C

node-minecraft-ping $ node demo.js localhost 17100
received ping_fe01 { pingVersion: 1,
  protocolVersion: 127,
  gameVersion: '1.7.10',
  motd: 'A Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
ended
(right after)
received ping_fe { pingVersion: -1,
  motd: 'Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
^C

node-minecraft-ping $ node demo.js localhost 18900
received ping_fe01 { pingVersion: 1,
  protocolVersion: 127,
  gameVersion: '1.8.9',
  motd: 'A Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
(right after)
received ping_fe { pingVersion: -1,
  motd: 'Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
ended
^C

node-minecraft-ping $ node demo.js localhost 19000
received ping_fe01 { pingVersion: 1,
  protocolVersion: 127,
  gameVersion: '16w03a',
  motd: 'A Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }
ended
(right after)
received ping_fe { pingVersion: -1,
  motd: 'Minecraft Server',
  playersOnline: 0,
  maxPlayers: 2 }

1.2 and 1.3 only respond to FE (due to the FE01 MC|PingHost incompatibility, see #2, required for instant 1.6.4 pings). 1.4, 1.5, 1.6 respond to FE01, and then after a delay (presumably a timeout) return FE too. 1.7, 1.8, 1.9 respond to both FE01 and FE at about the same time.

@deathcap deathcap changed the title Uber-ping/meta-ping: try different pings, return what works Uber-ping/meta-ping: try different/all pings, return what works Jan 30, 2016
@deathcap deathcap changed the title Uber-ping/meta-ping: try different/all pings, return what works Uber-ping/meta-ping: try different or all pings, return what works Jan 30, 2016
@deathcap
Copy link
Owner Author

The only benefit of multiple pings is that 1.3.2, 1.2.5, etc. and earlier could be "supported", but only in a limited sense, since ping_fe (and `ping_fe01 on ≤1.3.2) doesn't return the protocol version.

You could tell a "minecraft server" is running some older version, but not what it was except a nonspecific "1.3.2 or earlier". Maybe interoperability very old modded 1.2.5 servers would benefit.

But you can't even download anything earlier than 1.2.5 from the normal channels (see PrismarineJS/node-minecraft-wrap#9), Mojang has a launcher but only for the client(?). So this comes down to significant complexity to only support basically two major versions, one of which (1.3.x) was not too popular for modding, and probably many of the 1.2.5 holdouts have moved onto at least 1.5.2.

Marking as wontfix, but leaving open since could be reconsidered later if there is a compelling need (and it would sort of fit into node-minecraft-ping's goal of "pinging everything"). Nonetheless for now, targeting only 1.4.4+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant