| 907 | } |
| 908 | |
| 909 | String PreferencesCache::GetEffectivePlayerName() |
| 910 | { |
| 911 | // Discord display name has the highest priority, then the player name set in the preferences, and finally the system username |
| 912 | |
| 913 | String playerName; |
| 914 | #if (defined(DEATH_TARGET_WINDOWS) && !defined(DEATH_TARGET_WINDOWS_RT)) || defined(DEATH_TARGET_UNIX) |
| 915 | if (PreferencesCache::EnableDiscordIntegration && UI::DiscordRpcClient::Get().IsSupported()) { |
| 916 | playerName = UI::DiscordRpcClient::Get().GetUserDisplayName(); |
| 917 | } |
| 918 | #endif |
| 919 | if (playerName.empty()) { |
| 920 | playerName = PreferencesCache::PlayerName; |
| 921 | if (playerName.empty()) { |
| 922 | playerName = theApplication().GetUserName(); |
| 923 | if (playerName.empty()) { |
| 924 | // Fallback to "Player XXXX" using the last 4 hex digits of the unique player ID |
| 925 | playerName = format("Player {:.2x}{:.2x}", |
| 926 | PreferencesCache::UniquePlayerID[14], PreferencesCache::UniquePlayerID[15]); |
| 927 | } |
| 928 | } |
| 929 | } |
| 930 | |
| 931 | return playerName; |
| 932 | } |
| 933 | |
| 934 | EpisodeContinuationState* PreferencesCache::GetEpisodeEnd(StringView episodeName, bool createIfNotFound) |
| 935 | { |
nothing calls this directly
no test coverage detected