diff --git a/Readme.txt b/Readme.txt index 7cf261c..0bb13d3 100644 --- a/Readme.txt +++ b/Readme.txt @@ -11,6 +11,21 @@ website at: http://partner.steamgames.com Revision History: +---------------------------------------------------------------- +v1.30 10th July 2014 +---------------------------------------------------------------- + +General: +* Added a new Workshop item content API in ISteamUGC that is easy to use and allows multiple files per item without any size limits. It uses the same + content system that handles regular content depots, resulting in faster and smaller downloads due to delta patching. Subscribed workshop items will + be placed in unique subfolders in the install folder, so the game doesn't need to fetch them using ISteamRemoteStorage anymore. The new API is not + backwards compatible with old items created with ISteamRemoteStorage. Added Workshop feature to steamworksexample using ISteamUGC. + + +Steam VR: +* VR_Init now requires that you call SteamAPI_Init first. + + ---------------------------------------------------------------- v1.29 24th April 2014 ---------------------------------------------------------------- diff --git a/SteamworksExample/MainMenu.cpp b/SteamworksExample/MainMenu.cpp index 0a957aa..644de8b 100644 --- a/SteamworksExample/MainMenu.cpp +++ b/SteamworksExample/MainMenu.cpp @@ -28,5 +28,6 @@ CMainMenu::CMainMenu( IGameEngine *pGameEngine ) : CBaseMenu( AddMenuItem( MenuItem_t( "Write Minidump", k_EClientMinidump ) ); AddMenuItem( MenuItem_t( "Web Callback", k_EClientWebCallback ) ); AddMenuItem( MenuItem_t( "Music Player", k_EClientMusic ) ); + AddMenuItem( MenuItem_t( "Workshop Items", k_EClientWorkshop ) ); AddMenuItem( MenuItem_t( "Exit Game", k_EClientGameExiting ) ); } \ No newline at end of file diff --git a/SteamworksExample/SpaceWar.h b/SteamworksExample/SpaceWar.h index 34fd191..4d2c6d6 100644 --- a/SteamworksExample/SpaceWar.h +++ b/SteamworksExample/SpaceWar.h @@ -185,6 +185,7 @@ enum EClientGameState k_EClientClanChatRoom, k_EClientWebCallback, k_EClientMusic, + k_EClientWorkshop, }; diff --git a/SteamworksExample/SpaceWarClient.cpp b/SteamworksExample/SpaceWarClient.cpp index fe07b33..5f09c2f 100644 --- a/SteamworksExample/SpaceWarClient.cpp +++ b/SteamworksExample/SpaceWarClient.cpp @@ -51,7 +51,8 @@ CSpaceWarClient::CSpaceWarClient( IGameEngine *pGameEngine ) : m_SteamServerConnectFailure( this, &CSpaceWarClient::OnSteamServerConnectFailure ), m_GameJoinRequested( this, &CSpaceWarClient::OnGameJoinRequested ), m_CallbackGameOverlayActivated( this, &CSpaceWarClient::OnGameOverlayActivated ), - m_CallbackGameWebCallback( this, &CSpaceWarClient::OnGameWebCallback ) + m_CallbackGameWebCallback( this, &CSpaceWarClient::OnGameWebCallback ), + m_CallbackWorkshopItemInstalled( this, &CSpaceWarClient::OnWorkshopItemInstalled ) { Init( pGameEngine ); } @@ -128,6 +129,12 @@ void CSpaceWarClient::Init( IGameEngine *pGameEngine ) // Initialize sun m_pSun = new CSun( pGameEngine ); + m_nNumWorkshopItems = 0; + for (uint32 i = 0; i < MAX_WORKSHOP_ITEMS; ++i) + { + m_rgpWorkshopItems[i] = NULL; + } + // initialize P2P auth engine m_pP2PAuthedGame = new CP2PAuthedGame( m_pGameEngine ); @@ -148,6 +155,8 @@ void CSpaceWarClient::Init( IGameEngine *pGameEngine ) // P2P voice chat m_pVoiceChat = new CVoiceChat( pGameEngine ); + + LoadWorkshopItems(); } @@ -203,6 +212,15 @@ CSpaceWarClient::~CSpaceWarClient() m_rgpShips[i] = NULL; } } + + for (uint32 i = 0; i < MAX_WORKSHOP_ITEMS; ++i) + { + if ( m_rgpWorkshopItems[i] ) + { + delete m_rgpWorkshopItems[i]; + m_rgpWorkshopItems[i] = NULL; + } + } } @@ -1304,6 +1322,14 @@ void CSpaceWarClient::RunFrame() if ( bEscapePressed ) SetGameState( k_EClientGameMenu ); break; + case k_EClientWorkshop: + m_pStarField->Render(); + DrawWorkshopItems(); + + if (bEscapePressed) + SetGameState(k_EClientGameMenu); + break; + case k_EClientStatsAchievements: m_pStarField->Render(); m_pStatsAndAchievements->Render(); @@ -1389,6 +1415,14 @@ void CSpaceWarClient::RunFrame() if ( m_rgpShips[i] ) m_rgpShips[i]->RunFrame(); } + + for (uint32 i = 0; i < MAX_WORKSHOP_ITEMS; ++i) + { + if (m_rgpWorkshopItems[i]) + m_rgpWorkshopItems[i]->RunFrame(); + } + + DrawHUDText(); m_pStatsAndAchievements->RunFrame(); @@ -1503,6 +1537,13 @@ void CSpaceWarClient::RunFrame() if ( m_rgpShips[i] ) m_rgpShips[i]->Render(); } + + for (uint32 i = 0; i < MAX_WORKSHOP_ITEMS; ++i) + { + if ( m_rgpWorkshopItems[i] ) + m_rgpWorkshopItems[i]->Render(); + } + break; default: // Any needed drawing was already done above before server updates @@ -2003,3 +2044,184 @@ void CSpaceWarClient::ExecCommandLineConnect( const char *pchServerAddress, cons } } } + + +//----------------------------------------------------------------------------- +// Purpose: parse CWorkshopItem from text file +//----------------------------------------------------------------------------- +CWorkshopItem *CSpaceWarClient::LoadWorkshopItemFromFile( const char *pszFileName ) +{ + FILE *file = fopen( pszFileName, "rt"); + if (!file) + return NULL; + + CWorkshopItem *pItem = NULL; + + char szLine[1024]; + + if ( fgets(szLine, sizeof(szLine), file) ) + { + float flXPos, flYPos, flXVelocity, flYVelocity; + // initialize object + if ( sscanf(szLine, "%f %f %f %f", &flXPos, &flYPos, &flXVelocity, &flYVelocity) ) + { + pItem = new CWorkshopItem( m_pGameEngine, 0 ); + + pItem->SetPosition( flXPos, flYPos ); + pItem->SetVelocity( flXVelocity, flYVelocity ); + + while (!feof(file)) + { + float xPos0, yPos0, xPos1, yPos1; + DWORD dwColor; + fgets(szLine, sizeof(szLine), file); + + if (sscanf(szLine, "%f %f %f %f %x", &xPos0, &yPos0, &xPos1, &yPos1, &dwColor) >= 5) + { + // Add a line to the entity + pItem->AddLine(xPos0, yPos0, xPos1, yPos1, dwColor); + } + } + } + } + + fclose(file); + + return pItem; +} + + +//----------------------------------------------------------------------------- +// Purpose: load a Workshop item by PublishFileID +//----------------------------------------------------------------------------- +bool CSpaceWarClient::LoadWorkshopItem( PublishedFileId_t workshopItemID ) +{ + if ( m_nNumWorkshopItems == MAX_WORKSHOP_ITEMS ) + return false; // too much + + uint64 unSizeOnDisk = 0; + char szItemFolder[1024] = { 0 }; + if ( !SteamUGC()->GetItemInstallInfo( workshopItemID, &unSizeOnDisk, szItemFolder, sizeof(szItemFolder) ) ) + return false; + + char szFile[1024]; + _snprintf(szFile, sizeof(szFile), "%s/workshopitem.txt", szItemFolder); + + CWorkshopItem *pItem = LoadWorkshopItemFromFile( szFile ); + + if ( !pItem ) + return false; + + pItem->m_ItemDetails.m_nPublishedFileId = workshopItemID; + m_rgpWorkshopItems[m_nNumWorkshopItems++] = pItem; + + // get Workshop item details + SteamAPICall_t hSteamAPICall = SteamUGC()->RequestUGCDetails( workshopItemID, 60 ); + pItem->m_SteamCallResultUGCDetails.Set(hSteamAPICall, pItem, &CWorkshopItem::OnUGCDetailsResult); + + return true; +} + + +//----------------------------------------------------------------------------- +// Purpose: load all subscribed workshop items +//----------------------------------------------------------------------------- +void CSpaceWarClient::LoadWorkshopItems() +{ + // reset workshop Items + for (uint32 i = 0; i < MAX_WORKSHOP_ITEMS; ++i) + { + if ( m_rgpWorkshopItems[i] ) + { + delete m_rgpWorkshopItems[i]; + m_rgpWorkshopItems[i] = NULL; + } + } + + m_nNumWorkshopItems = 0; // load default test item + + PublishedFileId_t vecSubscribedItems[MAX_WORKSHOP_ITEMS]; + + int numSubscribedItems = SteamUGC()->GetSubscribedItems( vecSubscribedItems, MAX_WORKSHOP_ITEMS ); + + if ( numSubscribedItems > MAX_WORKSHOP_ITEMS ) + numSubscribedItems = MAX_WORKSHOP_ITEMS; // crop + + // load all subscribed workshop items + for ( int iSubscribedItem=0; iSubscribedItemm_ItemDetails.m_rgchTitle, "Test Item", k_cchPublishedDocumentTitleMax ); + strncpy( pItem->m_ItemDetails.m_rgchDescription, "This is a local test item for debugging", k_cchPublishedDocumentDescriptionMax ); + m_rgpWorkshopItems[m_nNumWorkshopItems++] = pItem; + } + } +} + + +//----------------------------------------------------------------------------- +// Purpose: new Workshop was installed, load it instantly +//----------------------------------------------------------------------------- +void CSpaceWarClient::OnWorkshopItemInstalled( ItemInstalled_t *pParam ) +{ + if ( pParam->m_unAppID == SteamUtils()->GetAppID() ) + LoadWorkshopItem( pParam->m_nPublishedFileId ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Draws PublishFileID, title & description for each subscribed Workshop item +//----------------------------------------------------------------------------- +void CSpaceWarClient::DrawWorkshopItems() +{ + const int32 width = m_pGameEngine->GetViewportWidth(); + + RECT rect; + rect.top = 0; + rect.bottom = 64; + rect.left = 0; + rect.right = width; + + char rgchBuffer[1024]; + sprintf_safe(rgchBuffer, "Subscribed Workshop Items"); + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB(255, 25, 200, 25), TEXTPOS_CENTER |TEXTPOS_VCENTER, rgchBuffer); + + rect.left = 32; + rect.top = 64; + rect.bottom = 96; + + for (int iSubscribedItem = 0; iSubscribedItem < MAX_WORKSHOP_ITEMS; iSubscribedItem++) + { + CWorkshopItem *pItem = m_rgpWorkshopItems[ iSubscribedItem ]; + + if ( !pItem ) + continue; + + rect.top += 32; + rect.bottom += 32; + + sprintf_safe( rgchBuffer, "%u. \"%s\" (%llu) : %s", iSubscribedItem+1, + pItem->m_ItemDetails.m_rgchTitle, pItem->m_ItemDetails.m_nPublishedFileId, pItem->m_ItemDetails.m_rgchDescription ); + + m_pGameEngine->BDrawString( m_hInstructionsFont, rect, D3DCOLOR_ARGB(255, 25, 200, 25), TEXTPOS_LEFT |TEXTPOS_VCENTER, rgchBuffer); + } + + rect.left = 0; + rect.right = width; + rect.top = LONG(m_pGameEngine->GetViewportHeight() * 0.8); + rect.bottom = m_pGameEngine->GetViewportHeight(); + + sprintf_safe(rgchBuffer, "Press ESC to return to the Main Menu"); + m_pGameEngine->BDrawString(m_hInstructionsFont, rect, D3DCOLOR_ARGB(255, 25, 200, 25), TEXTPOS_CENTER | TEXTPOS_TOP, rgchBuffer); +} + diff --git a/SteamworksExample/SpaceWarClient.h b/SteamworksExample/SpaceWarClient.h index 2d372dd..3f41875 100644 --- a/SteamworksExample/SpaceWarClient.h +++ b/SteamworksExample/SpaceWarClient.h @@ -85,6 +85,26 @@ struct LeaderboardMenuItem_t bool m_bNextLeaderboard; }; +#define MAX_WORKSHOP_ITEMS 16 + +// a Steam Workshop item +class CWorkshopItem : public CVectorEntity +{ +public: + + CWorkshopItem( IGameEngine *pGameEngine, uint32 uCollisionRadius ) : CVectorEntity( pGameEngine, uCollisionRadius ) + { + memset( &m_ItemDetails, 0, sizeof(m_ItemDetails) ); + } + + void OnUGCDetailsResult(SteamUGCRequestUGCDetailsResult_t *pCallback, bool bIOFailure) + { + m_ItemDetails = pCallback->m_details; + } + + SteamUGCDetails_t m_ItemDetails; // meta data + CCallResult m_SteamCallResultUGCDetails; +}; @@ -219,6 +239,16 @@ private: // Updates what we show to friends about what we're doing and how to connect void UpdateRichPresenceConnectionInfo(); + // Draw description for all subscribed workshop items + void DrawWorkshopItems(); + + // load subscribed workshop items + void LoadWorkshopItems(); + + // load a workshop item from file + bool LoadWorkshopItem( PublishedFileId_t workshopItemID ); + CWorkshopItem *LoadWorkshopItemFromFile( const char *pszFileName ); + // Server we are connected to CSpaceWarServer *m_pServer; @@ -330,6 +360,10 @@ private: // Sun instance CSun *m_pSun; + // Steam Workshop items + CWorkshopItem *m_rgpWorkshopItems[ MAX_WORKSHOP_ITEMS ]; + int m_nNumWorkshopItems; // items in m_rgpWorkshopItems + // Main menu instance CMainMenu *m_pMainMenu; @@ -360,6 +394,7 @@ private: // callback for when we're creating a new lobby void OnLobbyCreated( LobbyCreated_t *pCallback, bool bIOFailure ); CCallResult m_SteamCallResultLobbyCreated; + // callback for when we've joined a lobby void OnLobbyEntered( LobbyEnter_t *pCallback, bool bIOFailure ); CCallResult m_SteamCallResultLobbyEntered; @@ -378,6 +413,9 @@ private: // callback when getting the results of a web call STEAM_CALLBACK( CSpaceWarClient, OnGameWebCallback, GameWebCallback_t, m_CallbackGameWebCallback ); + // callback when new Workshop item was installed + STEAM_CALLBACK(CSpaceWarClient, OnWorkshopItemInstalled, ItemInstalled_t, m_CallbackWorkshopItemInstalled); + // lobby browser menu CLobbyBrowser *m_pLobbyBrowser; diff --git a/SteamworksExample/VectorEntity.h b/SteamworksExample/VectorEntity.h index 267c0d2..0370bfb 100644 --- a/SteamworksExample/VectorEntity.h +++ b/SteamworksExample/VectorEntity.h @@ -67,27 +67,26 @@ public: // Get the distance traveled each frame float GetDistanceTraveledLastFrame(); - -protected: - + // Add a line to the entity - void AddLine( float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor ); + void AddLine(float xPos0, float yPos0, float xPos1, float yPos1, DWORD dwColor); // Set the objects current position - void SetPosition( float xPos, float yPos ); + void SetPosition(float xPos, float yPos); + + // Set the velocity of the entity (normally you should just set acceleration and this will be computed) + void SetVelocity(float xVelocity, float yVelocity) { m_flXVelocity = xVelocity; m_flYVelocity = yVelocity; } + +protected: // Set the rotation to be applied next frame void SetRotationDeltaNextFrame( float flRotationInRadians ); // Set the acceleration to be applied next frame void SetAcceleration( float xAccel, float yAccel ); - // Set the cumulative rotation for this entity (overriding any existing value) void SetAccumulatedRotation( float flRotation ) { m_flAccumulatedRotation = flRotation; } - - // Set the velocity of the entity (normally you should just set acceleration and this will be computed) - void SetVelocity ( float xVelocity, float yVelocity ) { m_flXVelocity = xVelocity; m_flYVelocity = yVelocity; } - + // Reset velocity of the entity void ResetVelocity() { m_flXVelocity = 0; m_flYVelocity = 0; } diff --git a/client/steam.exe b/client/steam.exe index 31b4c3c..e533724 100644 Binary files a/client/steam.exe and b/client/steam.exe differ diff --git a/public/steam/isteamapplist.h b/public/steam/isteamapplist.h index b9d7113..e6726c1 100644 --- a/public/steam/isteamapplist.h +++ b/public/steam/isteamapplist.h @@ -10,8 +10,8 @@ #pragma once #endif -#include "steam/isteamclient.h" -#include "steam/steamtypes.h" +#include "isteamclient.h" +#include "steamtypes.h" //----------------------------------------------------------------------------- // Purpose: This is a restricted interface that can only be used by previously approved apps, diff --git a/public/steam/isteamclient.h b/public/steam/isteamclient.h index b54ad3d..b182100 100644 --- a/public/steam/isteamclient.h +++ b/public/steam/isteamclient.h @@ -88,6 +88,7 @@ class ISteamNetworking; class ISteamRemoteStorage; class ISteamScreenshots; class ISteamMusic; +class ISteamMusicRemote; class ISteamGameServerStats; class ISteamPS3OverlayRender; class ISteamHTTP; @@ -208,9 +209,12 @@ public: // 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; }; -#define STEAMCLIENT_INTERFACE_VERSION "SteamClient014" +#define STEAMCLIENT_INTERFACE_VERSION "SteamClient015" //----------------------------------------------------------------------------- // Purpose: Base values for callback identifiers, each callback must @@ -229,7 +233,7 @@ enum { k_iSteamAppsCallbacks = 1000 }; enum { k_iSteamUserStatsCallbacks = 1100 }; enum { k_iSteamNetworkingCallbacks = 1200 }; enum { k_iClientRemoteStorageCallbacks = 1300 }; -enum { k_iSteamUserItemsCallbacks = 1400 }; +enum { k_iClientDepotBuilderCallbacks = 1400 }; enum { k_iSteamGameServerItemsCallbacks = 1500 }; enum { k_iClientUtilsCallbacks = 1600 }; enum { k_iSteamGameCoordinatorCallbacks = 1700 }; @@ -256,7 +260,8 @@ enum { k_iClientShortcutsCallbacks = 3700 }; enum { k_iClientRemoteControlManagerCallbacks = 3800 }; enum { k_iSteamAppListCallbacks = 3900 }; enum { k_iSteamMusicCallbacks = 4000 }; - +enum { k_iSteamMusicRemoteCallbacks = 4100 }; +enum { k_iClientVRCallbacks = 4200 }; //----------------------------------------------------------------------------- // The CALLBACK macros are for client side callback logging enabled with diff --git a/public/steam/isteammusic.h b/public/steam/isteammusic.h index 23f0b85..779a4c2 100644 --- a/public/steam/isteammusic.h +++ b/public/steam/isteammusic.h @@ -6,7 +6,7 @@ #pragma once #endif -#include "steam/isteamclient.h" +#include "isteamclient.h" //----------------------------------------------------------------------------- // Purpose: diff --git a/public/steam/isteammusicremote.h b/public/steam/isteammusicremote.h new file mode 100644 index 0000000..18649a9 --- /dev/null +++ b/public/steam/isteammusicremote.h @@ -0,0 +1,126 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ + +#ifndef ISTEAMMUSICREMOTE_H +#define ISTEAMMUSICREMOTE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam/isteamclient.h" +#include "steam/isteammusic.h" + +#define k_SteamMusicNameMaxLength 255 +#define k_SteamMusicPNGMaxLength 65535 + + +class ISteamMusicRemote +{ +public: + // Service Definition + virtual bool RegisterSteamMusicRemote( const char *pchName ) = 0; + virtual bool DeregisterSteamMusicRemote() = 0; + virtual bool BIsCurrentMusicRemote() = 0; + virtual bool BActivationSuccess( bool bValue ) = 0; + + virtual bool SetDisplayName( const char *pchDisplayName ) = 0; + virtual bool SetPNGIcon_64x64( void *pvBuffer, uint32 cbBufferLength ) = 0; + + // Abilities for the user interface + virtual bool EnablePlayPrevious(bool bValue) = 0; + virtual bool EnablePlayNext( bool bValue ) = 0; + virtual bool EnableShuffled( bool bValue ) = 0; + virtual bool EnableLooped( bool bValue ) = 0; + virtual bool EnableQueue( bool bValue ) = 0; + virtual bool EnablePlaylists( bool bValue ) = 0; + + // Status + virtual bool UpdatePlaybackStatus( AudioPlayback_Status nStatus ) = 0; + virtual bool UpdateShuffled( bool bValue ) = 0; + virtual bool UpdateLooped( bool bValue ) = 0; + virtual bool UpdateVolume( float flValue ) = 0; // volume is between 0.0 and 1.0 + + // Current Entry + virtual bool CurrentEntryWillChange() = 0; + virtual bool CurrentEntryIsAvailable( bool bAvailable ) = 0; + virtual bool UpdateCurrentEntryText( const char *pchText ) = 0; + virtual bool UpdateCurrentEntryElapsedSeconds( int nValue ) = 0; + virtual bool UpdateCurrentEntryCoverArt( void *pvBuffer, uint32 cbBufferLength ) = 0; + virtual bool CurrentEntryDidChange() = 0; + + // Queue + virtual bool QueueWillChange() = 0; + virtual bool ResetQueueEntries() = 0; + virtual bool SetQueueEntry( int nID, int nPosition, const char *pchEntryText ) = 0; + virtual bool SetCurrentQueueEntry( int nID ) = 0; + virtual bool QueueDidChange() = 0; + + // Playlist + virtual bool PlaylistWillChange() = 0; + virtual bool ResetPlaylistEntries() = 0; + virtual bool SetPlaylistEntry( int nID, int nPosition, const char *pchEntryText ) = 0; + virtual bool SetCurrentPlaylistEntry( int nID ) = 0; + virtual bool PlaylistDidChange() = 0; +}; + +#define STEAMMUSICREMOTE_INTERFACE_VERSION "STEAMMUSICREMOTE_INTERFACE_VERSION001" + +// callbacks +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error isteamclient.h must be included +#endif + + +DEFINE_CALLBACK( MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerRemoteWillDeactivate_t, k_iSteamMusicRemoteCallbacks + 2 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerRemoteToFront_t, k_iSteamMusicRemoteCallbacks + 3 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWillQuit_t, k_iSteamMusicRemoteCallbacks + 4 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWantsPlay_t, k_iSteamMusicRemoteCallbacks + 5 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWantsPause_t, k_iSteamMusicRemoteCallbacks + 6 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWantsPlayPrevious_t, k_iSteamMusicRemoteCallbacks + 7 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWantsPlayNext_t, k_iSteamMusicRemoteCallbacks + 8 ) +END_DEFINE_CALLBACK_0() + +DEFINE_CALLBACK( MusicPlayerWantsShuffled_t, k_iSteamMusicRemoteCallbacks + 9 ) + CALLBACK_MEMBER( 0, bool, m_bShuffled ) +END_DEFINE_CALLBACK_1() + +DEFINE_CALLBACK( MusicPlayerWantsLooped_t, k_iSteamMusicRemoteCallbacks + 10 ) + CALLBACK_MEMBER(0, bool, m_bLooped ) +END_DEFINE_CALLBACK_1() + +DEFINE_CALLBACK( MusicPlayerWantsVolume_t, k_iSteamMusicCallbacks + 11 ) + CALLBACK_MEMBER(0, float, m_flNewVolume) +END_DEFINE_CALLBACK_1() + +DEFINE_CALLBACK( MusicPlayerSelectsQueueEntry_t, k_iSteamMusicCallbacks + 12 ) + CALLBACK_MEMBER(0, int, nID ) +END_DEFINE_CALLBACK_1() + +DEFINE_CALLBACK( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 ) + CALLBACK_MEMBER(0, int, nID ) +END_DEFINE_CALLBACK_1() + + +#pragma pack( pop ) + + + +#endif // #define ISTEAMMUSICREMOTE_H diff --git a/public/steam/isteamremotestorage.h b/public/steam/isteamremotestorage.h index ed5aa52..fd3bd18 100644 --- a/public/steam/isteamremotestorage.h +++ b/public/steam/isteamremotestorage.h @@ -103,7 +103,7 @@ enum EWorkshopFileType k_EWorkshopFileTypeControllerBinding = 12, k_EWorkshopFileTypeSteamworksAccessInvite = 13, - // Update k_EWorkshopFileTypeMax if you add values + // Update k_EWorkshopFileTypeMax if you add values. k_EWorkshopFileTypeMax = 14 }; @@ -138,10 +138,6 @@ enum EWorkshopVideoProvider k_EWorkshopVideoProviderYoutube = 1 }; -enum -{ - k_WorkshopForceLoadPublishedFileDetailsFromCache = -1 -}; enum EUGCReadAction { diff --git a/public/steam/isteamugc.h b/public/steam/isteamugc.h index 5e821ec..a853ecb 100644 --- a/public/steam/isteamugc.h +++ b/public/steam/isteamugc.h @@ -91,6 +91,16 @@ enum EUGCQuery k_EUGCQuery_RankedByTextSearch = 11, }; +enum EItemUpdateStatus +{ + k_EItemUpdateStatusInvalid = 0, // The item update handle was invalid, job might be finished, listen too SubmitItemUpdateResult_t + k_EItemUpdateStatusPreparingConfig = 1, // The item update is processing configuration data + k_EItemUpdateStatusPreparingContent = 2, // The item update is reading and processing content files + k_EItemUpdateStatusUploadingContent = 3, // The item update is uploading content changes to Steam + k_EItemUpdateStatusUploadingPreviewFile = 4, // The item update is uploading new preview file image + k_EItemUpdateStatusCommittingChanges = 5 // The item update is committing all changes +}; + const uint32 kNumUGCResultsPerPage = 50; @@ -166,7 +176,30 @@ public: // Request full details for one piece of UGC virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0; - + + // Steam Workshop Creator API + virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet + + virtual UGCUpdateHandle_t StartItemUpdate( AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID ) = 0; // start an UGC item update. Set changed properties before commiting update with CommitItemUpdate() + + virtual bool SetItemTitle( UGCUpdateHandle_t handle, const char *pchTitle ) = 0; // change the title of an UGC item + virtual bool SetItemDescription( UGCUpdateHandle_t handle, const char *pchDescription ) = 0; // change the description of an UGC item + virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item + virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item + virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder + virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file + + virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate() + virtual EItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, uint64 *punBytesProcessed, uint64* punBytesTotal ) = 0; + + // Steam Workshop Consumer API + virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscript to this item, will be installed ASAP + virtual SteamAPICall_t UnsubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // unsubscribe from this item, will be uninstalled after game quits + virtual uint32 GetNumSubscribedItems() = 0; // number of subscribed items + virtual uint32 GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; // all subscribed item PublishFileIDs + + virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, char *pchFolder, uint32 cchFolderSize ) = 0; // returns true if item is installed + virtual bool GetItemUpdateInfo( PublishedFileId_t nPublishedFileID, bool *pbNeedsUpdate, bool *pbIsDownloading, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; }; #define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION002" @@ -197,8 +230,37 @@ struct SteamUGCRequestUGCDetailsResult_t //----------------------------------------------------------------------------- -// Purpose: k_iClientUGCCallbacks + 3 to k_iClientUGCCallbacks + 6 in use +// Purpose: result for ISteamUGC::CreateItem() //----------------------------------------------------------------------------- +struct CreateItemResult_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 3 }; + EResult m_eResult; + PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID + bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +}; + + +//----------------------------------------------------------------------------- +// Purpose: result for ISteamUGC::SubmitItemUpdate() +//----------------------------------------------------------------------------- +struct SubmitItemUpdateResult_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 4 }; + EResult m_eResult; + bool m_bUserNeedsToAcceptWorkshopLegalAgreement; +}; + + +//----------------------------------------------------------------------------- +// Purpose: a new Workshop item has been installed +//----------------------------------------------------------------------------- +struct ItemInstalled_t +{ + enum { k_iCallback = k_iClientUGCCallbacks + 5 }; + AppId_t m_unAppID; + PublishedFileId_t m_nPublishedFileId; +}; #pragma pack( pop ) diff --git a/public/steam/lib/linux32/libsdkencryptedappticket.so b/public/steam/lib/linux32/libsdkencryptedappticket.so index 4615c1b..4cff872 100644 Binary files a/public/steam/lib/linux32/libsdkencryptedappticket.so and b/public/steam/lib/linux32/libsdkencryptedappticket.so differ diff --git a/public/steam/lib/linux64/libsdkencryptedappticket.so b/public/steam/lib/linux64/libsdkencryptedappticket.so index cf6f079..a46e7d7 100644 Binary files a/public/steam/lib/linux64/libsdkencryptedappticket.so and b/public/steam/lib/linux64/libsdkencryptedappticket.so differ diff --git a/public/steam/lib/win32/sdkencryptedappticket.dll b/public/steam/lib/win32/sdkencryptedappticket.dll index ee0c3f3..c88c9dc 100644 Binary files a/public/steam/lib/win32/sdkencryptedappticket.dll and b/public/steam/lib/win32/sdkencryptedappticket.dll differ diff --git a/public/steam/lib/win32/sdkencryptedappticket.lib b/public/steam/lib/win32/sdkencryptedappticket.lib index 470db5f..ace0715 100644 Binary files a/public/steam/lib/win32/sdkencryptedappticket.lib and b/public/steam/lib/win32/sdkencryptedappticket.lib differ diff --git a/public/steam/lib/win64/sdkencryptedappticket64.dll b/public/steam/lib/win64/sdkencryptedappticket64.dll index 8ca550d..a2fcb62 100644 Binary files a/public/steam/lib/win64/sdkencryptedappticket64.dll and b/public/steam/lib/win64/sdkencryptedappticket64.dll differ diff --git a/public/steam/lib/win64/sdkencryptedappticket64.lib b/public/steam/lib/win64/sdkencryptedappticket64.lib index 5c9d36f..bf585f1 100644 Binary files a/public/steam/lib/win64/sdkencryptedappticket64.lib and b/public/steam/lib/win64/sdkencryptedappticket64.lib differ diff --git a/public/steam/steam_api.h b/public/steam/steam_api.h index d1ebd2c..a50e4b3 100644 --- a/public/steam/steam_api.h +++ b/public/steam/steam_api.h @@ -21,6 +21,7 @@ #include "isteamremotestorage.h" #include "isteamscreenshots.h" #include "isteammusic.h" +#include "isteammusicremote.h" #include "isteamhttp.h" #include "isteamunifiedmessages.h" #include "isteamcontroller.h" @@ -124,6 +125,7 @@ S_API ISteamController *S_CALLTYPE SteamController(); S_API ISteamUGC *S_CALLTYPE SteamUGC(); S_API ISteamAppList *S_CALLTYPE SteamAppList(); S_API ISteamMusic *S_CALLTYPE SteamMusic(); +S_API ISteamMusicRemote *S_CALLTYPE SteamMusicRemote(); #ifdef _PS3 S_API ISteamPS3OverlayRender *S_CALLTYPE SteamPS3OverlayRender(); #endif @@ -408,6 +410,7 @@ public: ISteamUGC* SteamUGC() { return m_pSteamUGC; } ISteamAppList* SteamAppList() { return m_pSteamAppList; } ISteamMusic* SteamMusic() { return m_pSteamMusic; } + ISteamMusicRemote* SteamMusicRemote() { return m_pSteamMusicRemote; } #ifdef _PS3 ISteamPS3OverlayRender* SteamPS3OverlayRender() { return m_pSteamPS3OverlayRender; } #endif @@ -429,6 +432,7 @@ private: ISteamUGC *m_pSteamUGC; ISteamAppList *m_pSteamAppList; ISteamMusic *m_pSteamMusic; + ISteamMusicRemote *m_pSteamMusicRemote; #ifdef _PS3 ISteamPS3OverlayRender *m_pSteamPS3OverlayRender; #endif @@ -536,7 +540,13 @@ inline bool CSteamAPIContext::Init() { return false; } - + + m_pSteamMusicRemote = SteamClient()->GetISteamMusicRemote( hSteamUser, hSteamPipe, STEAMMUSICREMOTE_INTERFACE_VERSION ); + if ( !m_pSteamMusicRemote ) + { + return false; + } + #ifdef _PS3 m_pSteamPS3OverlayRender = SteamClient()->GetISteamPS3OverlayRender(); #endif diff --git a/public/steam/steam_gameserver.h b/public/steam/steam_gameserver.h index 3a10626..98e26a7 100644 --- a/public/steam/steam_gameserver.h +++ b/public/steam/steam_gameserver.h @@ -151,7 +151,7 @@ inline bool CSteamGameServerAPIContext::Init() return false; m_pSteamHTTP = g_pSteamClientGameServer->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION ); - if ( !m_pSteamGameServerStats ) + if ( !m_pSteamHTTP ) return false; return true; diff --git a/public/steam/steamclientpublic.h b/public/steam/steamclientpublic.h index c8a5f64..0fa9731 100644 --- a/public/steam/steamclientpublic.h +++ b/public/steam/steamclientpublic.h @@ -109,6 +109,10 @@ enum EResult k_EResultRestrictedDevice = 82, // The device being used is not allowed to perform this action k_EResultRegionLocked = 83, // The action could not be complete because it is region restricted k_EResultRateLimitExceeded = 84, // Temporary rate limit exceeded, try again later, different from k_EResultLimitExceeded which may be permanent + k_EResultAccountLoginDeniedNeedTwoFactor = 85, // Need two-factor code to login + k_EResultItemDeleted = 86, // The thing we're trying to access has been deleted + k_EResultAccountLoginDeniedThrottle = 87, // login attempt failed, try to throttle response to possible attacker + k_EResultTwoFactorCodeMismatch = 88, // two factor code mismatch (only on token setup, not on login path) }; // Error codes for use with the voice functions @@ -223,19 +227,21 @@ enum EAppReleaseState //----------------------------------------------------------------------------- enum EAppOwnershipFlags { - k_EAppOwnershipFlags_None = 0x000, // unknown - k_EAppOwnershipFlags_OwnsLicense = 0x001, // owns license for this game - k_EAppOwnershipFlags_FreeLicense = 0x002, // not paid for game - k_EAppOwnershipFlags_RegionRestricted = 0x004, // owns app, but not allowed to play in current region - k_EAppOwnershipFlags_LowViolence = 0x008, // only low violence version - k_EAppOwnershipFlags_InvalidPlatform = 0x010, // app not supported on current platform - k_EAppOwnershipFlags_SharedLicense = 0x020, // license was granted by authorized local device - k_EAppOwnershipFlags_FreeWeekend = 0x040, // owned by a free weekend licenses - k_EAppOwnershipFlags_LicenseLocked = 0x080, // shared license is locked (in use) by other user - k_EAppOwnershipFlags_LicensePending = 0x100, // owns app, but transaction is still pending. Can't install or play - k_EAppOwnershipFlags_LicenseExpired = 0x200, // doesn't own app anymore since license expired - k_EAppOwnershipFlags_LicensePermanent = 0x400, // permanent license, not borrowed, or guest or freeweekend etc - k_EAppOwnershipFlags_LicenseRecurring = 0x800, // Recurring license, user is charged periodically + k_EAppOwnershipFlags_None = 0x0000, // unknown + k_EAppOwnershipFlags_OwnsLicense = 0x0001, // owns license for this game + k_EAppOwnershipFlags_FreeLicense = 0x0002, // not paid for game + k_EAppOwnershipFlags_RegionRestricted = 0x0004, // owns app, but not allowed to play in current region + k_EAppOwnershipFlags_LowViolence = 0x0008, // only low violence version + k_EAppOwnershipFlags_InvalidPlatform = 0x0010, // app not supported on current platform + k_EAppOwnershipFlags_SharedLicense = 0x0020, // license was granted by authorized local device + k_EAppOwnershipFlags_FreeWeekend = 0x0040, // owned by a free weekend licenses + k_EAppOwnershipFlags_RetailLicense = 0x0080, // has a retail license for game, (CD-Key etc) + k_EAppOwnershipFlags_LicenseLocked = 0x0100, // shared license is locked (in use) by other user + k_EAppOwnershipFlags_LicensePending = 0x0200, // owns app, but transaction is still pending. Can't install or play + k_EAppOwnershipFlags_LicenseExpired = 0x0400, // doesn't own app anymore since license expired + k_EAppOwnershipFlags_LicensePermanent = 0x0800, // permanent license, not borrowed, or guest or freeweekend etc + k_EAppOwnershipFlags_LicenseRecurring = 0x1000, // Recurring license, user is charged periodically + k_EAppOwnershipFlags_LicenseCanceled = 0x2000, // Mark as canceled, but might be still active if recurring }; @@ -323,18 +329,6 @@ enum EChatRoomEnterResponse }; -//----------------------------------------------------------------------------- -// Purpose: Status of a given depot version, these are stored in the DB, don't renumber -//----------------------------------------------------------------------------- -enum EStatusDepotVersion -{ - k_EStatusDepotVersionInvalid = 0, - k_EStatusDepotVersionDisabled = 1, // version was disabled, no manifest & content available - k_EStatusDepotVersionAvailable = 2, // manifest & content is available, but not current - k_EStatusDepotVersionCurrent = 3, // current depot version. The can be multiple, one for public and one for each beta key -}; - - typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath ); typedef bool (*PFNLegacyKeyInstalled)(); diff --git a/public/steam/steamtypes.h b/public/steam/steamtypes.h index b26990d..c3320a1 100644 --- a/public/steam/steamtypes.h +++ b/public/steam/steamtypes.h @@ -148,4 +148,10 @@ typedef uint32 AccountID_t; typedef uint32 PartnerId_t; const PartnerId_t k_uPartnerIdInvalid = 0; +// ID for a depot content manifest +typedef uint64 ManifestId_t; +const ManifestId_t k_uManifestIdInvalid = 0; + + + #endif // STEAMTYPES_H diff --git a/redistributable_bin/linux32/libsteam_api.so b/redistributable_bin/linux32/libsteam_api.so index ffc51e8..9698653 100644 Binary files a/redistributable_bin/linux32/libsteam_api.so and b/redistributable_bin/linux32/libsteam_api.so differ diff --git a/redistributable_bin/linux64/libsteam_api.so b/redistributable_bin/linux64/libsteam_api.so index 630ce7f..2d62c4f 100644 Binary files a/redistributable_bin/linux64/libsteam_api.so and b/redistributable_bin/linux64/libsteam_api.so differ diff --git a/redistributable_bin/osx32/libsteam_api.dylib b/redistributable_bin/osx32/libsteam_api.dylib index dfa1ae2..66b85ee 100644 Binary files a/redistributable_bin/osx32/libsteam_api.dylib and b/redistributable_bin/osx32/libsteam_api.dylib differ diff --git a/redistributable_bin/steam_api.dll b/redistributable_bin/steam_api.dll index b6158e3..4f9b5de 100644 Binary files a/redistributable_bin/steam_api.dll and b/redistributable_bin/steam_api.dll differ diff --git a/redistributable_bin/steam_api.lib b/redistributable_bin/steam_api.lib index c895923..0a7680b 100644 Binary files a/redistributable_bin/steam_api.lib and b/redistributable_bin/steam_api.lib differ diff --git a/redistributable_bin/win64/steam_api64.dll b/redistributable_bin/win64/steam_api64.dll index 3698b04..8888b2b 100644 Binary files a/redistributable_bin/win64/steam_api64.dll and b/redistributable_bin/win64/steam_api64.dll differ diff --git a/redistributable_bin/win64/steam_api64.lib b/redistributable_bin/win64/steam_api64.lib index 201ba3c..0f59b11 100644 Binary files a/redistributable_bin/win64/steam_api64.lib and b/redistributable_bin/win64/steam_api64.lib differ diff --git a/steamworksexample/gameenginewin32.cpp b/steamworksexample/gameenginewin32.cpp index a861d32..eebbe11 100644 --- a/steamworksexample/gameenginewin32.cpp +++ b/steamworksexample/gameenginewin32.cpp @@ -790,6 +790,7 @@ bool CGameEngineWin32::StartFrame() OutputDebugString( "Reset() call on device failed\n" ); ::MessageBox( m_hWnd, "m_pD3D9Device->Reset() call has failed unexpectedly\n", "Fatal Error", MB_OK ); Shutdown(); + return false; } } diff --git a/tools/drm/drmtoolp.exe b/tools/drm/drmtoolp.exe index 23400f0..c54ba97 100644 Binary files a/tools/drm/drmtoolp.exe and b/tools/drm/drmtoolp.exe differ diff --git a/tools/drm/ubuntu12_32/drmtoolp b/tools/drm/ubuntu12_32/drmtoolp index cc6a651..f9c552e 100644 Binary files a/tools/drm/ubuntu12_32/drmtoolp and b/tools/drm/ubuntu12_32/drmtoolp differ diff --git a/tools/drm/ubuntu12_32/drmunpackp.so b/tools/drm/ubuntu12_32/drmunpackp.so index 9e04f4a..34e402c 100644 Binary files a/tools/drm/ubuntu12_32/drmunpackp.so and b/tools/drm/ubuntu12_32/drmunpackp.so differ diff --git a/tools/drm/ubuntu12_32/steamdrmp.so b/tools/drm/ubuntu12_32/steamdrmp.so index eb01417..8bcdad3 100644 Binary files a/tools/drm/ubuntu12_32/steamdrmp.so and b/tools/drm/ubuntu12_32/steamdrmp.so differ diff --git a/tools/drm/ubuntu12_64/drmtoolp b/tools/drm/ubuntu12_64/drmtoolp index 8eda70e..b3f7f25 100644 Binary files a/tools/drm/ubuntu12_64/drmtoolp and b/tools/drm/ubuntu12_64/drmtoolp differ diff --git a/tools/drm/ubuntu12_64/drmunpackp.so b/tools/drm/ubuntu12_64/drmunpackp.so index 45b2db9..afdca02 100644 Binary files a/tools/drm/ubuntu12_64/drmunpackp.so and b/tools/drm/ubuntu12_64/drmunpackp.so differ diff --git a/tools/drm/ubuntu12_64/steamdrmp.so b/tools/drm/ubuntu12_64/steamdrmp.so index 63ad1b9..6573621 100644 Binary files a/tools/drm/ubuntu12_64/steamdrmp.so and b/tools/drm/ubuntu12_64/steamdrmp.so differ