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
DolphinQt / InputCommon - Support multiple DSU servers #8804
Conversation
|
Testing this ASAP! |
Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp
Outdated
Show resolved
Hide resolved
65ce1d4
to
f69530e
Compare
|
So, I threw every compatible controller I have, simultaneously, and everything seems to work as expected! Good work! The controllers were a DualShock 4 (through DS4Windows), a DualShock 3 (through ScpToolkit), a Wii Remote Plus (through WiimoteHook) and an old Wii Remote with a separate Motion Plus attachment (also through WiimoteHook). Every controller entry was correctly shown on Dolphin's device list after adding the DSU server addresses on the "Alternate Input Sources" window. Strangely enough, I couldn't reproduce issue 12052, even through this PR shouldn't address it (yes, I checked the PR build I used was compiled after you reverted the commit that was supposed to address this issue from this PR). Every controller reported its own motion data, that reflected the movement of the matching physical controller. Haven't tried on master, though. Perhaps it could be an OS-specific issue? About the UI, I have some nitpicks. The actual design doesn't seem consistent with anything else we currently have on Dolphin and looks a little bit crowded, there's no padding between the elements too. Perhaps a better approach could be adopting a style similar to the existing USB Passthrough and Game Directory boxes from the Main Settings. I did a mockup of this suggestion below. Starting from the current design on master, get rid of the current "Server Address" and "Server Port" text inputs but keep the "Enable" checkbox. Once the checkbox is marked, change the state from a list box that shows the currently added servers, with the "Add" and "Remove" buttons aligned on the right, from disabled to enabled and allow the user to interact with it: Upon clicking on "Add...", open a new window, with the actual Name, IP and Port text fields, and the common Add and Cancel buttons (almost identical to the USB Passthrough whitelist window, minus the device list part): These footnotes aren't directly related to this PR, but I think are worth mentioning anyway (I noticed them while testing this PR but they probably apply to master too):
|
f69530e
to
303d513
Compare
|
@mbc07 - thank you very much for your detailed feedback. For your UI comments, I have updated this PR to follow your mockups. Good ideas! Good catch on the battery issue, it seems like something that needs to be fixed I agree with your comment about the button names but not sure what the best solution would be. At the moment I'd probably lean toward generic button names. I'd almost imagine that the user could specify some translation when adding a server but that might be difficult because our configuration is rather limited, "structures" or even lists are not inherently supported by Dolphin. I used a string for the current implementation, which works but would get quickly out of hand if we wanted something more complex. We could potentially embed json but it feels a bit evil. And even if we had a perfect solution, not sure if that would be too confusing to users. |
|
Switching the bindings to generic button names (probably not in the scope of this PR), in conjunction with this PR, should be sufficient for now. We can think of solutions for having button labels without hardcoding PlayStation-specific names on the bindings later, I think. Anyway, LGTM apart from the code comment I made... (I should probably open an issue report to avoid burying these notes under the PR discussion, especially the Advanced Input Window glitches) |
Source/Core/DolphinQt/Config/ControllerInterface/DualShockUDPClientWidget.cpp
Outdated
Show resolved
Hide resolved
c62577d
to
5c8ed74
Compare
Source/Core/DolphinQt/Config/ControllerInterface/DualShockUDPClientWidget.cpp
Outdated
Show resolved
Hide resolved
Source/Core/DolphinQt/Config/ControllerInterface/DualShockUDPClientWidget.cpp
Outdated
Show resolved
Hide resolved
| continue; | ||
|
|
||
| QListWidgetItem* list_item = new QListWidgetItem(QString::fromStdString( | ||
| fmt::format("{}:{} - {}", server_info[1], server_info[2], server_info[0]))); |
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.
QStringLiteral("%1:%2 - %3").arg(server_info[1], server_info[2], server_info[0])Will allow this to be done without a need to convert from std::string.
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.
Tried this but wasn't working. Seems like arg can't accept std::string arguments. I could make this work if I use fromStdString 3 times but seems like that'd be worse? Maybe I misunderstood you. I'm not very familiar with the Qt library.
Source/Core/DolphinQt/Config/ControllerInterface/DualShockUDPClientWidget.cpp
Outdated
Show resolved
Hide resolved
Source/Core/DolphinQt/Config/ControllerInterface/DualShockUDPClientWidget.cpp
Outdated
Show resolved
Hide resolved
Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp
Outdated
Show resolved
Hide resolved
Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp
Show resolved
Hide resolved
Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp
Outdated
Show resolved
Hide resolved
Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp
Outdated
Show resolved
Hide resolved
Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp
Outdated
Show resolved
Hide resolved
80098b2
to
b448a3a
Compare
|
Thank you for reviewing @lioncash ! I have made most of the changes you have requested and left a couple of comments. Please let me know if you see anything else |
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.
Entering a : into the description box breaks things of course.
Entering a : at the end of the "IP Address" box actually crashes dolphin in a stoi call.
Maybe you should remove any colons from the user input?
You make no attempt to load the old single-server configs?
I guess I don't really care, but someone might?
An "Edit" button would be nice, but I'm nitpicking.
Other than that, things look good.
Good points. Let me play with that idea
I don't. I'm really bad about this. Part of me wonders if we should have a global solution to handling this because of how often it comes up but I don't know what that would look like. Let me see how hard it would be to support the old config. I could probably give it some dummy description.
I did think of an edit button but just didn't get to it |
|
It could be handy to have enable/disable per DSU server. |
a44c14e
to
f87a137
Compare
|
@jordan-woyak - I added a change to address your concerns. More could be done to validate the ip address input but I couldn't find anything I was happy with. Decided to leave it with just the changes we discussed. Let me know what you think. @rlnilsen - thought of that but didn't have a UI that I was very happy with and did not want to complicate the review. I was assuming add/remove was reasonable enough for most users. |
f87a137
to
6bc6bf9
Compare
Source/Core/DolphinQt/Config/ControllerInterface/ServerStringValidator.cpp
Outdated
Show resolved
Hide resolved
6bc6bf9
to
e9e451c
Compare
…limited backwards compatibility support
e9e451c
to
97c9cf3
Compare
|
While this PR works for me, I'm not able to test it in a satisfactory manner that would let me merge it, nor do I understand the code well enough. |



This review allows support for multiple DSU servers, needed if you want to use a motion controller and a separate head tracking source (#8747)
Also, master made some assumptions about the name of the controller. It basically copied what DS4Windows used, where the "Mode" dictated the controller name. However, this documentation is more flexible and is what is used in this PR. This means mode is now just how much gyro functionality the server supports. So where does the "name" of the device come from?
It is now based on the server's description for the server added in the "Add New DSU Server" configuration window.