Skip to content

Commit

Permalink
GameRCON Client 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoz committed Mar 27, 2024
0 parents commit 0d00891
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.spec
*.pyc

/build/*
/dist/*
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# GameRCON Client
This is a console based RCON for most games that utilize source rcon.

## Supported Games
- Minecraft
- Ark: Survival Ascended
- Palworld
- Path of Titans
Any game using the [Source RCON Protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)

## Usage
> gamercon -host "127.0.0.1" -port "25575" -pass "rcon passoord" -command "Info"
Options
- -host
- Server address (default: 127.0.0.1)
- -port
- RCON Port (default: 25575)
- -pass
- RCON/Admin Password
- -command
- Execute a command
3 changes: 3 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
pyinstaller --onefile --icon=gamercon\gamercon.ico .\gamercon\gamercon.py
exit
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

cd "$(dirname "$0")"

pyinstaller --onefile --icon=gamercon/gamercon.ico gamercon/gamercon.py

exit
Binary file added gamercon/gamercon.ico
Binary file not shown.
21 changes: 21 additions & 0 deletions gamercon/gamercon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import argparse
import asyncio
from gamercon_async import GameRCON

# Command line parsing
parser = argparse.ArgumentParser(description='GameRCON command executor.')
parser.add_argument('-host', required=True, help='Server host address')
parser.add_argument('-port', required=True, type=int, help='Server port')
parser.add_argument('-pass', dest='password', required=True, help='RCON password')
parser.add_argument('-command', required=True, help='Command to execute on the server')
args = parser.parse_args()

# Sends command to game server
async def main():
async with GameRCON(args.host, args.port, args.password, timeout=10) as rcon:
response = await rcon.send(args.command)
print(response)

# Entry point
if __name__ == "__main__":
asyncio.run(main())
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyinstaller==6.4.0
gamercon-async==1.0.6

0 comments on commit 0d00891

Please sign in to comment.