Commit graph

27 commits

Author SHA1 Message Date
Johel Ernesto Guerrero Peña e04d904b2b
fix(net): prevent gibberish padding on linux client (#5941) 2022-02-05 11:23:48 +05:30
weihuoya adac0d193b reduce network latency 2021-07-04 23:06:13 +08:00
Subv 7903f6fbfc Warnings/Network: Handle ENET_EVENT_TYPE_NONE and ENET_EVENT_TYPE_CONNECT in the network packet loop.
ENET_EVENT_TYPE_NONE is basically a no-op.

ENET_EVENT_TYPE_CONNECT should not happen since we are already connected. Assert in case we do receive it.
2020-04-11 12:23:57 -05:00
Lioncash 21c71d21ae general: Use deducation guides for std::lock_guard and std::unique_lock
Since C++17, the introduction of deduction guides for locking facilities
means that we no longer need to hardcode the mutex type into the locks
themselves, making it easier to switch mutex types, should it ever be
necessary in the future.
2019-04-07 15:14:29 +02:00
zhupengfei 9d062d63da
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.
2018-12-15 20:28:03 +08:00
zhupengfei 7acd2664dd
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.
2018-12-15 11:03:31 +08:00
zhupengfei 0319e51960 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.
2018-12-15 11:03:06 +08:00
zhupengfei 1a8841f96e
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.
2018-12-15 11:02:51 +08:00
adityaruplaha 5f0e189238
Add Support for Room Descriptions 2018-12-15 11:02:50 +08:00
zhupengfei c396e3c6e5 network: check Console ID conflicts
As Console ID can be sensitive data sometimes, this implementation sent a SHA256 hash of it instead.
2018-12-15 11:02:47 +08:00
James Rowe e040bc9355
Multiplayer: Send an error message when connecting to a full room 2018-12-15 10:40:26 +08:00
Pengfei Zhu 0d2c027a9d
Merge pull request #4191 from valentinvanelslande/minor-fix
room_member: RakNet -> ENet
2018-09-08 10:05:33 +08:00
Valentin Vanelslande c29c66000e
room_member: RakNet -> ENet 2018-09-07 20:17:24 -05:00
Valentin Vanelslande fc876e727a
room_member: fix 3 typos 2018-09-07 20:12:52 -05:00
James Rowe d35693bbbc More minor issue fixes
* Move Joining state change sooner in the code to prevent an issue where
failing to connect multiple times in a row doesn't change the state (as
it goes from CouldNotConnect -> CouldNotConnect which doesn't trigger a
state changed callback)
* Prevent double clicking too fast on a room in the lobby from causing
issues
* Lobby no longer closes when joining a room
2018-04-19 10:28:19 -06:00
Lioncash 94999bde5b room/room_member: Silence -Wswitch warnings 2017-11-28 21:09:53 -05:00
B3n30 c0a7afaa5c
Libnetwork: add password protected rooms, guid, and error fixes (#3068)
* Network: Add password protected roomsand GUID

* Limit chat message size
2017-11-19 19:52:37 +01:00
B3n30 5d0a1e7efd Added missing parts in libnetwork (#2838)
* Network: Set and send the game information over enet

Added Callbacks for RoomMember and GetMemberList to Room in preparation for web_services.
2017-08-19 11:14:33 -06:00
B3n30 77df82f5d6 Network: Changed timeout for receiving packets to 100ms 2017-07-16 21:30:17 +02:00
B3n30 253d3dd3d8 Network: Propagate Room closing to connected members 2017-07-16 21:30:10 +02:00
B3n30 a0626221a5 Network: Made send async in RoomMember 2017-07-16 21:30:04 +02:00
B3n30 859be35d54 Network: Send the game title 2017-07-16 21:29:57 +02:00
B3n30 42e57c1218 Network: Enable sending and receiving chat messages 2017-07-16 21:29:49 +02:00
B3n30 641346c15c Network: Enable to send WifiPackets 2017-07-16 21:29:34 +02:00
B3n30 77677e205e Network: Send JoinRequest and handle the answer in RoomMember 2017-07-16 21:29:11 +02:00
B3n30 589dc083a5 Network: Threads for Room and RoomMember 2017-07-16 21:28:47 +02:00
B3n30 2e37ce01c9 Implement basic virtual Room support based on enet (#2803)
* Added support for network with ENet lib,

connecting is possible, but data can't be sent, yet.

* fixup! Added support for network with ENet lib,

* fixup! CLang

* fixup! Added support for network with ENet lib,

* fixup! Added support for network with ENet lib,

* fixup! Clang format

* More fixups!

* Moved ENetHost* and ENetPeer* into pimpl classes

* fixup! Moved ENetHost* and ENetPeer* into pimpl classes

* fixup! Clang again

* fixup! Moved ENetHost* and ENetPeer* into pimpl classes

* fixup! Moved ENetHost* and ENetPeer* into pimpl classes

* fixup! Moved ENetHost* and ENetPeer* into pimpl classes
2017-07-07 15:34:15 -04:00