Kallb123 Posted June 18, 2018 Share Posted June 18, 2018 Is there a way to get stats from a running server (from outside the game)? For example see how many players are connected? Link to comment Share on other sites More sharing options...
Beard Posted June 19, 2018 Share Posted June 19, 2018 You can check the servers through the Steam server list if you are hosting on a Steam version. Go to your Steam client. On the upper left part of the Steam window click "View" > Servers > Game > Select Project Zomboid Link to comment Share on other sites More sharing options...
Kallb123 Posted June 20, 2018 Author Share Posted June 20, 2018 I specifically want to get information programmatically in a command line environment. What does the RPC do and how can I interact with it? I can't seem to find any documents about it. Link to comment Share on other sites More sharing options...
Chained_Phoenix Posted June 26, 2018 Share Posted June 26, 2018 (edited) If you have access to the server cmd line then you can use "players" to see which players are currently online. Typing help on the command line gives you a list of most of the commands. Edited June 26, 2018 by Chained_Phoenix Link to comment Share on other sites More sharing options...
Kallb123 Posted June 26, 2018 Author Share Posted June 26, 2018 In the absence of an api, a quick and dirty solution was to count matching lines in the log file. It seems to have worked quite well over the last few days. echo $(( $(grep ' connected' /path/to/Zomboid/Logs/*user.txt | wc -l) - $(grep 'disconnected' /path/to/Zomboid/Logs/*user.txt | wc -l) )) > /path/to/output.txt Link to comment Share on other sites More sharing options...
Zae Posted July 9, 2018 Share Posted July 9, 2018 If you use this rcon tool you can issue the players or connections command to the server and parse the output however you'd like. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now