diff --git a/Source/Core/Core/Slippi/SlippiMatchmaking.cpp b/Source/Core/Core/Slippi/SlippiMatchmaking.cpp index 1b57e508331e..98f4ac965880 100644 --- a/Source/Core/Core/Slippi/SlippiMatchmaking.cpp +++ b/Source/Core/Core/Slippi/SlippiMatchmaking.cpp @@ -547,7 +547,9 @@ void SlippiMatchmaking::handleMatchmaking() { player_info.chat_messages = m_user->GetDefaultChatMessages(); } - } else { + } + else + { player_info.chat_messages = m_user->GetDefaultChatMessages(); } diff --git a/Source/Core/Core/Slippi/SlippiUser.cpp b/Source/Core/Core/Slippi/SlippiUser.cpp index 4ed9b9ff6e01..24a94aab2da7 100644 --- a/Source/Core/Core/Slippi/SlippiUser.cpp +++ b/Source/Core/Core/Slippi/SlippiUser.cpp @@ -8,21 +8,22 @@ // frees the underlying memory safely. std::vector ConvertChatMessagesFromRust(RustChatMessages* rsMessages) { - std::vector chatMessages; + std::vector chatMessages; - for(int i = 0; i < rsMessages->len; i++) { - std::string message = std::string(rsMessages->data[i]); - chatMessages.push_back(message); - } + for (int i = 0; i < rsMessages->len; i++) + { + std::string message = std::string(rsMessages->data[i]); + chatMessages.push_back(message); + } - slprs_user_free_messages(rsMessages); + slprs_user_free_messages(rsMessages); - return chatMessages; + return chatMessages; } SlippiUser::SlippiUser(uintptr_t rs_exi_device_ptr) { - slprs_exi_device_ptr = rs_exi_device_ptr; + slprs_exi_device_ptr = rs_exi_device_ptr; } SlippiUser::~SlippiUser() @@ -32,62 +33,62 @@ SlippiUser::~SlippiUser() bool SlippiUser::AttemptLogin() { - return slprs_user_attempt_login(slprs_exi_device_ptr); + return slprs_user_attempt_login(slprs_exi_device_ptr); } void SlippiUser::OpenLogInPage() { - slprs_user_open_login_page(slprs_exi_device_ptr); + slprs_user_open_login_page(slprs_exi_device_ptr); } void SlippiUser::ListenForLogIn() { - slprs_user_listen_for_login(slprs_exi_device_ptr); + slprs_user_listen_for_login(slprs_exi_device_ptr); } bool SlippiUser::UpdateApp() { - return slprs_user_update_app(slprs_exi_device_ptr); + return slprs_user_update_app(slprs_exi_device_ptr); } void SlippiUser::LogOut() { - slprs_user_logout(slprs_exi_device_ptr); + slprs_user_logout(slprs_exi_device_ptr); } void SlippiUser::OverwriteLatestVersion(std::string version) { - slprs_user_overwrite_latest_version(slprs_exi_device_ptr, version.c_str()); + slprs_user_overwrite_latest_version(slprs_exi_device_ptr, version.c_str()); } SlippiUser::UserInfo SlippiUser::GetUserInfo() { - SlippiUser::UserInfo userInfo; + SlippiUser::UserInfo userInfo; - RustUserInfo* info = slprs_user_get_info(slprs_exi_device_ptr); - userInfo.uid = std::string(info->uid); - userInfo.play_key = std::string(info->play_key); - userInfo.display_name = std::string(info->display_name); - userInfo.connect_code = std::string(info->connect_code); - userInfo.latest_version = std::string(info->latest_version); - slprs_user_free_info(info); + RustUserInfo* info = slprs_user_get_info(slprs_exi_device_ptr); + userInfo.uid = std::string(info->uid); + userInfo.play_key = std::string(info->play_key); + userInfo.display_name = std::string(info->display_name); + userInfo.connect_code = std::string(info->connect_code); + userInfo.latest_version = std::string(info->latest_version); + slprs_user_free_info(info); - return userInfo; + return userInfo; } std::vector SlippiUser::GetDefaultChatMessages() { - RustChatMessages* chatMessages = slprs_user_get_default_messages(slprs_exi_device_ptr); - return ConvertChatMessagesFromRust(chatMessages); + RustChatMessages* chatMessages = slprs_user_get_default_messages(slprs_exi_device_ptr); + return ConvertChatMessagesFromRust(chatMessages); } std::vector SlippiUser::GetUserChatMessages() { - RustChatMessages* chatMessages = slprs_user_get_messages(slprs_exi_device_ptr); - return ConvertChatMessagesFromRust(chatMessages); + RustChatMessages* chatMessages = slprs_user_get_messages(slprs_exi_device_ptr); + return ConvertChatMessagesFromRust(chatMessages); } bool SlippiUser::IsLoggedIn() { - return slprs_user_get_is_logged_in(slprs_exi_device_ptr); + return slprs_user_get_is_logged_in(slprs_exi_device_ptr); } diff --git a/Source/Core/Core/Slippi/SlippiUser.h b/Source/Core/Core/Slippi/SlippiUser.h index f59095dc7f3f..aa473fabb4ae 100644 --- a/Source/Core/Core/Slippi/SlippiUser.h +++ b/Source/Core/Core/Slippi/SlippiUser.h @@ -9,17 +9,17 @@ #include "Common/CommonTypes.h" // This class is currently a shim for the Rust user interface. We're doing it this way -// to begin migratig things over without needing to do larger invasive changes. +// to begin migrating things over without needing to do larger invasive changes. // -// The remaining methods on here are simply layers that direct the call over to the Rust -// side. A quirk of this is that we're using the EXI device pointer, so this class absolutely +// The remaining methods in here are simply layers that direct the call over to the Rust side. +// A quirk of this is that we're using the EXI device pointer, so this class absolutely // cannot outlive the EXI device - but we control that and just need to do our due diligence // when making changes. class SlippiUser { public: // This type is filled in with data from the Rust side. - // Eventually, this entire class will disappear. + // Eventually, this entire class will disappear. struct UserInfo { std::string uid = ""; @@ -45,7 +45,7 @@ class SlippiUser void OverwriteLatestVersion(std::string version); UserInfo GetUserInfo(); std::vector GetUserChatMessages(); - std::vector GetDefaultChatMessages(); + std::vector GetDefaultChatMessages(); bool IsLoggedIn(); protected: