diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/ldn/ldn_types.h | 19 | ||||
| -rw-r--r-- | src/dedicated_room/yuzu_room.cpp | 7 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/chat_room.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/direct_connect.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/direct_connect.h | 5 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/host_room.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/host_room.h | 4 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/lobby.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/lobby.h | 5 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/state.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/state.h | 5 |
11 files changed, 26 insertions, 27 deletions
diff --git a/src/core/hle/service/ldn/ldn_types.h b/src/core/hle/service/ldn/ldn_types.h index 0af653164..6231e936d 100644 --- a/src/core/hle/service/ldn/ldn_types.h +++ b/src/core/hle/service/ldn/ldn_types.h | |||
| @@ -145,26 +145,19 @@ struct NetworkId { | |||
| 145 | static_assert(sizeof(NetworkId) == 0x20, "NetworkId is an invalid size"); | 145 | static_assert(sizeof(NetworkId) == 0x20, "NetworkId is an invalid size"); |
| 146 | 146 | ||
| 147 | struct Ssid { | 147 | struct Ssid { |
| 148 | u8 length; | 148 | u8 length{}; |
| 149 | std::array<char, SsidLengthMax + 1> raw; | 149 | std::array<char, SsidLengthMax + 1> raw{}; |
| 150 | 150 | ||
| 151 | Ssid() { | 151 | Ssid() = default; |
| 152 | length = 0; | ||
| 153 | std::memset(raw.data(), 0, raw.size()); | ||
| 154 | } | ||
| 155 | 152 | ||
| 156 | Ssid(std::string data) { | 153 | explicit Ssid(std::string_view data) { |
| 157 | length = static_cast<u8>(std::min(data.size(), SsidLengthMax)); | 154 | length = static_cast<u8>(std::min(data.size(), SsidLengthMax)); |
| 158 | std::memcpy(raw.data(), data.data(), length); | 155 | data.copy(raw.data(), length); |
| 159 | raw[length] = 0; | 156 | raw[length] = 0; |
| 160 | } | 157 | } |
| 161 | 158 | ||
| 162 | std::string GetStringValue() const { | 159 | std::string GetStringValue() const { |
| 163 | return std::string(raw.data(), length); | 160 | return std::string(raw.data()); |
| 164 | } | ||
| 165 | |||
| 166 | bool operator==(const Ssid& b) const { | ||
| 167 | return (length == b.length) && (std::memcmp(raw.data(), b.raw.data(), length) == 0); | ||
| 168 | } | 161 | } |
| 169 | }; | 162 | }; |
| 170 | static_assert(sizeof(Ssid) == 0x22, "Ssid is an invalid size"); | 163 | static_assert(sizeof(Ssid) == 0x22, "Ssid is an invalid size"); |
diff --git a/src/dedicated_room/yuzu_room.cpp b/src/dedicated_room/yuzu_room.cpp index 173a53317..7b6deba41 100644 --- a/src/dedicated_room/yuzu_room.cpp +++ b/src/dedicated_room/yuzu_room.cpp | |||
| @@ -76,12 +76,7 @@ static constexpr char BanListMagic[] = "YuzuRoom-BanList-1"; | |||
| 76 | static constexpr char token_delimiter{':'}; | 76 | static constexpr char token_delimiter{':'}; |
| 77 | 77 | ||
| 78 | static void PadToken(std::string& token) { | 78 | static void PadToken(std::string& token) { |
| 79 | const auto remainder = token.size() % 3; | 79 | while (token.size() % 4 != 0) { |
| 80 | if (remainder == 0) { | ||
| 81 | return; | ||
| 82 | } | ||
| 83 | |||
| 84 | for (size_t i = 0; i < (3 - remainder); i++) { | ||
| 85 | token.push_back('='); | 80 | token.push_back('='); |
| 86 | } | 81 | } |
| 87 | } | 82 | } |
diff --git a/src/yuzu/multiplayer/chat_room.cpp b/src/yuzu/multiplayer/chat_room.cpp index bddceb795..9e672f82e 100644 --- a/src/yuzu/multiplayer/chat_room.cpp +++ b/src/yuzu/multiplayer/chat_room.cpp | |||
| @@ -154,9 +154,7 @@ public: | |||
| 154 | } | 154 | } |
| 155 | const QString version = data(GameVersionRole).toString(); | 155 | const QString version = data(GameVersionRole).toString(); |
| 156 | QString version_string; | 156 | QString version_string; |
| 157 | if (version.isEmpty()) { | 157 | if (!version.isEmpty()) { |
| 158 | version_string = QString{}; | ||
| 159 | } else { | ||
| 160 | version_string = QStringLiteral("(%1)").arg(version); | 158 | version_string = QStringLiteral("(%1)").arg(version); |
| 161 | } | 159 | } |
| 162 | return QStringLiteral("%1\n %2 %3") | 160 | return QStringLiteral("%1\n %2 %3") |
diff --git a/src/yuzu/multiplayer/direct_connect.cpp b/src/yuzu/multiplayer/direct_connect.cpp index 65b5f0b9d..017063074 100644 --- a/src/yuzu/multiplayer/direct_connect.cpp +++ b/src/yuzu/multiplayer/direct_connect.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <QString> | 8 | #include <QString> |
| 9 | #include <QtConcurrent/QtConcurrentRun> | 9 | #include <QtConcurrent/QtConcurrentRun> |
| 10 | #include "common/settings.h" | 10 | #include "common/settings.h" |
| 11 | #include "core/core.h" | ||
| 11 | #include "core/internal_network/network_interface.h" | 12 | #include "core/internal_network/network_interface.h" |
| 12 | #include "network/network.h" | 13 | #include "network/network.h" |
| 13 | #include "ui_direct_connect.h" | 14 | #include "ui_direct_connect.h" |
diff --git a/src/yuzu/multiplayer/direct_connect.h b/src/yuzu/multiplayer/direct_connect.h index defa4f4ec..e39dd1e0d 100644 --- a/src/yuzu/multiplayer/direct_connect.h +++ b/src/yuzu/multiplayer/direct_connect.h | |||
| @@ -6,13 +6,16 @@ | |||
| 6 | #include <memory> | 6 | #include <memory> |
| 7 | #include <QDialog> | 7 | #include <QDialog> |
| 8 | #include <QFutureWatcher> | 8 | #include <QFutureWatcher> |
| 9 | #include "core/core.h" | ||
| 10 | #include "yuzu/multiplayer/validation.h" | 9 | #include "yuzu/multiplayer/validation.h" |
| 11 | 10 | ||
| 12 | namespace Ui { | 11 | namespace Ui { |
| 13 | class DirectConnect; | 12 | class DirectConnect; |
| 14 | } | 13 | } |
| 15 | 14 | ||
| 15 | namespace Core { | ||
| 16 | class System; | ||
| 17 | } | ||
| 18 | |||
| 16 | class DirectConnectWindow : public QDialog { | 19 | class DirectConnectWindow : public QDialog { |
| 17 | Q_OBJECT | 20 | Q_OBJECT |
| 18 | 21 | ||
diff --git a/src/yuzu/multiplayer/host_room.cpp b/src/yuzu/multiplayer/host_room.cpp index ad7dcc36d..0c6adfd04 100644 --- a/src/yuzu/multiplayer/host_room.cpp +++ b/src/yuzu/multiplayer/host_room.cpp | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <QtConcurrent/QtConcurrentRun> | 12 | #include <QtConcurrent/QtConcurrentRun> |
| 13 | #include "common/logging/log.h" | 13 | #include "common/logging/log.h" |
| 14 | #include "common/settings.h" | 14 | #include "common/settings.h" |
| 15 | #include "core/core.h" | ||
| 15 | #include "core/internal_network/network_interface.h" | 16 | #include "core/internal_network/network_interface.h" |
| 16 | #include "network/announce_multiplayer_session.h" | 17 | #include "network/announce_multiplayer_session.h" |
| 17 | #include "ui_host_room.h" | 18 | #include "ui_host_room.h" |
diff --git a/src/yuzu/multiplayer/host_room.h b/src/yuzu/multiplayer/host_room.h index 63c0d2333..034cb2eef 100644 --- a/src/yuzu/multiplayer/host_room.h +++ b/src/yuzu/multiplayer/host_room.h | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | #include <QSortFilterProxyModel> | 8 | #include <QSortFilterProxyModel> |
| 9 | #include <QStandardItemModel> | 9 | #include <QStandardItemModel> |
| 10 | #include <QVariant> | 10 | #include <QVariant> |
| 11 | #include "core/core.h" | ||
| 12 | #include "network/network.h" | 11 | #include "network/network.h" |
| 13 | #include "yuzu/multiplayer/chat_room.h" | 12 | #include "yuzu/multiplayer/chat_room.h" |
| 14 | #include "yuzu/multiplayer/validation.h" | 13 | #include "yuzu/multiplayer/validation.h" |
| @@ -18,8 +17,9 @@ class HostRoom; | |||
| 18 | } | 17 | } |
| 19 | 18 | ||
| 20 | namespace Core { | 19 | namespace Core { |
| 20 | class System; | ||
| 21 | class AnnounceMultiplayerSession; | 21 | class AnnounceMultiplayerSession; |
| 22 | } | 22 | } // namespace Core |
| 23 | 23 | ||
| 24 | class ConnectionError; | 24 | class ConnectionError; |
| 25 | class ComboBoxProxyModel; | 25 | class ComboBoxProxyModel; |
diff --git a/src/yuzu/multiplayer/lobby.cpp b/src/yuzu/multiplayer/lobby.cpp index c5fb846c7..107d40547 100644 --- a/src/yuzu/multiplayer/lobby.cpp +++ b/src/yuzu/multiplayer/lobby.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <QtConcurrent/QtConcurrentRun> | 6 | #include <QtConcurrent/QtConcurrentRun> |
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | #include "common/settings.h" | 8 | #include "common/settings.h" |
| 9 | #include "core/core.h" | ||
| 9 | #include "core/internal_network/network_interface.h" | 10 | #include "core/internal_network/network_interface.h" |
| 10 | #include "network/network.h" | 11 | #include "network/network.h" |
| 11 | #include "ui_lobby.h" | 12 | #include "ui_lobby.h" |
diff --git a/src/yuzu/multiplayer/lobby.h b/src/yuzu/multiplayer/lobby.h index 49fd4c473..2696aec21 100644 --- a/src/yuzu/multiplayer/lobby.h +++ b/src/yuzu/multiplayer/lobby.h | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include <QSortFilterProxyModel> | 9 | #include <QSortFilterProxyModel> |
| 10 | #include <QStandardItemModel> | 10 | #include <QStandardItemModel> |
| 11 | #include "common/announce_multiplayer_room.h" | 11 | #include "common/announce_multiplayer_room.h" |
| 12 | #include "core/core.h" | ||
| 13 | #include "network/announce_multiplayer_session.h" | 12 | #include "network/announce_multiplayer_session.h" |
| 14 | #include "network/network.h" | 13 | #include "network/network.h" |
| 15 | #include "yuzu/multiplayer/validation.h" | 14 | #include "yuzu/multiplayer/validation.h" |
| @@ -21,6 +20,10 @@ class Lobby; | |||
| 21 | class LobbyModel; | 20 | class LobbyModel; |
| 22 | class LobbyFilterProxyModel; | 21 | class LobbyFilterProxyModel; |
| 23 | 22 | ||
| 23 | namespace Core { | ||
| 24 | class System; | ||
| 25 | } | ||
| 26 | |||
| 24 | /** | 27 | /** |
| 25 | * Listing of all public games pulled from services. The lobby should be simple enough for users to | 28 | * Listing of all public games pulled from services. The lobby should be simple enough for users to |
| 26 | * find the game they want to play, and join it. | 29 | * find the game they want to play, and join it. |
diff --git a/src/yuzu/multiplayer/state.cpp b/src/yuzu/multiplayer/state.cpp index d1a68b182..66e098296 100644 --- a/src/yuzu/multiplayer/state.cpp +++ b/src/yuzu/multiplayer/state.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <QStandardItemModel> | 8 | #include <QStandardItemModel> |
| 9 | #include "common/announce_multiplayer_room.h" | 9 | #include "common/announce_multiplayer_room.h" |
| 10 | #include "common/logging/log.h" | 10 | #include "common/logging/log.h" |
| 11 | #include "core/core.h" | ||
| 11 | #include "yuzu/game_list.h" | 12 | #include "yuzu/game_list.h" |
| 12 | #include "yuzu/multiplayer/client_room.h" | 13 | #include "yuzu/multiplayer/client_room.h" |
| 13 | #include "yuzu/multiplayer/direct_connect.h" | 14 | #include "yuzu/multiplayer/direct_connect.h" |
diff --git a/src/yuzu/multiplayer/state.h b/src/yuzu/multiplayer/state.h index 3921f2fc3..c92496413 100644 --- a/src/yuzu/multiplayer/state.h +++ b/src/yuzu/multiplayer/state.h | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <QWidget> | 6 | #include <QWidget> |
| 7 | #include "core/core.h" | ||
| 8 | #include "network/announce_multiplayer_session.h" | 7 | #include "network/announce_multiplayer_session.h" |
| 9 | #include "network/network.h" | 8 | #include "network/network.h" |
| 10 | 9 | ||
| @@ -15,6 +14,10 @@ class ClientRoomWindow; | |||
| 15 | class DirectConnectWindow; | 14 | class DirectConnectWindow; |
| 16 | class ClickableLabel; | 15 | class ClickableLabel; |
| 17 | 16 | ||
| 17 | namespace Core { | ||
| 18 | class System; | ||
| 19 | } | ||
| 20 | |||
| 18 | class MultiplayerState : public QWidget { | 21 | class MultiplayerState : public QWidget { |
| 19 | Q_OBJECT; | 22 | Q_OBJECT; |
| 20 | 23 | ||