-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function to disconnect from current server without ending the program #38
Comments
no problem for the issue. The simple answer is not. You can force the state of Az |
Thanks for the quick answer. I'll just hack something together for my very stupid use case. |
@enthrow Did you implement the disconnection functionality? If so, would you mind sharing the code with us? |
This works, but there's probably a better way to do it diff --git a/pymumble_py3/mumble.py b/pymumble_py3/mumble.py
index 8b45e6f..6df3485 100644
--- a/pymumble_py3/mumble.py
+++ b/pymumble_py3/mumble.py
@@ -163,6 +163,12 @@ class Mumble(threading.Thread):
self.connected = PYMUMBLE_CONN_STATE_AUTHENTICATING
return self.connected
+ def close(self):
+ if self.connected == PYMUMBLE_CONN_STATE_CONNECTED:
+ self.reconnect = False
+ self.connected = PYMUMBLE_CONN_STATE_NOT_CONNECTED
+ self.control_socket.close()
+
def loop(self):
"""
Main loop |
Is there a function somewhere to manually disconnect from the server without exiting the program?
Also apologies for the issue on the mumbleradioplayer git, accidentally asked there first. Looking at the code for !kill on that project it seems that the command only exits completely when I just want to kill the thread
The text was updated successfully, but these errors were encountered: