-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add port configuration #32
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks basically plausible to me – thanks! it will probably be a while before I get around to merging/testing/publishing an update, but it's on my to-do list.
do you know if there's any way we can display any information about which Discord instance we're connected to? e.g. does the READY
payload we receive contain any information that differs between release and PTB apps? I presume there's not, but it would be nice to know for sure one way or the other
public void ReconnectDiscord() { | ||
this.Connection.Dispose(); | ||
this.Connection = new DiscordConnection(this); | ||
this.disposeActions.Push(() => this.Connection.Dispose()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will cause this.Connection
to be disposed multiple times, right? since the constructor already pushes one of these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if the pushed one still works after replacing this.Connection with a new instance of DiscordConnection. I presumed it would not since the reference that was pushed into the stack points to a no-longer used instance of DiscordConnection. But i might be totally of the mark
There is a way to distinguish the instances. It's even logged into /xllog. It's part of the string you get when establishing the connection. The "api_endpoint" contains the url which is |
This isn't exactly what's described in #8 but it's a working solution for me. I run DiscordPtb (beta client) alongside the normal Discord client. And of course it usually tries to connect to the wrong one.
This lets me specifically set the port the websocket uses.
Added a number input to choose the port, with a big tooltip.
Along with a button to reconnect and a small label showing if its connected or not.
I also added a subcommand
/whostalking port <number>
.If you are interested, but want some changes please let me know. If you are not I would still appreciate a heads-up so I'm aware.
Thank you for the amazing plugin!