[Server] Peer Status (JSON?)

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

[Server] Peer Status (JSON?)

Post 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 ;)
Hosting a factorio server? Take a look at this || init script ||.

User avatar
TuckJohn
Filter Inserter
Filter Inserter
Posts: 335
Joined: Sat Jul 04, 2015 4:11 pm
Contact:

Re: [Server] Peer Status (JSON?)

Post by TuckJohn »

Can you not see all of the online players connected to a server or hosted world?
~1200+ hours clocked in factorio. Avid KSP and Factorio player

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [Server] Peer Status (JSON?)

Post 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)
Hosting a factorio server? Take a look at this || init script ||.

NoPantsMcDance
Filter Inserter
Filter Inserter
Posts: 478
Joined: Fri Jul 17, 2015 6:56 pm
Contact:

Re: [Server] Peer Status (JSON?)

Post 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.
Looking for a multiplayer server? Check out my servers Vanilla Server

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [Server] Peer Status (JSON?)

Post 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
Hosting a factorio server? Take a look at this || init script ||.

User avatar
malk0lm
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Wed Apr 27, 2016 9:45 pm
Contact:

Re: [Server] Peer Status (JSON?)

Post 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.

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [Server] Peer Status (JSON?)

Post 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 =)
Hosting a factorio server? Take a look at this || init script ||.

NoPantsMcDance
Filter Inserter
Filter Inserter
Posts: 478
Joined: Fri Jul 17, 2015 6:56 pm
Contact:

Re: [Server] Peer Status (JSON?)

Post 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
Looking for a multiplayer server? Check out my servers Vanilla Server

Post Reply

Return to “Ideas and Suggestions”