Skip to content

Commit 7efc874

Browse files
committed
Identify a game's storefront platform as (and record in INI) one of: Steam, Epic, GOG, Xbox, Origin, Ubisoft or Unknown
1 parent 7c6516c commit 7efc874

File tree

8 files changed

+63
-7
lines changed

8 files changed

+63
-7
lines changed

CHANGELOG.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
25.8.28.1
1+
25.8.28.2
2+
=========
3+
+ Identify a game's storefront platform as (and record in INI) one of:
4+
5+
Steam, Epic, GOG, Xbox, Origin, Ubisoft or Unknown
6+
7+
Also include this identifier when querying achievement metadata from
8+
Special K's backend server in order to identify which stores are
9+
being used for what games.
10+
11+
25.8.28.1
212
=========
313
+ Remove DLSS Preset A, B, C, D, E options when users are using DLSS ver.
414
>= 310.4.0, since NVIDIA has forgotten their ABC's.

include/SpecialK/DLL_VERSION.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#define SK_YEAR 25
44
#define SK_MONTH 8
55
#define SK_DATE 28
6-
#define SK_REV_N 1
7-
#define SK_REV 1
6+
#define SK_REV_N 2
7+
#define SK_REV 2
88

99
#ifndef _A2
1010
#define _A2(a) #a

include/SpecialK/config.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ static constexpr int SK_NoPreference = -1;
4242
static constexpr int SK_Disabled = 0;
4343
static constexpr int SK_Enabled = 1;
4444

45+
static constexpr wchar_t* SK_Platform_Unknown = L"Unknown";
46+
static constexpr wchar_t* SK_Platform_Steam = L"Steam";
47+
static constexpr wchar_t* SK_Platform_Epic = L"Epic";
48+
static constexpr wchar_t* SK_Platform_GOG = L"GOG";
49+
static constexpr wchar_t* SK_Platform_Xbox = L"Xbox";
50+
static constexpr wchar_t* SK_Platform_Origin = L"Origin";
51+
static constexpr wchar_t* SK_Platform_Ubisoft = L"Ubisoft";
52+
4553
enum {
4654
SK_HDR_CLIPBOARD_FORMAT_NONE = 0,
4755
SK_HDR_CLIPBOARD_FORMAT_PNG = 1,
@@ -487,6 +495,8 @@ struct sk_config_t
487495
bool silent = false;
488496
bool steam_is_b0rked = false; // Need to swallow some exceptions or Streamline may crash games
489497
int equivalent_steam_app = -1; // For non-Steam games, the AppID of the same game on Steam.
498+
std::wstring
499+
type = SK_Platform_Unknown;
490500
} platform;
491501

492502
struct epic_s {

src/SpecialK.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ SK_KeepAway (void)
239239
const bool xbox =
240240
((StrStrIW (wszAppFullName, L"\\Content\\") != nullptr) || PathFileExistsW (L"gamelaunchhelper.exe"));
241241

242+
if (xbox)
243+
config.platform.type = SK_Platform_Xbox;
244+
242245
auto _TestUndesirableDll = [&]
243246
(const std::initializer_list <constexpr_module_s>& list,
244247
INT list_type) ->
@@ -1334,13 +1337,23 @@ SK_EstablishDllRole (skWin32Module&& _sk_module)
13341337
bool is_gog_game =
13351338
(! is_steamworks_game) && (! is_epic_game) &&
13361339
(! is_microsoft_game ) && (! is_ubisoft_game) &&
1337-
SK_Path_wcsstr (wszProcessName, LR"(GOG Galaxy\Games)") != nullptr;
1340+
(SK_Path_wcsstr (wszProcessName, LR"(GOG Galaxy\Games)") != nullptr ||
1341+
PathFileExistsW (L"gog.ico"));
13381342

13391343
bool is_origin_game =
13401344
(! is_steamworks_game) && (! is_epic_game) && (! is_gog_game) &&
13411345
(! is_microsoft_game ) && (! is_ubisoft_game) &&
13421346
SK_Path_wcsstr (wszProcessName, LR"(Origin Games\)") != nullptr;
13431347

1348+
if (! wcscmp (config.platform.type.c_str (), SK_Platform_Unknown))
1349+
{
1350+
if (is_epic_game) config.platform.type = SK_Platform_Epic;
1351+
else if (is_steamworks_game) config.platform.type = SK_Platform_Steam;
1352+
else if (is_microsoft_game) config.platform.type = SK_Platform_Xbox;
1353+
else if (is_gog_game) config.platform.type = SK_Platform_GOG;
1354+
else if (is_origin_game) config.platform.type = SK_Platform_Origin;
1355+
else if (is_ubisoft_game) config.platform.type = SK_Platform_Ubisoft;
1356+
}
13441357

13451358
if (! is_steamworks_game)
13461359
{

src/config.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ struct
721721
sk::ParameterStringW* notify_corner = nullptr;
722722
sk::ParameterBool* reuse_overlay_pause = nullptr;
723723
sk::ParameterInt* equivalent_steam_app = nullptr;
724+
sk::ParameterStringW* type = nullptr;
724725
} system;
725726
} platform;
726727

