From 56f0897ac1620ad83042e72d31b7026b5dc645ad Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 12 Feb 2017 22:55:45 +0100 Subject: [PATCH] [Friends] Add mapname to the status string --- src/Components/Modules/Friends.cpp | 7 +++++-- src/Components/Modules/Friends.hpp | 3 ++- src/Components/Modules/Party.cpp | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Components/Modules/Friends.cpp b/src/Components/Modules/Friends.cpp index fbab8a58..230b0f32 100644 --- a/src/Components/Modules/Friends.cpp +++ b/src/Components/Modules/Friends.cpp @@ -138,7 +138,7 @@ namespace Components } } - void Friends::UpdateHostname(Network::Address server, std::string hostname) + void Friends::UpdateServer(Network::Address server, std::string hostname, std::string mapname) { std::lock_guard _(Friends::Mutex); @@ -147,6 +147,7 @@ namespace Components if(entry.server == server) { entry.serverName = hostname; + entry.mapname = mapname; } } } @@ -226,6 +227,8 @@ namespace Components std::lock_guard _(Friends::Mutex); if (!Steam::Proxy::SteamFriends) return; + Game::UI_UpdateArenas(); + int count = Steam::Proxy::SteamFriends->GetFriendCount(4); Proto::Friends::List list; @@ -350,7 +353,7 @@ namespace Components if (!Friends::IsOnline(user.lastTime)) return "Online"; if (user.server.getType() == Game::NA_BAD) return "Playing IW4x"; if (user.serverName.empty()) return Utils::String::VA("Playing on %s", user.server.getCString()); - return Utils::String::VA("Playing on %s", user.serverName.data()); + return Utils::String::VA("Playing %s on %s", Game::UI_LocalizeMapName(user.mapname.data()), user.serverName.data()); } default: diff --git a/src/Components/Modules/Friends.hpp b/src/Components/Modules/Friends.hpp index 654490ff..edd00b18 100644 --- a/src/Components/Modules/Friends.hpp +++ b/src/Components/Modules/Friends.hpp @@ -14,7 +14,7 @@ namespace Components static void UpdateFriends(); static void UpdateRank(); - static void UpdateHostname(Network::Address server, std::string hostname); + static void UpdateServer(Network::Address server, std::string hostname, std::string mapname); static void UpdateName(); static void SetPresence(std::string key, std::string value); @@ -45,6 +45,7 @@ namespace Components std::string cleanName; Network::Address server; std::string serverName; + std::string mapname; bool online; unsigned int lastTime; int experience; diff --git a/src/Components/Modules/Party.cpp b/src/Components/Modules/Party.cpp index 83c911aa..bd412925 100644 --- a/src/Components/Modules/Party.cpp +++ b/src/Components/Modules/Party.cpp @@ -452,7 +452,7 @@ namespace Components } ServerList::Insert(address, info); - Friends::UpdateHostname(address, info.get("hostname")); + Friends::UpdateServer(address, info.get("hostname"), info.get("mapname")); }); }