Woovie / palworld-server-helper

A simple Discord bot that performs RCON commands on a Palworld server
MIT License
9 stars 0 forks source link

Rcon problem #1

Closed josigamer closed 8 months ago

josigamer commented 8 months ago

I thought your project was wonderful

But I'm having a problem when I run the command

!players I get this error Screenshot_4

and when I try to kick someone I get this error Screenshot_5

josigamer commented 8 months ago

I'm currently using Windows, but it seems that the rcon command is trying to execute some files that I don't have

Woovie commented 8 months ago

Yeah sorry it's hardcoded. I have an update that will download rcon for Windows and deploy with it.

It's a little bit of a mess right now.

Here's the rcon I used: https://github.com/gorcon/rcon-cli

Woovie commented 8 months ago

Update this line for now:

https://github.com/Woovie/palworld-server-helper/blob/63ae65e111c9a5e6e7827e64294a0c45b8af2cab/bot.py#L27

josigamer commented 8 months ago

I was getting this error "RuntimeWarning: coroutine 'perform_rcon_command' was never awaited" when using the kick and ban command

I needed to change the lines

result = perform_rcon_command(f"KickPlayer {steamid}")
result = perform_rcon_command(f"BanPlayer {steamid}")

for that:

result = await perform_rcon_command(f"KickPlayer {steamid}")
result = await perform_rcon_command(f"BanPlayer {steamid}")
josigamer commented 8 months ago

Now it appears to be working fine

Woovie commented 8 months ago

Glad you got it working. Do note I'll be doing a huge update so expect changes. I'll try to commit tonight. It should solve several issues and complexities 🤞

Woovie commented 8 months ago

I reviewed my code, cleaned up a few things, and pushed it here: https://github.com/Woovie/palworld-server-helper/commit/99b1afe9e3a99116ed26b89f5872cb2da7c010ce

I've set up a channel in my Discord if you want to discuss the script faster and get help or possibly add features.

https://discord.gg/ccyGETpetw

The issues mentioned here should be fixed, but it still needs more testing in a pure Windows environment, I mostly wrote this in WSL. Please let me know if you still see issues.

Woovie commented 8 months ago

Okay I had more time, I went ahead and fully tested this in Windows. You do now need the Visual C++ Build Tools to run it, but everything works great. I'll update README with instructions on that.