Skip to content

Commit

Permalink
Merge pull request #110 from otavepto/patch-old-interfaces
Browse files Browse the repository at this point in the history
add some old interfaces
  • Loading branch information
Detanup01 authored Dec 7, 2024
2 parents e492aec + 88a941c commit a07d5e2
Show file tree
Hide file tree
Showing 19 changed files with 2,457 additions and 886 deletions.
48 changes: 24 additions & 24 deletions dll/dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,48 +212,48 @@ bool steamclient_has_ipv6_functions()
static void *create_client_interface(const char *ver)
{
std::lock_guard<std::recursive_mutex> lock(global_mutex);
void *steam_client = nullptr;

Steam_Client *client_ptr = get_steam_client();
if (strstr(ver, "SteamClient") == ver) {
if (strcmp(ver, "SteamClient007") == 0) {
steam_client = static_cast<ISteamClient007 *>(get_steam_client());
if (strcmp(ver, "SteamClient006") == 0) {
return static_cast<ISteamClient006 *>(client_ptr);
} else if (strcmp(ver, "SteamClient007") == 0) {
return static_cast<ISteamClient007 *>(client_ptr);
} else if (strcmp(ver, "SteamClient008") == 0) {
steam_client = static_cast<ISteamClient008 *>(get_steam_client());
return static_cast<ISteamClient008 *>(client_ptr);
} else if (strcmp(ver, "SteamClient009") == 0) {
steam_client = static_cast<ISteamClient009 *>(get_steam_client());
return static_cast<ISteamClient009 *>(client_ptr);
} else if (strcmp(ver, "SteamClient010") == 0) {
steam_client = static_cast<ISteamClient010 *>(get_steam_client());
return static_cast<ISteamClient010 *>(client_ptr);
} else if (strcmp(ver, "SteamClient011") == 0) {
steam_client = static_cast<ISteamClient011 *>(get_steam_client());
return static_cast<ISteamClient011 *>(client_ptr);
} else if (strcmp(ver, "SteamClient012") == 0) {
steam_client = static_cast<ISteamClient012 *>(get_steam_client());
return static_cast<ISteamClient012 *>(client_ptr);
} else if (strcmp(ver, "SteamClient013") == 0) {
steam_client = static_cast<ISteamClient013 *>(get_steam_client());
return static_cast<ISteamClient013 *>(client_ptr);
} else if (strcmp(ver, "SteamClient014") == 0) {
steam_client = static_cast<ISteamClient014 *>(get_steam_client());
return static_cast<ISteamClient014 *>(client_ptr);
} else if (strcmp(ver, "SteamClient015") == 0) {
steam_client = static_cast<ISteamClient015 *>(get_steam_client());
return static_cast<ISteamClient015 *>(client_ptr);
} else if (strcmp(ver, "SteamClient016") == 0) {
steam_client = static_cast<ISteamClient016 *>(get_steam_client());
return static_cast<ISteamClient016 *>(client_ptr);
} else if (strcmp(ver, "SteamClient017") == 0) {
steam_client = static_cast<ISteamClient017 *>(get_steam_client());
return static_cast<ISteamClient017 *>(client_ptr);
} else if (strcmp(ver, "SteamClient018") == 0) {
steam_client = static_cast<ISteamClient018 *>(get_steam_client());
return static_cast<ISteamClient018 *>(client_ptr);
} else if (strcmp(ver, "SteamClient019") == 0) {
steam_client = static_cast<ISteamClient019 *>(get_steam_client());
} else if (strcmp(ver, "SteamClient020") == 0) {
steamclient_has_ipv6_functions_flag = true;
steam_client = static_cast<ISteamClient020 *>(get_steam_client());
return static_cast<ISteamClient019 *>(client_ptr);
}

steamclient_has_ipv6_functions_flag = true;
if (strcmp(ver, "SteamClient020") == 0) {
return static_cast<ISteamClient020 *>(client_ptr);
} else if (strcmp(ver, STEAMCLIENT_INTERFACE_VERSION) == 0) {
steamclient_has_ipv6_functions_flag = true;
steam_client = static_cast<ISteamClient *>(get_steam_client());
} else {
PRINT_DEBUG("requested unknown steamclient version '%s'", ver);
get_steam_client()->report_missing_impl_and_exit(ver, EMU_FUNC_NAME);
return static_cast<ISteamClient *>(client_ptr);
}
}

return steam_client;
client_ptr->report_missing_impl_and_exit(ver, EMU_FUNC_NAME);
}

STEAMAPI_API void * S_CALLTYPE SteamInternal_CreateInterface( const char *ver )
Expand Down
97 changes: 97 additions & 0 deletions dll/dll/steam_billing.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/* Copyright (C) 2019 Mr Goldberg
This file is part of the Goldberg Emulator
The Goldberg Emulator is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
The Goldberg Emulator is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the Goldberg Emulator; if not, see
<http://www.gnu.org/licenses/>. */

#ifndef __INCLUDED_STEAM_BILLING_H__
#define __INCLUDED_STEAM_BILLING_H__

#include "base.h"

class Steam_Billing:
public ISteamBilling
{
class Settings *settings{};
class Networking *network{};
class SteamCallResults *callback_results{};
class SteamCallBacks *callbacks{};
class RunEveryRunCB *run_every_runcb{};


static void steam_network_callback(void *object, Common_Message *msg);
static void steam_run_every_runcb(void *object);

void steam_run_callback();
void network_callback(Common_Message *msg);

public:
Steam_Billing(class Settings *settings, class Networking *network, class SteamCallResults *callback_results, class SteamCallBacks *callbacks, class RunEveryRunCB *run_every_runcb);
~Steam_Billing();

bool _unknown_fn_1( );
bool _unknown_fn_2( );
bool _unknown_fn_3( );
bool _unknown_fn_4( );
bool _unknown_fn_5( );
bool _unknown_fn_6( );
bool _unknown_fn_7( );
bool _unknown_fn_8( );
bool _unknown_fn_9( );
bool _unknown_fn_10( );
bool _unknown_fn_11( );
bool _unknown_fn_12( );
bool _unknown_fn_13( );
bool _unknown_fn_14( );
bool _unknown_fn_15( );
bool _unknown_fn_16( );
bool _unknown_fn_17( );
bool _unknown_fn_18( );
bool _unknown_fn_19( );

int _unknown_fn_20( );
int _unknown_fn_21( );
int _unknown_fn_22( );
int _unknown_fn_23( );
int _unknown_fn_24( );
int _unknown_fn_25( );
int _unknown_fn_26( );

const char* _unknown_fn_27( ); // returns null string (str address is inside .rdata so it can't change at runtime)

int _unknown_fn_28( );

int _unknown_fn_29( ); // mov eax, 2

int _unknown_fn_30( );
int _unknown_fn_31( );
int _unknown_fn_32( );
int _unknown_fn_33( );
int _unknown_fn_34( );
int _unknown_fn_35( );
int _unknown_fn_36( );
int _unknown_fn_37( );

const char* _unknown_fn_38( ); // returns null string (str address is inside .rdata so it can't change at runtime)

int _unknown_fn_39( );
int _unknown_fn_40( );

bool _unknown_fn_41( );
bool _unknown_fn_42( );
bool _unknown_fn_43( );

};

#endif // __INCLUDED_STEAM_BILLING_H__
21 changes: 21 additions & 0 deletions dll/dll/steam_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "steam_parties.h"
#include "steam_remoteplay.h"
#include "steam_tv.h"
#include "steam_billing.h"

#include "steam_gameserver.h"
#include "steam_gameserverstats.h"
Expand All @@ -68,6 +69,7 @@ enum Steam_Pipe {
};

class Steam_Client :
public ISteamClient006,
public ISteamClient007,
public ISteamClient008,
public ISteamClient009,
Expand Down Expand Up @@ -142,6 +144,7 @@ public ISteamClient
Steam_GameStats *steam_gamestats{};
Steam_Timeline *steam_timeline{};
Steam_App_Disable_Update *steam_app_disable_update{};
Steam_Billing *steam_billing{};

Steam_GameServer *steam_gameserver{};
Steam_Utils *steam_gameserver_utils{};
Expand Down Expand Up @@ -248,6 +251,8 @@ public ISteamClient
// steam appp disable update
ISteamAppDisableUpdate *GetISteamAppDisableUpdate( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );

// steam billing
ISteamBilling *GetISteamBilling( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );

// Deprecated. Applications should use SteamAPI_RunCallbacks() or SteamGameServer_RunCallbacks() instead.
STEAM_PRIVATE_API( void RunFrame() );
Expand Down Expand Up @@ -343,6 +348,22 @@ public ISteamClient

void DestroyAllInterfaces();

// older sdk ----------------------------------------------------------
// https://github.com/ValveSoftware/Proton/blob/proton_9.0/lsteamclient/steamworks_sdk_099v/isteamclient.h
// https://workshop.perforce.com/files/guest/knut_wikstrom/ValveSDKCode/public/steam/isteamclient.h

// creates a global instance of a steam user, so that other processes can share it
// used by the steam UI, to share it's account info/connection with any games it launches
// fails (returns NULL) if an existing instance already exists
HSteamUser CreateGlobalUser( HSteamPipe *phSteamPipe );
// retrieves the IVac interface associated with the handle
// there is normally only one instance of VAC running, but using this connects it to the right user/account
void *GetIVAC( HSteamUser hSteamUser );
// returns the name of a universe
const char *GetUniverseName( EUniverse eUniverse );
void *GetISteamBilling_old( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
// older sdk ----------------------------------------------------------

void report_missing_impl(std::string_view itf, std::string_view caller);
[[noreturn]] void report_missing_impl_and_exit(std::string_view itf, std::string_view caller);

Expand Down
Loading

0 comments on commit a07d5e2

Please sign in to comment.