Compare commits
No commits in common. "e0af31894851ffb39cba1ee8aa9fb8d37cca0ac7" and "3f44827326eff6d9cc385c27f0bded89ee7642ea" have entirely different histories.
e0af318948
...
3f44827326
10
dll/dll.cpp
10
dll/dll.cpp
|
@ -193,17 +193,17 @@ STEAMAPI_API void * S_CALLTYPE SteamInternal_CreateInterface( const char *ver )
|
||||||
return create_client_interface(ver);
|
return create_client_interface(ver);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uintp global_counter;
|
|
||||||
struct ContextInitData { void (*pFn)(void* pCtx); uintp counter; CSteamAPIContext ctx; };
|
struct ContextInitData { void (*pFn)(void* pCtx); uintp counter; CSteamAPIContext ctx; };
|
||||||
|
|
||||||
STEAMAPI_API void * S_CALLTYPE SteamInternal_ContextInit( void *pContextInitData )
|
STEAMAPI_API void * S_CALLTYPE SteamInternal_ContextInit( void *pContextInitData )
|
||||||
{
|
{
|
||||||
//PRINT_DEBUG("SteamInternal_ContextInit\n");
|
//PRINT_DEBUG("SteamInternal_ContextInit\n");
|
||||||
struct ContextInitData *contextInitData = (struct ContextInitData *)pContextInitData;
|
struct ContextInitData *contextInitData = (struct ContextInitData *)pContextInitData;
|
||||||
if (contextInitData->counter != global_counter) {
|
if (!contextInitData->counter) {
|
||||||
PRINT_DEBUG("SteamInternal_ContextInit initializing\n");
|
PRINT_DEBUG("SteamInternal_ContextInit initializing\n");
|
||||||
contextInitData->pFn(&contextInitData->ctx);
|
contextInitData->pFn(&contextInitData->ctx);
|
||||||
contextInitData->counter = global_counter;
|
//this is hackish but whatever.
|
||||||
|
if (contextInitData->ctx.SteamUser()) contextInitData->counter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return &contextInitData->ctx;
|
return &contextInitData->ctx;
|
||||||
|
@ -224,7 +224,6 @@ STEAMAPI_API bool S_CALLTYPE SteamAPI_Init()
|
||||||
Steam_Client* client = get_steam_client();
|
Steam_Client* client = get_steam_client();
|
||||||
user_steam_pipe = client->CreateSteamPipe();
|
user_steam_pipe = client->CreateSteamPipe();
|
||||||
client->ConnectToGlobalUser(user_steam_pipe);
|
client->ConnectToGlobalUser(user_steam_pipe);
|
||||||
global_counter++;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,7 +263,6 @@ STEAMAPI_API void S_CALLTYPE SteamAPI_Shutdown()
|
||||||
get_steam_client()->clientShutdown();
|
get_steam_client()->clientShutdown();
|
||||||
get_steam_client()->BReleaseSteamPipe(user_steam_pipe);
|
get_steam_client()->BReleaseSteamPipe(user_steam_pipe);
|
||||||
user_steam_pipe = 0;
|
user_steam_pipe = 0;
|
||||||
--global_counter;
|
|
||||||
old_user_instance = NULL;
|
old_user_instance = NULL;
|
||||||
old_friends_interface = NULL;
|
old_friends_interface = NULL;
|
||||||
old_utils_interface = NULL;
|
old_utils_interface = NULL;
|
||||||
|
@ -596,7 +594,6 @@ STEAMAPI_API bool S_CALLTYPE SteamInternal_GameServer_Init( uint32 unIP, uint16
|
||||||
PRINT_DEBUG("SteamInternal_GameServer_Init %u %hu %hu %hu %u %s\n", unIP, usPort, usGamePort, usQueryPort, eServerMode, pchVersionString);
|
PRINT_DEBUG("SteamInternal_GameServer_Init %u %hu %hu %hu %u %s\n", unIP, usPort, usGamePort, usQueryPort, eServerMode, pchVersionString);
|
||||||
load_old_interface_versions();
|
load_old_interface_versions();
|
||||||
get_steam_client()->CreateLocalUser(&server_steam_pipe, k_EAccountTypeGameServer);
|
get_steam_client()->CreateLocalUser(&server_steam_pipe, k_EAccountTypeGameServer);
|
||||||
++global_counter;
|
|
||||||
//g_pSteamClientGameServer is only used in pre 1.37 (where the interface versions are not provided by the game)
|
//g_pSteamClientGameServer is only used in pre 1.37 (where the interface versions are not provided by the game)
|
||||||
g_pSteamClientGameServer = SteamGameServerClient();
|
g_pSteamClientGameServer = SteamGameServerClient();
|
||||||
uint32 unFlags = 0;
|
uint32 unFlags = 0;
|
||||||
|
@ -653,7 +650,6 @@ STEAMAPI_API void SteamGameServer_Shutdown()
|
||||||
get_steam_client()->serverShutdown();
|
get_steam_client()->serverShutdown();
|
||||||
get_steam_client()->BReleaseSteamPipe(server_steam_pipe);
|
get_steam_client()->BReleaseSteamPipe(server_steam_pipe);
|
||||||
server_steam_pipe = 0;
|
server_steam_pipe = 0;
|
||||||
--global_counter;
|
|
||||||
g_pSteamClientGameServer = NULL; //TODO: check if this actually gets nulled when SteamGameServer_Shutdown is called
|
g_pSteamClientGameServer = NULL; //TODO: check if this actually gets nulled when SteamGameServer_Shutdown is called
|
||||||
old_gameserver_instance = NULL;
|
old_gameserver_instance = NULL;
|
||||||
old_gamserver_utils_instance = NULL;
|
old_gamserver_utils_instance = NULL;
|
||||||
|
|
|
@ -123,7 +123,6 @@ void Steam_Overlay::SetNotificationInset(int nHorizontalInset, int nVerticalInse
|
||||||
|
|
||||||
void Steam_Overlay::SetupOverlay()
|
void Steam_Overlay::SetupOverlay()
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("%s\n", __FUNCTION__);
|
|
||||||
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
|
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
|
||||||
if (!setup_overlay_called)
|
if (!setup_overlay_called)
|
||||||
{
|
{
|
||||||
|
@ -600,20 +599,19 @@ void Steam_Overlay::CreateFonts()
|
||||||
// Try to make this function as short as possible or it might affect game's fps.
|
// Try to make this function as short as possible or it might affect game's fps.
|
||||||
void Steam_Overlay::OverlayProc()
|
void Steam_Overlay::OverlayProc()
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
|
||||||
|
|
||||||
if (!Ready())
|
if (!Ready())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|
||||||
ImGui::PushFont(font_notif);
|
ImGui::PushFont(font_notif);
|
||||||
overlay_mutex.lock();
|
|
||||||
BuildNotifications(io.DisplaySize.x, io.DisplaySize.y);
|
BuildNotifications(io.DisplaySize.x, io.DisplaySize.y);
|
||||||
overlay_mutex.unlock();
|
|
||||||
ImGui::PopFont();
|
ImGui::PopFont();
|
||||||
|
|
||||||
if (show_overlay)
|
if (show_overlay)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
|
|
||||||
int friend_size = friends.size();
|
int friend_size = friends.size();
|
||||||
|
|
||||||
// Set the overlay windows to the size of the game window
|
// Set the overlay windows to the size of the game window
|
||||||
|
@ -695,6 +693,7 @@ void Steam_Overlay::Callback(Common_Message *msg)
|
||||||
|
|
||||||
void Steam_Overlay::RunCallbacks()
|
void Steam_Overlay::RunCallbacks()
|
||||||
{
|
{
|
||||||
|
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
|
||||||
if (overlay_state_changed)
|
if (overlay_state_changed)
|
||||||
{
|
{
|
||||||
GameOverlayActivated_t data = { 0 };
|
GameOverlayActivated_t data = { 0 };
|
||||||
|
@ -707,7 +706,6 @@ void Steam_Overlay::RunCallbacks()
|
||||||
Steam_Friends* steamFriends = get_steam_client()->steam_friends;
|
Steam_Friends* steamFriends = get_steam_client()->steam_friends;
|
||||||
Steam_Matchmaking* steamMatchmaking = get_steam_client()->steam_matchmaking;
|
Steam_Matchmaking* steamMatchmaking = get_steam_client()->steam_matchmaking;
|
||||||
|
|
||||||
std::lock_guard<std::recursive_mutex> lock(overlay_mutex);
|
|
||||||
while (!has_friend_action.empty())
|
while (!has_friend_action.empty())
|
||||||
{
|
{
|
||||||
auto friend_info = friends.find(has_friend_action.front());
|
auto friend_info = friends.find(has_friend_action.front());
|
||||||
|
|
Loading…
Reference in New Issue