diff --git a/src/client/component/steam_proxy.cpp b/src/client/component/steam_proxy.cpp index 07aa460b..13d38bc0 100644 --- a/src/client/component/steam_proxy.cpp +++ b/src/client/component/steam_proxy.cpp @@ -98,6 +98,11 @@ namespace steam_proxy return steam_overlay_module_; } + const char* get_player_name() + { + return this->client_friends_.invoke("GetPersonaName"); + } + private: utils::nt::library steam_client_module_{}; utils::nt::library steam_overlay_module_{}; @@ -105,6 +110,7 @@ namespace steam_proxy steam::interface client_engine_{}; steam::interface client_user_{}; steam::interface client_utils_{}; + steam::interface client_friends_{}; void* steam_pipe_ = nullptr; void* global_user_ = nullptr; @@ -141,9 +147,10 @@ namespace steam_proxy this->steam_pipe_ = this->steam_client_module_.invoke("Steam_CreateSteamPipe"); this->global_user_ = this->steam_client_module_.invoke( "Steam_ConnectToGlobalUser", this->steam_pipe_); - this->client_user_ = this->client_engine_.invoke(8, this->steam_pipe_, this->global_user_); + this->client_user_ = this->client_engine_.invoke(8, this->global_user_, this->steam_pipe_); // GetIClientUser this->client_utils_ = this->client_engine_.invoke(14, this->steam_pipe_); // GetIClientUtils + this->client_friends_ = this->client_engine_.invoke(13, this->global_user_, this->steam_pipe_); // GetIClientFriends } ownership_state start_mod(const std::string& title, const size_t app_id) @@ -236,6 +243,12 @@ namespace steam_proxy // TODO: Find a better way to do this return component_loader::get()->get_overlay_module(); } + + const char* get_player_name() + { + static std::string name = component_loader::get()->get_player_name(); + return name.data(); + } } REGISTER_COMPONENT(steam_proxy::component) diff --git a/src/client/component/steam_proxy.hpp b/src/client/component/steam_proxy.hpp index 02807691..c5787cd1 100644 --- a/src/client/component/steam_proxy.hpp +++ b/src/client/component/steam_proxy.hpp @@ -4,4 +4,5 @@ namespace steam_proxy { const utils::nt::library& get_overlay_module(); + const char* get_player_name(); } diff --git a/src/client/steam/interfaces/friends.cpp b/src/client/steam/interfaces/friends.cpp index 209d23b7..2d6f8c9d 100644 --- a/src/client/steam/interfaces/friends.cpp +++ b/src/client/steam/interfaces/friends.cpp @@ -1,5 +1,6 @@ #include #include "../steam.hpp" +#include "component/steam_proxy.hpp" //#include @@ -7,7 +8,7 @@ namespace steam { const char* friends::GetPersonaName() { - return "boiii"; + return steam_proxy::get_player_name(); } unsigned long long friends::SetPersonaName(const char* pchPersonaName)