implement ISteamAppDisableUpdate001

This commit is contained in:
a 2024-10-09 22:34:03 +03:00
parent 1460b87e39
commit 2d69eb2164
7 changed files with 177 additions and 0 deletions

View File

@ -0,0 +1,47 @@
/* 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_APP_DISABLE_UPDATE_H__
#define __INCLUDED_STEAM_APP_DISABLE_UPDATE_H__
#include "base.h"
class Steam_App_Disable_Update:
public ISteamAppDisableUpdate
{
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_App_Disable_Update(class Settings *settings, class Networking *network, class SteamCallResults *callback_results, class SteamCallBacks *callbacks, class RunEveryRunCB *run_every_runcb);
~Steam_App_Disable_Update();
// probably means how many seconds to keep the updates disabled
void SetAppUpdateDisabledSecondsRemaining(int32 nSeconds);
};
#endif // __INCLUDED_STEAM_APP_DISABLE_UPDATE_H__

View File

@ -56,6 +56,7 @@
#include "steam_gameserverstats.h" #include "steam_gameserverstats.h"
#include "steam_gamestats.h" #include "steam_gamestats.h"
#include "steam_timeline.h" #include "steam_timeline.h"
#include "steam_app_disable_update.h"
#include "steam_masterserver_updater.h" #include "steam_masterserver_updater.h"
#include "overlay/steam_overlay.h" #include "overlay/steam_overlay.h"
@ -140,6 +141,7 @@ public:
Steam_TV *steam_tv{}; Steam_TV *steam_tv{};
Steam_GameStats *steam_gamestats{}; Steam_GameStats *steam_gamestats{};
Steam_Timeline *steam_timeline{}; Steam_Timeline *steam_timeline{};
Steam_App_Disable_Update *steam_app_disable_update{};
Steam_GameServer *steam_gameserver{}; Steam_GameServer *steam_gameserver{};
Steam_Utils *steam_gameserver_utils{}; Steam_Utils *steam_gameserver_utils{};
@ -243,6 +245,9 @@ public:
// steam timeline // steam timeline
ISteamTimeline *GetISteamTimeline( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ); ISteamTimeline *GetISteamTimeline( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
// steam appp disable update
ISteamAppDisableUpdate *GetISteamAppDisableUpdate( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
// Deprecated. Applications should use SteamAPI_RunCallbacks() or SteamGameServer_RunCallbacks() instead. // Deprecated. Applications should use SteamAPI_RunCallbacks() or SteamGameServer_RunCallbacks() instead.
STEAM_PRIVATE_API( void RunFrame() ); STEAM_PRIVATE_API( void RunFrame() );

View File

@ -0,0 +1,88 @@
/* 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/>. */
#include "dll/steam_app_disable_update.h"
void Steam_App_Disable_Update::steam_run_every_runcb(void *object)
{
// PRINT_DEBUG_ENTRY();
auto inst = (Steam_App_Disable_Update *)object;
inst->steam_run_callback();
}
void Steam_App_Disable_Update::steam_network_callback(void *object, Common_Message *msg)
{
// PRINT_DEBUG_ENTRY();
auto inst = (Steam_App_Disable_Update *)object;
inst->network_callback(msg);
}
Steam_App_Disable_Update::Steam_App_Disable_Update(class Settings *settings, class Networking *network, class SteamCallResults *callback_results, class SteamCallBacks *callbacks, class RunEveryRunCB *run_every_runcb)
{
this->settings = settings;
this->network = network;
this->callback_results = callback_results;
this->callbacks = callbacks;
this->run_every_runcb = run_every_runcb;
// this->network->setCallback(CALLBACK_ID_USER_STATUS, settings->get_local_steam_id(), &Steam_App_Disable_Update::steam_network_callback, this);
// this->run_every_runcb->add(&Steam_App_Disable_Update::steam_run_every_runcb, this);
}
Steam_App_Disable_Update::~Steam_App_Disable_Update()
{
// this->network->rmCallback(CALLBACK_ID_USER_STATUS, settings->get_local_steam_id(), &Steam_App_Disable_Update::steam_network_callback, this);
// this->run_every_runcb->remove(&Steam_App_Disable_Update::steam_run_every_runcb, this);
}
void Steam_App_Disable_Update::SetAppUpdateDisabledSecondsRemaining(int32 nSeconds)
{
PRINT_DEBUG_TODO();
std::lock_guard lock(global_mutex);
}
void Steam_App_Disable_Update::steam_run_callback()
{
}
void Steam_App_Disable_Update::network_callback(Common_Message *msg)
{
if (msg->has_low_level()) {
if (msg->low_level().type() == Low_Level::CONNECT) {
}
if (msg->low_level().type() == Low_Level::DISCONNECT) {
}
}
if (msg->has_networking_sockets()) {
}
}

