Supply is_user_logged_in as addition to API which is used by some not public

forks. Allows running recent version of Dead Cells from Steam. By armani on
irc.libera.chat #openbsd-gaming.
This commit is contained in:
thfr
2025-01-11 22:38:09 +00:00
parent 5a2ade609a
commit 57ad53f4bd
2 changed files with 19 additions and 2 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ GH_ACCOUNT = HeapsIO
GH_PROJECT = hlsteam
# checkout from 2022-03-22
GH_COMMIT = f774d8ea2b7255a3067254fde8d18063455dec24
REVISION = 1
REVISION = 2
CATEGORIES = games
MAINTAINER = Thomas Frohwein <thfr@openbsd.org>
+18 -1
View File
@@ -1,9 +1,21 @@
match steam SDK 1.57 API
supply is_user_logged_in (needed by some games using undisclosed forks)
Index: native/common.cpp
--- native/common.cpp.orig
+++ native/common.cpp
@@ -208,7 +208,7 @@ vdynamic *CallbackHandler::EncodeAuthSessionTicketResp
@@ -172,6 +172,10 @@ HL_PRIM bool HL_NAME(is_steam_running)(){
return SteamAPI_IsSteamRunning();
}
+HL_PRIM bool HL_NAME(is_user_logged_in)(){
+ return (SteamUser() != nullptr);
+}
+
HL_PRIM vbyte *HL_NAME(get_current_game_language)(){
if (!CheckInit()) return NULL;
return (vbyte*)SteamApps()->GetCurrentGameLanguage();
@@ -208,7 +212,7 @@ vdynamic *CallbackHandler::EncodeAuthSessionTicketResp
HL_PRIM vbyte *HL_NAME(get_auth_ticket)( int *size, int *authTicket ) {
vbyte *ticket = hl_alloc_bytes(1024);
@@ -12,3 +24,8 @@ Index: native/common.cpp
return ticket;
}
@@ -351,3 +355,4 @@ DEFINE_PRIM(_BOOL, is_app_owned, _I32);
DEFINE_PRIM(_BOOL, is_subscribed, _NO_ARG);
DEFINE_PRIM(_BOOL, is_subscribed_from_family_sharing, _NO_ARG);
DEFINE_PRIM(_BOOL, is_subscribed_from_free_weekend, _NO_ARG);
+DEFINE_PRIM(_BOOL, is_user_logged_in, _NO_ARG);