@@ -2309,6 +2310,7 @@ auto DeclKeybind =
23092310
ConfigEntry (platform.system.notify_corner, L"Overlay Notification Position (non-Big Picture Mode)", dll_ini, L"Platform.System", L"NotifyCorner"),
23102311
ConfigEntry (platform.system.reuse_overlay_pause, L"Pause Overlay Aware games when control panel is visible", dll_ini, L"Platform.System", L"ReuseOverlayPause"),
23112312
ConfigEntry (platform.system.equivalent_steam_app, L"The Steam AppID for this non-Steam game if it exists", dll_ini, L"Platform.System", L"EquivalentSteamApp"),
2313+
ConfigEntry (platform.system.type, L"String identifying the detected store for this game", dll_ini, L"Platform.System", L"Type"),
23122314

23132315
ConfigEntry (steam.system.appid, L"Steam AppID", dll_ini, L"Steam.System", L"AppID"),
23142316
ConfigEntry (steam.system.init_delay, L"Delay SteamAPI initialization if the game doesn't do it", dll_ini, L"Steam.System", L"AutoInitDelay"),
@@ -5935,6 +5937,7 @@ auto DeclKeybind =
59355937

59365938
platform.system.reuse_overlay_pause->load (config.platform.reuse_overlay_pause);
59375939
platform.system.equivalent_steam_app->load (config.platform.equivalent_steam_app);
5940+
platform.system.type->load (config.platform.type);
59385941
platform.overlay.hdr_luminance->load (config.platform.overlay_hdr_luminance);
59395942
uplay.overlay.hdr_luminance->load (config.uplay.overlay_luminance);
59405943
galaxy.overlay.hdr_luminance->load (config.galaxy.overlay_luminance);
@@ -7434,6 +7437,7 @@ SK_SaveConfig ( std::wstring name,
74347437
SK_Steam_PopupOriginToWStr (config.platform.notify_corner));
74357438
platform.system.reuse_overlay_pause->store (config.platform.reuse_overlay_pause);
74367439
platform.system.equivalent_steam_app->store (config.platform.equivalent_steam_app);
7440+
platform.system.type->store (config.platform.type);
74377441
platform.log.silent->store (config.platform.silent);
74387442
platform.overlay.hdr_luminance->store (config.platform.overlay_hdr_luminance);
74397443

src/storefront/achievements.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,9 @@ SK_Platform_PingBackendForNonSteamGame (void)
597597
( "ISteamUserStats", "GetSchemaForGame", 2,
598598
SK_HTTP_BundleArgs (
599599
{ SK_HTTP_MakeKVPair ( "appid",
600-
appid ) }
600+
appid ),
601+
SK_HTTP_MakeKVPair ( "platform",
602+
SK_WideCharToUTF8 (config.platform.type).data () ) }
601603
)
602604
),
603605
[]( const std::vector <uint8_t>&& data,
@@ -645,6 +647,11 @@ SK_AchievementManager::Achievement::Achievement (int idx, const char* szName, IS
645647
static bool once = false;
646648
if (! std::exchange (once, true))
647649
{
650+
if (stats != nullptr || SK::SteamAPI::GetCallbacksRun () > 0)
651+
{
652+
config.platform.type = SK_Platform_Steam;
653+
}
654+
648655
static concurrency::concurrent_unordered_set <uint64_t> friends;
649656
static concurrency::concurrent_unordered_set <uint64_t> friends_who_own;
650657
static concurrency::concurrent_unordered_set <uint64_t> friends_processed;
@@ -1062,7 +1069,9 @@ SK_AchievementManager::Achievement::Achievement (int idx, const char* szName, IS
10621069
( "ISteamUserStats", "GetSchemaForGame", 2,
10631070
SK_HTTP_BundleArgs (
10641071
{ SK_HTTP_MakeKVPair ( "appid",
1065-
config.steam.appid ) }
1072+
config.steam.appid ),
1073+
SK_HTTP_MakeKVPair ( "platform",
1074+
"Steam" ) }
10661075
)
10671076
),
10681077
[]( const std::vector <uint8_t>&& data,

src/storefront/epic.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,11 @@ SK_EOS_Platform_Tick (EOS_HPlatform Handle)
801801
if (ReadAcquire (&__SK_DLL_Ending))
802802
return;
803803

804+
if (config.steam.appid == 0 && !wcscmp (config.platform.type.c_str (), SK_Platform_Unknown))
805+
{
806+
config.platform.type = SK_Platform_Epic;
807+
}
808+
804809
// Temporarily incompatible
805810
SK_RunOnce (config.platform.reuse_overlay_pause = false);
806811
SK_RunOnce (epic_log->Log (L"EOS_Platform_Tick"));
@@ -1534,7 +1539,7 @@ SK::EOS::AppName (void)
15341539
{
15351540
epic_log->Log (L"App Name Parse Failure: %hs", e.what ());
15361541
}
1537-
}
1542+
}
15381543

15391544
return
15401545
name;

src/storefront/gog.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,11 @@ SK::Galaxy::Init (void)
348348
if (gog_gameId == 0) { _FindGameInfo ( L"../goggame-*.info");
349349
if (gog_gameId == 0) { _FindGameInfo ( L"../../goggame-*.info");
350350
if (gog_gameId == 0) { _FindGameInfo (L"../../../goggame-*.info"); } } }
351+
352+
if (gog_gameId != 0)
353+
{
354+
config.platform.type = SK_Platform_GOG;
355+
}
351356
}
352357

353358
const wchar_t*

0 commit comments

Comments
 (0)