TritonDataCenter / minecrab

Minecraft on Joyent's Cloud & Manta on Demand
Other
27 stars 12 forks source link

Add server information to ui #5

Closed nfitch closed 10 years ago

nfitch commented 10 years ago

Along with the ip address of the server, like:

  1. Seed
  2. Minecraft Version
  3. Server type (vanilla, bukkit, etc) ...?
nfitch commented 10 years ago

So it turns out there isn't a good programmatic way to get the seed. Seem that on multiplayer servers you have to do one of the following:

  1. Grep the logs
  2. Use a 3rd party app to parse the level.dat

There also isn't a good programmatic way to get the version. The only real suggestion that I found was:

  1. Grep the logs

The server type is already set up in the server.config (the config we generate). We could simply poll the logs until we get the version and the seed. But modded minecraft servers may not have the same output as the vanilla server. Need to go spin up different versions and see what they generate.

nfitch commented 10 years ago

Details on investigation:

vanilla:

/opt/minecraft/server/logs]# cat latest.log
[04:15:22] [Server thread/INFO]: Starting minecraft server version 1.7.2

Note that there is no seed in the logs. Sigh...

craftbukkit (log is in a different location):

/opt/minecraft/server]# cat server.log
2013-11-27 04:07:29 [INFO] Starting minecraft server version 1.6.4
2013-11-27 04:07:29 [INFO] Preparing start region for level 0 (Seed: -6792647903155132695)

ftb-ultimate:

/opt/minecraft/server]# cat server.log
2013-11-27 05:02:33 [INFO] Starting minecraft server version 1.4.7

Also no seed.

voltz:

/opt/minecraft/server]# cat server.log
2013-11-27 04:31:52 [INFO] Starting minecraft server version 1.5.2

Also, no seed here.

So it looks like we can really only reliably get the minecraft version from the logs. So I guess we'll go with that.

nfitch commented 10 years ago

So now that we have all the information in public we need, it's just a matter of fetching and slapping in the ui.