More accurate behavior.

merge-requests/6/head
Mr_Goldberg 2019-05-11 14:44:06 -04:00
parent 7938d1f5c9
commit c20944ca0a
No known key found for this signature in database
GPG Key ID: 8597D87419DEF278
3 changed files with 43 additions and 9 deletions

View File

@ -107,6 +107,7 @@ static void load_old_interface_versions()
S_API HSteamUser SteamAPI_GetHSteamUser() S_API HSteamUser SteamAPI_GetHSteamUser()
{ {
PRINT_DEBUG("SteamAPI_GetHSteamUser\n"); PRINT_DEBUG("SteamAPI_GetHSteamUser\n");
if (!get_steam_client()->user_logged_in) return 0;
return CLIENT_HSTEAMUSER; return CLIENT_HSTEAMUSER;
} }
@ -379,8 +380,8 @@ S_API void Steam_RegisterInterfaceFuncs( void *hModule )
S_API HSteamUser Steam_GetHSteamUserCurrent() S_API HSteamUser Steam_GetHSteamUserCurrent()
{ {
PRINT_DEBUG("Steam_GetHSteamUserCurrent\n"); PRINT_DEBUG("Steam_GetHSteamUserCurrent\n");
//TODO? //TODO
return CLIENT_HSTEAMUSER; return SteamAPI_GetHSteamUser();
} }
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name. // returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name.
@ -399,6 +400,7 @@ S_API const char *SteamAPI_GetSteamInstallPath()
S_API HSteamPipe SteamAPI_GetHSteamPipe() S_API HSteamPipe SteamAPI_GetHSteamPipe()
{ {
PRINT_DEBUG("SteamAPI_GetHSteamPipe\n"); PRINT_DEBUG("SteamAPI_GetHSteamPipe\n");
if (!get_steam_client()->user_logged_in) return 0;
return CLIENT_STEAM_PIPE; return CLIENT_STEAM_PIPE;
} }
@ -412,13 +414,13 @@ S_API void SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks )
S_API HSteamPipe GetHSteamPipe() S_API HSteamPipe GetHSteamPipe()
{ {
PRINT_DEBUG("GetHSteamPipe\n"); PRINT_DEBUG("GetHSteamPipe\n");
return CLIENT_STEAM_PIPE; return SteamAPI_GetHSteamPipe();
} }
S_API HSteamUser GetHSteamUser() S_API HSteamUser GetHSteamUser()
{ {
PRINT_DEBUG("GetHSteamUser\n"); PRINT_DEBUG("GetHSteamUser\n");
return CLIENT_HSTEAMUSER; return SteamAPI_GetHSteamUser();
} }
@ -469,12 +471,14 @@ S_API void * S_CALLTYPE SteamGameServerInternal_CreateInterface( const char *ver
S_API HSteamPipe S_CALLTYPE SteamGameServer_GetHSteamPipe() S_API HSteamPipe S_CALLTYPE SteamGameServer_GetHSteamPipe()
{ {
PRINT_DEBUG("SteamGameServer_GetHSteamPipe\n"); PRINT_DEBUG("SteamGameServer_GetHSteamPipe\n");
if (!get_steam_client()->server_init) return 0;
return SERVER_STEAM_PIPE; return SERVER_STEAM_PIPE;
} }
S_API HSteamUser S_CALLTYPE SteamGameServer_GetHSteamUser() S_API HSteamUser S_CALLTYPE SteamGameServer_GetHSteamUser()
{ {
PRINT_DEBUG("SteamGameServer_GetHSteamUser\n"); PRINT_DEBUG("SteamGameServer_GetHSteamUser\n");
if (!get_steam_client()->server_init) return 0;
return SERVER_HSTEAMUSER; return SERVER_HSTEAMUSER;
} }
@ -488,7 +492,7 @@ S_API bool S_CALLTYPE SteamInternal_GameServer_Init( uint32 unIP, uint16 usPort,
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);
SteamGameServerClient(); SteamGameServerClient();
get_steam_client()->serverInit(); get_steam_client()->serverInit();
return get_steam_client()->GetISteamGameServer(SERVER_HSTEAMUSER, SERVER_STEAM_PIPE, /* TODO: figure out right interface version */old_gameserver)->InitGameServer(unIP, usGamePort, usQueryPort, eServerMode, 0, pchVersionString); return get_steam_client()->steam_gameserver->InitGameServer(unIP, usGamePort, usQueryPort, eServerMode, 0, pchVersionString);
} }
S_API bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ) S_API bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString )
@ -511,15 +515,13 @@ S_API void SteamGameServer_RunCallbacks()
S_API bool SteamGameServer_BSecure() S_API bool SteamGameServer_BSecure()
{ {
PRINT_DEBUG("SteamGameServer_BSecure\n"); PRINT_DEBUG("SteamGameServer_BSecure\n");
return true; return get_steam_client()->steam_gameserver->BSecure();
} }
S_API uint64 SteamGameServer_GetSteamID() S_API uint64 SteamGameServer_GetSteamID()
{ {
PRINT_DEBUG("SteamGameServer_GetSteamID\n"); PRINT_DEBUG("SteamGameServer_GetSteamID\n");
ISteamGameServer *gs = get_steam_client()->GetISteamGameServer(SERVER_HSTEAMUSER, SERVER_STEAM_PIPE, /* TODO: figure out right interface version */old_gameserver); return get_steam_client()->steam_gameserver->GetSteamID().ConvertToUint64();
if (!gs) return 0;
return gs->GetSteamID().ConvertToUint64();
} }
S_API ISteamClient *SteamGameServerClient() { S_API ISteamClient *SteamGameServerClient() {

View File

@ -437,6 +437,7 @@ void Steam_Client::ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser )
ISteamUser *Steam_Client::GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamUser *Steam_Client::GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamUser %s\n", pchVersion); PRINT_DEBUG("GetISteamUser %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
if (strcmp(pchVersion, "SteamUser009") == 0) { if (strcmp(pchVersion, "SteamUser009") == 0) {
@ -474,6 +475,7 @@ ISteamUser *Steam_Client::GetISteamUser( HSteamUser hSteamUser, HSteamPipe hStea
ISteamGameServer *Steam_Client::GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamGameServer *Steam_Client::GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamGameServer %s\n", pchVersion); PRINT_DEBUG("GetISteamGameServer %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (!server_init) return NULL; if (!server_init) return NULL;
return steam_gameserver; return steam_gameserver;
} }
@ -489,6 +491,7 @@ void Steam_Client::SetLocalIPBinding( uint32 unIP, uint16 usPort )
ISteamFriends *Steam_Client::GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamFriends *Steam_Client::GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamFriends %s\n", pchVersion); PRINT_DEBUG("GetISteamFriends %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
if (strcmp(pchVersion, "SteamFriends004") == 0) { if (strcmp(pchVersion, "SteamFriends004") == 0) {
@ -530,6 +533,7 @@ ISteamFriends *Steam_Client::GetISteamFriends( HSteamUser hSteamUser, HSteamPipe
ISteamUtils *Steam_Client::GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) ISteamUtils *Steam_Client::GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamUtils %s\n", pchVersion); PRINT_DEBUG("GetISteamUtils %s\n", pchVersion);
if (!hSteamPipe) return NULL;
Steam_Utils *steam_utils_temp; Steam_Utils *steam_utils_temp;
@ -567,6 +571,7 @@ ISteamUtils *Steam_Client::GetISteamUtils( HSteamPipe hSteamPipe, const char *pc
ISteamMatchmaking *Steam_Client::GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamMatchmaking *Steam_Client::GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamMatchmaking %s\n", pchVersion); PRINT_DEBUG("GetISteamMatchmaking %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
if (strcmp(pchVersion, "SteamMatchMaking001") == 0) { if (strcmp(pchVersion, "SteamMatchMaking001") == 0) {
@ -604,6 +609,7 @@ ISteamMatchmaking *Steam_Client::GetISteamMatchmaking( HSteamUser hSteamUser, HS
ISteamMatchmakingServers *Steam_Client::GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamMatchmakingServers *Steam_Client::GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamMatchmakingServers %s\n", pchVersion); PRINT_DEBUG("GetISteamMatchmakingServers %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
return steam_matchmaking_servers; return steam_matchmaking_servers;
} }
@ -612,6 +618,7 @@ ISteamMatchmakingServers *Steam_Client::GetISteamMatchmakingServers( HSteamUser
void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamGenericInterface %s\n", pchVersion); PRINT_DEBUG("GetISteamGenericInterface %s\n", pchVersion);
if (!hSteamPipe) return NULL;
bool server = false; bool server = false;
if (hSteamUser == SERVER_HSTEAMUSER) { if (hSteamUser == SERVER_HSTEAMUSER) {
@ -732,6 +739,7 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe
ISteamUserStats *Steam_Client::GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamUserStats *Steam_Client::GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamUserStats %s\n", pchVersion); PRINT_DEBUG("GetISteamUserStats %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
if (strcmp(pchVersion, "STEAMUSERSTATS_INTERFACE_VERSION001") == 0) { if (strcmp(pchVersion, "STEAMUSERSTATS_INTERFACE_VERSION001") == 0) {
@ -769,6 +777,7 @@ ISteamUserStats *Steam_Client::GetISteamUserStats( HSteamUser hSteamUser, HSteam
ISteamGameServerStats *Steam_Client::GetISteamGameServerStats( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamGameServerStats *Steam_Client::GetISteamGameServerStats( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamGameServerStats %s\n", pchVersion); PRINT_DEBUG("GetISteamGameServerStats %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
return steam_gameserverstats; return steam_gameserverstats;
} }
@ -776,6 +785,7 @@ ISteamGameServerStats *Steam_Client::GetISteamGameServerStats( HSteamUser hSteam
ISteamApps *Steam_Client::GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamApps *Steam_Client::GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamApps %s\n", pchVersion); PRINT_DEBUG("GetISteamApps %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (hSteamUser == SERVER_HSTEAMUSER) { if (hSteamUser == SERVER_HSTEAMUSER) {
return steam_gameserver_apps; return steam_gameserver_apps;
} }
@ -788,6 +798,7 @@ ISteamApps *Steam_Client::GetISteamApps( HSteamUser hSteamUser, HSteamPipe hStea
ISteamNetworking *Steam_Client::GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamNetworking *Steam_Client::GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamNetworking %s\n", pchVersion); PRINT_DEBUG("GetISteamNetworking %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
Steam_Networking *steam_networking_temp; Steam_Networking *steam_networking_temp;
@ -819,6 +830,7 @@ ISteamNetworking *Steam_Client::GetISteamNetworking( HSteamUser hSteamUser, HSte
ISteamRemoteStorage *Steam_Client::GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamRemoteStorage *Steam_Client::GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamRemoteStorage %s\n", pchVersion); PRINT_DEBUG("GetISteamRemoteStorage %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
if (strcmp(pchVersion, "STEAMREMOTESTORAGE_INTERFACE_VERSION001") == 0) { if (strcmp(pchVersion, "STEAMREMOTESTORAGE_INTERFACE_VERSION001") == 0) {
@ -860,6 +872,7 @@ ISteamRemoteStorage *Steam_Client::GetISteamRemoteStorage( HSteamUser hSteamuser
ISteamScreenshots *Steam_Client::GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamScreenshots *Steam_Client::GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamScreenshots %s\n", pchVersion); PRINT_DEBUG("GetISteamScreenshots %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
return steam_screenshots; return steam_screenshots;
} }
@ -901,6 +914,7 @@ bool Steam_Client::BShutdownIfAllPipesClosed()
ISteamHTTP *Steam_Client::GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamHTTP *Steam_Client::GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamHTTP %s\n", pchVersion); PRINT_DEBUG("GetISteamHTTP %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
if (hSteamuser == SERVER_HSTEAMUSER) { if (hSteamuser == SERVER_HSTEAMUSER) {
return steam_gameserver_http; return steam_gameserver_http;
} }
@ -913,12 +927,14 @@ ISteamHTTP *Steam_Client::GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hStea
void *Steam_Client::DEPRECATED_GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) void *Steam_Client::DEPRECATED_GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("DEPRECATED_GetISteamUnifiedMessages %s\n", pchVersion); PRINT_DEBUG("DEPRECATED_GetISteamUnifiedMessages %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
return (void *)(ISteamUnifiedMessages *)steam_unified_messages; return (void *)(ISteamUnifiedMessages *)steam_unified_messages;
} }
ISteamUnifiedMessages *Steam_Client::GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamUnifiedMessages *Steam_Client::GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamUnifiedMessages %s\n", pchVersion); PRINT_DEBUG("GetISteamUnifiedMessages %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
return steam_unified_messages; return steam_unified_messages;
} }
@ -926,6 +942,7 @@ ISteamUnifiedMessages *Steam_Client::GetISteamUnifiedMessages( HSteamUser hSteam
ISteamController *Steam_Client::GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamController *Steam_Client::GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamController %s\n", pchVersion); PRINT_DEBUG("GetISteamController %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
if (strcmp(pchVersion, "STEAMCONTROLLER_INTERFACE_VERSION") == 0) { if (strcmp(pchVersion, "STEAMCONTROLLER_INTERFACE_VERSION") == 0) {
@ -954,6 +971,7 @@ ISteamController *Steam_Client::GetISteamController( HSteamUser hSteamUser, HSte
ISteamUGC *Steam_Client::GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamUGC *Steam_Client::GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamUGC %s\n", pchVersion); PRINT_DEBUG("GetISteamUGC %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
Steam_UGC *steam_ugc_temp; Steam_UGC *steam_ugc_temp;
if (hSteamUser == SERVER_HSTEAMUSER) { if (hSteamUser == SERVER_HSTEAMUSER) {
@ -1002,6 +1020,7 @@ ISteamUGC *Steam_Client::GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamP
ISteamAppList *Steam_Client::GetISteamAppList( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamAppList *Steam_Client::GetISteamAppList( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamAppList %s\n", pchVersion); PRINT_DEBUG("GetISteamAppList %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
return steam_applist; return steam_applist;
} }
@ -1010,6 +1029,7 @@ ISteamAppList *Steam_Client::GetISteamAppList( HSteamUser hSteamUser, HSteamPipe
ISteamMusic *Steam_Client::GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamMusic *Steam_Client::GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamMusic %s\n", pchVersion); PRINT_DEBUG("GetISteamMusic %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
return steam_music; return steam_music;
} }
@ -1018,6 +1038,7 @@ ISteamMusic *Steam_Client::GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSt
ISteamMusicRemote *Steam_Client::GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) ISteamMusicRemote *Steam_Client::GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion)
{ {
PRINT_DEBUG("GetISteamMusicRemote %s\n", pchVersion); PRINT_DEBUG("GetISteamMusicRemote %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
return steam_musicremote; return steam_musicremote;
} }
@ -1026,6 +1047,7 @@ ISteamMusicRemote *Steam_Client::GetISteamMusicRemote(HSteamUser hSteamuser, HSt
ISteamHTMLSurface *Steam_Client::GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) ISteamHTMLSurface *Steam_Client::GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion)
{ {
PRINT_DEBUG("GetISteamHTMLSurface %s\n", pchVersion); PRINT_DEBUG("GetISteamHTMLSurface %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
if (strcmp(pchVersion, "STEAMHTMLSURFACE_INTERFACE_VERSION_001") == 0) { if (strcmp(pchVersion, "STEAMHTMLSURFACE_INTERFACE_VERSION_001") == 0) {
@ -1075,6 +1097,7 @@ void Steam_Client::Remove_SteamAPI_CPostAPIResultInProcess( SteamAPI_PostAPIResu
ISteamInventory *Steam_Client::GetISteamInventory( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamInventory *Steam_Client::GetISteamInventory( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamInventory %s\n", pchVersion); PRINT_DEBUG("GetISteamInventory %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
Steam_Inventory *steam_inventory_temp; Steam_Inventory *steam_inventory_temp;
Settings *settings_temp; Settings *settings_temp;
SteamCallBacks *callbacks_temp; SteamCallBacks *callbacks_temp;
@ -1104,6 +1127,7 @@ ISteamInventory *Steam_Client::GetISteamInventory( HSteamUser hSteamuser, HSteam
ISteamVideo *Steam_Client::GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamVideo *Steam_Client::GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamVideo %s\n", pchVersion); PRINT_DEBUG("GetISteamVideo %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
return steam_video; return steam_video;
} }
@ -1112,6 +1136,7 @@ ISteamVideo *Steam_Client::GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSt
ISteamParentalSettings *Steam_Client::GetISteamParentalSettings( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamParentalSettings *Steam_Client::GetISteamParentalSettings( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamParentalSettings %s\n", pchVersion); PRINT_DEBUG("GetISteamParentalSettings %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
return steam_parental; return steam_parental;
} }
@ -1119,12 +1144,14 @@ ISteamParentalSettings *Steam_Client::GetISteamParentalSettings( HSteamUser hSte
ISteamMasterServerUpdater *Steam_Client::GetISteamMasterServerUpdater( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamMasterServerUpdater *Steam_Client::GetISteamMasterServerUpdater( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamMasterServerUpdater %s\n", pchVersion); PRINT_DEBUG("GetISteamMasterServerUpdater %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
return steam_masterserver_updater; return steam_masterserver_updater;
} }
ISteamContentServer *Steam_Client::GetISteamContentServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamContentServer *Steam_Client::GetISteamContentServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamContentServer %s\n", pchVersion); PRINT_DEBUG("GetISteamContentServer %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
return NULL; return NULL;
} }
@ -1132,6 +1159,7 @@ ISteamContentServer *Steam_Client::GetISteamContentServer( HSteamUser hSteamUser
ISteamGameSearch *Steam_Client::GetISteamGameSearch( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamGameSearch *Steam_Client::GetISteamGameSearch( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamGameSearch %s\n", pchVersion); PRINT_DEBUG("GetISteamGameSearch %s\n", pchVersion);
if (!hSteamPipe || !hSteamuser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
return steam_game_search; return steam_game_search;
@ -1141,6 +1169,7 @@ ISteamGameSearch *Steam_Client::GetISteamGameSearch( HSteamUser hSteamuser, HSte
ISteamInput *Steam_Client::GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamInput *Steam_Client::GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamInput %s\n", pchVersion); PRINT_DEBUG("GetISteamInput %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
return steam_controller; return steam_controller;
@ -1150,6 +1179,7 @@ ISteamInput *Steam_Client::GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSt
ISteamParties *Steam_Client::GetISteamParties( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) ISteamParties *Steam_Client::GetISteamParties( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion )
{ {
PRINT_DEBUG("GetISteamParties %s\n", pchVersion); PRINT_DEBUG("GetISteamParties %s\n", pchVersion);
if (!hSteamPipe || !hSteamUser) return NULL;
if (!user_logged_in) return NULL; if (!user_logged_in) return NULL;
return steam_parties; return steam_parties;

View File

@ -162,6 +162,7 @@ bool Steam_GameServer::BSecure()
{ {
PRINT_DEBUG("BSecure\n"); PRINT_DEBUG("BSecure\n");
std::lock_guard<std::recursive_mutex> lock(global_mutex); std::lock_guard<std::recursive_mutex> lock(global_mutex);
if (!policy_response_called) return false;
return flags == eServerModeAuthenticationAndSecure; return flags == eServerModeAuthenticationAndSecure;
} }
@ -169,6 +170,7 @@ CSteamID Steam_GameServer::GetSteamID()
{ {
PRINT_DEBUG("Steam_GameServer::GetSteamID\n"); PRINT_DEBUG("Steam_GameServer::GetSteamID\n");
std::lock_guard<std::recursive_mutex> lock(global_mutex); std::lock_guard<std::recursive_mutex> lock(global_mutex);
if (!logged_in) return k_steamIDNil;
return settings->get_local_steam_id(); return settings->get_local_steam_id();
} }