Skip to content
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

Multiplayer version 4 #4468

merged 28 commits into from Dec 22, 2018


None yet
5 participants
Copy link

zhaowenlan1779 commented Nov 25, 2018

This is a mega PR for the 4th multiplayer version. When the sub-PRs are reviewed, they should be force pushed to here. (Maintainers can push to my branch)

Current plans (All Done!):


  • (Done #4378) Web services authentication
  • (Done #4379) #3677
  • (Done #4466) Basic moderation
  • (Done #4393) #3721
  • (Deferred after discussion) #3681
  • (Done #4390) Protect multiple users with the same Console ID from connecting to the same room
  • (Done #4394) #4177 server side validation
  • (Done #4417) "XXX Joined" and "XXX Left" status message like IRC
  • (Done #4477) User pings while chatting

Bug fixes:

  • (Done #4407) "Connected" message does not appear on first connection to a room

... and more (request for comments)

Before merging:

  • #4507
  • #4516
  • Test this out with the mods
  • Change the lobby endpoint to /lobby
  • @chris062689: 1. Switch /lobby2 to /lobby api side; 2. Push an update to citra-emu/citra-multiplayer-dedicated

This change is Reviewable


This comment has been minimized.

Copy link
Member Author

zhaowenlan1779 commented Dec 2, 2018

Reminder to self: when there's no description/player username, should not pass description and username as empty string (would return 400), but instead do not pass them at all


This comment has been minimized.

Copy link

ghost commented Dec 13, 2018

can you add image support to chat?


This comment has been minimized.

Copy link

wwylele commented Dec 13, 2018

Before @zhaowenlan1779 replies I have to say this first: no, I won't accept a PR adding image support. We are not building a discord.


This comment has been minimized.

Copy link
Member Author

zhaowenlan1779 commented Dec 13, 2018

as @wwylele said, I'm not going to do that.

zhaowenlan1779 and others added some commits Oct 1, 2018

network: check Console ID conflicts
As Console ID can be sensitive data sometimes, this implementation sent a SHA256 hash of it instead.
network, web_service: Add Verification backend and use new lobby API
Added verify_backend to load user_data for members. and removed method to generate UID as this is now done server-side.

Added GetUsername function and a "token" param to room_member.
Also added a username to ChatEntry, so that the username can be shown (along with nicknames) in the chat dialog.
core, web_service: Changes to announce service
Separated registering and updating to correspond to the new announce API endpoint. Also added a verify_UID for JWT audience verification.
web_backend: added GetExternalJWT function
To support requesting external JWTs to use them as verification tokens.
citra_qt: Use the new verify backend; UI changes
Displayed username along with nickname (when they are not identical); Requested and displayed user's avatar; Made the dialog bigger for extended names.

Added a few functions to web_backend (GetImage, GetPlain) to support getting data in multiple content-types.

Added a no_avatar icon for users without avatars.
multiplayer: Add status message for user joining/leaving
The room server is now able to send a new type of packet: IdStatusMessage which is parsed and displayed by the client.
network/room: Moderation implementation
Currently consist of 4 moderation commands (kick, ban, unban and get ban list).
network/room_member: Add moderation functions
To allow for passing moderation errors around without impacting the State, this commit also separates the previous State enum into two enums: State, and Error. The State enum now only contains generic states like disconnected or connected, and the Error enum describes the specific error happened.

citra_qt/multiplayer/{state, message} is changed accordingly.
citra_qt: Add a moderation dialog
The dialog currently supports accessing the ban list and removing entries from it.
dedicated_room: load and save ban list
The ban list is stored in a format so-called CitraRoom-BanList-1 and just first stores username ban list, one entry per line, then an empty line and then store the ip ban list.
citra_qt/multiplayer: Add user ping support
The user would be notified if the message contains "@" followed by the user's nickname or forum username. An alert would be shown, and the icon and message in the status bar would be changed. All notification is only shown if the chat window currently does not have focus.

Also added a connected_notification icon for showing in the status bar.

@zhaowenlan1779 zhaowenlan1779 force-pushed the multiplayer-v4/main branch from 205028d to 8b8b39e Dec 15, 2018

zhaowenlan1779 added some commits Dec 15, 2018

network/packet: Fix reading vectors/arrays of strings
Previously would break here, as it is trying to initialize a string with 0, which is then considered NULL.
network, citra_qt: Give moderation permission to community mods
Based on the `roles` payload in the JWT, the rooms will now give mod permission to Citra Community Moderators. To notify the client of its permissions, a new response, IdJoinSuccessAsMod is added, and there's now a new RoomMember::State called Moderator.

zhaowenlan1779 added some commits Dec 15, 2018

network: Make citra mods optional and disabled by default
To avoid extra legal responsibility, this should actually only be used on our self-hosted rooms.
web_service: Change endpoint to `/lobby`.
Preparation for shipping.

@zhaowenlan1779 zhaowenlan1779 force-pushed the multiplayer-v4/main branch from 4ca8c6c to 4574bd1 Dec 16, 2018

citra_qt/multiplayer: Change style for pinged messages a bit
To allow it to be seen more clearly in dark themes

zhaowenlan1779 added some commits Dec 16, 2018

citra_qt/multiplayer: Add `View Profile` option
Adds an UI action to navigate to the user's profile located in Citra Community.
Copy link

jroweboy left a comment

kinda nervous approving this, but we've tested it and i've looked over all of the individual commits. i'd really hate to see all this go to waste!


This comment has been minimized.

Copy link

edoaxyz commented Dec 19, 2018

Is it possible to add UI sounds triggered whenever an user pings you or an user enters your same room? Obviously these must be selectable in options with enabled ping as default (I think).


This comment has been minimized.

Copy link
Member Author

zhaowenlan1779 commented Dec 19, 2018

@edoaxyz Did not look into that, but we can add that later if we decided we need it, as it is a frontend change that is unrelated to the multiplayer protocol anyway.

@zhaowenlan1779 zhaowenlan1779 changed the title [DO NOT MERGE] Multiplayer version 4 Multiplayer version 4 Dec 22, 2018

@zhaowenlan1779 zhaowenlan1779 merged commit eabc972 into master Dec 22, 2018

5 of 6 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
ci/bitrise/4ccd8e5720f0d13b/pr Passed - citra
ci/bitrise/4ccd8e5720f0d13b/push Passed - citra
continuous-integration/appveyor/branch AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

@zhaowenlan1779 zhaowenlan1779 deleted the multiplayer-v4/main branch Dec 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.