SDK 1.53 update.
parent
8383f16be7
commit
1a411405e6
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,216 @@
|
||||
|
||||
#ifndef ISTEAMINPUT005_H
|
||||
#define ISTEAMINPUT005_H
|
||||
#ifdef STEAM_WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
class ISteamInput005
|
||||
{
|
||||
public:
|
||||
|
||||
// Init and Shutdown must be called when starting/ending use of this interface.
|
||||
// if bExplicitlyCallRunFrame is called then you will need to manually call RunFrame
|
||||
// each frame, otherwise Steam Input will updated when SteamAPI_RunCallbacks() is called
|
||||
virtual bool Init( bool bExplicitlyCallRunFrame ) = 0;
|
||||
virtual bool Shutdown() = 0;
|
||||
|
||||
// Set the absolute path to the Input Action Manifest file containing the in-game actions
|
||||
// and file paths to the official configurations. Used in games that bundle Steam Input
|
||||
// configurations inside of the game depot instead of using the Steam Workshop
|
||||
virtual bool SetInputActionManifestFilePath( const char *pchInputActionManifestAbsolutePath ) = 0;
|
||||
|
||||
// Synchronize API state with the latest Steam Input action data available. This
|
||||
// is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest
|
||||
// possible latency, you call this directly before reading controller state.
|
||||
// Note: This must be called from somewhere before GetConnectedControllers will
|
||||
// return any handles
|
||||
virtual void RunFrame( bool bReservedValue = true ) = 0;
|
||||
|
||||
// Waits on an IPC event from Steam sent when there is new data to be fetched from
|
||||
// the data drop. Returns true when data was recievied before the timeout expires.
|
||||
// Useful for games with a dedicated input thread
|
||||
virtual bool BWaitForData( bool bWaitForever, uint32 unTimeout ) = 0;
|
||||
|
||||
// Returns true if new data has been received since the last time action data was accessed
|
||||
// via GetDigitalActionData or GetAnalogActionData. The game will still need to call
|
||||
// SteamInput()->RunFrame() or SteamAPI_RunCallbacks() before this to update the data stream
|
||||
virtual bool BNewDataAvailable() = 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;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CALLBACKS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Controller configuration loaded - these callbacks will always fire if you have
|
||||
// a handler. Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks
|
||||
STEAM_CALL_BACK( SteamInputConfigurationLoaded_t )
|
||||
|
||||
// Enable SteamInputDeviceConnected_t and SteamInputDeviceDisconnected_t callbacks.
|
||||
// Each controller that is already connected will generate a device connected
|
||||
// callback when you enable them
|
||||
virtual void EnableDeviceCallbacks() = 0;
|
||||
|
||||
// Controller Connected - provides info about a single newly connected controller
|
||||
// Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks
|
||||
STEAM_CALL_BACK( SteamInputDeviceConnected_t )
|
||||
|
||||
// Controller Disconnected - provides info about a single disconnected controller
|
||||
// Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks
|
||||
STEAM_CALL_BACK( SteamInputDeviceDisconnected_t )
|
||||
|
||||
// Enable SteamInputActionEvent_t callbacks. Directly calls your callback function
|
||||
// for lower latency than standard Steam callbacks. Supports one callback at a time.
|
||||
// Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks
|
||||
virtual void EnableActionEventCallbacks( SteamInputActionEventCallbackPointer pCallback ) = 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 InputActionSetHandle_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;
|
||||
|
||||
// Returns a localized string (from Steam's language setting) for the user-facing action name corresponding to the specified handle
|
||||
virtual const char *GetStringForDigitalActionName( InputDigitalActionHandle_t eActionHandle ) = 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 a PNG file for the provided origin's glyph.
|
||||
virtual const char *GetGlyphPNGForActionOrigin( EInputActionOrigin eOrigin, ESteamInputGlyphSize eSize, uint32 unFlags ) = 0;
|
||||
|
||||
// Get a local path to a SVG file for the provided origin's glyph.
|
||||
virtual const char *GetGlyphSVGForActionOrigin( EInputActionOrigin eOrigin, uint32 unFlags ) = 0;
|
||||
|
||||
// Get a local path to an older, Big Picture Mode-style PNG file for a particular origin
|
||||
virtual const char *GetGlyphForActionOrigin_Legacy( EInputActionOrigin eOrigin ) = 0;
|
||||
|
||||
// Returns a localized string (from Steam's language setting) for the specified origin.
|
||||
virtual const char *GetStringForActionOrigin( EInputActionOrigin eOrigin ) = 0;
|
||||
|
||||
// Returns a localized string (from Steam's language setting) for the user-facing action name corresponding to the specified handle
|
||||
virtual const char *GetStringForAnalogActionName( InputAnalogActionHandle_t eActionHandle ) = 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;
|
||||
|
||||
// Trigger a vibration event on supported controllers including Xbox trigger impulse rumble - Steam will translate these commands into haptic pulses for Steam Controllers
|
||||
virtual void TriggerVibrationExtended( InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed, unsigned short usLeftTriggerSpeed, unsigned short usRightTriggerSpeed ) = 0;
|
||||
|
||||
// Send a haptic pulse, works on Steam Deck and Steam Controller devices
|
||||
virtual void TriggerSimpleHapticEvent( InputHandle_t inputHandle, EControllerHapticLocation eHapticLocation, uint8 nIntensity, char nGainDB, uint8 nOtherIntensity, char nOtherGainDB ) = 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 Legacy_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 Legacy_TriggerRepeatedHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Utility functions available 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;
|
||||
|
||||
// Get a bitmask of the Steam Input Configuration types opted in for the current session. Returns ESteamInputConfigurationEnableType values.?
|
||||
// Note: user can override the settings from the Steamworks Partner site so the returned values may not exactly match your default configuration
|
||||
virtual uint16 GetSessionInputConfigurationSettings() = 0;
|
||||
};
|
||||
|
||||
#endif //ISTEAMINPUT005_H
|
@ -0,0 +1,308 @@
|
||||
|
||||
#ifndef ISTEAMNETWORKINGUTILS003
|
||||
#define ISTEAMNETWORKINGUTILS003
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/// Misc networking utilities for checking the local networking environment
|
||||
/// and estimating pings.
|
||||
class ISteamNetworkingUtils003
|
||||
{
|
||||
public:
|
||||
//
|
||||
// Efficient message sending
|
||||
//
|
||||
|
||||
/// Allocate and initialize a message object. Usually the reason
|
||||
/// you call this is to pass it to ISteamNetworkingSockets::SendMessages.
|
||||
/// The returned object will have all of the relevant fields cleared to zero.
|
||||
///
|
||||
/// Optionally you can also request that this system allocate space to
|
||||
/// hold the payload itself. If cbAllocateBuffer is nonzero, the system
|
||||
/// will allocate memory to hold a payload of at least cbAllocateBuffer bytes.
|
||||
/// m_pData will point to the allocated buffer, m_cbSize will be set to the
|
||||
/// size, and m_pfnFreeData will be set to the proper function to free up
|
||||
/// the buffer.
|
||||
///
|
||||
/// If cbAllocateBuffer=0, then no buffer is allocated. m_pData will be NULL,
|
||||
/// m_cbSize will be zero, and m_pfnFreeData will be NULL. You will need to
|
||||
/// set each of these.
|
||||
virtual SteamNetworkingMessage_t *AllocateMessage( int cbAllocateBuffer ) = 0;
|
||||
|
||||
//
|
||||
// Access to Steam Datagram Relay (SDR) network
|
||||
//
|
||||
|
||||
//
|
||||
// Initialization and status check
|
||||
//
|
||||
|
||||
/// If you know that you are going to be using the relay network (for example,
|
||||
/// because you anticipate making P2P connections), call this to initialize the
|
||||
/// relay network. If you do not call this, the initialization will
|
||||
/// be delayed until the first time you use a feature that requires access
|
||||
/// to the relay network, which will delay that first access.
|
||||
///
|
||||
/// You can also call this to force a retry if the previous attempt has failed.
|
||||
/// Performing any action that requires access to the relay network will also
|
||||
/// trigger a retry, and so calling this function is never strictly necessary,
|
||||
/// but it can be useful to call it a program launch time, if access to the
|
||||
/// relay network is anticipated.
|
||||
///
|
||||
/// Use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t
|
||||
/// callbacks to know when initialization has completed.
|
||||
/// Typically initialization completes in a few seconds.
|
||||
///
|
||||
/// Note: dedicated servers hosted in known data centers do *not* need
|
||||
/// to call this, since they do not make routing decisions. However, if
|
||||
/// the dedicated server will be using P2P functionality, it will act as
|
||||
/// a "client" and this should be called.
|
||||
inline void InitRelayNetworkAccess();
|
||||
|
||||
/// Fetch current status of the relay network.
|
||||
///
|
||||
/// SteamRelayNetworkStatus_t is also a callback. It will be triggered on
|
||||
/// both the user and gameserver interfaces any time the status changes, or
|
||||
/// ping measurement starts or stops.
|
||||
///
|
||||
/// SteamRelayNetworkStatus_t::m_eAvail is returned. If you want
|
||||
/// more details, you can pass a non-NULL value.
|
||||
virtual ESteamNetworkingAvailability GetRelayNetworkStatus( SteamRelayNetworkStatus_t *pDetails ) = 0;
|
||||
|
||||
//
|
||||
// "Ping location" functions
|
||||
//
|
||||
// We use the ping times to the valve relays deployed worldwide to
|
||||
// generate a "marker" that describes the location of an Internet host.
|
||||
// Given two such markers, we can estimate the network latency between
|
||||
// two hosts, without sending any packets. The estimate is based on the
|
||||
// optimal route that is found through the Valve network. If you are
|
||||
// using the Valve network to carry the traffic, then this is precisely
|
||||
// the ping you want. If you are not, then the ping time will probably
|
||||
// still be a reasonable estimate.
|
||||
//
|
||||
// This is extremely useful to select peers for matchmaking!
|
||||
//
|
||||
// The markers can also be converted to a string, so they can be transmitted.
|
||||
// We have a separate library you can use on your app's matchmaking/coordinating
|
||||
// server to manipulate these objects. (See steamdatagram_gamecoordinator.h)
|
||||
|
||||
/// Return location info for the current host. Returns the approximate
|
||||
/// age of the data, in seconds, or -1 if no data is available.
|
||||
///
|
||||
/// It takes a few seconds to initialize access to the relay network. If
|
||||
/// you call this very soon after calling InitRelayNetworkAccess,
|
||||
/// the data may not be available yet.
|
||||
///
|
||||
/// This always return the most up-to-date information we have available
|
||||
/// right now, even if we are in the middle of re-calculating ping times.
|
||||
virtual float GetLocalPingLocation( SteamNetworkPingLocation_t &result ) = 0;
|
||||
|
||||
/// Estimate the round-trip latency between two arbitrary locations, in
|
||||
/// milliseconds. This is a conservative estimate, based on routing through
|
||||
/// the relay network. For most basic relayed connections, this ping time
|
||||
/// will be pretty accurate, since it will be based on the route likely to
|
||||
/// be actually used.
|
||||
///
|
||||
/// If a direct IP route is used (perhaps via NAT traversal), then the route
|
||||
/// will be different, and the ping time might be better. Or it might actually
|
||||
/// be a bit worse! Standard IP routing is frequently suboptimal!
|
||||
///
|
||||
/// But even in this case, the estimate obtained using this method is a
|
||||
/// reasonable upper bound on the ping time. (Also it has the advantage
|
||||
/// of returning immediately and not sending any packets.)
|
||||
///
|
||||
/// In a few cases we might not able to estimate the route. In this case
|
||||
/// a negative value is returned. k_nSteamNetworkingPing_Failed means
|
||||
/// the reason was because of some networking difficulty. (Failure to
|
||||
/// ping, etc) k_nSteamNetworkingPing_Unknown is returned if we cannot
|
||||
/// currently answer the question for some other reason.
|
||||
///
|
||||
/// Do you need to be able to do this from a backend/matchmaking server?
|
||||
/// You are looking for the "ticketgen" library.
|
||||
virtual int EstimatePingTimeBetweenTwoLocations( const SteamNetworkPingLocation_t &location1, const SteamNetworkPingLocation_t &location2 ) = 0;
|
||||
|
||||
/// Same as EstimatePingTime, but assumes that one location is the local host.
|
||||
/// This is a bit faster, especially if you need to calculate a bunch of
|
||||
/// these in a loop to find the fastest one.
|
||||
///
|
||||
/// In rare cases this might return a slightly different estimate than combining
|
||||
/// GetLocalPingLocation with EstimatePingTimeBetweenTwoLocations. That's because
|
||||
/// this function uses a slightly more complete set of information about what
|
||||
/// route would be taken.
|
||||
virtual int EstimatePingTimeFromLocalHost( const SteamNetworkPingLocation_t &remoteLocation ) = 0;
|
||||
|
||||
/// Convert a ping location into a text format suitable for sending over the wire.
|
||||
/// The format is a compact and human readable. However, it is subject to change
|
||||
/// so please do not parse it yourself. Your buffer must be at least
|
||||
/// k_cchMaxSteamNetworkingPingLocationString bytes.
|
||||
virtual void ConvertPingLocationToString( const SteamNetworkPingLocation_t &location, char *pszBuf, int cchBufSize ) = 0;
|
||||
|
||||
/// Parse back SteamNetworkPingLocation_t string. Returns false if we couldn't understand
|
||||
/// the string.
|
||||
virtual bool ParsePingLocationString( const char *pszString, SteamNetworkPingLocation_t &result ) = 0;
|
||||
|
||||
/// Check if the ping data of sufficient recency is available, and if
|
||||
/// it's too old, start refreshing it.
|
||||
///
|
||||
/// Please only call this function when you *really* do need to force an
|
||||
/// immediate refresh of the data. (For example, in response to a specific
|
||||
/// user input to refresh this information.) Don't call it "just in case",
|
||||
/// before every connection, etc. That will cause extra traffic to be sent
|
||||
/// for no benefit. The library will automatically refresh the information
|
||||
/// as needed.
|
||||
///
|
||||
/// Returns true if sufficiently recent data is already available.
|
||||
///
|
||||
/// Returns false if sufficiently recent data is not available. In this
|
||||
/// case, ping measurement is initiated, if it is not already active.
|
||||
/// (You cannot restart a measurement already in progress.)
|
||||
///
|
||||
/// You can use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t
|
||||
/// to know when ping measurement completes.
|
||||
virtual bool CheckPingDataUpToDate( float flMaxAgeSeconds ) = 0;
|
||||
|
||||
//
|
||||
// List of Valve data centers, and ping times to them. This might
|
||||
// be useful to you if you are use our hosting, or just need to measure
|
||||
// latency to a cloud data center where we are running relays.
|
||||
//
|
||||
|
||||
/// Fetch ping time of best available relayed route from this host to
|
||||
/// the specified data center.
|
||||
virtual int GetPingToDataCenter( SteamNetworkingPOPID popID, SteamNetworkingPOPID *pViaRelayPoP ) = 0;
|
||||
|
||||
/// Get *direct* ping time to the relays at the data center.
|
||||
virtual int GetDirectPingToPOP( SteamNetworkingPOPID popID ) = 0;
|
||||
|
||||
/// Get number of network points of presence in the config
|
||||
virtual int GetPOPCount() = 0;
|
||||
|
||||
/// Get list of all POP IDs. Returns the number of entries that were filled into
|
||||
/// your list.
|
||||
virtual int GetPOPList( SteamNetworkingPOPID *list, int nListSz ) = 0;
|
||||
|
||||
//
|
||||
// Misc
|
||||
//
|
||||
|
||||
/// Fetch current timestamp. This timer has the following properties:
|
||||
///
|
||||
/// - Monotonicity is guaranteed.
|
||||
/// - The initial value will be at least 24*3600*30*1e6, i.e. about
|
||||
/// 30 days worth of microseconds. In this way, the timestamp value of
|
||||
/// 0 will always be at least "30 days ago". Also, negative numbers
|
||||
/// will never be returned.
|
||||
/// - Wraparound / overflow is not a practical concern.
|
||||
///
|
||||
/// If you are running under the debugger and stop the process, the clock
|
||||
/// might not advance the full wall clock time that has elapsed between
|
||||
/// calls. If the process is not blocked from normal operation, the
|
||||
/// timestamp values will track wall clock time, even if you don't call
|
||||
/// the function frequently.
|
||||
///
|
||||
/// The value is only meaningful for this run of the process. Don't compare
|
||||
/// it to values obtained on another computer, or other runs of the same process.
|
||||
virtual SteamNetworkingMicroseconds GetLocalTimestamp() = 0;
|
||||
|
||||
/// Set a function to receive network-related information that is useful for debugging.
|
||||
/// This can be very useful during development, but it can also be useful for troubleshooting
|
||||
/// problems with tech savvy end users. If you have a console or other log that customers
|
||||
/// can examine, these log messages can often be helpful to troubleshoot network issues.
|
||||
/// (Especially any warning/error messages.)
|
||||
///
|
||||
/// The detail level indicates what message to invoke your callback on. Lower numeric
|
||||
/// value means more important, and the value you pass is the lowest priority (highest
|
||||
/// numeric value) you wish to receive callbacks for.
|
||||
///
|
||||
/// The value here controls the detail level for most messages. You can control the
|
||||
/// detail level for various subsystems (perhaps only for certain connections) by
|
||||
/// adjusting the configuration values k_ESteamNetworkingConfig_LogLevel_Xxxxx.
|
||||
///
|
||||
/// Except when debugging, you should only use k_ESteamNetworkingSocketsDebugOutputType_Msg
|
||||
/// or k_ESteamNetworkingSocketsDebugOutputType_Warning. For best performance, do NOT
|
||||
/// request a high detail level and then filter out messages in your callback. This incurs
|
||||
/// all of the expense of formatting the messages, which are then discarded. Setting a high
|
||||
/// priority value (low numeric value) here allows the library to avoid doing this work.
|
||||
///
|
||||
/// IMPORTANT: This may be called from a service thread, while we own a mutex, etc.
|
||||
/// Your output function must be threadsafe and fast! Do not make any other
|
||||
/// Steamworks calls from within the handler.
|
||||
virtual void SetDebugOutputFunction( ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) = 0;
|
||||
|
||||
//
|
||||
// Set and get configuration values, see ESteamNetworkingConfigValue for individual descriptions.
|
||||
//
|
||||
|
||||
// Shortcuts for common cases. (Implemented as inline functions below)
|
||||
bool SetGlobalConfigValueInt32( ESteamNetworkingConfigValue eValue, int32 val );
|
||||
bool SetGlobalConfigValueFloat( ESteamNetworkingConfigValue eValue, float val );
|
||||
bool SetGlobalConfigValueString( ESteamNetworkingConfigValue eValue, const char *val );
|
||||
bool SetGlobalConfigValuePtr( ESteamNetworkingConfigValue eValue, void *val );
|
||||
bool SetConnectionConfigValueInt32( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val );
|
||||
bool SetConnectionConfigValueFloat( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val );
|
||||
bool SetConnectionConfigValueString( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char *val );
|
||||
|
||||
//
|
||||
// Set global callbacks. If you do not want to use Steam's callback dispatch mechanism and you
|
||||
// want to use the same callback on all (or most) listen sockets and connections, then
|
||||
// simply install these callbacks first thing, and you are good to go.
|
||||
// See ISteamNetworkingSockets::RunCallbacks
|
||||
//
|
||||
bool SetGlobalCallback_SteamNetConnectionStatusChanged( FnSteamNetConnectionStatusChanged fnCallback );
|
||||
bool SetGlobalCallback_SteamNetAuthenticationStatusChanged( FnSteamNetAuthenticationStatusChanged fnCallback );
|
||||
bool SetGlobalCallback_SteamRelayNetworkStatusChanged( FnSteamRelayNetworkStatusChanged fnCallback );
|
||||
bool SetGlobalCallback_MessagesSessionRequest( FnSteamNetworkingMessagesSessionRequest fnCallback );
|
||||
bool SetGlobalCallback_MessagesSessionFailed( FnSteamNetworkingMessagesSessionFailed fnCallback );
|
||||
|
||||
/// Set a configuration value.
|
||||
/// - eValue: which value is being set
|
||||
/// - eScope: Onto what type of object are you applying the setting?
|
||||
/// - scopeArg: Which object you want to change? (Ignored for global scope). E.g. connection handle, listen socket handle, interface pointer, etc.
|
||||
/// - eDataType: What type of data is in the buffer at pValue? This must match the type of the variable exactly!
|
||||
/// - pArg: Value to set it to. You can pass NULL to remove a non-global setting at this scope,
|
||||
/// causing the value for that object to use global defaults. Or at global scope, passing NULL
|
||||
/// will reset any custom value and restore it to the system default.
|
||||
/// NOTE: When setting pointers (e.g. callback functions), do not pass the function pointer directly.
|
||||
/// Your argument should be a pointer to a function pointer.
|
||||
virtual bool SetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj,
|
||||
ESteamNetworkingConfigDataType eDataType, const void *pArg ) = 0;
|
||||
|
||||
/// Set a configuration value, using a struct to pass the value.
|
||||
/// (This is just a convenience shortcut; see below for the implementation and
|
||||
/// a little insight into how SteamNetworkingConfigValue_t is used when
|
||||
/// setting config options during listen socket and connection creation.)
|
||||
bool SetConfigValueStruct( const SteamNetworkingConfigValue_t &opt, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj );
|
||||
|
||||
/// Get a configuration value.
|
||||
/// - eValue: which value to fetch
|
||||
/// - eScopeType: query setting on what type of object
|
||||
/// - eScopeArg: the object to query the setting for
|
||||
/// - pOutDataType: If non-NULL, the data type of the value is returned.
|
||||
/// - pResult: Where to put the result. Pass NULL to query the required buffer size. (k_ESteamNetworkingGetConfigValue_BufferTooSmall will be returned.)
|
||||
/// - cbResult: IN: the size of your buffer. OUT: the number of bytes filled in or required.
|
||||
virtual ESteamNetworkingGetConfigValueResult GetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj,
|
||||
ESteamNetworkingConfigDataType *pOutDataType, void *pResult, size_t *cbResult ) = 0;
|
||||
|
||||
/// Returns info about a configuration value. Returns false if the value does not exist.
|
||||
/// pOutNextValue can be used to iterate through all of the known configuration values.
|
||||
/// (Use GetFirstConfigValue() to begin the iteration, will be k_ESteamNetworkingConfig_Invalid on the last value)
|
||||
/// Any of the output parameters can be NULL if you do not need that information.
|
||||
///
|
||||
/// See k_ESteamNetworkingConfig_EnumerateDevVars for some more info about "dev" variables,
|
||||
/// which are usually excluded from the set of variables enumerated using this function.
|
||||
virtual bool GetConfigValueInfo( ESteamNetworkingConfigValue eValue, const char **pOutName, ESteamNetworkingConfigDataType *pOutDataType, ESteamNetworkingConfigScope *pOutScope, ESteamNetworkingConfigValue *pOutNextValue ) = 0;
|
||||
|
||||
/// Return the lowest numbered configuration value available in the current environment.
|
||||
virtual ESteamNetworkingConfigValue GetFirstConfigValue() = 0;
|
||||
|
||||
// String conversions. You'll usually access these using the respective
|
||||
// inline methods.
|
||||
virtual void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr &addr, char *buf, size_t cbBuf, bool bWithPort ) = 0;
|
||||
virtual bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ) = 0;
|
||||
virtual void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ) = 0;
|
||||
virtual bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr ) = 0;
|
||||
protected:
|
||||
// ~ISteamNetworkingUtils(); // Silence some warnings
|
||||
};
|
||||
|
||||
#endif // ISTEAMNETWORKINGUTILS003
|
@ -0,0 +1,180 @@
|
||||
|
||||
#ifndef ISTEAMUGC015_H
|
||||
#define ISTEAMUGC015_H
|
||||
#ifdef STEAM_WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
class ISteamUGC015
|
||||
{
|
||||
public:
|
||||
|
||||
// Query UGC associated with a user. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.
|
||||
virtual UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0;
|
||||
|
||||
// Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.
|
||||
STEAM_FLAT_NAME( CreateQueryAllUGCRequestPage )
|
||||
virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0;
|
||||
|
||||
// Query for all matching UGC using the new deep paging interface. Creator app id or consumer app id must be valid and be set to the current running app. pchCursor should be set to NULL or "*" to get the first result set.
|
||||
STEAM_FLAT_NAME( CreateQueryAllUGCRequestCursor )
|
||||
virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char *pchCursor = NULL ) = 0;
|
||||
|
||||
// Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this)
|
||||
virtual UGCQueryHandle_t CreateQueryUGCDetailsRequest( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0;
|
||||
|
||||
// Send the query to Steam
|
||||
STEAM_CALL_RESULT( SteamUGCQueryCompleted_t )
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual uint32 GetQueryUGCNumTags( UGCQueryHandle_t handle, uint32 index ) = 0;
|
||||
virtual bool GetQueryUGCTag( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0;
|
||||
virtual bool GetQueryUGCTagDisplayName( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0;
|
||||
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0;
|
||||
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0;
|
||||
virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0;
|
||||
virtual bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint32 index, EItemStatistic eStatType, uint64 *pStatValue ) = 0;
|
||||
virtual uint32 GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint32 index ) = 0;
|
||||
virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURLOrVideoID, uint32 cchURLSize, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType *pPreviewType ) = 0;
|
||||
virtual uint32 GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint32 index ) = 0;
|
||||
virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, STEAM_OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0;
|
||||
|
||||
// Return the first value matching the pchKey. Note that a key may map to multiple values. Returns false if there was an error or no matching value was found.
|
||||
STEAM_FLAT_NAME( GetQueryFirstUGCKeyValueTag )
|
||||
virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, const char *pchKey, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0;
|
||||
|
||||
// Release the request to free up memory, after retrieving results
|
||||
virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Options to set for querying UGC
|
||||
virtual bool AddRequiredTag( UGCQueryHandle_t handle, const char *pTagName ) = 0;
|
||||
virtual bool AddRequiredTagGroup( UGCQueryHandle_t handle, const SteamParamStringArray_t *pTagGroups ) = 0; // match any of the tags in this group
|
||||
virtual bool AddExcludedTag( UGCQueryHandle_t handle, const char *pTagName ) = 0;
|
||||
virtual bool SetReturnOnlyIDs( UGCQueryHandle_t handle, bool bReturnOnlyIDs ) = 0;
|
||||
virtual bool SetReturnKeyValueTags( UGCQueryHandle_t handle, bool bReturnKeyValueTags ) = 0;
|
||||
virtual bool SetReturnLongDescription( UGCQueryHandle_t handle, bool bReturnLongDescription ) = 0;
|
||||
virtual bool SetReturnMetadata( UGCQueryHandle_t handle, bool bReturnMetadata ) = 0;
|
||||
virtual bool SetReturnChildren( UGCQueryHandle_t handle, bool bReturnChildren ) = 0;
|
||||
virtual bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, bool bReturnAdditionalPreviews ) = 0;
|
||||
virtual bool SetReturnTotalOnly( UGCQueryHandle_t handle, bool bReturnTotalOnly ) = 0;
|
||||
virtual bool SetReturnPlaytimeStats( UGCQueryHandle_t handle, uint32 unDays ) = 0;
|
||||
virtual bool SetLanguage( UGCQueryHandle_t handle, const char *pchLanguage ) = 0;
|
||||
virtual bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Options only for querying user UGC
|
||||
virtual bool SetCloudFileNameFilter( UGCQueryHandle_t handle, const char *pMatchCloudFileName ) = 0;
|
||||
|
||||
// Options only for querying all UGC
|
||||
virtual bool SetMatchAnyTag( UGCQueryHandle_t handle, bool bMatchAnyTag ) = 0;
|
||||
virtual bool SetSearchText( UGCQueryHandle_t handle, const char *pSearchText ) = 0;
|
||||
virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0;
|
||||
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
STEAM_CALL_RESULT( SteamUGCRequestUGCDetailsResult_t )
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
STEAM_CALL_RESULT( CreateItemResult_t )
|
||||
virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet
|
||||
|
||||
virtual UGCUpdateHandle_t StartItemUpdate( AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID ) = 0; // start an UGC item update. Set changed properties before commiting update with CommitItemUpdate()
|
||||
|
||||
virtual bool SetItemTitle( UGCUpdateHandle_t handle, const char *pchTitle ) = 0; // change the title of an UGC item
|
||||
virtual bool SetItemDescription( UGCUpdateHandle_t handle, const char *pchDescription ) = 0; // change the description of an UGC item
|
||||
virtual bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set
|
||||
virtual bool SetItemMetadata( UGCUpdateHandle_t handle, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax)
|
||||
virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item
|
||||
virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item
|
||||
virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder
|
||||
virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size
|
||||
virtual bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, bool bAllowLegacyUpload ) = 0; // use legacy upload for a single small file. The parameter to SetItemContent() should either be a directory with one file or the full path to the file. The file must also be less than 10MB in size.
|
||||
virtual bool RemoveAllItemKeyValueTags( UGCUpdateHandle_t handle ) = 0; // remove all existing key-value tags (you can add new ones via the AddItemKeyValueTag function)
|
||||
virtual bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key
|
||||
virtual bool AddItemKeyValueTag( UGCUpdateHandle_t handle, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag.
|
||||
virtual bool AddItemPreviewFile( UGCUpdateHandle_t handle, const char *pszPreviewFile, EItemPreviewType type ) = 0; // add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
|
||||
virtual bool AddItemPreviewVideo( UGCUpdateHandle_t handle, const char *pszVideoID ) = 0; // add preview video for this item
|
||||
virtual bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint32 index, const char *pszPreviewFile ) = 0; // updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
|
||||
virtual bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint32 index, const char *pszVideoID ) = 0; // updates an existing preview video for this item
|
||||
virtual bool RemoveItemPreview( UGCUpdateHandle_t handle, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted)
|
||||
|
||||
STEAM_CALL_RESULT( SubmitItemUpdateResult_t )
|
||||
virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate()
|
||||
virtual EItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, uint64 *punBytesProcessed, uint64* punBytesTotal ) = 0;
|
||||
|
||||
// Steam Workshop Consumer API
|
||||
STEAM_CALL_RESULT( SetUserItemVoteResult_t )
|
||||
virtual SteamAPICall_t SetUserItemVote( PublishedFileId_t nPublishedFileID, bool bVoteUp ) = 0;
|
||||
STEAM_CALL_RESULT( GetUserItemVoteResult_t )
|
||||
virtual SteamAPICall_t GetUserItemVote( PublishedFileId_t nPublishedFileID ) = 0;
|
||||
STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t )
|
||||
virtual SteamAPICall_t AddItemToFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0;
|
||||
STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t )
|
||||
virtual SteamAPICall_t RemoveItemFromFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0;
|
||||
STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t )
|
||||
virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscribe to this item, will be installed ASAP
|
||||
STEAM_CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t )
|
||||
virtual SteamAPICall_t UnsubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // unsubscribe from this item, will be uninstalled after game quits
|
||||
virtual uint32 GetNumSubscribedItems() = 0; // number of subscribed items
|
||||
virtual uint32 GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; // all subscribed item PublishFileIDs
|
||||
|
||||
// get EItemState flags about item on this client
|
||||
virtual uint32 GetItemState( PublishedFileId_t nPublishedFileID ) = 0;
|
||||
|
||||
// get info about currently installed content on disc for items that have k_EItemStateInstalled set
|
||||
// if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder)
|
||||
virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, STEAM_OUT_STRING_COUNT( cchFolderSize ) char *pchFolder, uint32 cchFolderSize, uint32 *punTimeStamp ) = 0;
|
||||
|
||||
// get info about pending update for items that have k_EItemStateNeedsUpdate set. punBytesTotal will be valid after download started once
|
||||
virtual bool GetItemDownloadInfo( PublishedFileId_t nPublishedFileID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0;
|
||||
|
||||
// download new or update already installed item. If function returns true, wait for DownloadItemResult_t. If the item is already installed,
|
||||
// then files on disk should not be used until callback received. If item is not subscribed to, it will be cached for some time.
|
||||
// If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP.
|
||||
virtual bool DownloadItem( PublishedFileId_t nPublishedFileID, bool bHighPriority ) = 0;
|
||||
|
||||
// game servers can set a specific workshop folder before issuing any UGC commands.
|
||||
// This is helpful if you want to support multiple game servers running out of the same install folder
|
||||
virtual bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, const char *pszFolder ) = 0;
|
||||
|
||||
// SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends
|
||||
virtual void SuspendDownloads( bool bSuspend ) = 0;
|
||||
|
||||
// usage tracking
|
||||
STEAM_CALL_RESULT( StartPlaytimeTrackingResult_t )
|
||||
virtual SteamAPICall_t StartPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0;
|
||||
STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t )
|
||||
virtual SteamAPICall_t StopPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0;
|
||||
STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t )
|
||||
virtual SteamAPICall_t StopPlaytimeTrackingForAllItems() = 0;
|
||||
|
||||
// parent-child relationship or dependency management
|
||||
STEAM_CALL_RESULT( AddUGCDependencyResult_t )
|
||||
virtual SteamAPICall_t AddDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0;
|
||||
STEAM_CALL_RESULT( RemoveUGCDependencyResult_t )
|
||||
virtual SteamAPICall_t RemoveDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0;
|
||||
|
||||
// add/remove app dependence/requirements (usually DLC)
|
||||
STEAM_CALL_RESULT( AddAppDependencyResult_t )
|
||||
virtual SteamAPICall_t AddAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0;
|
||||
STEAM_CALL_RESULT( RemoveAppDependencyResult_t )
|
||||
virtual SteamAPICall_t RemoveAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0;
|
||||
// request app dependencies. note that whatever callback you register for GetAppDependenciesResult_t may be called multiple times
|
||||
// until all app dependencies have been returned
|
||||
STEAM_CALL_RESULT( GetAppDependenciesResult_t )
|
||||
virtual SteamAPICall_t GetAppDependencies( PublishedFileId_t nPublishedFileID ) = 0;
|
||||
|
||||
// delete the item without prompting the user
|
||||
STEAM_CALL_RESULT( DeleteItemResult_t )
|
||||
virtual SteamAPICall_t DeleteItem( PublishedFileId_t nPublishedFileID ) = 0;
|
||||
|
||||
// Show the app's latest Workshop EULA to the user in an overlay window, where they can accept it or not
|
||||
virtual bool ShowWorkshopEULA() = 0;
|
||||
// Retrieve information related to the user's acceptance or not of the app's specific Workshop EULA
|
||||
STEAM_CALL_RESULT( WorkshopEULAStatus_t )
|
||||
virtual SteamAPICall_t GetWorkshopEULAStatus() = 0;
|
||||
};
|
||||
|
||||
#endif // ISTEAMUGC015_H
|
@ -0,0 +1,135 @@
|
||||
//====== Copyright Valve Corporation, All rights reserved. ====================
|
||||
|
||||
#ifndef STEAMNETWORKINGFAKEIP_H
|
||||
#define STEAMNETWORKINGFAKEIP_H
|
||||
|
||||
#include "steamnetworkingtypes.h"
|
||||
#include "steam_api_common.h"
|
||||
|
||||
// It is HIGHLY recommended to limit messages sent via Fake UDP port to this
|
||||
// value. The purpose of a Fake UDP port is to make porting ordinary ad-hoc UDP
|
||||
// code easier. Although the real MTU might be higher than this, this particular
|
||||
// conservative value is chosen so that fragmentation won't be occurring and
|
||||
// hiding performance problems from you.
|
||||
constexpr int k_cbSteamNetworkingSocketsFakeUDPPortRecommendedMTU = 1200;
|
||||
|
||||
// Messages larger than this size are not allowed and cannot be sent
|
||||
// via Fake UDP port.
|
||||
constexpr int k_cbSteamNetworkingSocketsFakeUDPPortMaxMessageSize = 4096;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/// ISteamNetworkingFakeUDPPort
|
||||
///
|
||||
/// Acts like a UDP port, sending and receiving datagrams addressed using
|
||||
/// FakeIP addresses.
|
||||
///
|
||||
/// See: ISteamNetworkingSockets::CreateFakeUDPPort
|
||||
|
||||
class ISteamNetworkingFakeUDPPort
|
||||
{
|
||||
public:
|
||||
/// Destroy the object and cleanup any internal connections.
|
||||
/// Note that this function call is not threadsafe with respect
|
||||
/// to any other method of this interface. (However, in general
|
||||
/// all other operations are threadsafe with respect to each other.)
|
||||
virtual void DestroyFakeUDPPort() = 0;
|
||||
|
||||
/// Send a datagram to the specified FakeIP.
|
||||
///
|
||||
/// See ISteamNetworkingSockets::SendMessageToConnection for the meaning of
|
||||
/// nSendFlags and possible return codes.
|
||||
///
|
||||
/// Notes:
|
||||
/// - datagrams larger than the underlying MTU are supported, but
|
||||
/// reliable messages (k_nSteamNetworkingSend_Reliable) are not supported.
|
||||
/// - You will usually want to use k_nSteamNetworkingSend_NoNagle
|
||||
/// - k_EResultBusy is returned if this is a "server" port and the global
|
||||
/// allocation has not yet completed.
|
||||
/// - k_EResultIPNotFound will be returned if the address is a local/ephemeral
|
||||
/// address and no existing connection can be found. This can happen if
|
||||
/// the remote host contacted us without having a global address, and we
|
||||
/// assigned them a random local address, and then the session with
|
||||
/// that host timed out.
|
||||
/// - When initiating communications, the first messages may be sent
|
||||
/// via backend signaling, or otherwise delayed, while a route is found.
|
||||
/// Expect the ping time to fluctuate during this period, and it's possible
|
||||
/// that messages will be delivered out of order (which is also possible with
|
||||
/// ordinary UDP).
|
||||
virtual EResult SendMessageToFakeIP( const SteamNetworkingIPAddr &remoteAddress, const void *pData, uint32 cbData, int nSendFlags ) = 0;
|
||||
|
||||
/// Receive messages on the port.
|
||||
///
|
||||
/// Returns the number of messages returned into your array, up to nMaxMessages.
|
||||
///
|
||||
/// SteamNetworkingMessage_t::m_identity in the returned message(s) will always contain
|
||||
/// a FakeIP. See ISteamNetworkingUtils::GetRealIdentityForFakeIP.
|
||||
virtual int ReceiveMessages( SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0;
|
||||
|
||||
/// Schedule the internal connection for a given peer to be cleaned up in a few seconds.
|
||||
///
|
||||
/// Idle connections automatically time out, and so this is not strictly *necessary*,
|
||||
/// but if you have reason to believe that you are done talking to a given peer for
|
||||
/// a while, you can call this to speed up the timeout. If any remaining packets are
|
||||
/// sent or received from the peer, the cleanup is canceled and the usual timeout
|
||||
/// value is restored. Thus you will usually call this immediately after sending
|
||||
/// or receiving application-layer "close connection" packets.
|
||||
virtual void ScheduleCleanup( const SteamNetworkingIPAddr &remoteAddress ) = 0;
|
||||
};
|
||||
#define STEAMNETWORKINGFAKEUDPPORT_INTERFACE_VERSION "SteamNetworkingFakeUDPPort001" /* for proton codegen */
|
||||
|
||||
/// Callback struct used to notify when a connection has changed state
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE"
|
||||
#endif
|
||||
|
||||
/// A struct used to describe a "fake IP" we have been assigned to
|
||||
/// use as an identifier. This callback is posted when
|
||||
/// ISteamNetworkingSoockets::BeginAsyncRequestFakeIP completes.
|
||||
/// See also ISteamNetworkingSockets::GetFakeIP
|
||||
struct SteamNetworkingFakeIPResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 3 };
|
||||
|
||||
/// Status/result of the allocation request. Possible failure values are:
|
||||
/// - k_EResultBusy - you called GetFakeIP but the request has not completed.
|
||||
/// - k_EResultInvalidParam - you called GetFakeIP with an invalid port index
|
||||
/// - k_EResultLimitExceeded - You asked for too many ports, or made an
|
||||
/// additional request after one had already succeeded
|
||||
/// - k_EResultNoMatch - GetFakeIP was called, but no request has been made
|
||||
///
|
||||
/// Note that, with the exception of k_EResultBusy (if you are polling),
|
||||
/// it is highly recommended to treat all failures as fatal.
|
||||
EResult m_eResult;
|
||||
|
||||
/// Local identity of the ISteamNetworkingSockets object that made
|
||||
/// this request and is assigned the IP. This is needed in the callback
|
||||
/// in the case where there are multiple ISteamNetworkingSockets objects.
|
||||
/// (E.g. one for the user, and another for the local gameserver).
|
||||
SteamNetworkingIdentity m_identity;
|
||||
|
||||
/// Fake IPv4 IP address that we have been assigned. NOTE: this
|
||||
/// IP address is not exclusively ours! Steam tries to avoid sharing
|
||||
/// IP addresses, but this may not always be possible. The IP address
|
||||
/// may be currently in use by another host, but with different port(s).
|
||||
/// The exact same IP:port address may have been used previously.
|
||||
/// Steam tries to avoid reusing ports until they have not been in use for
|
||||
/// some time, but this may not always be possible.
|
||||
uint32 m_unIP;
|
||||
|
||||
/// Port number(s) assigned to us. Only the first entries will contain
|
||||
/// nonzero values. Entries corresponding to ports beyond what was
|
||||
/// allocated for you will be zero.
|
||||
///
|
||||
/// (NOTE: At the time of this writing, the maximum number of ports you may
|
||||
/// request is 4.)
|
||||
enum { k_nMaxReturnPorts = 8 };
|
||||
uint16 m_unPorts[k_nMaxReturnPorts];
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // _H
|
Loading…
Reference in New Issue