From 47c6f8ef3d0ba501de66756781c402ca65ac87dc Mon Sep 17 00:00:00 2001 From: Detanup01 <91248446+Detanup01@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:23:22 +0200 Subject: [PATCH 1/3] steamutils001 imp --- sdk/steam/isteamutils001.h | 37 +++++++++++++++++++++++++++++++++++++ sdk/steam/steam_api.h | 1 + 2 files changed, 38 insertions(+) create mode 100644 sdk/steam/isteamutils001.h diff --git a/sdk/steam/isteamutils001.h b/sdk/steam/isteamutils001.h new file mode 100644 index 00000000..d77f88eb --- /dev/null +++ b/sdk/steam/isteamutils001.h @@ -0,0 +1,37 @@ + +#ifndef ISTEAMUTILS001_H +#define ISTEAMUTILS001_H +#ifdef STEAM_WIN32 +#pragma once +#endif + +// Might be not complete/real. Some only has 4, 5, or 7 function, we want them all here. +// -Detanup01 + +class ISteamUtils001 +{ +public: + // return the number of seconds since the user + virtual uint32 GetSecondsSinceAppActive() = 0; + virtual uint32 GetSecondsSinceComputerActive() = 0; + + // the universe this client is connecting to + virtual EUniverse GetConnectedUniverse() = 0; + + // Steam server time - in PST, number of seconds since January 1, 1970 (i.e unix time) + virtual uint32 GetServerRealTime() = 0; + + // returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database) + // e.g "US" or "UK". + virtual const char *GetIPCountry() = 0; + + // returns true if the image exists, and valid sizes were filled out + virtual bool GetImageSize( int iImage, uint32 *pnWidth, uint32 *pnHeight ) = 0; + + // returns true if the image exists, and the buffer was successfully filled out + // results are returned in RGBA format + // the destination buffer size should be 4 * height * width * sizeof(char) + virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0; +}; + +#endif // ISTEAMUTILS001_H diff --git a/sdk/steam/steam_api.h b/sdk/steam/steam_api.h index 8ef2a072..ac794306 100644 --- a/sdk/steam/steam_api.h +++ b/sdk/steam/steam_api.h @@ -73,6 +73,7 @@ #include "isteamfriends015.h" #include "isteamfriends016.h" #include "isteamutils.h" +#include "isteamutils001.h" #include "isteamutils002.h" #include "isteamutils003.h" #include "isteamutils004.h" From 6be3ba1963f849fb47ce4f9175a6b0d1c5b7d0eb Mon Sep 17 00:00:00 2001 From: Detanup01 <91248446+Detanup01@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:00:28 +0200 Subject: [PATCH 2/3] fix interface getter and steamutils class --- dll/dll/steam_utils.h | 1 + dll/steam_client_interface_getter.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dll/dll/steam_utils.h b/dll/dll/steam_utils.h index 7a06bcb4..3d46e67c 100644 --- a/dll/dll/steam_utils.h +++ b/dll/dll/steam_utils.h @@ -25,6 +25,7 @@ class Steam_Utils : +public ISteamUtils001, public ISteamUtils002, public ISteamUtils003, public ISteamUtils004, diff --git a/dll/steam_client_interface_getter.cpp b/dll/steam_client_interface_getter.cpp index 1953adc6..4c6b2b09 100644 --- a/dll/steam_client_interface_getter.cpp +++ b/dll/steam_client_interface_getter.cpp @@ -209,7 +209,10 @@ ISteamUtils *Steam_Client::GetISteamUtils( HSteamPipe hSteamPipe, const char *pc steam_utils_temp = steam_utils; } - if (strcmp(pchVersion, "SteamUtils002") == 0) { + + if (strcmp(pchVersion, "SteamUtils001") == 0) { + return reinterpret_cast(static_cast(steam_utils_temp)); + } else if (strcmp(pchVersion, "SteamUtils002") == 0) { return reinterpret_cast(static_cast(steam_utils_temp)); } else if (strcmp(pchVersion, "SteamUtils003") == 0) { return reinterpret_cast(static_cast(steam_utils_temp)); // ISteamUtils003 Not found in public Archive, must be between 1.02-1.03 From 85563361694626fbc58eb264bf59ae59fffcd4c6 Mon Sep 17 00:00:00 2001 From: Detanup01 <91248446+Detanup01@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:07:34 +0200 Subject: [PATCH 3/3] remove the comment in SteamUtils001 --- sdk/steam/isteamutils001.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/sdk/steam/isteamutils001.h b/sdk/steam/isteamutils001.h index d77f88eb..6f4b7b3d 100644 --- a/sdk/steam/isteamutils001.h +++ b/sdk/steam/isteamutils001.h @@ -5,9 +5,6 @@ #pragma once #endif -// Might be not complete/real. Some only has 4, 5, or 7 function, we want them all here. -// -Detanup01 - class ISteamUtils001 { public: