Page 1 of 1

Server Read Playerfile?!

Posted: Tue Aug 02, 2016 7:22 pm
by noliVe
how is it possible to archive a playerlist
consolecommand
/players

give out a nice list of players
how about "lastlogin" would be very interesting

and how can you have a log from it ? cannot find anything on the forum or guides

Re: Server Read Playerfile?!

Posted: Wed Aug 03, 2016 11:08 am
by NoPantsMcDance
Use rcon https://bukkit.org/threads/admin-rcon-m ... ers.70910/

then simply use a script to get the players and do w/e you want with it. If you wanted to know last login you'd have to put data into a file or database then add the times to it.

Code: Select all

#!/bin/bash
while true; do
	#Get online players and send them to the online.players file
	./mcrcon -p <password> -P 4444 -H sugaming.us /players | grep "(online)" | cut -d " " -f3 > /var/www/vanilla.online
sleep 60
done
Not the best solution because it doesn't keep an active connection to rcon, instead it slopily just reconnects and sends /players command once a min. Much better ways to do it but it works.