简体   繁体   English

python-valve rcon minecraft'ConnectionRefusedError:[Errno 111]连接被拒绝'

[英]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()''的文档可以在这里找到

I found out the problem. 我发现了问题。 I am hosting the server on a seperate machine from what I'm executing the python code on. 我将服务器托管在与执行python代码不同的机器上。 I tried to send it to connect to localhost rather than my private address within my network. 我试图将其发送以连接到本地主机,而不是我的网络中的私有地址。 Answer found here 这里找到答案

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ConnectionRefusedError:[Errno 111]连接被拒绝 - ConnectionRefusedError: [Errno 111] Connection refused Python ConnectionRefusedError:[Errno 111] Docker 容器上的连接被拒绝 - Python ConnectionRefusedError: [Errno 111] Connection refused on Docker container 使用 python ftplib 下载但得到 ConnectionRefusedError: [Errno 111] Connection refused - use python ftplib downloading but get ConnectionRefusedError: [Errno 111] Connection refused Ftplib ConnectionRefusedError: [Errno 111] 连接被拒绝 (python 3.5) - Ftplib ConnectionRefusedError: [Errno 111] Connection refused (python 3.5) python 套接字返回 ConnectionRefusedError: [Errno 111] 连接被拒绝 - python socket return ConnectionRefusedError: [Errno 111] Connection refused ConnectionRefusedError: [Errno 111] 连接被拒绝- Mlrun - ConnectionRefusedError: [Errno 111] Connection refused- Mlrun Flask+requests API ConnectionRefusedError: [Errno 111] 连接被拒绝 - Flask+requests API ConnectionRefusedError: [Errno 111] Connection refused PythonAnywhere ConnectionRefusedError:[Errno 111] 与 Twilio 一起使用时连接被拒绝 - PythonAnywhere ConnectionRefusedError: [Errno 111] Connection refused when used with Twilio 在Python(多处理)中正确酸洗和取消代理对象? “ConnectionRefusedError:[Errno 111] 解压时连接被拒绝” - Properly pickling and unpickling proxy objects in Python (multiprocessing)? "ConnectionRefusedError: [Errno 111] Connection refused while unpickling" ConnectionRefusedError:[Errno 111] 笔记本电脑和树莓派之间使用 python 连接被拒绝 - ConnectionRefusedError: [Errno 111] Connection refused between laptop and raspberry pi using python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM