[英]python-valve rcon minecraft 'ConnectionRefusedError: [Errno 111] Connection refused'
I am trying to connect to RCON on a minecraft server hosted on my own network using python-valve. 我正在尝试使用python-valve连接到托管在自己网络上的Minecraft服务器上的RCON。 My code is as follows(Keep in mind it is only accessible on my network, hence my connection to localhost):
我的代码如下(请记住,它只能在我的网络上访问,因此连接到本地主机):
import valve.rcon
def rconsendCMD():
address = ("127.0.0.1", 25575)
valve.rcon.execute(address,"jeff","time set night")
That code, according to the documentation, should work fine yet it returns: 根据文档,该代码应该可以正常工作,但是会返回:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "bot.py", line 90, in on_message
rconsendCMD()
File "bot.py", line 43, in rconsendCMD
valve.rcon.execute(address,"jeff","time set night")
File "/usr/local/lib/python3.6/site-packages/valve/rcon.py", line 630, in execute
with RCON(address, password) as rcon:
File "/usr/local/lib/python3.6/site-packages/valve/rcon.py", line 325, in __enter__
self.connect()
File "/usr/local/lib/python3.6/site-packages/valve/rcon.py", line 464, in wrapper
return function(instance, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/valve/rcon.py", line 464, in wrapper
return function(instance, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/valve/rcon.py", line 483, in connect
self._socket.connect(self._address)
ConnectionRefusedError: [Errno 111] Connection refused
The documentation for 'valve.rcon.execute()' can be found here ``valve.rcon.execute()''的文档可以在这里找到
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.