knownasthatguy 12. jan. 2021 kl. 13:20
Python RCON Help - struct.error: unpack requires a string argument of length 8
import valve.rcon address = ('x.x.x.x',28216) pwd = 'abcdefg' valve.rcon.RCONMessage.ENCODING = "utf-8" with valve.rcon.RCON(address,pwd) as rcon: print(rcon("echo Hello, world!"))

I get the following error:
File "/home/xxxxx/anaconda3/envs/rcon/lib/python2.7/site-packages/valve/rcon.py", line 180, in decode id_, type_ = struct.unpack("<ii", fixed_fields) struct.error: unpack requires a string argument of length 8

Any help with this is greatly appreciated. I'm not a python/programming expert, but i'm willing to read and follow. This error comes up regardless if I use python 3.7 or 2.7.
< >
Viser 1-8 af 8 kommentarer
Metal_Warrior 12. jan. 2021 kl. 13:48 
Well, this seems to be the point:

unpack requires a string argument of length 8

I don't see a string here, and most certainly nothing the length of 8 chars.
knownasthatguy 12. jan. 2021 kl. 13:50 
is that to say that im not getting anything back from the server?
knownasthatguy 12. jan. 2021 kl. 13:55 
Here is the return data i'm getting:

“÷˜
knownasthatguy 12. jan. 2021 kl. 14:03 
here is the buffer data:

print(buffer_.decode('latin-1').encode("utf-8"))
print(type(buffer_))

Ï¥}V
<type 'str'>
[N]ebsun 12. jan. 2021 kl. 19:09 
What is the game server ? does it support this type of rcon ?
knownasthatguy 24. jan. 2021 kl. 14:03 
that's a good question. I'll ask
knownasthatguy 24. jan. 2021 kl. 14:19 
Hosting site said they are using RCON and not WebRCON
Vojtík 8. mar. 2021 kl. 3:18 
cau
< >
Viser 1-8 af 8 kommentarer
Per side: 1530 50