Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/game/client/swarm/c_rd_infection_deathmatch_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ void CRD_Infection_Deathmatch_Stats::OnUpdate( C_RD_HUD_VScript *pHUD )

if ( !m_bStatsRequested && SteamUserStats() )
{
// Valve:
// This call is no longer required as it is managed by the Steam client. The game stats and achievements
// will be synchronized with Steam before the game process begins.
// [Obsolete("No longer required. Automatically handled by the Steam client.", false)]
#if defined(STEAMAPPS_INTERFACE_VERSION008)
SteamUserStats()->RequestCurrentStats();
#else
SteamUserStats()->RequestUserStats(SteamUser()->GetSteamID());
#endif
m_bStatsRequested = true;
}

Expand Down
32 changes: 32 additions & 0 deletions src/game/server/gameinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,16 @@ bool CServerGameDLL::DLLInit( CreateInterfaceFn appSystemFactory,
CGlobalVars *pGlobals)
{

#ifndef STEAMAPPS_INTERFACE_VERSION008
#ifndef CLIENT_DLL

// initialize a game server. this call was in engine before, but not anymore. we need to call it from somewhere
// initialize the gameserver, srcds already binds to the correct ip and ports, so we can just pass 0 here to all parameters
bool r = SteamGameServer_Init(0, 0, 0, eServerModeAuthenticationAndSecure, "7149");
ConMsg("StartGameServer_Init resulted in %d\n", r);
#endif
#endif

COM_TimestampedLog( "ConnectTier1/2/3Libraries - Start" );

ConnectTier1Libraries( &appSystemFactory, 1 );
Expand Down Expand Up @@ -1457,6 +1467,28 @@ static void OnServerUpdateRequested()

void CServerGameDLL::Think( bool finalTick )
{
// this is normally done in engine, but not anymore
// we need to put this here
if (SteamGameServer()) {
bool bLoggedIn = SteamGameServer()->BLoggedOn();
if (!bLoggedIn) {
SteamGameServer()->LogOnAnonymous();
}
}

SteamGameServer_RunCallbacks();

// because steam_api and engine are disagreeing, sv_lan is set to 1
// this is not because they are incompatible, but because the init in engine is gone
// as workaround, we simply set sv_lan back to 0, and send a heartbeat
ConVarRef sv_lan("sv_lan");
if (sv_lan.GetBool()) {
sv_lan.SetValue(0);
ConMsg("************************************************\n* Steam API connection restored *\n************************************************\n");
engine->ServerCommand("heartbeat\n");
engine->ServerExecute();
}

static bool s_bUpdateCheckInit = engine->IsDedicatedServer();
if ( s_bUpdateCheckInit )
{
Expand Down
1 change: 1 addition & 0 deletions src/game/server/serverhelper.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "cbase.h"
#include "serverhelper.h"
#include <winsock.h>

// helper class to find the offset of a datamap for a specific edict
inline unsigned int FindPropertyOffsetInDataMap( datamap_t* pMap, const char* className, const char* property )
Expand Down
12 changes: 11 additions & 1 deletion src/game/shared/achievementmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,22 @@ void CAchievementMgr::UserConnected( int nUserSlot )
if ( IsPC() )
{
// ASSERT( STEAM_PLAYER_SLOT == nUserSlot )


if ( SteamUserStats() )
{
// request stat download; will get called back at OnUserStatsReceived when complete

// Valve:
// This call is no longer required as it is managed by the Steam client. The game stats and achievements
// will be synchronized with Steam before the game process begins.
// [Obsolete("No longer required. Automatically handled by the Steam client.", false)]
#if defined(STEAMAPPS_INTERFACE_VERSION008)
SteamUserStats()->RequestCurrentStats();
#else
SteamUserStats()->RequestUserStats(SteamUser()->GetSteamID());
#endif
}

m_bUserSlotActive[STEAM_PLAYER_SLOT] = true;

}
Expand Down
8 changes: 8 additions & 0 deletions src/game/shared/swarm/asw_player_experience.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,15 @@ void CASW_Player::RequestExperience()
{
if ( IsLocalPlayer( this ) )
{
// Valve:
// This call is no longer required as it is managed by the Steam client. The game stats and achievements
// will be synchronized with Steam before the game process begins.
// [Obsolete("No longer required. Automatically handled by the Steam client.", false)]
#if defined(STEAMAPPS_INTERFACE_VERSION008)
SteamUserStats()->RequestCurrentStats();
#else
SteamUserStats()->RequestUserStats(SteamUser()->GetSteamID());
#endif
}
else
{
Expand Down
Binary file modified src/lib/public/steam_api.lib
Binary file not shown.
68 changes: 0 additions & 68 deletions src/public/steam/isteamapplist.h

This file was deleted.

32 changes: 28 additions & 4 deletions src/public/steam/isteamapps.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@

const int k_cubAppProofOfPurchaseKeyMax = 240; // max supported length of a legacy cd key

// Games can specify what settings the user has selected or has been selected by default based
// on the user's machine.
enum EGamePerformanceSetting
{
k_EGamePerformanceSetting_NotSet = 0,
k_EGamePerformanceSetting_Low = 1,
k_EGamePerformanceSetting_Medium = 2,
k_EGamePerformanceSetting_High = 3,
k_EGamePerformanceSetting_Ultra = 4,
k_EGamePerformanceSetting_Custom = 5,
};

//-----------------------------------------------------------------------------
// Purpose: interface to app data
Expand All @@ -39,7 +50,7 @@ class ISteamApps

// Checks if the user is subscribed to the current app through a free weekend
// This function will return false for users who have a retail or other type of license
// Before using, please ask your Valve technical contact how to package and secure your free weekened
// Before using, please ask your Valve technical contact how to package and secure your free weekend
virtual bool BIsSubscribedFromFreeWeekend() = 0;

// Returns the number of DLC pieces for the running app
Expand Down Expand Up @@ -84,7 +95,7 @@ class ISteamApps
// return the buildid of this app, may change at any time based on backend updates to the game
virtual int GetAppBuildId() = 0;

// Request all proof of purchase keys for the calling appid and asociated DLC.
// Request all proof of purchase keys for the calling appid and associated DLC.
// A series of AppProofOfPurchaseKeyResponse_t callbacks will be sent with
// appropriate appid values, ending with a final callback where the m_nAppId
// member is k_uAppIdInvalid (zero).
Expand All @@ -110,10 +121,23 @@ class ISteamApps
virtual bool BIsTimedTrial( uint32* punSecondsAllowed, uint32* punSecondsPlayed ) = 0;

// set current DLC AppID being played (or 0 if none). Allows Steam to track usage of major DLC extensions
virtual bool SetDlcContext( AppId_t nAppID ) = 0;
virtual bool SetDlcContext( AppId_t nAppID ) = 0;

// returns total number of known app branches (including default "public" branch ). nAvailable is number of available betas
virtual int GetNumBetas( int *pnAvailable, int *pnPrivate ) = 0; //

// return beta branch details, name, description, current BuildID and state flags (EBetaBranchFlags)
virtual bool GetBetaInfo( int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription, uint32 *punLastUpdated ) = 0; // iterate through

// select this beta branch for this app as active, might need the game to restart so Steam can update to that branch
virtual bool SetActiveBeta( const char *pchBetaName ) = 0;

// game performance settings
virtual void SetGamePerformanceSetting( EGamePerformanceSetting setting ) = 0;
virtual void SetGameRenderResolution( uint32 unWidth, uint32 unHeight ) = 0;
};

#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION008"
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION009"

// Global interface accessor
inline ISteamApps *SteamApps();
Expand Down
14 changes: 1 addition & 13 deletions src/public/steam/isteamclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ class ISteamClient
// user screenshots
virtual ISteamScreenshots *GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// game search
virtual ISteamGameSearch *GetISteamGameSearch( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// Deprecated. Applications should use SteamAPI_RunCallbacks() or SteamGameServer_RunCallbacks() instead.
STEAM_PRIVATE_API( virtual void RunFrame() = 0; )

Expand All @@ -115,24 +112,15 @@ class ISteamClient
// Expose HTTP interface
virtual ISteamHTTP *GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// Deprecated - the ISteamUnifiedMessages interface is no longer intended for public consumption.
STEAM_PRIVATE_API( virtual void *DEPRECATED_GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0 ; )

// Exposes the ISteamController interface - deprecated in favor of Steam Input
virtual ISteamController *GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// Exposes the ISteamUGC interface
virtual ISteamUGC *GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// returns app list interface, only available on specially registered apps
virtual ISteamAppList *GetISteamAppList( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// Music Player
virtual ISteamMusic *GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// Music Player Remote
virtual ISteamMusicRemote *GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0;

// html page display
virtual ISteamHTMLSurface *GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0;

Expand Down Expand Up @@ -162,7 +150,7 @@ class ISteamClient
STEAM_PRIVATE_API( virtual void DestroyAllInterfaces() = 0; )

};
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient020"
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient023"

#ifndef STEAM_API_EXPORTS

Expand Down
Loading
Loading