2019-04-13 12:21:56 -04:00
|
|
|
/* 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/>. */
|
|
|
|
|
2023-12-27 09:21:59 +02:00
|
|
|
#include "dll/steam_client.h"
|
|
|
|
#include "dll/settings_parser.h"
|
2019-04-13 12:21:56 -04:00
|
|
|
|
2024-05-05 04:24:51 +03:00
|
|
|
|
2024-06-04 13:15:44 +03:00
|
|
|
void Steam_Client::background_thread_proc()
|
|
|
|
{
|
|
|
|
auto now_ms = (unsigned long long)std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
|
|
|
|
|
|
|
|
// if our time exceeds last run time of callbacks and it wasn't processing already
|
|
|
|
const auto runcallbacks_timeout_ms = last_cb_run + max_stall_ms.count();
|
|
|
|
if (!cb_run_active && (now_ms >= runcallbacks_timeout_ms)) {
|
|
|
|
std::lock_guard lock(global_mutex);
|
|
|
|
|
|
|
|
PRINT_DEBUG("run @@@@@@@@@@@@@@@@@@@@@@@@@@@");
|
|
|
|
last_cb_run = now_ms; // update the time counter just to avoid overlap
|
|
|
|
network->Run(); // networking must run first since it receives messages used by each run_callback()
|
|
|
|
run_every_runcb->run(); // call each run_callback()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-13 12:21:56 -04:00
|
|
|
Steam_Client::Steam_Client()
|
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("start ----------");
|
2019-08-26 13:01:45 -04:00
|
|
|
uint32 appid = create_localstorage_settings(&settings_client, &settings_server, &local_storage);
|
2024-01-19 21:45:32 +02:00
|
|
|
local_storage->update_save_filenames(Local_Storage::remote_storage_folder);
|
2019-04-13 12:21:56 -04:00
|
|
|
|
2024-06-04 13:15:44 +03:00
|
|
|
background_thread = new common_helpers::KillableWorker(
|
|
|
|
[this](void *){background_thread_proc(); return false;},
|
|
|
|
std::chrono::duration_cast<std::chrono::milliseconds>(initial_delay),
|
|
|
|
std::chrono::duration_cast<std::chrono::milliseconds>(max_stall_ms)
|
|
|
|
);
|
2019-10-05 15:39:50 -04:00
|
|
|
network = new Networking(settings_server->get_local_steam_id(), appid, settings_server->get_port(), &(settings_server->custom_broadcasts), settings_server->disable_networking);
|
2019-04-13 12:21:56 -04:00
|
|
|
|
|
|
|
run_every_runcb = new RunEveryRunCB();
|
|
|
|
|
2024-04-11 14:08:04 +02:00
|
|
|
PRINT_DEBUG(
|
|
|
|
"init: id: %llu server id: %llu, appid: %u, port: %u",
|
|
|
|
settings_client->get_local_steam_id().ConvertToUint64(), settings_server->get_local_steam_id().ConvertToUint64(), appid, settings_server->get_port()
|
|
|
|
);
|
2019-04-13 12:21:56 -04:00
|
|
|
|
2022-05-29 15:45:39 -04:00
|
|
|
if (appid) {
|
2024-03-22 19:52:18 +02:00
|
|
|
auto appid_str = std::to_string(appid);
|
|
|
|
set_env_variable("SteamAppId", appid_str);
|
|
|
|
set_env_variable("SteamGameId", appid_str);
|
2024-04-20 01:13:10 +02:00
|
|
|
|
|
|
|
if (!settings_client->disable_steamoverlaygameid_env_var) {
|
|
|
|
set_env_variable("SteamOverlayGameId", appid_str);
|
|
|
|
}
|
2024-04-13 17:35:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const char *user_name = settings_client->get_local_name();
|
|
|
|
if (user_name) {
|
|
|
|
set_env_variable("SteamAppUser", user_name);
|
|
|
|
set_env_variable("SteamUser", user_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
set_env_variable("SteamClientLaunch", "1");
|
|
|
|
set_env_variable("SteamEnv", "1");
|
|
|
|
|
|
|
|
{
|
|
|
|
std::string steam_path(get_env_variable("SteamPath"));
|
|
|
|
if (steam_path.empty()) {
|
|
|
|
set_env_variable("SteamPath", get_full_program_path());
|
|
|
|
}
|
2022-05-29 15:45:39 -04:00
|
|
|
}
|
|
|
|
|
2024-04-11 14:08:04 +02:00
|
|
|
// client
|
|
|
|
PRINT_DEBUG("init client");
|
|
|
|
callback_results_client = new SteamCallResults();
|
|
|
|
callbacks_client = new SteamCallBacks(callback_results_client);
|
2024-04-09 21:03:07 +02:00
|
|
|
steam_overlay = new Steam_Overlay(settings_client, local_storage, callback_results_client, callbacks_client, run_every_runcb, network);
|
2019-07-25 23:33:28 +02:00
|
|
|
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_user = new Steam_User(settings_client, local_storage, network, callback_results_client, callbacks_client);
|
2024-04-09 20:56:35 +02:00
|
|
|
steam_friends = new Steam_Friends(settings_client, local_storage, network, callback_results_client, callbacks_client, run_every_runcb, steam_overlay);
|
2024-04-11 14:08:04 +02:00
|
|
|
steam_utils = new Steam_Utils(settings_client, callback_results_client, callbacks_client, steam_overlay);
|
2024-01-14 19:39:19 +02:00
|
|
|
|
2024-01-19 21:45:32 +02:00
|
|
|
ugc_bridge = new Ugc_Remote_Storage_Bridge(settings_client);
|
2019-07-25 23:33:28 +02:00
|
|
|
|
2024-04-23 02:13:51 +02:00
|
|
|
steam_matchmaking = new Steam_Matchmaking(settings_client, local_storage, network, callback_results_client, callbacks_client, run_every_runcb);
|
|
|
|
steam_matchmaking_servers = new Steam_Matchmaking_Servers(settings_client, local_storage, network);
|
2024-03-23 07:22:47 +02:00
|
|
|
steam_user_stats = new Steam_User_Stats(settings_client, network, local_storage, callback_results_client, callbacks_client, run_every_runcb, steam_overlay);
|
2024-04-11 06:40:29 +02:00
|
|
|
steam_apps = new Steam_Apps(settings_client, callback_results_client, callbacks_client);
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_networking = new Steam_Networking(settings_client, network, callbacks_client, run_every_runcb);
|
2024-08-02 16:30:39 +03:00
|
|
|
steam_remote_storage = new Steam_Remote_Storage(settings_client, ugc_bridge, local_storage, callback_results_client, callbacks_client);
|
2020-10-09 13:48:09 +02:00
|
|
|
steam_screenshots = new Steam_Screenshots(local_storage, callbacks_client);
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_http = new Steam_HTTP(settings_client, network, callback_results_client, callbacks_client);
|
2019-09-10 14:54:54 -04:00
|
|
|
steam_controller = new Steam_Controller(settings_client, callback_results_client, callbacks_client, run_every_runcb);
|
2024-01-19 21:45:32 +02:00
|
|
|
steam_ugc = new Steam_UGC(settings_client, ugc_bridge, local_storage, callback_results_client, callbacks_client);
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_applist = new Steam_Applist();
|
|
|
|
steam_music = new Steam_Music(callbacks_client);
|
|
|
|
steam_musicremote = new Steam_MusicRemote();
|
|
|
|
steam_HTMLsurface = new Steam_HTMLsurface(settings_client, network, callback_results_client, callbacks_client);
|
2019-08-24 17:42:39 +02:00
|
|
|
steam_inventory = new Steam_Inventory(settings_client, callback_results_client, callbacks_client, run_every_runcb, local_storage);
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_video = new Steam_Video();
|
|
|
|
steam_parental = new Steam_Parental();
|
2022-01-26 12:03:08 -05:00
|
|
|
steam_networking_sockets = new Steam_Networking_Sockets(settings_client, network, callback_results_client, callbacks_client, run_every_runcb, NULL);
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_networking_sockets_serialized = new Steam_Networking_Sockets_Serialized(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
2020-09-14 19:53:56 -04:00
|
|
|
steam_networking_messages = new Steam_Networking_Messages(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_game_coordinator = new Steam_Game_Coordinator(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
|
|
|
steam_networking_utils = new Steam_Networking_Utils(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
|
|
|
steam_unified_messages = new Steam_Unified_Messages(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
|
|
|
steam_game_search = new Steam_Game_Search(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
|
|
|
steam_parties = new Steam_Parties(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
2019-07-28 09:02:09 -04:00
|
|
|
steam_remoteplay = new Steam_RemotePlay(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
2020-03-25 13:43:23 -04:00
|
|
|
steam_tv = new Steam_TV(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
2024-06-14 17:57:04 +03:00
|
|
|
steam_gamestats = new Steam_GameStats(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
2024-07-01 11:52:32 +03:00
|
|
|
steam_timeline = new Steam_Timeline(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
2024-10-09 22:34:03 +03:00
|
|
|
steam_app_disable_update = new Steam_App_Disable_Update(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
2024-12-06 22:45:10 +02:00
|
|
|
steam_billing = new Steam_Billing(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
2019-04-13 12:21:56 -04:00
|
|
|
|
2024-04-11 14:08:04 +02:00
|
|
|
// server
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("init gameserver");
|
2024-04-11 14:08:04 +02:00
|
|
|
callback_results_server = new SteamCallResults();
|
|
|
|
callbacks_server = new SteamCallBacks(callback_results_server);
|
|
|
|
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_gameserver = new Steam_GameServer(settings_server, network, callbacks_server);
|
2024-04-11 14:08:04 +02:00
|
|
|
steam_gameserver_utils = new Steam_Utils(settings_server, callback_results_server, callbacks_server, steam_overlay);
|
2024-03-23 07:22:47 +02:00
|
|
|
steam_gameserverstats = new Steam_GameServerStats(settings_server, network, callback_results_server, callbacks_server, run_every_runcb);
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_gameserver_networking = new Steam_Networking(settings_server, network, callbacks_server, run_every_runcb);
|
|
|
|
steam_gameserver_http = new Steam_HTTP(settings_server, network, callback_results_server, callbacks_server);
|
2019-08-24 17:42:39 +02:00
|
|
|
steam_gameserver_inventory = new Steam_Inventory(settings_server, callback_results_server, callbacks_server, run_every_runcb, local_storage);
|
2024-01-19 21:45:32 +02:00
|
|
|
steam_gameserver_ugc = new Steam_UGC(settings_server, ugc_bridge, local_storage, callback_results_server, callbacks_server);
|
2024-04-11 06:40:29 +02:00
|
|
|
steam_gameserver_apps = new Steam_Apps(settings_server, callback_results_server, callbacks_server);
|
2022-01-26 12:03:08 -05:00
|
|
|
steam_gameserver_networking_sockets = new Steam_Networking_Sockets(settings_server, network, callback_results_server, callbacks_server, run_every_runcb, steam_networking_sockets->get_shared_between_client_server());
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_gameserver_networking_sockets_serialized = new Steam_Networking_Sockets_Serialized(settings_server, network, callback_results_server, callbacks_server, run_every_runcb);
|
2020-09-14 19:53:56 -04:00
|
|
|
steam_gameserver_networking_messages = new Steam_Networking_Messages(settings_server, network, callback_results_server, callbacks_server, run_every_runcb);
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_gameserver_game_coordinator = new Steam_Game_Coordinator(settings_server, network, callback_results_server, callbacks_server, run_every_runcb);
|
2024-11-08 20:06:05 +02:00
|
|
|
steam_masterserver_updater = new Steam_Masterserver_Updater(settings_server, network, callback_results_server, callbacks_server, run_every_runcb, steam_gameserver);
|
2024-08-02 23:41:53 +03:00
|
|
|
steam_gameserver_gamestats = new Steam_GameStats(settings_server, network, callback_results_server, callbacks_server, run_every_runcb);
|
2019-04-13 12:21:56 -04:00
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("init AppTicket");
|
2024-01-08 22:32:20 +02:00
|
|
|
steam_app_ticket = new Steam_AppTicket(settings_client);
|
|
|
|
|
2021-04-09 14:53:20 -04:00
|
|
|
gameserver_has_ipv6_functions = false;
|
|
|
|
|
2020-02-14 15:01:10 -05:00
|
|
|
last_cb_run = 0;
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("end *********");
|
2024-04-20 01:13:10 +02:00
|
|
|
|
|
|
|
reset_LastError();
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Steam_Client::~Steam_Client()
|
|
|
|
{
|
2024-06-01 14:24:20 +03:00
|
|
|
#define DEL_INST(_obj_ins) do if (_obj_ins) { delete _obj_ins; _obj_ins = nullptr; } while(0)
|
|
|
|
|
2024-06-01 14:24:39 +03:00
|
|
|
DEL_INST(background_thread);
|
|
|
|
|
2024-06-01 14:24:20 +03:00
|
|
|
DEL_INST(steam_gameserver_utils);
|
|
|
|
DEL_INST(steam_gameserverstats);
|
|
|
|
DEL_INST(steam_gameserver_networking);
|
|
|
|
DEL_INST(steam_gameserver_http);
|
|
|
|
DEL_INST(steam_gameserver_inventory);
|
|
|
|
DEL_INST(steam_gameserver_ugc);
|
|
|
|
DEL_INST(steam_gameserver_apps);
|
|
|
|
DEL_INST(steam_gameserver_networking_sockets);
|
|
|
|
DEL_INST(steam_gameserver_networking_sockets_serialized);
|
|
|
|
DEL_INST(steam_gameserver_networking_messages);
|
|
|
|
DEL_INST(steam_gameserver_game_coordinator);
|
|
|
|
DEL_INST(steam_masterserver_updater);
|
2024-12-06 23:17:59 +02:00
|
|
|
DEL_INST(steam_gameserver);
|
|
|
|
DEL_INST(steam_gameserver_gamestats);
|
2024-06-01 14:24:20 +03:00
|
|
|
|
|
|
|
DEL_INST(steam_matchmaking);
|
|
|
|
DEL_INST(steam_matchmaking_servers);
|
|
|
|
DEL_INST(steam_user_stats);
|
|
|
|
DEL_INST(steam_apps);
|
|
|
|
DEL_INST(steam_networking);
|
|
|
|
DEL_INST(steam_remote_storage);
|
|
|
|
DEL_INST(steam_screenshots);
|
|
|
|
DEL_INST(steam_http);
|
|
|
|
DEL_INST(steam_controller);
|
|
|
|
DEL_INST(steam_ugc);
|
|
|
|
DEL_INST(steam_applist);
|
|
|
|
DEL_INST(steam_music);
|
|
|
|
DEL_INST(steam_musicremote);
|
|
|
|
DEL_INST(steam_HTMLsurface);
|
|
|
|
DEL_INST(steam_inventory);
|
|
|
|
DEL_INST(steam_video);
|
|
|
|
DEL_INST(steam_parental);
|
|
|
|
DEL_INST(steam_networking_sockets);
|
|
|
|
DEL_INST(steam_networking_sockets_serialized);
|
|
|
|
DEL_INST(steam_networking_messages);
|
|
|
|
DEL_INST(steam_game_coordinator);
|
|
|
|
DEL_INST(steam_networking_utils);
|
|
|
|
DEL_INST(steam_unified_messages);
|
|
|
|
DEL_INST(steam_game_search);
|
|
|
|
DEL_INST(steam_parties);
|
|
|
|
DEL_INST(steam_remoteplay);
|
|
|
|
DEL_INST(steam_tv);
|
2024-06-14 17:57:04 +03:00
|
|
|
DEL_INST(steam_gamestats);
|
2024-07-01 11:52:32 +03:00
|
|
|
DEL_INST(steam_timeline);
|
2024-10-09 22:34:03 +03:00
|
|
|
DEL_INST(steam_app_disable_update);
|
2024-12-06 22:45:10 +02:00
|
|
|
DEL_INST(steam_billing);
|
2024-06-01 14:24:20 +03:00
|
|
|
|
|
|
|
DEL_INST(steam_utils);
|
|
|
|
DEL_INST(steam_friends);
|
|
|
|
DEL_INST(steam_user);
|
|
|
|
DEL_INST(steam_overlay);
|
2024-12-06 23:17:59 +02:00
|
|
|
|
|
|
|
DEL_INST(steam_app_ticket);
|
2024-06-01 14:24:20 +03:00
|
|
|
|
|
|
|
DEL_INST(ugc_bridge);
|
|
|
|
|
|
|
|
DEL_INST(callbacks_server);
|
|
|
|
DEL_INST(callbacks_client);
|
|
|
|
DEL_INST(callback_results_server);
|
|
|
|
DEL_INST(callback_results_client);
|
|
|
|
|
|
|
|
DEL_INST(network);
|
|
|
|
DEL_INST(run_every_runcb);
|
|
|
|
|
|
|
|
#undef DEL_INST
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Steam_Client::userLogIn()
|
|
|
|
{
|
|
|
|
network->addListenId(settings_client->get_local_steam_id());
|
|
|
|
user_logged_in = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Steam_Client::serverInit()
|
|
|
|
{
|
|
|
|
server_init = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Steam_Client::IsServerInit()
|
|
|
|
{
|
|
|
|
return server_init;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Steam_Client::IsUserLogIn()
|
|
|
|
{
|
|
|
|
return user_logged_in;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Steam_Client::serverShutdown()
|
|
|
|
{
|
|
|
|
server_init = false;
|
|
|
|
}
|
|
|
|
|
2019-08-03 18:58:23 -04:00
|
|
|
void Steam_Client::clientShutdown()
|
|
|
|
{
|
|
|
|
user_logged_in = false;
|
|
|
|
}
|
|
|
|
|
2019-04-13 12:21:56 -04:00
|
|
|
void Steam_Client::setAppID(uint32 appid)
|
|
|
|
{
|
|
|
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
|
|
|
if (appid && !settings_client->get_local_game_id().AppID()) {
|
|
|
|
settings_client->set_game_id(CGameID(appid));
|
|
|
|
settings_server->set_game_id(CGameID(appid));
|
|
|
|
local_storage->setAppId(appid);
|
|
|
|
network->setAppID(appid);
|
2024-05-03 01:29:57 +03:00
|
|
|
|
|
|
|
std::string appid_str(std::to_string(appid));
|
|
|
|
set_env_variable("SteamAppId", appid_str);
|
|
|
|
set_env_variable("SteamGameId", appid_str);
|
2024-04-20 01:13:10 +02:00
|
|
|
|
|
|
|
if (!settings_client->disable_steamoverlaygameid_env_var) {
|
2024-05-03 01:29:57 +03:00
|
|
|
set_env_variable("SteamOverlayGameId", appid_str);
|
2024-04-20 01:13:10 +02:00
|
|
|
}
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Creates a communication pipe to the Steam client.
|
|
|
|
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
|
|
|
|
HSteamPipe Steam_Client::CreateSteamPipe()
|
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG_ENTRY();
|
2024-06-01 14:21:10 +03:00
|
|
|
if (!steam_pipe_counter) ++steam_pipe_counter;
|
|
|
|
HSteamPipe pipe = steam_pipe_counter;
|
|
|
|
++steam_pipe_counter;
|
|
|
|
PRINT_DEBUG(" returned pipe handle %i", pipe);
|
2020-01-15 10:11:37 -05:00
|
|
|
|
|
|
|
steam_pipes[pipe] = Steam_Pipe::NO_USER;
|
2024-06-01 14:21:10 +03:00
|
|
|
|
2020-01-15 10:11:37 -05:00
|
|
|
return pipe;
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Releases a previously created communications pipe
|
|
|
|
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
|
2023-12-18 14:45:35 +02:00
|
|
|
// "true if the pipe was valid and released successfully; otherwise, false"
|
|
|
|
// https://partner.steamgames.com/doc/api/ISteamClient
|
2019-04-13 12:21:56 -04:00
|
|
|
bool Steam_Client::BReleaseSteamPipe( HSteamPipe hSteamPipe )
|
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("%i", hSteamPipe);
|
2020-01-15 10:11:37 -05:00
|
|
|
if (steam_pipes.count(hSteamPipe)) {
|
2023-12-18 14:45:35 +02:00
|
|
|
return steam_pipes.erase(hSteamPipe) > 0;
|
2020-01-15 10:11:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// connects to an existing global user, failing if none exists
|
|
|
|
// used by the game to coordinate with the steamUI
|
|
|
|
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
|
|
|
|
HSteamUser Steam_Client::ConnectToGlobalUser( HSteamPipe hSteamPipe )
|
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("%i", hSteamPipe);
|
2020-01-15 10:11:37 -05:00
|
|
|
if (!steam_pipes.count(hSteamPipe)) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
userLogIn();
|
2024-03-14 19:23:39 +02:00
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
// games like appid 1740720 and 2379780 do not call SteamAPI_RunCallbacks() or SteamAPI_ManualDispatch_RunFrame() or Steam_BGetCallback()
|
|
|
|
// hence all run_callbacks() will never run, which might break the assumption that these callbacks are always run
|
|
|
|
// also networking callbacks won't run
|
|
|
|
// hence we spawn the background thread here which trigger all run_callbacks() and run networking callbacks
|
2024-06-04 13:15:44 +03:00
|
|
|
PRINT_DEBUG("started background thread");
|
2024-06-01 14:22:58 +03:00
|
|
|
background_thread->start(this);
|
2024-03-14 19:23:39 +02:00
|
|
|
|
2024-06-01 14:21:10 +03:00
|
|
|
steam_overlay->SetupOverlay();
|
2024-06-01 14:22:58 +03:00
|
|
|
|
2020-01-15 10:11:37 -05:00
|
|
|
steam_pipes[hSteamPipe] = Steam_Pipe::CLIENT;
|
2019-04-13 12:21:56 -04:00
|
|
|
return CLIENT_HSTEAMUSER;
|
|
|
|
}
|
|
|
|
|
|
|
|
// used by game servers, create a steam user that won't be shared with anyone else
|
|
|
|
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
|
|
|
|
HSteamUser Steam_Client::CreateLocalUser( HSteamPipe *phSteamPipe, EAccountType eAccountType )
|
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("%p %i", phSteamPipe, eAccountType);
|
2020-01-15 10:11:37 -05:00
|
|
|
//if (eAccountType == k_EAccountTypeIndividual) {
|
|
|
|
//Is this actually used?
|
|
|
|
//if (phSteamPipe) *phSteamPipe = CLIENT_STEAM_PIPE;
|
|
|
|
//return CLIENT_HSTEAMUSER;
|
|
|
|
//} else { //k_EAccountTypeGameServer
|
|
|
|
serverInit();
|
|
|
|
|
2024-06-01 14:23:33 +03:00
|
|
|
// gameservers don't call ConnectToGlobalUser(), instead they call this function
|
2024-06-04 13:15:44 +03:00
|
|
|
PRINT_DEBUG("started background thread");
|
2024-06-01 14:23:33 +03:00
|
|
|
background_thread->start(this);
|
|
|
|
|
2020-01-15 10:11:37 -05:00
|
|
|
HSteamPipe pipe = CreateSteamPipe();
|
|
|
|
if (phSteamPipe) *phSteamPipe = pipe;
|
|
|
|
steam_pipes[pipe] = Steam_Pipe::SERVER;
|
|
|
|
steamclient_server_inited = true;
|
|
|
|
return SERVER_HSTEAMUSER;
|
|
|
|
//}
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
HSteamUser Steam_Client::CreateLocalUser( HSteamPipe *phSteamPipe )
|
|
|
|
{
|
|
|
|
return CreateLocalUser(phSteamPipe, k_EAccountTypeGameServer);
|
|
|
|
}
|
|
|
|
|
|
|
|
// removes an allocated user
|
|
|
|
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
|
|
|
|
void Steam_Client::ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser )
|
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG_ENTRY();
|
2020-01-15 10:11:37 -05:00
|
|
|
if (hUser == SERVER_HSTEAMUSER && steam_pipes.count(hSteamPipe)) {
|
|
|
|
steamclient_server_inited = false;
|
|
|
|
}
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// set the local IP and Port to bind to
|
|
|
|
// this must be set before CreateLocalUser()
|
|
|
|
void Steam_Client::SetLocalIPBinding( uint32 unIP, uint16 usPort )
|
|
|
|
{
|
2024-05-05 04:24:51 +03:00
|
|
|
PRINT_DEBUG("old %u %hu // TODO", unIP, usPort);
|
2019-12-09 12:49:55 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void Steam_Client::SetLocalIPBinding( const SteamIPAddress_t &unIP, uint16 usPort )
|
|
|
|
{
|
2024-05-05 04:24:51 +03:00
|
|
|
PRINT_DEBUG("%i %u %hu // TODO", unIP.m_eType, unIP.m_unIPv4, usPort);
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Deprecated. Applications should use SteamAPI_RunCallbacks() or SteamGameServer_RunCallbacks() instead.
|
|
|
|
void Steam_Client::RunFrame()
|
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG_TODO();
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// returns the number of IPC calls made since the last time this function was called
|
|
|
|
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
|
|
|
// Every IPC call is at minimum a thread context switch if not a process one so you want to rate
|
|
|
|
// control how often you do them.
|
|
|
|
uint32 Steam_Client::GetIPCCallCount()
|
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG_ENTRY();
|
2019-04-13 12:21:56 -04:00
|
|
|
return steam_utils->GetIPCCallCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
// API warning handling
|
|
|
|
// 'int' is the severity; 0 for msg, 1 for warning
|
|
|
|
// 'const char *' is the text of the message
|
|
|
|
// callbacks will occur directly after the API function is called that generated the warning or message.
|
|
|
|
void Steam_Client::SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction )
|
|
|
|
{
|
2024-05-05 04:24:51 +03:00
|
|
|
PRINT_DEBUG("%p // TODO", pFunction);
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Trigger global shutdown for the DLL
|
|
|
|
bool Steam_Client::BShutdownIfAllPipesClosed()
|
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG_ENTRY();
|
|
|
|
if (steam_pipes.size()) return false; // not all pipes are released via BReleaseSteamPipe() yet
|
|
|
|
|
2024-06-04 13:15:44 +03:00
|
|
|
PRINT_DEBUG("killing background thread...");
|
2024-06-01 14:22:58 +03:00
|
|
|
background_thread->kill();
|
2024-06-04 13:15:44 +03:00
|
|
|
PRINT_DEBUG("killed background thread");
|
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
steam_controller->Shutdown();
|
2024-06-01 14:21:10 +03:00
|
|
|
steam_overlay->UnSetupOverlay();
|
2020-01-15 12:40:18 -05:00
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("all pipes closed");
|
|
|
|
return true;
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Helper functions for internal Steam usage
|
|
|
|
void Steam_Client::DEPRECATED_Set_SteamAPI_CPostAPIResultInProcess( void (*)() )
|
|
|
|
{
|
2024-05-05 04:24:51 +03:00
|
|
|
PRINT_DEBUG_TODO();
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Steam_Client::DEPRECATED_Remove_SteamAPI_CPostAPIResultInProcess( void (*)() )
|
|
|
|
{
|
2024-05-05 04:24:51 +03:00
|
|
|
PRINT_DEBUG_TODO();
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Steam_Client::Set_SteamAPI_CCheckCallbackRegisteredInProcess( SteamAPI_CheckCallbackRegistered_t func )
|
|
|
|
{
|
2024-05-05 04:24:51 +03:00
|
|
|
PRINT_DEBUG("%p // TODO", func);
|
2023-12-19 22:17:29 +02:00
|
|
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Steam_Client::Set_SteamAPI_CPostAPIResultInProcess( SteamAPI_PostAPIResultInProcess_t func )
|
|
|
|
{
|
2024-05-05 04:24:51 +03:00
|
|
|
PRINT_DEBUG_TODO();
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Steam_Client::Remove_SteamAPI_CPostAPIResultInProcess( SteamAPI_PostAPIResultInProcess_t func )
|
|
|
|
{
|
2024-05-05 04:24:51 +03:00
|
|
|
PRINT_DEBUG_TODO();
|
2024-01-08 22:32:20 +02:00
|
|
|
}
|
|
|
|
|
2019-04-13 12:21:56 -04:00
|
|
|
void Steam_Client::RegisterCallback( class CCallbackBase *pCallback, int iCallback)
|
|
|
|
{
|
|
|
|
int base_callback = (iCallback / 100) * 100;
|
|
|
|
int callback_id = iCallback % 100;
|
|
|
|
bool isGameServer = CCallbackMgr::isServer(pCallback);
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("isGameServer %u %i %i", isGameServer, iCallback, base_callback);
|
2019-04-13 12:21:56 -04:00
|
|
|
|
|
|
|
switch (base_callback) {
|
|
|
|
case k_iSteamUserCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamUserCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameServerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameServerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamFriendsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamFriendsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamBillingCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamBillingCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamMatchmakingCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamMatchmakingCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamContentServerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamContentServerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamUtilsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamUtilsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientFriendsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientFriendsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientUserCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientUserCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamAppsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamAppsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamUserStatsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamUserStatsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamNetworkingCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamNetworkingCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientRemoteStorageCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientRemoteStorageCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientDepotBuilderCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientDepotBuilderCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameServerItemsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameServerItemsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientUtilsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientUtilsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameCoordinatorCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameCoordinatorCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameServerStatsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameServerStatsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteam2AsyncCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteam2AsyncCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameStatsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameStatsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientHTTPCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientHTTPCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientScreenshotsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientScreenshotsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamScreenshotsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamScreenshotsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientAudioCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientAudioCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientUnifiedMessagesCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientUnifiedMessagesCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamStreamLauncherCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamStreamLauncherCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientControllerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientControllerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamControllerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamControllerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientParentalSettingsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientParentalSettingsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientDeviceAuthCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientDeviceAuthCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientNetworkDeviceManagerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientNetworkDeviceManagerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientMusicCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientMusicCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientRemoteClientManagerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientRemoteClientManagerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientUGCCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientUGCCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamStreamClientCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamStreamClientCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_IClientProductBuilderCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_IClientProductBuilderCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientShortcutsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientShortcutsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientRemoteControlManagerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientRemoteControlManagerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamAppListCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamAppListCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamMusicCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamMusicCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamMusicRemoteCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamMusicRemoteCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientVRCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientVRCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientGameNotificationCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientGameNotificationCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameNotificationCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameNotificationCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamHTMLSurfaceCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamHTMLSurfaceCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientVideoCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientVideoCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientInventoryCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientInventoryCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientBluetoothManagerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientBluetoothManagerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientSharedConnectionCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientSharedConnectionCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_ISteamParentalSettingsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_ISteamParentalSettingsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientShaderCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientShaderCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("Unknown callback base %i", base_callback);
|
2019-04-13 12:21:56 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
if (isGameServer) {
|
|
|
|
callbacks_server->addCallBack(iCallback, pCallback);
|
|
|
|
} else {
|
|
|
|
callbacks_client->addCallBack(iCallback, pCallback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Steam_Client::UnregisterCallback( class CCallbackBase *pCallback)
|
|
|
|
{
|
|
|
|
int iCallback = pCallback->GetICallback();
|
|
|
|
int base_callback = (iCallback / 100) * 100;
|
|
|
|
int callback_id = iCallback % 100;
|
|
|
|
bool isGameServer = CCallbackMgr::isServer(pCallback);
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("isGameServer %u %i", isGameServer, base_callback);
|
2019-04-13 12:21:56 -04:00
|
|
|
|
|
|
|
switch (base_callback) {
|
|
|
|
case k_iSteamUserCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamUserCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameServerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameServerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamFriendsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamFriendsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamBillingCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamBillingCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamMatchmakingCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamMatchmakingCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamContentServerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamContentServerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamUtilsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamUtilsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientFriendsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientFriendsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientUserCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientUserCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamAppsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamAppsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamUserStatsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamUserStatsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamNetworkingCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamNetworkingCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientRemoteStorageCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientRemoteStorageCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientDepotBuilderCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientDepotBuilderCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameServerItemsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameServerItemsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientUtilsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientUtilsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameCoordinatorCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameCoordinatorCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameServerStatsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameServerStatsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteam2AsyncCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteam2AsyncCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameStatsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameStatsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientHTTPCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientHTTPCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientScreenshotsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientScreenshotsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamScreenshotsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamScreenshotsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientAudioCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientAudioCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientUnifiedMessagesCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientUnifiedMessagesCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamStreamLauncherCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamStreamLauncherCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientControllerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientControllerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamControllerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamControllerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientParentalSettingsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientParentalSettingsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientDeviceAuthCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientDeviceAuthCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientNetworkDeviceManagerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientNetworkDeviceManagerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientMusicCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientMusicCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientRemoteClientManagerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientRemoteClientManagerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientUGCCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientUGCCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamStreamClientCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamStreamClientCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_IClientProductBuilderCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_IClientProductBuilderCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientShortcutsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientShortcutsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientRemoteControlManagerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientRemoteControlManagerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamAppListCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamAppListCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamMusicCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamMusicCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamMusicRemoteCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamMusicRemoteCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientVRCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientVRCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientGameNotificationCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientGameNotificationCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamGameNotificationCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamGameNotificationCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iSteamHTMLSurfaceCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iSteamHTMLSurfaceCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientVideoCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientVideoCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientInventoryCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientInventoryCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientBluetoothManagerCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientBluetoothManagerCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientSharedConnectionCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientSharedConnectionCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_ISteamParentalSettingsCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_ISteamParentalSettingsCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case k_iClientShaderCallbacks:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("k_iClientShaderCallbacks %i", callback_id);
|
2019-04-13 12:21:56 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("Unknown callback base %i", base_callback);
|
2019-04-13 12:21:56 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
if (isGameServer) {
|
|
|
|
callbacks_server->rmCallBack(iCallback, pCallback);
|
|
|
|
} else {
|
|
|
|
callbacks_client->rmCallBack(iCallback, pCallback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Steam_Client::RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall)
|
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("%llu %i", hAPICall, pCallback->GetICallback());
|
2019-04-13 12:21:56 -04:00
|
|
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
|
|
|
callback_results_client->addCallBack(hAPICall, pCallback);
|
|
|
|
callback_results_server->addCallBack(hAPICall, pCallback);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void Steam_Client::UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall)
|
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("%llu %i", hAPICall, pCallback->GetICallback());
|
2019-04-13 12:21:56 -04:00
|
|
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
|
|
|
callback_results_client->rmCallBack(hAPICall, pCallback);
|
|
|
|
callback_results_server->rmCallBack(hAPICall, pCallback);
|
|
|
|
}
|
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
void Steam_Client::RunCallbacks(bool runClientCB, bool runGameserverCB)
|
2019-04-13 12:21:56 -04:00
|
|
|
{
|
2024-04-06 08:14:37 +02:00
|
|
|
PRINT_DEBUG("begin ------------------------------------------------------");
|
2019-04-13 12:21:56 -04:00
|
|
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
2024-04-06 08:14:37 +02:00
|
|
|
cb_run_active = true;
|
2019-04-13 12:21:56 -04:00
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
// PRINT_DEBUG("network *********");
|
|
|
|
network->Run(); // networking must run first since it receives messages use by each run_callback()
|
2024-03-16 05:19:04 +02:00
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
// PRINT_DEBUG("steam_matchmaking_servers *********");
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_matchmaking_servers->RunCallbacks();
|
2024-03-16 05:19:04 +02:00
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
// PRINT_DEBUG("run_every_runcb *********");
|
2019-04-13 12:21:56 -04:00
|
|
|
run_every_runcb->run();
|
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
// PRINT_DEBUG("steam_gameserver *********");
|
2019-04-13 12:21:56 -04:00
|
|
|
steam_gameserver->RunCallbacks();
|
|
|
|
|
|
|
|
if (runClientCB) {
|
2024-04-06 08:14:37 +02:00
|
|
|
// PRINT_DEBUG("callback_results_client *********");
|
2019-04-13 12:21:56 -04:00
|
|
|
callback_results_client->runCallResults();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (runGameserverCB) {
|
2024-04-06 08:14:37 +02:00
|
|
|
// PRINT_DEBUG("callback_results_server *********");
|
2019-04-13 12:21:56 -04:00
|
|
|
callback_results_server->runCallResults();
|
|
|
|
}
|
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
// PRINT_DEBUG("callbacks_server *********");
|
2019-04-13 12:21:56 -04:00
|
|
|
callbacks_server->runCallBacks();
|
2024-03-16 05:19:04 +02:00
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
// PRINT_DEBUG("callbacks_client *********");
|
2019-04-13 12:21:56 -04:00
|
|
|
callbacks_client->runCallBacks();
|
2024-03-16 05:19:04 +02:00
|
|
|
|
2024-04-06 08:14:37 +02:00
|
|
|
last_cb_run = (unsigned long long)std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
|
|
|
|
cb_run_active = false;
|
|
|
|
PRINT_DEBUG("done ******************************************************");
|
2019-04-13 12:21:56 -04:00
|
|
|
}
|
2019-12-09 12:49:55 -05:00
|
|
|
|
|
|
|
void Steam_Client::DestroyAllInterfaces()
|
|
|
|
{
|
2024-05-03 01:29:57 +03:00
|
|
|
PRINT_DEBUG_TODO();
|
2020-11-18 10:15:24 -05:00
|
|
|
}
|
2024-12-06 22:49:02 +02:00
|
|
|
|
|
|
|
// older sdk ----------------------------------------------------------
|
|
|
|
|
|
|
|
// 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 Steam_Client::CreateGlobalUser( HSteamPipe *phSteamPipe )
|
|
|
|
{
|
|
|
|
// TODO not sure if this implementation is correct
|
|
|
|
PRINT_DEBUG_TODO();
|
|
|
|
for (const auto& [pipe_handle, pipe_type] : steam_pipes) {
|
|
|
|
if (pipe_type == Steam_Pipe::CLIENT) {
|
|
|
|
if (phSteamPipe) *phSteamPipe = pipe_handle;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
HSteamPipe pipe = CreateSteamPipe();
|
|
|
|
if (phSteamPipe) *phSteamPipe = pipe;
|
|
|
|
|
|
|
|
steam_pipes[pipe] = Steam_Pipe::CLIENT;
|
|
|
|
return CLIENT_HSTEAMUSER;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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 *Steam_Client::GetIVAC( HSteamUser hSteamUser )
|
|
|
|
{
|
|
|
|
PRINT_DEBUG_ENTRY();
|
|
|
|
// actual value from steamclient64.dll
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
// returns the name of a universe
|
|
|
|
const char *Steam_Client::GetUniverseName( EUniverse eUniverse )
|
|
|
|
{
|
|
|
|
PRINT_DEBUG("%i", (int)eUniverse);
|
|
|
|
// actual values returned by steamclient64.dll
|
|
|
|
switch (eUniverse)
|
|
|
|
{
|
|
|
|
case EUniverse::k_EUniverseInvalid: return "Invalid";
|
|
|
|
case EUniverse::k_EUniversePublic: return "Public";
|
|
|
|
case EUniverse::k_EUniverseBeta: return "Beta";
|
|
|
|
case EUniverse::k_EUniverseInternal: return "Internal";
|
|
|
|
case EUniverse::k_EUniverseDev: return "Dev";
|
|
|
|
}
|
|
|
|
|
|
|
|
return "Unknown";
|
|
|
|
}
|
|
|
|
// older sdk ----------------------------------------------------------
|