SDK 1.52
parent
19dc4f468a
commit
98b149b9b6
@ -0,0 +1,240 @@
|
|||||||
|
|
||||||
|
#ifndef ISTEAMGAMESERVER013_H
|
||||||
|
#define ISTEAMGAMESERVER013_H
|
||||||
|
#ifdef STEAM_WIN32
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class ISteamGameServer013
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// Basic server data. These properties, if set, must be set before before calling LogOn. They
|
||||||
|
// may not be changed after logged in.
|
||||||
|
//
|
||||||
|
|
||||||
|
/// This is called by SteamGameServer_Init, and you will usually not need to call it directly
|
||||||
|
STEAM_PRIVATE_API( virtual bool InitGameServer( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char *pchVersionString ) = 0; )
|
||||||
|
|
||||||
|
/// Game product identifier. This is currently used by the master server for version checking purposes.
|
||||||
|
/// It's a required field, but will eventually will go away, and the AppID will be used for this purpose.
|
||||||
|
virtual void SetProduct( const char *pszProduct ) = 0;
|
||||||
|
|
||||||
|
/// Description of the game. This is a required field and is displayed in the steam server browser....for now.
|
||||||
|
/// This is a required field, but it will go away eventually, as the data should be determined from the AppID.
|
||||||
|
virtual void SetGameDescription( const char *pszGameDescription ) = 0;
|
||||||
|
|
||||||
|
/// If your game is a "mod," pass the string that identifies it. The default is an empty string, meaning
|
||||||
|
/// this application is the original game, not a mod.
|
||||||
|
///
|
||||||
|
/// @see k_cbMaxGameServerGameDir
|
||||||
|
virtual void SetModDir( const char *pszModDir ) = 0;
|
||||||
|
|
||||||
|
/// Is this is a dedicated server? The default value is false.
|
||||||
|
virtual void SetDedicatedServer( bool bDedicated ) = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Login
|
||||||
|
//
|
||||||
|
|
||||||
|
/// Begin process to login to a persistent game server account
|
||||||
|
///
|
||||||
|
/// You need to register for callbacks to determine the result of this operation.
|
||||||
|
/// @see SteamServersConnected_t
|
||||||
|
/// @see SteamServerConnectFailure_t
|
||||||
|
/// @see SteamServersDisconnected_t
|
||||||
|
virtual void LogOn( const char *pszToken ) = 0;
|
||||||
|
|
||||||
|
/// Login to a generic, anonymous account.
|
||||||
|
///
|
||||||
|
/// Note: in previous versions of the SDK, this was automatically called within SteamGameServer_Init,
|
||||||
|
/// but this is no longer the case.
|
||||||
|
virtual void LogOnAnonymous() = 0;
|
||||||
|
|
||||||
|
/// Begin process of logging game server out of steam
|
||||||
|
virtual void LogOff() = 0;
|
||||||
|
|
||||||
|
// status functions
|
||||||
|
virtual bool BLoggedOn() = 0;
|
||||||
|
virtual bool BSecure() = 0;
|
||||||
|
virtual CSteamID GetSteamID() = 0;
|
||||||
|
|
||||||
|
/// Returns true if the master server has requested a restart.
|
||||||
|
/// Only returns true once per request.
|
||||||
|
virtual bool WasRestartRequested() = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Server state. These properties may be changed at any time.
|
||||||
|
//
|
||||||
|
|
||||||
|
/// Max player count that will be reported to server browser and client queries
|
||||||
|
virtual void SetMaxPlayerCount( int cPlayersMax ) = 0;
|
||||||
|
|
||||||
|
/// Number of bots. Default value is zero
|
||||||
|
virtual void SetBotPlayerCount( int cBotplayers ) = 0;
|
||||||
|
|
||||||
|
/// Set the name of server as it will appear in the server browser
|
||||||
|
///
|
||||||
|
/// @see k_cbMaxGameServerName
|
||||||
|
virtual void SetServerName( const char *pszServerName ) = 0;
|
||||||
|
|
||||||
|
/// Set name of map to report in the server browser
|
||||||
|
///
|
||||||
|
/// @see k_cbMaxGameServerName
|
||||||
|
virtual void SetMapName( const char *pszMapName ) = 0;
|
||||||
|
|
||||||
|
/// Let people know if your server will require a password
|
||||||
|
virtual void SetPasswordProtected( bool bPasswordProtected ) = 0;
|
||||||
|
|
||||||
|
/// Spectator server. The default value is zero, meaning the service
|
||||||
|
/// is not used.
|
||||||
|
virtual void SetSpectatorPort( uint16 unSpectatorPort ) = 0;
|
||||||
|
|
||||||
|
/// Name of the spectator server. (Only used if spectator port is nonzero.)
|
||||||
|
///
|
||||||
|
/// @see k_cbMaxGameServerMapName
|
||||||
|
virtual void SetSpectatorServerName( const char *pszSpectatorServerName ) = 0;
|
||||||
|
|
||||||
|
/// Call this to clear the whole list of key/values that are sent in rules queries.
|
||||||
|
virtual void ClearAllKeyValues() = 0;
|
||||||
|
|
||||||
|
/// Call this to add/update a key/value pair.
|
||||||
|
virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0;
|
||||||
|
|
||||||
|
/// Sets a string defining the "gametags" for this server, this is optional, but if it is set
|
||||||
|
/// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||||
|
///
|
||||||
|
/// @see k_cbMaxGameServerTags
|
||||||
|
virtual void SetGameTags( const char *pchGameTags ) = 0;
|
||||||
|
|
||||||
|
/// Sets a string defining the "gamedata" for this server, this is optional, but if it is set
|
||||||
|
/// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||||
|
/// don't set this unless it actually changes, its only uploaded to the master once (when
|
||||||
|
/// acknowledged)
|
||||||
|
///
|
||||||
|
/// @see k_cbMaxGameServerGameData
|
||||||
|
virtual void SetGameData( const char *pchGameData ) = 0;
|
||||||
|
|
||||||
|
/// Region identifier. This is an optional field, the default value is empty, meaning the "world" region
|
||||||
|
virtual void SetRegion( const char *pszRegion ) = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Player list management / authentication
|
||||||
|
//
|
||||||
|
|
||||||
|
// Handles receiving a new connection from a Steam user. This call will ask the Steam
|
||||||
|
// servers to validate the users identity, app ownership, and VAC status. If the Steam servers
|
||||||
|
// are off-line, then it will validate the cached ticket itself which will validate app ownership
|
||||||
|
// and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection()
|
||||||
|
// and must then be sent up to the game server for authentication.
|
||||||
|
//
|
||||||
|
// Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL
|
||||||
|
// If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication
|
||||||
|
// for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)
|
||||||
|
virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0;
|
||||||
|
|
||||||
|
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||||
|
//
|
||||||
|
// Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect()
|
||||||
|
// when this user leaves the server just like you would for a real user.
|
||||||
|
virtual CSteamID CreateUnauthenticatedUserConnection() = 0;
|
||||||
|
|
||||||
|
// Should be called whenever a user leaves our game server, this lets Steam internally
|
||||||
|
// track which users are currently on which servers for the purposes of preventing a single
|
||||||
|
// account being logged into multiple servers, showing who is currently on a server, etc.
|
||||||
|
virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0;
|
||||||
|
|
||||||
|
// Update the data to be displayed in the server browser and matchmaking interfaces for a user
|
||||||
|
// currently connected to the server. For regular users you must call this after you receive a
|
||||||
|
// GSUserValidationSuccess callback.
|
||||||
|
//
|
||||||
|
// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
|
||||||
|
virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
|
||||||
|
|
||||||
|
// New auth system APIs - do not mix with the old auth system APIs.
|
||||||
|
// ----------------------------------------------------------------
|
||||||
|
|
||||||
|
// Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ).
|
||||||
|
// pcbTicket retrieves the length of the actual ticket.
|
||||||
|
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
|
||||||
|
|
||||||
|
// Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused
|
||||||
|
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
|
||||||
|
virtual EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID ) = 0;
|
||||||
|
|
||||||
|
// Stop tracking started by BeginAuthSession - called when no longer playing game with this entity
|
||||||
|
virtual void EndAuthSession( CSteamID steamID ) = 0;
|
||||||
|
|
||||||
|
// Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to
|
||||||
|
virtual void CancelAuthTicket( HAuthTicket hAuthTicket ) = 0;
|
||||||
|
|
||||||
|
// After receiving a user's authentication data, and passing it to SendUserConnectAndAuthenticate, use this function
|
||||||
|
// to determine if the user owns downloadable content specified by the provided AppID.
|
||||||
|
virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0;
|
||||||
|
|
||||||
|
// Ask if a user in in the specified group, results returns async by GSUserGroupStatus_t
|
||||||
|
// returns false if we're not connected to the steam servers and thus cannot ask
|
||||||
|
virtual bool RequestUserGroupStatus( CSteamID steamIDUser, CSteamID steamIDGroup ) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// these two functions s are deprecated, and will not return results
|
||||||
|
// they will be removed in a future version of the SDK
|
||||||
|
virtual void GetGameplayStats( ) = 0;
|
||||||
|
STEAM_CALL_RESULT( GSReputation_t )
|
||||||
|
virtual SteamAPICall_t GetServerReputation() = 0;
|
||||||
|
|
||||||
|
// Returns the public IP of the server according to Steam, useful when the server is
|
||||||
|
// behind NAT and you want to advertise its IP in a lobby for other clients to directly
|
||||||
|
// connect to
|
||||||
|
virtual SteamIPAddress_t GetPublicIP() = 0;
|
||||||
|
|
||||||
|
// These are in GameSocketShare mode, where instead of ISteamGameServer creating its own
|
||||||
|
// socket to talk to the master server on, it lets the game use its socket to forward messages
|
||||||
|
// back and forth. This prevents us from requiring server ops to open up yet another port
|
||||||
|
// in their firewalls.
|
||||||
|
//
|
||||||
|
// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001
|
||||||
|
|
||||||
|
// These are used when you've elected to multiplex the game server's UDP socket
|
||||||
|
// rather than having the master server updater use its own sockets.
|
||||||
|
//
|
||||||
|
// Source games use this to simplify the job of the server admins, so they
|
||||||
|
// don't have to open up more ports on their firewalls.
|
||||||
|
|
||||||
|
// Call this when a packet that starts with 0xFFFFFFFF comes in. That means
|
||||||
|
// it's for us.
|
||||||
|
virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0;
|
||||||
|
|
||||||
|
// AFTER calling HandleIncomingPacket for any packets that came in that frame, call this.
|
||||||
|
// This gets a packet that the master server updater needs to send out on UDP.
|
||||||
|
// It returns the length of the packet it wants to send, or 0 if there are no more packets to send.
|
||||||
|
// Call this each frame until it returns 0.
|
||||||
|
virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Control heartbeats / advertisement with master server
|
||||||
|
//
|
||||||
|
|
||||||
|
// Call this as often as you like to tell the master server updater whether or not
|
||||||
|
// you want it to be active (default: off).
|
||||||
|
virtual void EnableHeartbeats( bool bActive ) = 0;
|
||||||
|
|
||||||
|
// You usually don't need to modify this.
|
||||||
|
// Pass -1 to use the default value for iHeartbeatInterval.
|
||||||
|
// Some mods change this.
|
||||||
|
virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0;
|
||||||
|
|
||||||
|
// Force a heartbeat to steam at the next opportunity
|
||||||
|
virtual void ForceHeartbeat() = 0;
|
||||||
|
|
||||||
|
// associate this game server with this clan for the purposes of computing player compat
|
||||||
|
STEAM_CALL_RESULT( AssociateWithClanResult_t )
|
||||||
|
virtual SteamAPICall_t AssociateWithClan( CSteamID steamIDClan ) = 0;
|
||||||
|
|
||||||
|
// ask if any of the current players dont want to play with this new player - or vice versa
|
||||||
|
STEAM_CALL_RESULT( ComputeNewPlayerCompatibilityResult_t )
|
||||||
|
virtual SteamAPICall_t ComputeNewPlayerCompatibility( CSteamID steamIDNewPlayer ) = 0;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ISTEAMGAMESERVER013_H
|
@ -0,0 +1,149 @@
|
|||||||
|
|
||||||
|
#ifndef ISTEAMINPUT002_H
|
||||||
|
#define ISTEAMINPUT002_H
|
||||||
|
#ifdef STEAM_WIN32
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class ISteamInput002
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Init and Shutdown must be called when starting/ending use of this interface
|
||||||
|
virtual bool Init() = 0;
|
||||||
|
virtual bool Shutdown() = 0;
|
||||||
|
|
||||||
|
// Synchronize API state with the latest Steam Controller inputs available. This
|
||||||
|
// is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest
|
||||||
|
// possible latency, you call this directly before reading controller state. This must
|
||||||
|
// be called from somewhere before GetConnectedControllers will return any handles
|
||||||
|
virtual void RunFrame() = 0;
|
||||||
|
|
||||||
|
// Enumerate currently connected Steam Input enabled devices - developers can opt in controller by type (ex: Xbox/Playstation/etc) via
|
||||||
|
// the Steam Input settings in the Steamworks site or users can opt-in in their controller settings in Steam.
|
||||||
|
// handlesOut should point to a STEAM_INPUT_MAX_COUNT sized array of InputHandle_t handles
|
||||||
|
// Returns the number of handles written to handlesOut
|
||||||
|
virtual int GetConnectedControllers( STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_COUNT, Receives list of connected controllers ) InputHandle_t *handlesOut ) = 0;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// ACTION SETS
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls.
|
||||||
|
virtual InputActionSetHandle_t GetActionSetHandle( const char *pszActionSetName ) = 0;
|
||||||
|
|
||||||
|
// Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive')
|
||||||
|
// This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in
|
||||||
|
// your state loops, instead of trying to place it in all of your state transitions.
|
||||||
|
virtual void ActivateActionSet( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ) = 0;
|
||||||
|
virtual InputActionSetHandle_t GetCurrentActionSet( InputHandle_t inputHandle ) = 0;
|
||||||
|
|
||||||
|
// ACTION SET LAYERS
|
||||||
|
virtual void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0;
|
||||||
|
virtual void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0;
|
||||||
|
virtual void DeactivateAllActionSetLayers( InputHandle_t inputHandle ) = 0;
|
||||||
|
// Enumerate currently active layers.
|
||||||
|
// handlesOut should point to a STEAM_INPUT_MAX_ACTIVE_LAYERS sized array of ControllerActionSetHandle_t handles
|
||||||
|
// Returns the number of handles written to handlesOut
|
||||||
|
virtual int GetActiveActionSetLayers( InputHandle_t inputHandle, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ACTIVE_LAYERS, Receives list of active layers ) InputActionSetHandle_t *handlesOut ) = 0;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// ACTIONS
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls.
|
||||||
|
virtual InputDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionName ) = 0;
|
||||||
|
|
||||||
|
// Returns the current state of the supplied digital game action
|
||||||
|
virtual InputDigitalActionData_t GetDigitalActionData( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ) = 0;
|
||||||
|
|
||||||
|
// Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.
|
||||||
|
// originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to
|
||||||
|
// the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.
|
||||||
|
virtual int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ORIGINS, Receives list of action origins ) EInputActionOrigin *originsOut ) = 0;
|
||||||
|
|
||||||
|
// Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls.
|
||||||
|
virtual InputAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName ) = 0;
|
||||||
|
|
||||||
|
// Returns the current state of these supplied analog game action
|
||||||
|
virtual InputAnalogActionData_t GetAnalogActionData( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ) = 0;
|
||||||
|
|
||||||
|
// Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.
|
||||||
|
// originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to
|
||||||
|
// the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.
|
||||||
|
virtual int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ORIGINS, Receives list of action origins ) EInputActionOrigin *originsOut ) = 0;
|
||||||
|
|
||||||
|
// Get a local path to art for on-screen glyph for a particular origin
|
||||||
|
virtual const char *GetGlyphForActionOrigin( EInputActionOrigin eOrigin ) = 0;
|
||||||
|
|
||||||
|
// Returns a localized string (from Steam's language setting) for the specified origin.
|
||||||
|
virtual const char *GetStringForActionOrigin( EInputActionOrigin eOrigin ) = 0;
|
||||||
|
|
||||||
|
// Stop analog momentum for the action if it is a mouse action in trackball mode
|
||||||
|
virtual void StopAnalogActionMomentum( InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ) = 0;
|
||||||
|
|
||||||
|
// Returns raw motion data from the specified device
|
||||||
|
virtual InputMotionData_t GetMotionData( InputHandle_t inputHandle ) = 0;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// OUTPUTS
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Trigger a vibration event on supported controllers - Steam will translate these commands into haptic pulses for Steam Controllers
|
||||||
|
virtual void TriggerVibration( InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed ) = 0;
|
||||||
|
|
||||||
|
// Set the controller LED color on supported controllers. nFlags is a bitmask of values from ESteamInputLEDFlag - 0 will default to setting a color. Steam will handle
|
||||||
|
// the behavior on exit of your program so you don't need to try restore the default as you are shutting down
|
||||||
|
virtual void SetLEDColor( InputHandle_t inputHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) = 0;
|
||||||
|
|
||||||
|
// Trigger a haptic pulse on a Steam Controller - if you are approximating rumble you may want to use TriggerVibration instead.
|
||||||
|
// Good uses for Haptic pulses include chimes, noises, or directional gameplay feedback (taking damage, footstep locations, etc).
|
||||||
|
virtual void TriggerHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ) = 0;
|
||||||
|
|
||||||
|
// Trigger a haptic pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times. If you are approximating rumble you may want to use TriggerVibration instead.
|
||||||
|
// nFlags is currently unused and reserved for future use.
|
||||||
|
virtual void TriggerRepeatedHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Utility functions availible without using the rest of Steam Input API
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode
|
||||||
|
// If the user is not in Big Picture Mode it will open up the binding in a new window
|
||||||
|
virtual bool ShowBindingPanel( InputHandle_t inputHandle ) = 0;
|
||||||
|
|
||||||
|
// Returns the input type for a particular handle - unlike EInputActionOrigin which update with Steam and may return unrecognized values
|
||||||
|
// ESteamInputType will remain static and only return valid values from your SDK version
|
||||||
|
virtual ESteamInputType GetInputTypeForHandle( InputHandle_t inputHandle ) = 0;
|
||||||
|
|
||||||
|
// Returns the associated controller handle for the specified emulated gamepad - can be used with the above 2 functions
|
||||||
|
// to identify controllers presented to your game over Xinput. Returns 0 if the Xinput index isn't associated with Steam Input
|
||||||
|
virtual InputHandle_t GetControllerForGamepadIndex( int nIndex ) = 0;
|
||||||
|
|
||||||
|
// Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index
|
||||||
|
virtual int GetGamepadIndexForController( InputHandle_t ulinputHandle ) = 0;
|
||||||
|
|
||||||
|
// Returns a localized string (from Steam's language setting) for the specified Xbox controller origin.
|
||||||
|
virtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0;
|
||||||
|
|
||||||
|
// Get a local path to art for on-screen glyph for a particular Xbox controller origin
|
||||||
|
virtual const char *GetGlyphForXboxOrigin( EXboxOrigin eOrigin ) = 0;
|
||||||
|
|
||||||
|
// Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for
|
||||||
|
// non-Steam Input API action games. Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration
|
||||||
|
virtual EInputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHandle, EXboxOrigin eOrigin ) = 0;
|
||||||
|
|
||||||
|
// Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EInputActionOrigin_None
|
||||||
|
// When a new input type is added you will be able to pass in k_ESteamInputType_Unknown and the closest origin that your version of the SDK recognized will be returned
|
||||||
|
// ex: if a Playstation 5 controller was released this function would return Playstation 4 origins.
|
||||||
|
virtual EInputActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin ) = 0;
|
||||||
|
|
||||||
|
// Get the binding revision for a given device. Returns false if the handle was not valid or if a mapping is not yet loaded for the device
|
||||||
|
virtual bool GetDeviceBindingRevision( InputHandle_t inputHandle, int *pMajor, int *pMinor ) = 0;
|
||||||
|
|
||||||
|
// Get the Steam Remote Play session ID associated with a device, or 0 if there is no session associated with it
|
||||||
|
// See isteamremoteplay.h for more information on Steam Remote Play sessions
|
||||||
|
virtual uint32 GetRemotePlaySessionID( InputHandle_t inputHandle ) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //ISTEAMINPUT002_H
|
@ -0,0 +1,653 @@
|
|||||||
|
|
||||||
|
#ifndef ISTEAMNETWORKINGSOCKETS009
|
||||||
|
#define ISTEAMNETWORKINGSOCKETS009
|
||||||
|
|
||||||
|
|
||||||
|
class ISteamNetworkingSockets009
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/// Creates a "server" socket that listens for clients to connect to by
|
||||||
|
/// calling ConnectByIPAddress, over ordinary UDP (IPv4 or IPv6)
|
||||||
|
///
|
||||||
|
/// You must select a specific local port to listen on and set it
|
||||||
|
/// the port field of the local address.
|
||||||
|
///
|
||||||
|
/// Usually you will set the IP portion of the address to zero (SteamNetworkingIPAddr::Clear()).
|
||||||
|
/// This means that you will not bind to any particular local interface (i.e. the same
|
||||||
|
/// as INADDR_ANY in plain socket code). Furthermore, if possible the socket will be bound
|
||||||
|
/// in "dual stack" mode, which means that it can accept both IPv4 and IPv6 client connections.
|
||||||
|
/// If you really do wish to bind a particular interface, then set the local address to the
|
||||||
|
/// appropriate IPv4 or IPv6 IP.
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
///
|
||||||
|
/// When a client attempts to connect, a SteamNetConnectionStatusChangedCallback_t
|
||||||
|
/// will be posted. The connection will be in the connecting state.
|
||||||
|
virtual HSteamListenSocket CreateListenSocketIP( const SteamNetworkingIPAddr &localAddress, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
/// Creates a connection and begins talking to a "server" over UDP at the
|
||||||
|
/// given IPv4 or IPv6 address. The remote host must be listening with a
|
||||||
|
/// matching call to CreateListenSocketIP on the specified port.
|
||||||
|
///
|
||||||
|
/// A SteamNetConnectionStatusChangedCallback_t callback will be triggered when we start
|
||||||
|
/// connecting, and then another one on either timeout or successful connection.
|
||||||
|
///
|
||||||
|
/// If the server does not have any identity configured, then their network address
|
||||||
|
/// will be the only identity in use. Or, the network host may provide a platform-specific
|
||||||
|
/// identity with or without a valid certificate to authenticate that identity. (These
|
||||||
|
/// details will be contained in the SteamNetConnectionStatusChangedCallback_t.) It's
|
||||||
|
/// up to your application to decide whether to allow the connection.
|
||||||
|
///
|
||||||
|
/// By default, all connections will get basic encryption sufficient to prevent
|
||||||
|
/// casual eavesdropping. But note that without certificates (or a shared secret
|
||||||
|
/// distributed through some other out-of-band mechanism), you don't have any
|
||||||
|
/// way of knowing who is actually on the other end, and thus are vulnerable to
|
||||||
|
/// man-in-the-middle attacks.
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
virtual HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
/// Like CreateListenSocketIP, but clients will connect using ConnectP2P.
|
||||||
|
///
|
||||||
|
/// nLocalVirtualPort specifies how clients can connect to this socket using
|
||||||
|
/// ConnectP2P. It's very common for applications to only have one listening socket;
|
||||||
|
/// in that case, use zero. If you need to open multiple listen sockets and have clients
|
||||||
|
/// be able to connect to one or the other, then nLocalVirtualPort should be a small
|
||||||
|
/// integer (<1000) unique to each listen socket you create.
|
||||||
|
///
|
||||||
|
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
|
||||||
|
/// when your app initializes.
|
||||||
|
///
|
||||||
|
/// If you are listening on a dedicated servers in known data center,
|
||||||
|
/// then you can listen using this function instead of CreateHostedDedicatedServerListenSocket,
|
||||||
|
/// to allow clients to connect without a ticket. Any user that owns
|
||||||
|
/// the app and is signed into Steam will be able to attempt to connect to
|
||||||
|
/// your server. Also, a connection attempt may require the client to
|
||||||
|
/// be connected to Steam, which is one more moving part that may fail. When
|
||||||
|
/// tickets are used, then once a ticket is obtained, a client can connect to
|
||||||
|
/// your server even if they got disconnected from Steam or Steam is offline.
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
virtual HSteamListenSocket CreateListenSocketP2P( int nLocalVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
/// Begin connecting to a peer that is identified using a platform-specific identifier.
|
||||||
|
/// This uses the default rendezvous service, which depends on the platform and library
|
||||||
|
/// configuration. (E.g. on Steam, it goes through the steam backend.)
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
///
|
||||||
|
/// To use your own signaling service, see:
|
||||||
|
/// - ConnectP2PCustomSignaling
|
||||||
|
/// - k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling
|
||||||
|
virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
/// Accept an incoming connection that has been received on a listen socket.
|
||||||
|
///
|
||||||
|
/// When a connection attempt is received (perhaps after a few basic handshake
|
||||||
|
/// packets have been exchanged to prevent trivial spoofing), a connection interface
|
||||||
|
/// object is created in the k_ESteamNetworkingConnectionState_Connecting state
|
||||||
|
/// and a SteamNetConnectionStatusChangedCallback_t is posted. At this point, your
|
||||||
|
/// application MUST either accept or close the connection. (It may not ignore it.)
|
||||||
|
/// Accepting the connection will transition it either into the connected state,
|
||||||
|
/// or the finding route state, depending on the connection type.
|
||||||
|
///
|
||||||
|
/// You should take action within a second or two, because accepting the connection is
|
||||||
|
/// what actually sends the reply notifying the client that they are connected. If you
|
||||||
|
/// delay taking action, from the client's perspective it is the same as the network
|
||||||
|
/// being unresponsive, and the client may timeout the connection attempt. In other
|
||||||
|
/// words, the client cannot distinguish between a delay caused by network problems
|
||||||
|
/// and a delay caused by the application.
|
||||||
|
///
|
||||||
|
/// This means that if your application goes for more than a few seconds without
|
||||||
|
/// processing callbacks (for example, while loading a map), then there is a chance
|
||||||
|
/// that a client may attempt to connect in that interval and fail due to timeout.
|
||||||
|
///
|
||||||
|
/// If the application does not respond to the connection attempt in a timely manner,
|
||||||
|
/// and we stop receiving communication from the client, the connection attempt will
|
||||||
|
/// be timed out locally, transitioning the connection to the
|
||||||
|
/// k_ESteamNetworkingConnectionState_ProblemDetectedLocally state. The client may also
|
||||||
|
/// close the connection before it is accepted, and a transition to the
|
||||||
|
/// k_ESteamNetworkingConnectionState_ClosedByPeer is also possible depending the exact
|
||||||
|
/// sequence of events.
|
||||||
|
///
|
||||||
|
/// Returns k_EResultInvalidParam if the handle is invalid.
|
||||||
|
/// Returns k_EResultInvalidState if the connection is not in the appropriate state.
|
||||||
|
/// (Remember that the connection state could change in between the time that the
|
||||||
|
/// notification being posted to the queue and when it is received by the application.)
|
||||||
|
///
|
||||||
|
/// A note about connection configuration options. If you need to set any configuration
|
||||||
|
/// options that are common to all connections accepted through a particular listen
|
||||||
|
/// socket, consider setting the options on the listen socket, since such options are
|
||||||
|
/// inherited automatically. If you really do need to set options that are connection
|
||||||
|
/// specific, it is safe to set them on the connection before accepting the connection.
|
||||||
|
virtual EResult AcceptConnection( HSteamNetConnection hConn ) = 0;
|
||||||
|
|
||||||
|
/// Disconnects from the remote host and invalidates the connection handle.
|
||||||
|
/// Any unread data on the connection is discarded.
|
||||||
|
///
|
||||||
|
/// nReason is an application defined code that will be received on the other
|
||||||
|
/// end and recorded (when possible) in backend analytics. The value should
|
||||||
|
/// come from a restricted range. (See ESteamNetConnectionEnd.) If you don't need
|
||||||
|
/// to communicate any information to the remote host, and do not want analytics to
|
||||||
|
/// be able to distinguish "normal" connection terminations from "exceptional" ones,
|
||||||
|
/// You may pass zero, in which case the generic value of
|
||||||
|
/// k_ESteamNetConnectionEnd_App_Generic will be used.
|
||||||
|
///
|
||||||
|
/// pszDebug is an optional human-readable diagnostic string that will be received
|
||||||
|
/// by the remote host and recorded (when possible) in backend analytics.
|
||||||
|
///
|
||||||
|
/// If you wish to put the socket into a "linger" state, where an attempt is made to
|
||||||
|
/// flush any remaining sent data, use bEnableLinger=true. Otherwise reliable data
|
||||||
|
/// is not flushed.
|
||||||
|
///
|
||||||
|
/// If the connection has already ended and you are just freeing up the
|
||||||
|
/// connection interface, the reason code, debug string, and linger flag are
|
||||||
|
/// ignored.
|
||||||
|
virtual bool CloseConnection( HSteamNetConnection hPeer, int nReason, const char *pszDebug, bool bEnableLinger ) = 0;
|
||||||
|
|
||||||
|
/// Destroy a listen socket. All the connections that were accepting on the listen
|
||||||
|
/// socket are closed ungracefully.
|
||||||
|
virtual bool CloseListenSocket( HSteamListenSocket hSocket ) = 0;
|
||||||
|
|
||||||
|
/// Set connection user data. the data is returned in the following places
|
||||||
|
/// - You can query it using GetConnectionUserData.
|
||||||
|
/// - The SteamNetworkingmessage_t structure.
|
||||||
|
/// - The SteamNetConnectionInfo_t structure. (Which is a member of SteamNetConnectionStatusChangedCallback_t.)
|
||||||
|
///
|
||||||
|
/// Returns false if the handle is invalid.
|
||||||
|
virtual bool SetConnectionUserData( HSteamNetConnection hPeer, int64 nUserData ) = 0;
|
||||||
|
|
||||||
|
/// Fetch connection user data. Returns -1 if handle is invalid
|
||||||
|
/// or if you haven't set any userdata on the connection.
|
||||||
|
virtual int64 GetConnectionUserData( HSteamNetConnection hPeer ) = 0;
|
||||||
|
|
||||||
|
/// Set a name for the connection, used mostly for debugging
|
||||||
|
virtual void SetConnectionName( HSteamNetConnection hPeer, const char *pszName ) = 0;
|
||||||
|
|
||||||
|
/// Fetch connection name. Returns false if handle is invalid
|
||||||
|
virtual bool GetConnectionName( HSteamNetConnection hPeer, char *pszName, int nMaxLen ) = 0;
|
||||||
|
|
||||||
|
/// Send a message to the remote host on the specified connection.
|
||||||
|
///
|
||||||
|
/// nSendFlags determines the delivery guarantees that will be provided,
|
||||||
|
/// when data should be buffered, etc. E.g. k_nSteamNetworkingSend_Unreliable
|
||||||
|
///
|
||||||
|
/// Note that the semantics we use for messages are not precisely
|
||||||
|
/// the same as the semantics of a standard "stream" socket.
|
||||||
|
/// (SOCK_STREAM) For an ordinary stream socket, the boundaries
|
||||||
|
/// between chunks are not considered relevant, and the sizes of
|
||||||
|
/// the chunks of data written will not necessarily match up to
|
||||||
|
/// the sizes of the chunks that are returned by the reads on
|
||||||
|
/// the other end. The remote host might read a partial chunk,
|
||||||
|
/// or chunks might be coalesced. For the message semantics
|
||||||
|
/// used here, however, the sizes WILL match. Each send call
|
||||||
|
/// will match a successful read call on the remote host
|
||||||
|
/// one-for-one. If you are porting existing stream-oriented
|
||||||
|
/// code to the semantics of reliable messages, your code should
|
||||||
|
/// work the same, since reliable message semantics are more
|
||||||
|
/// strict than stream semantics. The only caveat is related to
|
||||||
|
/// performance: there is per-message overhead to retain the
|
||||||
|
/// message sizes, and so if your code sends many small chunks
|
||||||
|
/// of data, performance will suffer. Any code based on stream
|
||||||
|
/// sockets that does not write excessively small chunks will
|
||||||
|
/// work without any changes.
|
||||||
|
///
|
||||||
|
/// The pOutMessageNumber is an optional pointer to receive the
|
||||||
|
/// message number assigned to the message, if sending was successful.
|
||||||
|
///
|
||||||
|
/// Returns:
|
||||||
|
/// - k_EResultInvalidParam: invalid connection handle, or the individual message is too big.
|
||||||
|
/// (See k_cbMaxSteamNetworkingSocketsMessageSizeSend)
|
||||||
|
/// - k_EResultInvalidState: connection is in an invalid state
|
||||||
|
/// - k_EResultNoConnection: connection has ended
|
||||||
|
/// - k_EResultIgnored: You used k_nSteamNetworkingSend_NoDelay, and the message was dropped because
|
||||||
|
/// we were not ready to send it.
|
||||||
|
/// - k_EResultLimitExceeded: there was already too much data queued to be sent.
|
||||||
|
/// (See k_ESteamNetworkingConfig_SendBufferSize)
|
||||||
|
virtual EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, uint32 cbData, int nSendFlags, int64 *pOutMessageNumber ) = 0;
|
||||||
|
|
||||||
|
/// Send one or more messages without copying the message payload.
|
||||||
|
/// This is the most efficient way to send messages. To use this
|
||||||
|
/// function, you must first allocate a message object using
|
||||||
|
/// ISteamNetworkingUtils::AllocateMessage. (Do not declare one
|
||||||
|
/// on the stack or allocate your own.)
|
||||||
|
///
|
||||||
|
/// You should fill in the message payload. You can either let
|
||||||
|
/// it allocate the buffer for you and then fill in the payload,
|
||||||
|
/// or if you already have a buffer allocated, you can just point
|
||||||
|
/// m_pData at your buffer and set the callback to the appropriate function
|
||||||
|
/// to free it. Note that if you use your own buffer, it MUST remain valid
|
||||||
|
/// until the callback is executed. And also note that your callback can be
|
||||||
|
/// invoked at ant time from any thread (perhaps even before SendMessages
|
||||||
|
/// returns!), so it MUST be fast and threadsafe.
|
||||||
|
///
|
||||||
|
/// You MUST also fill in:
|
||||||
|
/// - m_conn - the handle of the connection to send the message to
|
||||||
|
/// - m_nFlags - bitmask of k_nSteamNetworkingSend_xxx flags.
|
||||||
|
///
|
||||||
|
/// All other fields are currently reserved and should not be modified.
|
||||||
|
///
|
||||||
|
/// The library will take ownership of the message structures. They may
|
||||||
|
/// be modified or become invalid at any time, so you must not read them
|
||||||
|
/// after passing them to this function.
|
||||||
|
///
|
||||||
|
/// pOutMessageNumberOrResult is an optional array that will receive,
|
||||||
|
/// for each message, the message number that was assigned to the message
|
||||||
|
/// if sending was successful. If sending failed, then a negative EResult
|
||||||
|
/// value is placed into the array. For example, the array will hold
|
||||||
|
/// -k_EResultInvalidState if the connection was in an invalid state.
|
||||||
|
/// See ISteamNetworkingSockets::SendMessageToConnection for possible
|
||||||
|
/// failure codes.
|
||||||
|
virtual void SendMessages( int nMessages, SteamNetworkingMessage_t *const *pMessages, int64 *pOutMessageNumberOrResult ) = 0;
|
||||||
|
|
||||||
|
/// Flush any messages waiting on the Nagle timer and send them
|
||||||
|
/// at the next transmission opportunity (often that means right now).
|
||||||
|
///
|
||||||
|
/// If Nagle is enabled (it's on by default) then when calling
|
||||||
|
/// SendMessageToConnection the message will be buffered, up to the Nagle time
|
||||||
|
/// before being sent, to merge small messages into the same packet.
|
||||||
|
/// (See k_ESteamNetworkingConfig_NagleTime)
|
||||||
|
///
|
||||||
|
/// Returns:
|
||||||
|
/// k_EResultInvalidParam: invalid connection handle
|
||||||
|
/// k_EResultInvalidState: connection is in an invalid state
|
||||||
|
/// k_EResultNoConnection: connection has ended
|
||||||
|
/// k_EResultIgnored: We weren't (yet) connected, so this operation has no effect.
|
||||||
|
virtual EResult FlushMessagesOnConnection( HSteamNetConnection hConn ) = 0;
|
||||||
|
|
||||||
|
/// Fetch the next available message(s) from the connection, if any.
|
||||||
|
/// Returns the number of messages returned into your array, up to nMaxMessages.
|
||||||
|
/// If the connection handle is invalid, -1 is returned.
|
||||||
|
///
|
||||||
|
/// The order of the messages returned in the array is relevant.
|
||||||
|
/// Reliable messages will be received in the order they were sent (and with the
|
||||||
|
/// same sizes --- see SendMessageToConnection for on this subtle difference from a stream socket).
|
||||||
|
///
|
||||||
|
/// Unreliable messages may be dropped, or delivered out of order with respect to
|
||||||
|
/// each other or with respect to reliable messages. The same unreliable message
|
||||||
|
/// may be received multiple times.
|
||||||
|
///
|
||||||
|
/// If any messages are returned, you MUST call SteamNetworkingMessage_t::Release() on each
|
||||||
|
/// of them free up resources after you are done. It is safe to keep the object alive for
|
||||||
|
/// a little while (put it into some queue, etc), and you may call Release() from any thread.
|
||||||
|
virtual int ReceiveMessagesOnConnection( HSteamNetConnection hConn, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0;
|
||||||
|
|
||||||
|
/// Returns basic information about the high-level state of the connection.
|
||||||
|
virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0;
|
||||||
|
|
||||||
|
/// Returns a small set of information about the real-time state of the connection
|
||||||
|
/// Returns false if the connection handle is invalid, or the connection has ended.
|
||||||
|
virtual bool GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats ) = 0;
|
||||||
|
|
||||||
|
/// Returns detailed connection stats in text format. Useful
|
||||||
|
/// for dumping to a log, etc.
|
||||||
|
///
|
||||||
|
/// Returns:
|
||||||
|
/// -1 failure (bad connection handle)
|
||||||
|
/// 0 OK, your buffer was filled in and '\0'-terminated
|
||||||
|
/// >0 Your buffer was either nullptr, or it was too small and the text got truncated.
|
||||||
|
/// Try again with a buffer of at least N bytes.
|
||||||
|
virtual int GetDetailedConnectionStatus( HSteamNetConnection hConn, char *pszBuf, int cbBuf ) = 0;
|
||||||
|
|
||||||
|
/// Returns local IP and port that a listen socket created using CreateListenSocketIP is bound to.
|
||||||
|
///
|
||||||
|
/// An IPv6 address of ::0 means "any IPv4 or IPv6"
|
||||||
|
/// An IPv6 address of ::ffff:0000:0000 means "any IPv4"
|
||||||
|
virtual bool GetListenSocketAddress( HSteamListenSocket hSocket, SteamNetworkingIPAddr *address ) = 0;
|
||||||
|
|
||||||
|
/// Create a pair of connections that are talking to each other, e.g. a loopback connection.
|
||||||
|
/// This is very useful for testing, or so that your client/server code can work the same
|
||||||
|
/// even when you are running a local "server".
|
||||||
|
///
|
||||||
|
/// The two connections will immediately be placed into the connected state, and no callbacks
|
||||||
|
/// will be posted immediately. After this, if you close either connection, the other connection
|
||||||
|
/// will receive a callback, exactly as if they were communicating over the network. You must
|
||||||
|
/// close *both* sides in order to fully clean up the resources!
|
||||||
|
///
|
||||||
|
/// By default, internal buffers are used, completely bypassing the network, the chopping up of
|
||||||
|
/// messages into packets, encryption, copying the payload, etc. This means that loopback
|
||||||
|
/// packets, by default, will not simulate lag or loss. Passing true for bUseNetworkLoopback will
|
||||||
|
/// cause the socket pair to send packets through the local network loopback device (127.0.0.1)
|
||||||
|
/// on ephemeral ports. Fake lag and loss are supported in this case, and CPU time is expended
|
||||||
|
/// to encrypt and decrypt.
|
||||||
|
///
|
||||||
|
/// If you wish to assign a specific identity to either connection, you may pass a particular
|
||||||
|
/// identity. Otherwise, if you pass nullptr, the respective connection will assume a generic
|
||||||
|
/// "localhost" identity. If you use real network loopback, this might be translated to the
|
||||||
|
/// actual bound loopback port. Otherwise, the port will be zero.
|
||||||
|
virtual bool CreateSocketPair( HSteamNetConnection *pOutConnection1, HSteamNetConnection *pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity *pIdentity1, const SteamNetworkingIdentity *pIdentity2 ) = 0;
|
||||||
|
|
||||||
|
/// Get the identity assigned to this interface.
|
||||||
|
/// E.g. on Steam, this is the user's SteamID, or for the gameserver interface, the SteamID assigned
|
||||||
|
/// to the gameserver. Returns false and sets the result to an invalid identity if we don't know
|
||||||
|
/// our identity yet. (E.g. GameServer has not logged in. On Steam, the user will know their SteamID
|
||||||
|
/// even if they are not signed into Steam.)
|
||||||
|
virtual bool GetIdentity( SteamNetworkingIdentity *pIdentity ) = 0;
|
||||||
|
|
||||||
|
/// Indicate our desire to be ready participate in authenticated communications.
|
||||||
|
/// If we are currently not ready, then steps will be taken to obtain the necessary
|
||||||
|
/// certificates. (This includes a certificate for us, as well as any CA certificates
|
||||||
|
/// needed to authenticate peers.)
|
||||||
|
///
|
||||||
|
/// You can call this at program init time if you know that you are going to
|
||||||
|
/// be making authenticated connections, so that we will be ready immediately when
|
||||||
|
/// those connections are attempted. (Note that essentially all connections require
|
||||||
|
/// authentication, with the exception of ordinary UDP connections with authentication
|
||||||
|
/// disabled using k_ESteamNetworkingConfig_IP_AllowWithoutAuth.) If you don't call
|
||||||
|
/// this function, we will wait until a feature is utilized that that necessitates
|
||||||
|
/// these resources.
|
||||||
|
///
|
||||||
|
/// You can also call this function to force a retry, if failure has occurred.
|
||||||
|
/// Once we make an attempt and fail, we will not automatically retry.
|
||||||
|
/// In this respect, the behavior of the system after trying and failing is the same
|
||||||
|
/// as before the first attempt: attempting authenticated communication or calling
|
||||||
|
/// this function will call the system to attempt to acquire the necessary resources.
|
||||||
|
///
|
||||||
|
/// You can use GetAuthenticationStatus or listen for SteamNetAuthenticationStatus_t
|
||||||
|
/// to monitor the status.
|
||||||
|
///
|
||||||
|
/// Returns the current value that would be returned from GetAuthenticationStatus.
|
||||||
|
virtual ESteamNetworkingAvailability InitAuthentication() = 0;
|
||||||
|
|
||||||
|
/// Query our readiness to participate in authenticated communications. A
|
||||||
|
/// SteamNetAuthenticationStatus_t callback is posted any time this status changes,
|
||||||
|
/// but you can use this function to query it at any time.
|
||||||
|
///
|
||||||
|
/// The value of SteamNetAuthenticationStatus_t::m_eAvail is returned. If you only
|
||||||
|
/// want this high level status, you can pass NULL for pDetails. If you want further
|
||||||
|
/// details, pass non-NULL to receive them.
|
||||||
|
virtual ESteamNetworkingAvailability GetAuthenticationStatus( SteamNetAuthenticationStatus_t *pDetails ) = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Poll groups. A poll group is a set of connections that can be polled efficiently.
|
||||||
|
// (In our API, to "poll" a connection means to retrieve all pending messages. We
|
||||||
|
// actually don't have an API to "poll" the connection *state*, like BSD sockets.)
|
||||||
|
//
|
||||||
|
|
||||||
|
/// Create a new poll group.
|
||||||
|
///
|
||||||
|
/// You should destroy the poll group when you are done using DestroyPollGroup
|
||||||
|
virtual HSteamNetPollGroup CreatePollGroup() = 0;
|
||||||
|
|
||||||
|
/// Destroy a poll group created with CreatePollGroup().
|
||||||
|
///
|
||||||
|
/// If there are any connections in the poll group, they are removed from the group,
|
||||||
|
/// and left in a state where they are not part of any poll group.
|
||||||
|
/// Returns false if passed an invalid poll group handle.
|
||||||
|
virtual bool DestroyPollGroup( HSteamNetPollGroup hPollGroup ) = 0;
|
||||||
|
|
||||||
|
/// Assign a connection to a poll group. Note that a connection may only belong to a
|
||||||
|
/// single poll group. Adding a connection to a poll group implicitly removes it from
|
||||||
|
/// any other poll group it is in.
|
||||||
|
///
|
||||||
|
/// You can pass k_HSteamNetPollGroup_Invalid to remove a connection from its current
|
||||||
|
/// poll group without adding it to a new poll group.
|
||||||
|
///
|
||||||
|
/// If there are received messages currently pending on the connection, an attempt
|
||||||
|
/// is made to add them to the queue of messages for the poll group in approximately
|
||||||
|
/// the order that would have applied if the connection was already part of the poll
|
||||||
|
/// group at the time that the messages were received.
|
||||||
|
///
|
||||||
|
/// Returns false if the connection handle is invalid, or if the poll group handle
|
||||||
|
/// is invalid (and not k_HSteamNetPollGroup_Invalid).
|
||||||
|
virtual bool SetConnectionPollGroup( HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup ) = 0;
|
||||||
|
|
||||||
|
/// Same as ReceiveMessagesOnConnection, but will return the next messages available
|
||||||
|
/// on any connection in the poll group. Examine SteamNetworkingMessage_t::m_conn
|
||||||
|
/// to know which connection. (SteamNetworkingMessage_t::m_nConnUserData might also
|
||||||
|
/// be useful.)
|
||||||
|
///
|
||||||
|
/// Delivery order of messages among different connections will usually match the
|
||||||
|
/// order that the last packet was received which completed the message. But this
|
||||||
|
/// is not a strong guarantee, especially for packets received right as a connection
|
||||||
|
/// is being assigned to poll group.
|
||||||
|
///
|
||||||
|
/// Delivery order of messages on the same connection is well defined and the
|
||||||
|
/// same guarantees are present as mentioned in ReceiveMessagesOnConnection.
|
||||||
|
/// (But the messages are not grouped by connection, so they will not necessarily
|
||||||
|
/// appear consecutively in the list; they may be interleaved with messages for
|
||||||
|
/// other connections.)
|
||||||
|
virtual int ReceiveMessagesOnPollGroup( HSteamNetPollGroup hPollGroup, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Clients connecting to dedicated servers hosted in a data center,
|
||||||
|
// using tickets issued by your game coordinator. If you are not
|
||||||
|
// issuing your own tickets to restrict who can attempt to connect
|
||||||
|
// to your server, then you won't use these functions.
|
||||||
|
//
|
||||||
|
|
||||||
|
/// Call this when you receive a ticket from your backend / matchmaking system. Puts the
|
||||||
|
/// ticket into a persistent cache, and optionally returns the parsed ticket.
|
||||||
|
///
|
||||||
|
/// See stamdatagram_ticketgen.h for more details.
|
||||||
|
virtual bool ReceivedRelayAuthTicket( const void *pvTicket, int cbTicket, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0;
|
||||||
|
|
||||||
|
/// Search cache for a ticket to talk to the server on the specified virtual port.
|
||||||
|
/// If found, returns the number of seconds until the ticket expires, and optionally
|
||||||
|
/// the complete cracked ticket. Returns 0 if we don't have a ticket.
|
||||||
|
///
|
||||||
|
/// Typically this is useful just to confirm that you have a ticket, before you
|
||||||
|
/// call ConnectToHostedDedicatedServer to connect to the server.
|
||||||
|
virtual int FindRelayAuthTicketForServer( const SteamNetworkingIdentity &identityGameServer, int nRemoteVirtualPort, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0;
|
||||||
|
|
||||||
|
/// Client call to connect to a server hosted in a Valve data center, on the specified virtual
|
||||||
|
/// port. You must have placed a ticket for this server into the cache, or else this connect
|
||||||
|
/// attempt will fail! If you are not issuing your own tickets, then to connect to a dedicated
|
||||||
|
/// server via SDR in auto-ticket mode, use ConnectP2P. (The server must be configured to allow
|
||||||
|
/// this type of connection by listening using CreateListenSocketP2P.)
|
||||||
|
///
|
||||||
|
/// You may wonder why tickets are stored in a cache, instead of simply being passed as an argument
|
||||||
|
/// here. The reason is to make reconnection to a gameserver robust, even if the client computer loses
|
||||||
|
/// connection to Steam or the central backend, or the app is restarted or crashes, etc.
|
||||||
|
///
|
||||||
|
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
|
||||||
|
/// when your app initializes
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
virtual HSteamNetConnection ConnectToHostedDedicatedServer( const SteamNetworkingIdentity &identityTarget, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Servers hosted in data centers known to the Valve relay network
|
||||||
|
//
|
||||||
|
|
||||||
|
/// Returns the value of the SDR_LISTEN_PORT environment variable. This
|
||||||
|
/// is the UDP server your server will be listening on. This will
|
||||||
|
/// configured automatically for you in production environments.
|
||||||
|
///
|
||||||
|
/// In development, you'll need to set it yourself. See
|
||||||
|
/// https://partner.steamgames.com/doc/api/ISteamNetworkingSockets
|
||||||
|
/// for more information on how to configure dev environments.
|
||||||
|
virtual uint16 GetHostedDedicatedServerPort() = 0;
|
||||||
|
|
||||||
|
/// Returns 0 if SDR_LISTEN_PORT is not set. Otherwise, returns the data center the server
|
||||||
|
/// is running in. This will be k_SteamDatagramPOPID_dev in non-production environment.
|
||||||
|
virtual SteamNetworkingPOPID GetHostedDedicatedServerPOPID() = 0;
|
||||||
|
|
||||||
|
/// Return info about the hosted server. This contains the PoPID of the server,
|
||||||
|
/// and opaque routing information that can be used by the relays to send traffic
|
||||||
|
/// to your server.
|
||||||
|
///
|
||||||
|
/// You will need to send this information to your backend, and put it in tickets,
|
||||||
|
/// so that the relays will know how to forward traffic from
|
||||||
|
/// clients to your server. See SteamDatagramRelayAuthTicket for more info.
|
||||||
|
///
|
||||||
|
/// Also, note that the routing information is contained in SteamDatagramGameCoordinatorServerLogin,
|
||||||
|
/// so if possible, it's preferred to use GetGameCoordinatorServerLogin to send this info
|
||||||
|
/// to your game coordinator service, and also login securely at the same time.
|
||||||
|
///
|
||||||
|
/// On a successful exit, k_EResultOK is returned
|
||||||
|
///
|
||||||
|
/// Unsuccessful exit:
|
||||||
|
/// - Something other than k_EResultOK is returned.
|
||||||
|
/// - k_EResultInvalidState: We are not configured to listen for SDR (SDR_LISTEN_SOCKET
|
||||||
|
/// is not set.)
|
||||||
|
/// - k_EResultPending: we do not (yet) have the authentication information needed.
|
||||||
|
/// (See GetAuthenticationStatus.) If you use environment variables to pre-fetch
|
||||||
|
/// the network config, this data should always be available immediately.
|
||||||
|
/// - A non-localized diagnostic debug message will be placed in m_data that describes
|
||||||
|
/// the cause of the failure.
|
||||||
|
///
|
||||||
|
/// NOTE: The returned blob is not encrypted. Send it to your backend, but don't
|
||||||
|
/// directly share it with clients.
|
||||||
|
virtual EResult GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRouting ) = 0;
|
||||||
|
|
||||||
|
/// Create a listen socket on the specified virtual port. The physical UDP port to use
|
||||||
|
/// will be determined by the SDR_LISTEN_PORT environment variable. If a UDP port is not
|
||||||
|
/// configured, this call will fail.
|
||||||
|
///
|
||||||
|
/// This call MUST be made through the SteamGameServerNetworkingSockets() interface.
|
||||||
|
///
|
||||||
|
/// This function should be used when you are using the ticket generator library
|
||||||
|
/// to issue your own tickets. Clients connecting to the server on this virtual
|
||||||
|
/// port will need a ticket, and they must connect using ConnectToHostedDedicatedServer.
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
virtual HSteamListenSocket CreateHostedDedicatedServerListenSocket( int nLocalVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
/// Generate an authentication blob that can be used to securely login with
|
||||||
|
/// your backend, using SteamDatagram_ParseHostedServerLogin. (See
|
||||||
|
/// steamdatagram_gamecoordinator.h)
|
||||||
|
///
|
||||||
|
/// Before calling the function:
|
||||||
|
/// - Populate the app data in pLoginInfo (m_cbAppData and m_appData). You can leave
|
||||||
|
/// all other fields uninitialized.
|
||||||
|
/// - *pcbSignedBlob contains the size of the buffer at pBlob. (It should be
|
||||||
|
/// at least k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized.)
|
||||||
|
///
|
||||||
|
/// On a successful exit:
|
||||||
|
/// - k_EResultOK is returned
|
||||||
|
/// - All of the remaining fields of pLoginInfo will be filled out.
|
||||||
|
/// - *pcbSignedBlob contains the size of the serialized blob that has been
|
||||||
|
/// placed into pBlob.
|
||||||
|
///
|
||||||
|
/// Unsuccessful exit:
|
||||||
|
/// - Something other than k_EResultOK is returned.
|
||||||
|
/// - k_EResultNotLoggedOn: you are not logged in (yet)
|
||||||
|
/// - See GetHostedDedicatedServerAddress for more potential failure return values.
|
||||||
|
/// - A non-localized diagnostic debug message will be placed in pBlob that describes
|
||||||
|
/// the cause of the failure.
|
||||||
|
///
|
||||||
|
/// This works by signing the contents of the SteamDatagramGameCoordinatorServerLogin
|
||||||
|
/// with the cert that is issued to this server. In dev environments, it's OK if you do
|
||||||
|
/// not have a cert. (You will need to enable insecure dev login in SteamDatagram_ParseHostedServerLogin.)
|
||||||
|
/// Otherwise, you will need a signed cert.
|
||||||
|
///
|
||||||
|
/// NOTE: The routing blob returned here is not encrypted. Send it to your backend
|
||||||
|
/// and don't share it directly with clients.
|
||||||
|
virtual EResult GetGameCoordinatorServerLogin( SteamDatagramGameCoordinatorServerLogin *pLoginInfo, int *pcbSignedBlob, void *pBlob ) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Relayed connections using custom signaling protocol
|
||||||
|
//
|
||||||
|
// This is used if you have your own method of sending out-of-band
|
||||||
|
// signaling / rendezvous messages through a mutually trusted channel.
|
||||||
|
//
|
||||||
|
|
||||||
|
/// Create a P2P "client" connection that does signaling over a custom
|
||||||
|
/// rendezvous/signaling channel.
|
||||||
|
///
|
||||||
|
/// pSignaling points to a new object that you create just for this connection.
|
||||||
|
/// It must stay valid until Release() is called. Once you pass the
|
||||||
|
/// object to this function, it assumes ownership. Release() will be called
|
||||||
|
/// from within the function call if the call fails. Furthermore, until Release()
|
||||||
|
/// is called, you should be prepared for methods to be invoked on your
|
||||||
|
/// object from any thread! You need to make sure your object is threadsafe!
|
||||||
|
/// Furthermore, you should make sure that dispatching the methods is done
|
||||||
|
/// as quickly as possible.
|
||||||
|
///
|
||||||
|
/// This function will immediately construct a connection in the "connecting"
|
||||||
|
/// state. Soon after (perhaps before this function returns, perhaps in another thread),
|
||||||
|
/// the connection will begin sending signaling messages by calling
|
||||||
|
/// ISteamNetworkingConnectionSignaling::SendSignal.
|
||||||
|
///
|
||||||
|
/// When the remote peer accepts the connection (See
|
||||||
|
/// ISteamNetworkingSignalingRecvContext::OnConnectRequest),
|
||||||
|
/// it will begin sending signaling messages. When these messages are received,
|
||||||
|
/// you can pass them to the connection using ReceivedP2PCustomSignal.
|
||||||
|
///
|
||||||
|
/// If you know the identity of the peer that you expect to be on the other end,
|
||||||
|
/// you can pass their identity to improve debug output or just detect bugs.
|
||||||
|
/// If you don't know their identity yet, you can pass NULL, and their
|
||||||
|
/// identity will be established in the connection handshake.
|
||||||
|
///
|
||||||
|
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
|
||||||
|
/// when your app initializes
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
virtual HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionCustomSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
/// Called when custom signaling has received a message. When your
|
||||||
|
/// signaling channel receives a message, it should save off whatever
|
||||||
|
/// routing information was in the envelope into the context object,
|
||||||
|
/// and then pass the payload to this function.
|
||||||
|
///
|
||||||
|
/// A few different things can happen next, depending on the message:
|
||||||
|
///
|
||||||
|
/// - If the signal is associated with existing connection, it is dealt
|
||||||
|
/// with immediately. If any replies need to be sent, they will be
|
||||||
|
/// dispatched using the ISteamNetworkingConnectionSignaling
|
||||||
|
/// associated with the connection.
|
||||||
|
/// - If the message represents a connection request (and the request
|
||||||
|
/// is not redundant for an existing connection), a new connection
|
||||||
|
/// will be created, and ReceivedConnectRequest will be called on your
|
||||||
|
/// context object to determine how to proceed.
|
||||||
|
/// - Otherwise, the message is for a connection that does not
|
||||||
|
/// exist (anymore). In this case, we *may* call SendRejectionReply
|
||||||
|
/// on your context object.
|
||||||
|
///
|
||||||
|
/// In any case, we will not save off pContext or access it after this
|
||||||
|
/// function returns.
|
||||||
|
///
|
||||||
|
/// Returns true if the message was parsed and dispatched without anything
|
||||||
|
/// unusual or suspicious happening. Returns false if there was some problem
|
||||||
|
/// with the message that prevented ordinary handling. (Debug output will
|
||||||
|
/// usually have more information.)
|
||||||
|
///
|
||||||
|
/// If you expect to be using relayed connections, then you probably want
|
||||||
|
/// to call ISteamNetworkingUtils::InitRelayNetworkAccess() when your app initializes
|
||||||
|
virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext *pContext ) = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Certificate provision by the application. On Steam, we normally handle all this automatically
|
||||||
|
// and you will not need to use these advanced functions.
|
||||||
|
//
|
||||||
|
|
||||||
|
/// Get blob that describes a certificate request. You can send this to your game coordinator.
|
||||||
|
/// Upon entry, *pcbBlob should contain the size of the buffer. On successful exit, it will
|
||||||
|
/// return the number of bytes that were populated. You can pass pBlob=NULL to query for the required
|
||||||
|
/// size. (256 bytes is a very conservative estimate.)
|
||||||
|
///
|
||||||
|
/// Pass this blob to your game coordinator and call SteamDatagram_CreateCert.
|
||||||
|
virtual bool GetCertificateRequest( int *pcbBlob, void *pBlob, SteamNetworkingErrMsg &errMsg ) = 0;
|
||||||
|
|
||||||
|
/// Set the certificate. The certificate blob should be the output of
|
||||||
|
/// SteamDatagram_CreateCert.
|
||||||
|
virtual bool SetCertificate( const void *pCertificate, int cbCertificate, SteamNetworkingErrMsg &errMsg ) = 0;
|
||||||
|
|
||||||
|
/// Invoke all callback functions queued for this interface.
|
||||||
|
/// See k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, etc
|
||||||
|
///
|
||||||
|
/// You don't need to call this if you are using Steam's callback dispatch
|
||||||
|
/// mechanism (SteamAPI_RunCallbacks and SteamGameserver_RunCallbacks).
|
||||||
|
virtual void RunCallbacks() = 0;
|
||||||
|
protected:
|
||||||
|
// ~ISteamNetworkingSockets(); // Silence some warnings
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ISTEAMNETWORKINGSOCKETS009
|
@ -0,0 +1,214 @@
|
|||||||
|
|
||||||
|
#ifndef ISTEAMREMOTESTORAGE014_H
|
||||||
|
#define ISTEAMREMOTESTORAGE014_H
|
||||||
|
#ifdef STEAM_WIN32
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: Functions for accessing, reading and writing files stored remotely
|
||||||
|
// and cached locally
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
class ISteamRemoteStorage014
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// NOTE
|
||||||
|
//
|
||||||
|
// Filenames are case-insensitive, and will be converted to lowercase automatically.
|
||||||
|
// So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then
|
||||||
|
// iterate the files, the filename returned will be "foo.bar".
|
||||||
|
//
|
||||||
|
|
||||||
|
// file operations
|
||||||
|
virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0;
|
||||||
|
virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0;
|
||||||
|
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageFileWriteAsyncComplete_t )
|
||||||
|
virtual SteamAPICall_t FileWriteAsync( const char *pchFile, const void *pvData, uint32 cubData ) = 0;
|
||||||
|
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageFileReadAsyncComplete_t )
|
||||||
|
virtual SteamAPICall_t FileReadAsync( const char *pchFile, uint32 nOffset, uint32 cubToRead ) = 0;
|
||||||
|
virtual bool FileReadAsyncComplete( SteamAPICall_t hReadCall, void *pvBuffer, uint32 cubToRead ) = 0;
|
||||||
|
|
||||||
|
virtual bool FileForget( const char *pchFile ) = 0;
|
||||||
|
virtual bool FileDelete( const char *pchFile ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageFileShareResult_t )
|
||||||
|
virtual SteamAPICall_t FileShare( const char *pchFile ) = 0;
|
||||||
|
virtual bool SetSyncPlatforms( const char *pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ) = 0;
|
||||||
|
|
||||||
|
// file operations that cause network IO
|
||||||
|
virtual UGCFileWriteStreamHandle_t FileWriteStreamOpen( const char *pchFile ) = 0;
|
||||||
|
virtual bool FileWriteStreamWriteChunk( UGCFileWriteStreamHandle_t writeHandle, const void *pvData, int32 cubData ) = 0;
|
||||||
|
virtual bool FileWriteStreamClose( UGCFileWriteStreamHandle_t writeHandle ) = 0;
|
||||||
|
virtual bool FileWriteStreamCancel( UGCFileWriteStreamHandle_t writeHandle ) = 0;
|
||||||
|
|
||||||
|
// file information
|
||||||
|
virtual bool FileExists( const char *pchFile ) = 0;
|
||||||
|
virtual bool FilePersisted( const char *pchFile ) = 0;
|
||||||
|
virtual int32 GetFileSize( const char *pchFile ) = 0;
|
||||||
|
virtual int64 GetFileTimestamp( const char *pchFile ) = 0;
|
||||||
|
virtual ERemoteStoragePlatform GetSyncPlatforms( const char *pchFile ) = 0;
|
||||||
|
|
||||||
|
// iteration
|
||||||
|
virtual int32 GetFileCount() = 0;
|
||||||
|
virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0;
|
||||||
|
|
||||||
|
// configuration management
|
||||||
|
virtual bool GetQuota( uint64 *pnTotalBytes, uint64 *puAvailableBytes ) = 0;
|
||||||
|
virtual bool IsCloudEnabledForAccount() = 0;
|
||||||
|
virtual bool IsCloudEnabledForApp() = 0;
|
||||||
|
virtual void SetCloudEnabledForApp( bool bEnabled ) = 0;
|
||||||
|
|
||||||
|
// user generated content
|
||||||
|
|
||||||
|
// Downloads a UGC file. A priority value of 0 will download the file immediately,
|
||||||
|
// otherwise it will wait to download the file until all downloads with a lower priority
|
||||||
|
// value are completed. Downloads with equal priority will occur simultaneously.
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageDownloadUGCResult_t )
|
||||||
|
virtual SteamAPICall_t UGCDownload( UGCHandle_t hContent, uint32 unPriority ) = 0;
|
||||||
|
|
||||||
|
// Gets the amount of data downloaded so far for a piece of content. pnBytesExpected can be 0 if function returns false
|
||||||
|
// or if the transfer hasn't started yet, so be careful to check for that before dividing to get a percentage
|
||||||
|
virtual bool GetUGCDownloadProgress( UGCHandle_t hContent, int32 *pnBytesDownloaded, int32 *pnBytesExpected ) = 0;
|
||||||
|
|
||||||
|
// Gets metadata for a file after it has been downloaded. This is the same metadata given in the RemoteStorageDownloadUGCResult_t call result
|
||||||
|
virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, STEAM_OUT_STRING() char **ppchName, int32 *pnFileSizeInBytes, STEAM_OUT_STRUCT() CSteamID *pSteamIDOwner ) = 0;
|
||||||
|
|
||||||
|
// After download, gets the content of the file.
|
||||||
|
// Small files can be read all at once by calling this function with an offset of 0 and cubDataToRead equal to the size of the file.
|
||||||
|
// Larger files can be read in chunks to reduce memory usage (since both sides of the IPC client and the game itself must allocate
|
||||||
|
// enough memory for each chunk). Once the last byte is read, the file is implicitly closed and further calls to UGCRead will fail
|
||||||
|
// unless UGCDownload is called again.
|
||||||
|
// For especially large files (anything over 100MB) it is a requirement that the file is read in chunks.
|
||||||
|
virtual int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead, uint32 cOffset, EUGCReadAction eAction ) = 0;
|
||||||
|
|
||||||
|
// Functions to iterate through UGC that has finished downloading but has not yet been read via UGCRead()
|
||||||
|
virtual int32 GetCachedUGCCount() = 0;
|
||||||
|
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
|
||||||
|
// On Playstation 3, the game controls which files are stored in the cloud, via FilePersist, FileFetch, and FileForget.
|
||||||
|
|
||||||
|
#if 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;
|
||||||
|
// Reset any fetch/persist/etc requests
|
||||||
|
virtual bool ResetFileRequestState() = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// publishing UGC
|
||||||
|
STEAM_CALL_RESULT( RemoteStoragePublishFileProgress_t )
|
||||||
|
virtual SteamAPICall_t PublishWorkshopFile( const char *pchFile, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags, EWorkshopFileType eWorkshopFileType ) = 0;
|
||||||
|
virtual PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest( PublishedFileId_t unPublishedFileId ) = 0;
|
||||||
|
virtual bool UpdatePublishedFileFile( PublishedFileUpdateHandle_t updateHandle, const char *pchFile ) = 0;
|
||||||
|
virtual bool UpdatePublishedFilePreviewFile( PublishedFileUpdateHandle_t updateHandle, const char *pchPreviewFile ) = 0;
|
||||||
|
virtual bool UpdatePublishedFileTitle( PublishedFileUpdateHandle_t updateHandle, const char *pchTitle ) = 0;
|
||||||
|
virtual bool UpdatePublishedFileDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchDescription ) = 0;
|
||||||
|
virtual bool UpdatePublishedFileVisibility( PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0;
|
||||||
|
virtual bool UpdatePublishedFileTags( PublishedFileUpdateHandle_t updateHandle, SteamParamStringArray_t *pTags ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageUpdatePublishedFileResult_t )
|
||||||
|
virtual SteamAPICall_t CommitPublishedFileUpdate( PublishedFileUpdateHandle_t updateHandle ) = 0;
|
||||||
|
// Gets published file details for the given publishedfileid. If unMaxSecondsOld is greater than 0,
|
||||||
|
// cached data may be returned, depending on how long ago it was cached. A value of 0 will force a refresh.
|
||||||
|
// A value of k_WorkshopForceLoadPublishedFileDetailsFromCache will use cached data if it exists, no matter how old it is.
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageGetPublishedFileDetailsResult_t )
|
||||||
|
virtual SteamAPICall_t GetPublishedFileDetails( PublishedFileId_t unPublishedFileId, uint32 unMaxSecondsOld ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageDeletePublishedFileResult_t )
|
||||||
|
virtual SteamAPICall_t DeletePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||||
|
// enumerate the files that the current user published with this app
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t )
|
||||||
|
virtual SteamAPICall_t EnumerateUserPublishedFiles( uint32 unStartIndex ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t )
|
||||||
|
virtual SteamAPICall_t SubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageEnumerateUserSubscribedFilesResult_t )
|
||||||
|
virtual SteamAPICall_t EnumerateUserSubscribedFiles( uint32 unStartIndex ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t )
|
||||||
|
virtual SteamAPICall_t UnsubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||||
|
virtual bool UpdatePublishedFileSetChangeDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchChangeDescription ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t )
|
||||||
|
virtual SteamAPICall_t GetPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageUpdateUserPublishedItemVoteResult_t )
|
||||||
|
virtual SteamAPICall_t UpdateUserPublishedItemVote( PublishedFileId_t unPublishedFileId, bool bVoteUp ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t )
|
||||||
|
virtual SteamAPICall_t GetUserPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t )
|
||||||
|
virtual SteamAPICall_t EnumerateUserSharedWorkshopFiles( CSteamID steamId, uint32 unStartIndex, SteamParamStringArray_t *pRequiredTags, SteamParamStringArray_t *pExcludedTags ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStoragePublishFileProgress_t )
|
||||||
|
virtual SteamAPICall_t PublishVideo( EWorkshopVideoProvider eVideoProvider, const char *pchVideoAccount, const char *pchVideoIdentifier, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageSetUserPublishedFileActionResult_t )
|
||||||
|
virtual SteamAPICall_t SetUserPublishedFileAction( PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction ) = 0;
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageEnumeratePublishedFilesByUserActionResult_t )
|
||||||
|
virtual SteamAPICall_t EnumeratePublishedFilesByUserAction( EWorkshopFileAction eAction, uint32 unStartIndex ) = 0;
|
||||||
|
// this method enumerates the public view of workshop files
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageEnumerateWorkshopFilesResult_t )
|
||||||
|
virtual SteamAPICall_t EnumeratePublishedWorkshopFiles( EWorkshopEnumerationType eEnumerationType, uint32 unStartIndex, uint32 unCount, uint32 unDays, SteamParamStringArray_t *pTags, SteamParamStringArray_t *pUserTags ) = 0;
|
||||||
|
|
||||||
|
STEAM_CALL_RESULT( RemoteStorageDownloadUGCResult_t )
|
||||||
|
virtual SteamAPICall_t UGCDownloadToLocation( UGCHandle_t hContent, const char *pchLocation, uint32 unPriority ) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: sent when the local file cache is fully synced with the server for an app
|
||||||
|
// That means that an application can be started and has all latest files
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
struct RemoteStorageAppSyncedClient_t
|
||||||
|
{
|
||||||
|
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 1 };
|
||||||
|
AppId_t m_nAppID;
|
||||||
|
EResult m_eResult;
|
||||||
|
int m_unNumDownloads;
|
||||||
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: sent when the server is fully synced with the local file cache for an app
|
||||||
|
// That means that we can shutdown Steam and our data is stored on the server
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
struct RemoteStorageAppSyncedServer_t
|
||||||
|
{
|
||||||
|
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 2 };
|
||||||
|
AppId_t m_nAppID;
|
||||||
|
EResult m_eResult;
|
||||||
|
int m_unNumUploads;
|
||||||
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: Status of up and downloads during a sync session
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
struct RemoteStorageAppSyncProgress_t
|
||||||
|
{
|
||||||
|
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 3 };
|
||||||
|
char m_rgchCurrentFile[k_cchFilenameMax]; // Current file being transferred
|
||||||
|
AppId_t m_nAppID; // App this info relates to
|
||||||
|
uint32 m_uBytesTransferredThisChunk; // Bytes transferred this chunk
|
||||||
|
double m_dAppPercentComplete; // Percent complete that this app's transfers are
|
||||||
|
bool m_bUploading; // if false, downloading
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // ISTEAMREMOTESTORAGE014_H
|
Loading…
Reference in New Issue