MCPcopy Create free account
hub / github.com/ZyphrZero/palworld-python-script / send_rcon_command

Method send_rcon_command

src/task_scheduler.py:71–86  ·  view source on GitHub ↗
(self, command)

Source from the content-addressed store, hash-verified

69 Client.run = patched_run
70
71 def send_rcon_command(self, command):
72 try:
73 with Client(
74 host=self.host,
75 port=self.port,
76 passwd=self.passwd,
77 timeout=1) as client:
78 response = client.run(command)
79 return True, response
80
81 except TimeoutError:
82 return False, "连接超时,请检查服务端"
83 except ConnectionResetError:
84 return False, "远程主机强迫关闭了一个现有的连接,请重连RCON"
85 except:
86 return False, "未知错误"
87
88 def check_rcon(self):
89 while True:

Callers 2

polling_taskMethod · 0.95
send_shutdown_noticeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected