This commit is contained in:
Riley Labrecque
2014-01-29 13:16:49 +02:00
parent 2bb3ea4d3e
commit cef9939a5c
46 changed files with 281 additions and 33 deletions
+8
View File
@@ -11,6 +11,14 @@ website at: http://partner.steamgames.com
Revision History:
----------------------------------------------------------------
v1.16 29th July 2011
----------------------------------------------------------------
HTTP
* added ISteamHTTP::SetHTTPRequestRawPostBody() to set the raw body of a POST request
Screenshots
* added ISteamScreenshots interface, which enables adding screenshots to the user's screenshot library and tagging them with location data or relevant players that are visible in the screenshot. A game can provide screenshots based on game events using WriteScreenshot, AddScreenshotToLibrary, or TriggerScreenshot. A game can also choose to provide its own screenshots when the Steam screenshot hotkey is pressed by calling HookScreenshots() and listening for the ScreenshotRequested_t callback.
----------------------------------------------------------------
v1.15 1st June 2011
----------------------------------------------------------------
+14 -5
View File
@@ -49,7 +49,7 @@ CSpaceWarClient::CSpaceWarClient( IGameEngine *pGameEngine ) :
//-----------------------------------------------------------------------------
// Purpose: Shared initialization for both constructors
// Purpose: initialize our client for use
//-----------------------------------------------------------------------------
void CSpaceWarClient::Init( IGameEngine *pGameEngine )
{
@@ -78,7 +78,7 @@ void CSpaceWarClient::Init( IGameEngine *pGameEngine )
m_pServer = NULL;
m_uPlayerShipIndex = 0;
m_eConnectedStatus = k_EClientNotConnected;
m_bTransitionedGameState = false;
m_bTransitionedGameState = true;
m_rgchErrorText[0] = 0;
m_unServerIP = 0;
m_usServerPort = 0;
@@ -483,7 +483,7 @@ void CSpaceWarClient::SetGameState( EClientGameState eState )
//-----------------------------------------------------------------------------
// Purpose: Used to transition game state
// Purpose: set the error string to display in the UI
//-----------------------------------------------------------------------------
void CSpaceWarClient::SetConnectionFailureText( const char *pchErrorText )
{
@@ -553,7 +553,7 @@ void CSpaceWarClient::InitiateServerConnection( CSteamID steamIDGameServer )
//-----------------------------------------------------------------------------
// Purpose: steam callback, trigger when our connection state changes
// Purpose: steam callback, triggered when our connection to another client fails
//-----------------------------------------------------------------------------
void CSpaceWarClient::OnP2PSessionConnectFail( P2PSessionConnectFail_t *pCallback )
{
@@ -894,10 +894,12 @@ void CSpaceWarClient::OnGameStateChanged( EClientGameState eGameStateNew )
{
// If we are just opening the find servers screen, then start a refresh
m_pServerBrowser->RefreshInternetServers();
SteamFriends()->SetRichPresence( "status", "Finding an internet game" );
}
else if ( m_eGameState == k_EClientFindLANServers )
{
m_pServerBrowser->RefreshLANServers();
SteamFriends()->SetRichPresence( "status", "Finding a LAN game" );
}
else if ( m_eGameState == k_EClientCreatingLobby )
{
@@ -909,10 +911,12 @@ void CSpaceWarClient::OnGameStateChanged( EClientGameState eGameStateNew )
// set the function to call when this completes
m_SteamCallResultLobbyCreated.Set( hSteamAPICall, this, &CSpaceWarClient::OnLobbyCreated );
}
SteamFriends()->SetRichPresence( "status", "Creating a lobby" );
}
else if ( m_eGameState == k_EClientFindLobby )
{
m_pLobbyBrowser->Refresh();
SteamFriends()->SetRichPresence( "status", "Main menu: finding lobbies" );
}
else if ( m_eGameState == k_EClientGameMenu )
{
@@ -927,6 +931,8 @@ void CSpaceWarClient::OnGameStateChanged( EClientGameState eGameStateNew )
delete m_pServer;
m_pServer = NULL;
}
SteamFriends()->SetRichPresence( "status", "Main menu" );
}
else if ( m_eGameState == k_EClientGameWinner || m_eGameState == k_EClientGameDraw )
{
@@ -937,16 +943,19 @@ void CSpaceWarClient::OnGameStateChanged( EClientGameState eGameStateNew )
{
// we've switched to the leaderboard menu
m_pLeaderboards->Show();
SteamFriends()->SetRichPresence( "status", "Viewing leaderboards" );
}
else if ( m_eGameState == k_EClientGameActive )
{
// start voice chat
m_pVoiceChat->StartVoiceChat();
SteamFriends()->SetRichPresence( "status", "In match" );
}
else if ( m_eGameState == k_EClientRemoteStorage )
{
// we've switched to the remote storage menu
m_pRemoteStorage->Show();
SteamFriends()->SetRichPresence( "status", "Viewing remote storage" );
}
}
@@ -1026,7 +1035,7 @@ void CSpaceWarClient::OnGameOverlayActivated( GameOverlayActivated_t *callback )
//-----------------------------------------------------------------------------
// Purpose: Handles notification that we are now connected to Steam
// Purpose: Handles notification that we are failed to connected to Steam
//-----------------------------------------------------------------------------
void CSpaceWarClient::OnSteamServerConnectFailure( SteamServerConnectFailure_t *callback )
{
+2 -2
View File
@@ -281,7 +281,7 @@ void CSpaceWarServer::OnClientBeginAuthentication( CSteamID steamIDClient, void
}
//-----------------------------------------------------------------------------
// Purpose: Handle a new client connecting
// Purpose: A new client that connected has had their authentication processed
//-----------------------------------------------------------------------------
void CSpaceWarServer::OnAuthCompleted( bool bAuthSuccessful, uint32 iPendingAuthIndex )
{
@@ -864,7 +864,7 @@ void CSpaceWarServer::OnSteamServersConnected( SteamServersConnected_t *pLogonSu
//-----------------------------------------------------------------------------
// Purpose: Callback from Steam3 when logon is fully completed and VAC secure policy is set
// Purpose: Callback from Steam when logon is fully completed and VAC secure policy is set
//-----------------------------------------------------------------------------
void CSpaceWarServer::OnPolicyResponse( GSPolicyResponse_t *pPolicyResponse )
{
+1
View File
@@ -130,6 +130,7 @@ typedef unsigned char uint8;
#define VK_RIGHT 0x27
#define VK_DOWN 0x28
#define VK_SELECT 0x29
#define VK_F5 0x74
#ifndef VALVE_RECT_DEFINED
#define VALVE_RECT_DEFINED
+11 -4
View File
@@ -23,6 +23,7 @@
#include <OpenGL/CGLCurrent.h>
#include <OpenGL/CGLProfiler.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <ApplicationServices/ApplicationServices.h>
#include "imageformat.h"
@@ -36,6 +37,15 @@
// some portability shims to eliminate dependencies on partcular segments of Valve code
typedef int8_t int8;
typedef uint8_t uint8;
typedef int16_t int16;
typedef uint16_t uint16;
typedef int32_t int32;
typedef uint32_t uint32;
typedef int64_t int64;
typedef uint64_t uint64;
class CUtlBuffer
{
public:
@@ -152,9 +162,6 @@ private:
#define Q_memset(dst,count,val) memset(dst,count,val)
typedef int int32;
typedef unsigned int uint32;
int V_stricmp(const char *s1, const char *s2 );
char const* V_stristr( char const* pStr, char const* pSearch );
@@ -304,7 +311,7 @@ inline void GLMDebugger( void )
{
if (GLMDebugChannelMask() & (1<<eDebugger))
{
asm {int 3 };
asm ( "int $3" );
}
if (GLMDebugChannelMask() & (1<<eGLProfiler))
+24
View File
@@ -36,6 +36,7 @@ public:
// 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
virtual bool BIsSubscribedFromFreeWeekend() = 0;
// Returns the number of DLC pieces for the running app
virtual int GetDLCCount() = 0;
@@ -66,6 +67,29 @@ struct DlcInstalled_t
AppId_t m_nAppID; // AppID of the DLC
};
//-----------------------------------------------------------------------------
// Purpose: possible results when registering an activation code
//-----------------------------------------------------------------------------
enum ERegisterActivactionCodeResult
{
k_ERegisterActivactionCodeResultOK = 0,
k_ERegisterActivactionCodeResultFail = 1,
k_ERegisterActivactionCodeResultAlreadyRegistered = 2,
k_ERegisterActivactionCodeResultTimeout = 3,
};
//-----------------------------------------------------------------------------
// Purpose: response to RegisterActivationCode()
//-----------------------------------------------------------------------------
struct RegisterActivationCodeResponse_t
{
enum { k_iCallback = k_iSteamAppsCallbacks + 8 };
ERegisterActivactionCodeResult m_eResult;
uint32 m_unPackageRegistered; // package that was registered. Only set on success
};
#pragma pack( pop )
#endif // ISTEAMAPPS_H
+9 -1
View File
@@ -41,6 +41,7 @@ class ISteamUserStats;
class ISteamApps;
class ISteamNetworking;
class ISteamRemoteStorage;
class ISteamScreenshots;
class ISteamGameServerStats;
class ISteamPS3OverlayRender;
class ISteamHTTP;
@@ -116,6 +117,10 @@ public:
// remote storage
virtual ISteamRemoteStorage *GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// user screenshots
virtual ISteamScreenshots *GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
// this needs to be called every frame to process matchmaking results
// redundant if you're already calling SteamAPI_RunCallbacks()
virtual void RunFrame() = 0;
@@ -145,7 +150,7 @@ public:
};
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient010"
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient011"
//-----------------------------------------------------------------------------
// Purpose: Base values for callback identifiers, each callback must
@@ -172,5 +177,8 @@ enum { k_iSteamGameServerStatsCallbacks = 1800 };
enum { k_iSteam2AsyncCallbacks = 1900 };
enum { k_iSteamGameStatsCallbacks = 2000 };
enum { k_iClientHTTPCallbacks = 2100 };
enum { k_iClientScreenshotsCallbacks = 2200 };
enum { k_iSteamScreenshotsCallbacks = 2300 };
enum { k_iClientAudioCallbacks = 2400 };
#endif // ISTEAMCLIENT_H
+28 -1
View File
@@ -26,8 +26,15 @@ enum EFriendRelationship
k_EFriendRelationshipRequestInitiator = 4,
k_EFriendRelationshipIgnored = 5,
k_EFriendRelationshipIgnoredFriend = 6,
k_EFriendRelationshipSuggested = 7,
};
// maximum length of friend group name (not including terminating nul!)
const int k_cchMaxFriendGroupName = 64;
// maximum number of groups a single user is allowed
const int k_cFriendGroupLimit = 100;
//-----------------------------------------------------------------------------
// Purpose: list of states a friend can be in
@@ -60,6 +67,7 @@ enum EFriendFlags
k_EFriendFlagRequestingInfo = 0x100,
k_EFriendFlagIgnored = 0x200,
k_EFriendFlagIgnoredFriend = 0x400,
k_EFriendFlagSuggested = 0x800,
k_EFriendFlagAll = 0xFFFF,
};
@@ -171,6 +179,7 @@ public:
// iterators for getting users in a chat room, lobby, game server or clan
// note that large clans that cannot be iterated by the local user
// note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby
// steamIDSource can be the steamID of a group, game server, lobby or chat room
virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0;
virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0;
@@ -309,6 +318,7 @@ enum EPersonaChange
k_EPersonaChangeLeftSource = 0x100,
k_EPersonaChangeRelationshipChanged = 0x200,
k_EPersonaChangeNameFirstSet = 0x400,
k_EPersonaChangeFacebookInfo = 0x800,
};
@@ -343,7 +353,13 @@ struct GameLobbyJoinRequested_t
{
enum { k_iCallback = k_iSteamFriendsCallbacks + 33 };
CSteamID m_steamIDLobby;
CSteamID m_steamIDFriend; // the friend they did the join via (will be invalid if not directly via a friend)
// The friend they did the join via (will be invalid if not directly via a friend)
//
// On PS3, the friend will be invalid if this was triggered by a PSN invite via the XMB, but
// the account type will be console user so you can tell at least that this was from a PSN friend
// rather than a Steam friend.
CSteamID m_steamIDFriend;
};
@@ -393,6 +409,17 @@ struct GameRichPresenceJoinRequested_t
char m_rgchConnect[k_cchMaxRichPresenceValueLength];
};
//-----------------------------------------------------------------------------
// Purpose: called when the user requests the history of player names on a given account
//-----------------------------------------------------------------------------
struct NameHistoryResponse_t
{
enum { k_iCallback = k_iSteamFriendsCallbacks + 38 };
int m_cSuccessfulLookups; // number of lookups that were successful
int m_cFailedLookups; // number of lookups that failed for one reason or another
};
#pragma pack( pop )
#endif // ISTEAMFRIENDS_H
+5
View File
@@ -90,6 +90,11 @@ public:
// received which included a content-length field. For responses that contain no content-length it will report
// zero for the duration of the request as the size is unknown until the connection closes.
virtual bool GetHTTPDownloadProgressPct( HTTPRequestHandle hRequest, float *pflPercentOut ) = 0;
// Sets the body for an HTTP Post request. Will fail and return false on a GET request, and will fail if POST params
// have already been set for the request. Setting this raw body makes it the only contents for the post, the pchContentType
// parameter will set the content-type header for the request so the server may know how to interpret the body.
virtual bool SetHTTPRequestRawPostBody( HTTPRequestHandle hRequest, const char *pchContentType, uint8 *pubBody, uint32 unBodyLen ) = 0;
};
#define STEAMHTTP_INTERFACE_VERSION "STEAMHTTP_INTERFACE_VERSION001"
+3 -2
View File
@@ -38,11 +38,11 @@ enum ELobbyComparison
k_ELobbyComparisonNotEqual = 3,
};
// lobby search distance
// lobby search distance. Lobby results are sorted from closest to farthest.
enum ELobbyDistanceFilter
{
k_ELobbyDistanceFilterClose, // only lobbies in the same immediate region will be returned
k_ELobbyDistanceFilterDefault, // only lobbies in the same region or close, but looking further if the current region has infrequent lobby activity (the default)
k_ELobbyDistanceFilterDefault, // only lobbies in the same region or near by regions
k_ELobbyDistanceFilterFar, // for games that don't have many latency requirements, will return lobbies about half-way around the globe
k_ELobbyDistanceFilterWorldwide, // no filtering, will match lobbies as far as India to NY (not recommended, expect multiple seconds of latency between the clients)
};
@@ -160,6 +160,7 @@ public:
virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0;
// returns the CSteamID of a user in the lobby
// iMember is of range [0,GetNumLobbyMembers())
// note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby
virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0;
// Get data associated with this lobby
+6
View File
@@ -79,6 +79,12 @@ public:
// should then ignore all the input until BHandleCellPadData once again returns false, which
// will mean the overlay is deactivated.
virtual bool BHandleCellPadData( const CellPadData &padData ) = 0;
// Call this if you detect no controllers connected or that the XMB is intercepting input
//
// This is important to clear input state for the overlay, so keys left down during XMB activation
// are not continued to be processed.
virtual bool BResetInputState() = 0;
};
+26 -4
View File
@@ -84,11 +84,21 @@ class ISteamRemoteStorage
virtual UGCHandle_t GetCachedUGCHandle( int32 iCachedContent ) = 0;
// The following functions are only necessary on the Playstation 3. On PC & Mac, the Steam client will handle these operations for you
#if _PS3
// synchronization
// On Playstation 3, the game controls which files are stored in the cloud, via FilePersist, FileFetch, and FileForget.
#if defined(_PS3) || defined(_SERVER)
// Connect to Steam and get a list of files in the Cloud - results in a RemoteStorageAppSyncStatusCheck_t callback
virtual void GetFileListFromServer() = 0;
// Indicate this file should be downloaded in the next sync
virtual bool FileFetch( const char *pchFile ) = 0;
// Indicate this file should be persisted in the next sync
virtual bool FilePersist( const char *pchFile ) = 0;
// Pull any requested files down from the Cloud - results in a RemoteStorageAppSyncedClient_t callback
virtual bool SynchronizeToClient() = 0;
// Upload any requested files to the Cloud - results in a RemoteStorageAppSyncedServer_t callback
virtual bool SynchronizeToServer() = 0;
virtual bool ResolveSyncConflict( EResolveConflict eResolveConflict ) = 0;
// Reset any fetch/persist/etc requests
virtual bool ResetFileRequestState() = 0;
#endif
};
@@ -136,9 +146,21 @@ struct RemoteStorageAppSyncProgress_t
};
//
// IMPORTANT! k_iClientRemoteStorageCallbacks + 4-5 are used, see iclientremotestorage.h
// IMPORTANT! k_iClientRemoteStorageCallbacks + 4 is used, see iclientremotestorage.h
//
//-----------------------------------------------------------------------------
// Purpose: Sent after we've determined the list of files that are out of sync
// with the server.
//-----------------------------------------------------------------------------
struct RemoteStorageAppSyncStatusCheck_t
{
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 5 };
AppId_t m_nAppID;
EResult m_eResult;
};
//-----------------------------------------------------------------------------
// Purpose: Sent after a conflict resolution attempt.
//-----------------------------------------------------------------------------
+85
View File
@@ -0,0 +1,85 @@
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
//
// Purpose: public interface to user remote file storage in Steam
//
//=============================================================================
#ifndef ISTEAMSCREENSHOTS_H
#define ISTEAMSCREENSHOTS_H
#ifdef _WIN32
#pragma once
#endif
#include "isteamclient.h"
const uint32 k_nScreenshotMaxTaggedUsers = 32;
const int k_cubUFSTagTypeMax = 255;
const int k_cubUFSTagValueMax = 255;
// Required with of a thumbnail provided to AddScreenshotToLibrary. If you do not provide a thumbnail
// one will be generated.
const int k_ScreenshotThumbWidth = 200;
// Handle is valid for the lifetime of your process and no longer
typedef uint32 ScreenshotHandle;
#define INVALID_SCREENSHOT_HANDLE 0
//-----------------------------------------------------------------------------
// Purpose: Functions for adding screenshots to the user's screenshot library
//-----------------------------------------------------------------------------
class ISteamScreenshots
{
public:
// Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format.
// The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
virtual ScreenshotHandle WriteScreenshot( void *pubRGB, uint32 cubRGB, int nWidth, int nHeight ) = 0;
// Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio
// as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format.
// The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
virtual ScreenshotHandle AddScreenshotToLibrary( const char *pchJpegOrTGAFilename, const char *pchJpegOrTGAThumbFilename, int nWidth, int nHeight ) = 0;
// Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead.
virtual void TriggerScreenshot() = 0;
// Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots,
// then the ScreenshotRequested_t callback will be sent if the user presses the hotkey, and the game is expected to call WriteScreenshot or AddScreenshotToLibrary
// in response.
virtual void HookScreenshots( bool bHook ) = 0;
// Sets metadata about a screenshot's location (for example, the name of the map)
virtual bool SetLocation( ScreenshotHandle hScreenshot, const char *pchLocation ) = 0;
// Tags a user as being visible in the screenshot
virtual bool TagUser( ScreenshotHandle hScreenshot, CSteamID steamID ) = 0;
};
#define STEAMSCREENSHOTS_INTERFACE_VERSION "STEAMSCREENSHOTS_INTERFACE_VERSION001"
// callbacks
#pragma pack( push, 8 )
//-----------------------------------------------------------------------------
// Purpose: Screenshot successfully written or otherwise added to the library
// and can now be tagged
//-----------------------------------------------------------------------------
struct ScreenshotReady_t
{
enum { k_iCallback = k_iSteamScreenshotsCallbacks + 1 };
ScreenshotHandle m_hLocal;
EResult m_eResult;
};
//-----------------------------------------------------------------------------
// Purpose: Screenshot has been requested by the user. Only sent if
// HookScreenshots() has been called, in which case Steam will not take
// the screenshot itself.
//-----------------------------------------------------------------------------
struct ScreenshotRequested_t
{
enum { k_iCallback = k_iSteamScreenshotsCallbacks + 2 };
};
#pragma pack( pop )
#endif // ISTEAMSCREENSHOTS_H
+5 -2
View File
@@ -90,6 +90,7 @@ public:
// data is not the raw feed from the microphone: data may only be available if audible
// levels of speech are detected.
// nUncompressedVoiceDesiredSampleRate is necessary to know the number of bytes to return in pcbUncompressed - can be set to 0 if you don't need uncompressed (the usual case)
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nUncompressedVoiceDesiredSampleRate
virtual EVoiceResult GetAvailableVoice(uint32 *pcbCompressed, uint32 *pcbUncompressed, uint32 nUncompressedVoiceDesiredSampleRate) = 0;
// Gets the latest voice data from the microphone. Compressed data is an arbitrary format, and is meant to be handed back to
@@ -102,6 +103,7 @@ public:
// You must grab both compressed and uncompressed here at the same time, if you want both.
// Matching data that is not read during this call will be thrown away.
// GetAvailableVoice() can be used to determine how much data is actually available.
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nUncompressedVoiceDesiredSampleRate
virtual EVoiceResult GetVoice( bool bWantCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, bool bWantUncompressed, void *pUncompressedDestBuffer, uint32 cbUncompressedDestBufferSize, uint32 *nUncompressBytesWritten, uint32 nUncompressedVoiceDesiredSampleRate ) = 0;
// Decompresses a chunk of compressed data produced by GetVoice().
@@ -109,6 +111,7 @@ public:
// In that case, nBytesWritten is set to the size of the buffer required to decompress the given
// data. The suggested buffer size for the destination buffer is 22 kilobytes.
// The output format of the data is 16-bit signed at the requested samples per second.
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nDesiredSampleRate
virtual EVoiceResult DecompressVoice( const void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, uint32 nDesiredSampleRate ) = 0;
// This returns the frequency of the voice data as it's stored internally; calling DecompressVoice() with this size will yield the best results
@@ -156,7 +159,7 @@ public:
// prompt the user for network setup/PSN logon before initiating the Steam side of the logon.
//
// Listen for SteamServersConnected_t or SteamServerConnectFailure_t for status. SteamServerConnectFailure_t
// may return with EResult k_EResultPSNAccountUnlinked if the PSN account is unknown to Steam. You should
// may return with EResult k_EResultExternalAccountUnlinked if the PSN account is unknown to Steam. You should
// then call LogOnAndLinkSteamAccountToPSN() after prompting the user for credentials to establish a link.
// Future calls to LogOn() after the one time link call should succeed as long as the user is connected to PSN.
virtual void LogOn( bool bInteractive ) = 0;
@@ -169,7 +172,7 @@ public:
// should be the users Steam username, and pchPassword should be the users Steam password.
//
// Listen for SteamServersConnected_t or SteamServerConnectFailure_t for status. SteamServerConnectFailure_t
// may return with EResult k_EResultPSNAccountAlreadyLinked if already linked to another account.
// may return with EResult k_EResultOtherAccountAlreadyLinked if already linked to another account.
virtual void LogOnAndLinkSteamAccountToPSN( bool bInteractive, const char *pchUserName, const char *pchPassword ) = 0;
// Final logon option for PS3, this logs into an existing account if already linked, but if not already linked
+6 -3
View File
@@ -115,12 +115,15 @@ public:
// Achievement / GroupAchievement metadata
// Gets the icon of the achievement, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set.
// Gets the icon of the achievement, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if none set.
// A return value of 0 may indicate we are still fetching data, and you can wait for the UserAchievementIconFetched_t callback
// which will notify you when the bits are ready. If the callback still returns zero, then there is no image set for the
// specified achievement.
virtual int GetAchievementIcon( const char *pchName ) = 0;
// Get general attributes (display name, desc, etc) for an Achievement
// Get general attributes for an achievement. Accepts the following keys:
// - "name" and "desc" for retrieving the localized achievement name and description (returned in UTF8)
// - "hidden" for retrieving if an achievement is hidden (returns "0" when not hidden, "1" when hidden)
virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0;
// Achievement progress - triggers an AchievementProgress callback, that is all.
@@ -385,7 +388,7 @@ struct UserAchievementIconFetched_t
CGameID m_nGameID; // Game this is for
char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement
bool m_bAchieved; // Is the icon for the achieved or not achieved version?
int m_nIconHandle; // Handle to the image, which can be used in ClientUtils()->GetImageRGBA(), 0 means no image is set for the achievement
int m_nIconHandle; // Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement
};
+4
View File
@@ -125,6 +125,10 @@ public:
virtual void PostPS3SysutilCallback( uint64_t status, uint64_t param, void* userdata ) = 0;
virtual bool BIsReadyToShutdown() = 0;
virtual bool BIsPSNOnline() = 0;
// Call this with localized strings for the language the game is running in, otherwise default english
// strings will be used by Steam.
virtual void SetPSNGameBootInviteStrings( const char *pchSubject, const char *pchBody ) = 0;
#endif
};
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+10
View File
@@ -19,6 +19,7 @@
#include "isteamapps.h"
#include "isteamnetworking.h"
#include "isteamremotestorage.h"
#include "isteamscreenshots.h"
#include "isteamhttp.h"
#if defined( _PS3 )
@@ -120,6 +121,7 @@ S_API ISteamApps *SteamApps();
S_API ISteamNetworking *SteamNetworking();
S_API ISteamMatchmakingServers *SteamMatchmakingServers();
S_API ISteamRemoteStorage *SteamRemoteStorage();
S_API ISteamScreenshots *SteamScreenshots();
S_API ISteamHTTP *SteamHTTP();
#ifdef _PS3
S_API ISteamPS3OverlayRender * SteamPS3OverlayRender();
@@ -221,6 +223,7 @@ public:
Cancel();
}
void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; }
private:
virtual void Run( void *pvParam )
{
@@ -397,6 +400,7 @@ public:
ISteamMatchmakingServers* SteamMatchmakingServers() { return m_pSteamMatchmakingServers; }
ISteamNetworking* SteamNetworking() { return m_pSteamNetworking; }
ISteamRemoteStorage* SteamRemoteStorage() { return m_pSteamRemoteStorage; }
ISteamScreenshots* SteamScreenshots() { return m_pSteamScreenshots; }
ISteamHTTP* SteamHTTP() { return m_pSteamHTTP; }
#ifdef _PS3
ISteamPS3OverlayRender* SteamPS3OverlayRender() { return m_pSteamPS3OverlayRender; }
@@ -412,6 +416,7 @@ private:
ISteamMatchmakingServers *m_pSteamMatchmakingServers;
ISteamNetworking *m_pSteamNetworking;
ISteamRemoteStorage *m_pSteamRemoteStorage;
ISteamScreenshots *m_pSteamScreenshots;
ISteamHTTP *m_pSteamHTTP;
#ifdef _PS3
ISteamPS3OverlayRender *m_pSteamPS3OverlayRender;
@@ -434,6 +439,7 @@ inline void CSteamAPIContext::Clear()
m_pSteamMatchmakingServers = NULL;
m_pSteamNetworking = NULL;
m_pSteamRemoteStorage = NULL;
m_pSteamScreenshots = NULL;
}
// This function must be inlined so the module using steam_api.dll gets the version names they want.
@@ -481,6 +487,10 @@ inline bool CSteamAPIContext::Init()
if ( !m_pSteamRemoteStorage )
return false;
m_pSteamScreenshots = SteamClient()->GetISteamScreenshots( hSteamUser, hSteamPipe, STEAMSCREENSHOTS_INTERFACE_VERSION );
if ( !m_pSteamScreenshots )
return false;
m_pSteamHTTP = SteamClient()->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION );
if ( !m_pSteamHTTP )
return false;
+5 -2
View File
@@ -81,9 +81,9 @@ enum EResult
k_EResultDiskFull = 54, // Operation canceled - not enough disk space.
k_EResultRemoteCallFailed = 55, // an remote call or IPC call failed
k_EResultPasswordUnset = 56, // Password could not be verified as it's unset server side
k_EResultPSNAccountUnlinked = 57, // Attempt to logon from a PS3 failed because the PSN online id is not linked to a Steam account
k_EResultExternalAccountUnlinked = 57, // External account (PSN, Facebook...) is not linked to a Steam account
k_EResultPSNTicketInvalid = 58, // PSN ticket was invalid
k_EResultPSNAccountAlreadyLinked = 59, // PSN account is already linked to some other account, must explicitly request to replace/delete the link first
k_EResultExternalAccountAlreadyLinked = 59, // External account (PSN, Facebook...) is already linked to some other account, must explicitly request to replace/delete the link first
k_EResultRemoteFileConflict = 60, // The sync cannot resume due to a conflict between the local and remote files
k_EResultIllegalPassword = 61, // The requested new password is not legal
k_EResultSameAsPreviousValue = 62, // new value is the same as the old one ( secret question and answer )
@@ -93,7 +93,10 @@ enum EResult
k_EResultAccountLogonDeniedNoMail = 66, // account login denied due to 2nd factor auth failure - and no mail has been sent
k_EResultHardwareNotCapableOfIPT = 67, //
k_EResultIPTInitError = 68, //
k_EResultParentalControlRestricted = 69, // operation failed due to parental control restrictions for current user
k_EResultFacebookQueryError = 70, // Facebook query returned an error
k_EResultExpiredLoginAuthCode = 71, // account login denied due to auth code expired
k_EResultIPLoginRestrictionFailed = 72,
};
// Error codes for use with the voice functions
+22 -4
View File
@@ -19,8 +19,8 @@
#define STEAM_PS3_SERVICE_ID_MAX 32
#define STEAM_PS3_COMMUNICATION_ID_MAX 10
#define STEAM_PS3_COMMUNICATION_SIG_MAX 160
#define STEAM_PS3_GAMEBOOT_INVITE_SUBJECT_MAX 18
#define STEAM_PS3_GAMEBOOT_INVITE_BODY_MAX 512
#define STEAM_PS3_LANGUAGE_MAX 64
#define STEAM_PS3_REGION_CODE_MAX 16
struct SteamPS3Params_t
{
void *pReserved;
@@ -33,9 +33,27 @@ struct SteamPS3Params_t
char m_rgchNpCommunicationID[ STEAM_PS3_COMMUNICATION_ID_MAX ];
char m_rgchNpCommunicationSig[ STEAM_PS3_COMMUNICATION_SIG_MAX ];
char m_rgchGameBootInviteSubject[ STEAM_PS3_GAMEBOOT_INVITE_SUBJECT_MAX ];
char m_rgchGameBootInviteBody[ STEAM_PS3_GAMEBOOT_INVITE_BODY_MAX ];
// Language should be one of the following. must be zero terminated
// danish
// dutch
// english
// finnish
// french
// german
// italian
// korean
// norwegian
// polish
// portuguese
// russian
// schinese
// spanish
// swedish
// tchinese
char m_rgchSteamLanguage[ STEAM_PS3_LANGUAGE_MAX ];
// region codes are "SCEA", "SCEE", "SCEJ". must be zero terminated
char m_rgchRegionCode[ STEAM_PS3_REGION_CODE_MAX ];
// Should be SYS_TTYP3 through SYS_TTYP10, if it's 0 then Steam won't spawn a
// thread to read console input at all. Using this let's you use Steam console commands
+4
View File
@@ -103,6 +103,10 @@ typedef uint32 AppId_t;
const AppId_t k_uAppIdInvalid = 0x0;
typedef uint32 PhysicalItemId_t;
const PhysicalItemId_t k_uPhysicalItemIdInvalid = 0x0;
// this is baked into client messages and interfaces as an int,
// make sure we never break this. AppIds and DepotIDs also presently
// share the same namespace, but since we'd like to change that in the future
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.
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -191,7 +191,7 @@ CGameEngineWin32::CGameEngineWin32( HINSTANCE hInstance, int nShowCommand, int32
// initialzie XAudio2 interface
if( FAILED( XAudio2Create( &m_pXAudio2, 0 ) ) )
{
::MessageBoxA( NULL, "Failed to init XAudio2 engine", "SteamworksExample - Fatal error", MB_OK | MB_ICONERROR );
::MessageBoxA( NULL, "Failed to init XAudio2 engine (grab the latest \"DirectX End-User Runtime Web Installer\" )", "SteamworksExample - Fatal error", MB_OK | MB_ICONERROR );
return;
}
+2 -2
View File
@@ -244,12 +244,12 @@ void CRemoteStorageSync::OnMenuSelection( ERemoteStorageSyncMenuCommand selectio
case k_EMenuCommandKeepClient:
m_menu.ShowSyncProgress( m_eSyncOperation, 0.0 );
SteamRemoteStorage()->ResolveSyncConflict( k_EResolveConflictKeepClient );
//SteamRemoteStorage()->ResolveSyncConflict( k_EResolveConflictKeepClient );
break;
case k_EMenuCommandKeepServer:
m_menu.ShowSyncProgress( m_eSyncOperation, 0.0 );
SteamRemoteStorage()->ResolveSyncConflict( k_EResolveConflictKeepServer );
//SteamRemoteStorage()->ResolveSyncConflict( k_EResolveConflictKeepServer );
break;
}
}
Binary file not shown.