knownasthatguy 2021 年 1 月 12 日 下午 1: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.
< >
正在显示第 1 - 8 条,共 8 条留言
Metal_Warrior 2021 年 1 月 12 日 下午 1: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 2021 年 1 月 12 日 下午 1:50 
is that to say that im not getting anything back from the server?
knownasthatguy 2021 年 1 月 12 日 下午 1:55 
Here is the return data i'm getting:

“÷˜
knownasthatguy 2021 年 1 月 12 日 下午 2:03 
here is the buffer data:

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

Ï¥}V
<type 'str'>
[N]ebsun 2021 年 1 月 12 日 下午 7:09 
What is the game server ? does it support this type of rcon ?
knownasthatguy 2021 年 1 月 24 日 下午 2:03 
that's a good question. I'll ask
knownasthatguy 2021 年 1 月 24 日 下午 2:19 
Hosting site said they are using RCON and not WebRCON
Vojtík 2021 年 3 月 8 日 上午 3:18 
cau
< >
正在显示第 1 - 8 条,共 8 条留言
每页显示数: 1530 50