mirror of
https://github.com/rlabrecque/SteamworksSDK.git
synced 2026-10-10 09:33:04 +08:00
v1.30
This commit is contained in:
+15
@@ -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
|
||||
----------------------------------------------------------------
|
||||
|
||||
@@ -28,5 +28,6 @@ CMainMenu::CMainMenu( IGameEngine *pGameEngine ) : CBaseMenu<EClientGameState>(
|
||||
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 ) );
|
||||
}
|
||||
@@ -185,6 +185,7 @@ enum EClientGameState
|
||||
k_EClientClanChatRoom,
|
||||
k_EClientWebCallback,
|
||||
k_EClientMusic,
|
||||
k_EClientWorkshop,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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; iSubscribedItem<numSubscribedItems; iSubscribedItem++ )
|
||||
{
|
||||
PublishedFileId_t workshopItemID = vecSubscribedItems[iSubscribedItem];
|
||||
LoadWorkshopItem( workshopItemID );
|
||||
}
|
||||
|
||||
// load local test item
|
||||
if ( m_nNumWorkshopItems < MAX_WORKSHOP_ITEMS )
|
||||
{
|
||||
CWorkshopItem *pItem = LoadWorkshopItemFromFile("workshop/workshopitem.txt");
|
||||
|
||||
if ( pItem )
|
||||
{
|
||||
strncpy( pItem->m_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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<CWorkshopItem, SteamUGCRequestUGCDetailsResult_t> 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<CSpaceWarClient, LobbyCreated_t> m_SteamCallResultLobbyCreated;
|
||||
|
||||
// callback for when we've joined a lobby
|
||||
void OnLobbyEntered( LobbyEnter_t *pCallback, bool bIOFailure );
|
||||
CCallResult<CSpaceWarClient, LobbyEnter_t> 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;
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
Binary file not shown.
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam/isteamclient.h"
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user