Skip to main content

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

Pypi Package.


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 messages
  • players() : List all players online
  • save() : Save the game in it's current state
  • quit() : Save & shut down the game server
  • showoptions() : Get game server settings
  • help() : 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

zomboid_rcon-0.2.3.tar.gz (42.2 kB view hashes)

Uploaded Source

Built Distribution

zomboid_rcon-0.2.3-py3-none-any.whl (30.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page