network, yuzu: Improve variable naming and style consistency

This commit is contained in:
FearlessTobi
2022-07-25 17:08:20 +02:00
parent 6b5667dfa5
commit 6a2dcc8b3d
14 changed files with 53 additions and 47 deletions

View File

@ -163,7 +163,7 @@ void HostRoomWindow::Host() {
// Start the announce session if they chose Public
if (is_public) {
if (auto session = announce_multiplayer_session.lock()) {
// Register the room first to ensure verify_UID is present when we connect
// Register the room first to ensure verify_uid is present when we connect
WebService::WebResult result = session->Register();
if (result.result_code != WebService::WebResult::Code::Success) {
QMessageBox::warning(

View File

@ -149,11 +149,11 @@ void Lobby::OnJoinRoom(const QModelIndex& source) {
const std::string ip =
proxy->data(connection_index, LobbyItemHost::HostIPRole).toString().toStdString();
int port = proxy->data(connection_index, LobbyItemHost::HostPortRole).toInt();
const std::string verify_UID =
const std::string verify_uid =
proxy->data(connection_index, LobbyItemHost::HostVerifyUIDRole).toString().toStdString();
// attempt to connect in a different thread
QFuture<void> f = QtConcurrent::run([nickname, ip, port, password, verify_UID, this] {
QFuture<void> f = QtConcurrent::run([nickname, ip, port, password, verify_uid, this] {
std::string token;
#ifdef ENABLE_WEB_SERVICE
if (!Settings::values.yuzu_username.GetValue().empty() &&
@ -161,7 +161,7 @@ void Lobby::OnJoinRoom(const QModelIndex& source) {
WebService::Client client(Settings::values.web_api_url.GetValue(),
Settings::values.yuzu_username.GetValue(),
Settings::values.yuzu_token.GetValue());
token = client.GetExternalJWT(verify_UID).returned_data;
token = client.GetExternalJWT(verify_uid).returned_data;
if (token.empty()) {
LOG_ERROR(WebService, "Could not get external JWT, verification may fail");
} else {
@ -239,7 +239,7 @@ void Lobby::OnRefreshLobby() {
smdh_icon),
new LobbyItemHost(QString::fromStdString(room.information.host_username),
QString::fromStdString(room.ip), room.information.port,
QString::fromStdString(room.verify_UID)),
QString::fromStdString(room.verify_uid)),
new LobbyItemMemberList(members, room.information.member_slots),
});
model->appendRow(row);

View File

@ -123,11 +123,11 @@ public:
static const int HostVerifyUIDRole = Qt::UserRole + 4;
LobbyItemHost() = default;
explicit LobbyItemHost(QString username, QString ip, u16 port, QString verify_UID) {
explicit LobbyItemHost(QString username, QString ip, u16 port, QString verify_uid) {
setData(username, HostUsernameRole);
setData(ip, HostIPRole);
setData(port, HostPortRole);
setData(verify_UID, HostVerifyUIDRole);
setData(verify_uid, HostVerifyUIDRole);
}
QVariant data(int role) const override {

View File

@ -98,14 +98,18 @@ void MultiplayerState::retranslateUi() {
status_text->setText(tr("Not Connected"));
}
if (lobby)
if (lobby) {
lobby->RetranslateUi();
if (host_room)
}
if (host_room) {
host_room->RetranslateUi();
if (client_room)
}
if (client_room) {
client_room->RetranslateUi();
if (direct_connect)
}
if (direct_connect) {
direct_connect->RetranslateUi();
}
}
void MultiplayerState::OnNetworkStateChanged(const Network::RoomMember::State& state) {