Page 1 of 1

[Server] Peer Status (JSON?)

Posted: Mon Nov 23, 2015 10:02 pm
by Bisa
I've been trying to parse the logs to get a list of currently connected players - would be awesome if this information could be given to me in a simple parsable format, for example:

If the binary could output a separate file every once in awhile (any time the list of peers change?) to "peers.json"

Code: Select all

{  
   "last_updated":"2015-11-23T21:43:32.802087+00:00",
   "peers":[  
      {  
         "peer_id":1,
         "connected":"2015-11-21T11:23:52.688470+00:00",
         "disconnected":"2015-11-21T11:37:24.711285+00:00",
         "online":false,
         "peer_ip":"XXX",
         "peer_port":34197,
         "player_index":"0",
         "username":"Bisa"
      },
      {  
         "peer_id":2,
         "connected":"2015-11-21T11:29:06.575346+00:00",
         "online":true,
         "peer_ip":"XXX",
         "peer_port":34197,
         "player_index":"29",
         "username":"Deedo"
      }
   ]
}
That, or make the 0.13 planned multiplayer lobby somehow able to give me this information if I authenticate properly - everything to make administering these servers easier and thus more accessible to the community ;)

Re: [Server] Peer Status (JSON?)

Posted: Tue Nov 24, 2015 2:26 pm
by TuckJohn
Can you not see all of the online players connected to a server or hosted world?

Re: [Server] Peer Status (JSON?)

Posted: Tue Nov 24, 2015 6:46 pm
by Bisa
TuckJohn wrote:Can you not see all of the online players connected to a server or hosted world?
I'm not sure if you meant in-game or not (if you meant in-game, yes you wan) - in a server environment tho, on a headless linux box it's another story (unless I missed something in the last few patch notes)

Re: [Server] Peer Status (JSON?)

Posted: Sat Feb 27, 2016 6:50 pm
by NoPantsMcDance
I doubt anything like this would be added before .13 by then we should have some administration system. At the current moment you can really make this yourself. All the information you need is already in the log just not in a pretty format. You could use something like mysql, parse the log for each section of info you need then put it into the table.

Re: [Server] Peer Status (JSON?)

Posted: Sat Feb 27, 2016 7:11 pm
by Bisa
NoPantsMcDance wrote:At the current moment you can really make this yourself
I tried already 8-) viewtopic.php?f=133&t=14672

yea, looking forward to 0.13

Re: [Server] Peer Status (JSON?)

Posted: Tue Jun 28, 2016 5:13 pm
by malk0lm
Bisa wrote:I've been trying to parse the logs to get a list of currently connected players - would be awesome if this information could be given to me in a simple parsable format, for example:

If the binary could output a separate file every once in awhile (any time the list of peers change?) to "peers.json"

Code: Select all

{  
   "last_updated":"2015-11-23T21:43:32.802087+00:00",
   "peers":[  
      {  
         "peer_id":1,
         "connected":"2015-11-21T11:23:52.688470+00:00",
         "disconnected":"2015-11-21T11:37:24.711285+00:00",
         "online":false,
         "peer_ip":"XXX",
         "peer_port":34197,
         "player_index":"0",
         "username":"Bisa"
      },
      {  
         "peer_id":2,
         "connected":"2015-11-21T11:29:06.575346+00:00",
         "online":true,
         "peer_ip":"XXX",
         "peer_port":34197,
         "player_index":"29",
         "username":"Deedo"
      }
   ]
}
That, or make the 0.13 planned multiplayer lobby somehow able to give me this information if I authenticate properly - everything to make administering these servers easier and thus more accessible to the community ;)
+1 for adding this to a future release.

Re: [Server] Peer Status (JSON?)

Posted: Tue Jun 28, 2016 7:57 pm
by Bisa
malk0lm wrote:+1 for adding this to a future release.
It's actually kinda added with the /players command you can do now, plus connecting with RCON allows you to grab the list of players and parse them with a script.
I'll see what others and me can do with this =)

Re: [Server] Peer Status (JSON?)

Posted: Wed Jun 29, 2016 4:27 am
by NoPantsMcDance
Bisa wrote:
malk0lm wrote:+1 for adding this to a future release.
It's actually kinda added with the /players command you can do now, plus connecting with RCON allows you to grab the list of players and parse them with a script.
I'll see what others and me can do with this =)
./mcrcon -p password -P 4444 -H sugaming.us /players | grep "(online)" | cut -d " " -f3 > /var/www/vanilla.online

That's what I got to get online players atm