View File

@ -124,6 +124,7 @@ Steam_Client::Steam_Client()
steam_tv = new Steam_TV(settings_client, network, callback_results_client, callbacks_client, run_every_runcb); steam_tv = new Steam_TV(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_gamestats = new Steam_GameStats(settings_client, network, callback_results_client, callbacks_client, run_every_runcb); steam_gamestats = new Steam_GameStats(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_timeline = new Steam_Timeline(settings_client, network, callback_results_client, callbacks_client, run_every_runcb); steam_timeline = new Steam_Timeline(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
steam_app_disable_update = new Steam_App_Disable_Update(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
// server // server
PRINT_DEBUG("init gameserver"); PRINT_DEBUG("init gameserver");
@ -205,6 +206,7 @@ Steam_Client::~Steam_Client()
DEL_INST(steam_tv); DEL_INST(steam_tv);
DEL_INST(steam_gamestats); DEL_INST(steam_gamestats);
DEL_INST(steam_timeline); DEL_INST(steam_timeline);
DEL_INST(steam_app_disable_update);
DEL_INST(steam_utils); DEL_INST(steam_utils);
DEL_INST(steam_friends); DEL_INST(steam_friends);

View File

@ -18,6 +18,19 @@
#include "dll/steam_client.h" #include "dll/steam_client.h"
// retrieves the ISteamAppDisableUpdate interface associated with the handle
ISteamAppDisableUpdate *Steam_Client::GetISteamAppDisableUpdate( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{
PRINT_DEBUG("%s", pchVersion);
if (!steam_pipes.count(hSteamPipe) || !hSteamUser) return nullptr;
if (strcmp(pchVersion, STEAMAPPDISABLEUPDATE_INTERFACE_VERSION) == 0) {
return reinterpret_cast<ISteamAppDisableUpdate *>(static_cast<ISteamAppDisableUpdate *>(steam_app_disable_update));
}
report_missing_impl_and_exit(pchVersion, EMU_FUNC_NAME);
}
// retrieves the ISteamTimeline interface associated with the handle // retrieves the ISteamTimeline interface associated with the handle
ISteamTimeline *Steam_Client::GetISteamTimeline( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamTimeline *Steam_Client::GetISteamTimeline( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
@ -422,6 +435,8 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe
return GetAppTicket(hSteamUser, hSteamPipe, pchVersion); return GetAppTicket(hSteamUser, hSteamPipe, pchVersion);
} else if (strstr(pchVersion, "STEAMTIMELINE_INTERFACE") == pchVersion) { } else if (strstr(pchVersion, "STEAMTIMELINE_INTERFACE") == pchVersion) {
return GetISteamTimeline(hSteamUser, hSteamPipe, pchVersion); return GetISteamTimeline(hSteamUser, hSteamPipe, pchVersion);
} else if (strstr(pchVersion, "SteamAppDisableUpdate") == pchVersion) {
return GetISteamAppDisableUpdate(hSteamUser, hSteamPipe, pchVersion);
} }
PRINT_DEBUG("No interface: %s", pchVersion); PRINT_DEBUG("No interface: %s", pchVersion);

View File

@ -0,0 +1,19 @@
#ifndef ISTEAMAPPDISABLEUPDATE_H
#define ISTEAMAPPDISABLEUPDATE_H
// this interface is not found in public SDK archives, it is based on reversing the returned vftable from steamclient64.dll
// requested by appid 730
class ISteamAppDisableUpdate
{
public:
// probably means how many seconds to keep the updates disabled
virtual void SetAppUpdateDisabledSecondsRemaining(int32 nSeconds) = 0;
};
#define STEAMAPPDISABLEUPDATE_INTERFACE_VERSION "SteamAppDisableUpdate001"
#endif // ISTEAMAPPDISABLEUPDATE_H

View File

@ -21,6 +21,7 @@
#include "steam_api_common.h" #include "steam_api_common.h"
// All of the interfaces // All of the interfaces
#include "isteamappdisableupdate.h"
#include "isteamclient.h" #include "isteamclient.h"
#include "isteamclient007.h" #include "isteamclient007.h"
#include "isteamclient008.h" #include "isteamclient008.h"