Python class for interacting with Project Zomboid servers using RCON
Project description
Zomboid-rcon: Python RCON for Project Zomboid Servers
Zomboid-rcon enables you to easily communicate with your Project Zomboid servers via RCON. With zomboid-rcon, you can send commands to your server, manage players, and more, all from within your Python script.
Installation
To get started, simply install zomboid-rcon using pip:
pip install zomboid-rcon
Usage
Using zomboid-rcon is easy. Here's a basic example:
from zomboid_rcon import ZomboidRCON
if __name__ == "__main__":
pz = ZomboidRCON(ip='localhost', password='myPassword')
command = pz.serverMsg("You dead yet?")
print(command.response)
print(command.success)
This example connects to a server running on your local machine and sends the message "You dead yet?".
Zomboid-rcon provides several built-in methods for common server management tasks, such as getting a list of connected players:
from zomboid_rcon import ZomboidRCON
if __name__ == "__main__":
pz = ZomboidRCON(ip='localhost', password='myPassword')
print(pz.players().response)
This example prints a list of all players currently connected to the server.
Available Commands
Zomboid-rcon provides several built-in methods for common server management tasks:
serverMsg("Your message")
: Global server messagesplayers()
: List all players onlinesave()
: Save the game in it's current statequit()
: Save & shut down the game servershowoptions()
: Get game server settingshelp()
: Get all command options: Note that only the listed commands have pre-build methods. For any not listed here please use the 'command' method in the following example.
You can execute any custom command using the command method:
from zomboid_rcon import ZomboidRCON
if __name__ == "__main__":
pz = ZomboidRCON(ip='localhost', password='myPassword')
print(pz.command("command", "arg1", "arg2").response)
Known Issues
Please note that zomboid-rcon uses the timeout_decorator package, which is currently only compatible with Unix/Linux systems. As a result, timeouts may cause errors on Windows machines. We are actively working on finding an alternative solution for Windows users.
Contributing
We welcome contributions from anyone! If you would like to contribute to the project, please open an issue or submit a pull request on Github.
License
Zomboid-rcon is licensed under the GPL-3.0 license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for zomboid_rcon-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1c3d3bb811b3aa7120b87837c2d9cb1ef796d5575392da45b8678a2ad304bde |
|
MD5 | 53b38956046738d0b21d5024f0371d3c |
|
BLAKE2b-256 | f2d9be2d627a37078ddf0a9004176e8053c68852daa7bf72ecad3b9a8e783fef |