SDK 1.53 update.

This commit is contained in:
Mr_Goldberg 2022-01-25 15:49:26 -05:00
parent 8383f16be7
commit 1a411405e6
No known key found for this signature in database
GPG key ID: 8597D87419DEF278
27 changed files with 2872 additions and 624 deletions

View file

@ -22,8 +22,11 @@
static void static void
randombytes(char * const buf, const size_t size) randombytes(char * const buf, const size_t size)
{ {
while (!RtlGenRandom((PVOID) buf, (ULONG) size)) {
PRINT_DEBUG("RtlGenRandom ERROR\n");
Sleep(100);
}
RtlGenRandom((PVOID) buf, (ULONG) size);
} }
std::string get_env_variable(std::string name) std::string get_env_variable(std::string name)

File diff suppressed because it is too large Load diff

View file

@ -538,6 +538,8 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe
return (void *)(ISteamNetworkingUtils001 *)steam_networking_utils; return (void *)(ISteamNetworkingUtils001 *)steam_networking_utils;
} else if (strcmp(pchVersion, "SteamNetworkingUtils002") == 0) { } else if (strcmp(pchVersion, "SteamNetworkingUtils002") == 0) {
return (void *)(ISteamNetworkingUtils002 *)steam_networking_utils; return (void *)(ISteamNetworkingUtils002 *)steam_networking_utils;
} else if (strcmp(pchVersion, "SteamNetworkingUtils003") == 0) {
return (void *)(ISteamNetworkingUtils003 *)steam_networking_utils;
} else if (strcmp(pchVersion, STEAMNETWORKINGUTILS_INTERFACE_VERSION) == 0) { } else if (strcmp(pchVersion, STEAMNETWORKINGUTILS_INTERFACE_VERSION) == 0) {
return (void *)(ISteamNetworkingUtils *)steam_networking_utils; return (void *)(ISteamNetworkingUtils *)steam_networking_utils;
} else { } else {
@ -936,6 +938,8 @@ ISteamUGC *Steam_Client::GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamP
return (ISteamUGC *)(void *)(ISteamUGC013 *)steam_ugc_temp; return (ISteamUGC *)(void *)(ISteamUGC013 *)steam_ugc_temp;
} else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION014") == 0) { } else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION014") == 0) {
return (ISteamUGC *)(void *)(ISteamUGC014 *)steam_ugc_temp; return (ISteamUGC *)(void *)(ISteamUGC014 *)steam_ugc_temp;
} else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION015") == 0) {
return (ISteamUGC *)(void *)(ISteamUGC015 *)steam_ugc_temp;
} else if (strcmp(pchVersion, STEAMUGC_INTERFACE_VERSION) == 0) { } else if (strcmp(pchVersion, STEAMUGC_INTERFACE_VERSION) == 0) {
return (ISteamUGC *)(void *)(ISteamUGC *)steam_ugc_temp; return (ISteamUGC *)(void *)(ISteamUGC *)steam_ugc_temp;
} else { } else {
@ -1096,6 +1100,8 @@ ISteamInput *Steam_Client::GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSt
return (ISteamInput *)(void *)(ISteamInput001 *)steam_controller; return (ISteamInput *)(void *)(ISteamInput001 *)steam_controller;
} else if (strcmp(pchVersion, "SteamInput002") == 0) { } else if (strcmp(pchVersion, "SteamInput002") == 0) {
return (ISteamInput *)(void *)(ISteamInput002 *)steam_controller; return (ISteamInput *)(void *)(ISteamInput002 *)steam_controller;
} else if (strcmp(pchVersion, "SteamInput005") == 0) {
return (ISteamInput *)(void *)(ISteamInput005 *)steam_controller;
} else if (strcmp(pchVersion, STEAMINPUT_INTERFACE_VERSION) == 0) { } else if (strcmp(pchVersion, STEAMINPUT_INTERFACE_VERSION) == 0) {
return (ISteamInput *)(void *)(ISteamInput *)steam_controller; return (ISteamInput *)(void *)(ISteamInput *)steam_controller;
} else { } else {

View file

@ -102,6 +102,7 @@ public ISteamController007,
public ISteamController, public ISteamController,
public ISteamInput001, public ISteamInput001,
public ISteamInput002, public ISteamInput002,
public ISteamInput005,
public ISteamInput public ISteamInput
{ {
class Settings *settings; class Settings *settings;

View file

@ -336,7 +336,7 @@ bool CloseChannelWithUser( const SteamNetworkingIdentity &identityRemote, int nL
/// you do not need the corresponding details. Note that sessions time out after a while, /// you do not need the corresponding details. Note that sessions time out after a while,
/// so if a connection fails, or SendMessageToUser returns SendMessageToUser, you cannot wait /// so if a connection fails, or SendMessageToUser returns SendMessageToUser, you cannot wait
/// indefinitely to obtain the reason for failure. /// indefinitely to obtain the reason for failure.
ESteamNetworkingConnectionState GetSessionConnectionInfo( const SteamNetworkingIdentity &identityRemote, SteamNetConnectionInfo_t *pConnectionInfo, SteamNetworkingQuickConnectionStatus *pQuickStatus ) ESteamNetworkingConnectionState GetSessionConnectionInfo( const SteamNetworkingIdentity &identityRemote, SteamNetConnectionInfo_t *pConnectionInfo, SteamNetConnectionRealTimeStatus_t *pQuickStatus )
{ {
PRINT_DEBUG("Steam_Networking_Messages::GetSessionConnectionInfo\n"); PRINT_DEBUG("Steam_Networking_Messages::GetSessionConnectionInfo\n");
std::lock_guard<std::recursive_mutex> lock(global_mutex); std::lock_guard<std::recursive_mutex> lock(global_mutex);
@ -360,7 +360,7 @@ ESteamNetworkingConnectionState GetSessionConnectionInfo( const SteamNetworkingI
} }
if (pQuickStatus) { if (pQuickStatus) {
memset(pQuickStatus, 0, sizeof(SteamNetworkingQuickConnectionStatus)); memset(pQuickStatus, 0, sizeof(SteamNetConnectionRealTimeStatus_t));
pQuickStatus->m_eState = state; pQuickStatus->m_eState = state;
pQuickStatus->m_nPing = 10; //TODO: calculate real numbers? pQuickStatus->m_nPing = 10; //TODO: calculate real numbers?
pQuickStatus->m_flConnectionQualityLocal = 1.0; pQuickStatus->m_flConnectionQualityLocal = 1.0;

View file

@ -900,6 +900,48 @@ bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pIn
return true; return true;
} }
/// Returns a small set of information about the real-time state of the connection
/// and the queue status of each lane.
///
/// - pStatus may be NULL if the information is not desired. (E.g. you are only interested
/// in the lane information.)
/// - On entry, nLanes specifies the length of the pLanes array. This may be 0
/// if you do not wish to receive any lane data. It's OK for this to be smaller than
/// the total number of configured lanes.
/// - pLanes points to an array that will receive lane-specific info. It can be NULL
/// if this is not needed.
///
/// Return value:
/// - k_EResultNoConnection - connection handle is invalid or connection has been closed.
/// - k_EResultInvalidParam - nLanes is bad
EResult GetConnectionRealTimeStatus( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus, int nLanes, SteamNetConnectionRealTimeLaneStatus_t *pLanes )
{
PRINT_DEBUG("%s %u %p %i %p\n", __FUNCTION__, hConn, pStatus, nLanes, pLanes);
std::lock_guard<std::recursive_mutex> lock(global_mutex);
auto connect_socket = connect_sockets.find(hConn);
if (connect_socket == connect_sockets.end()) return k_EResultNoConnection;
if (pStatus) {
pStatus->m_eState = convert_status(connect_socket->second.status);
pStatus->m_nPing = 10; //TODO: calculate real numbers?
pStatus->m_flConnectionQualityLocal = 1.0;
pStatus->m_flConnectionQualityRemote = 1.0;
//TODO: rest
pStatus->m_flOutPacketsPerSec = 0.0;
pStatus->m_flOutBytesPerSec = 0.0;
pStatus->m_flInPacketsPerSec = 0.0;
pStatus->m_flInBytesPerSec = 0.0;
pStatus->m_cbSentUnackedReliable = 0.0;
pStatus->m_usecQueueTime = 0.0;
//Note some games (volcanoids) might not allocate a struct the whole size of SteamNetworkingQuickConnectionStatus
//keep this in mind in future interface updates
//NOTE: need to implement GetQuickConnectionStatus seperately if this changes.
}
//TODO: lanes
return k_EResultOK;
}
/// Fetch the next available message(s) from the socket, if any. /// Fetch the next available message(s) from the socket, if any.
/// Returns the number of messages returned into your array, up to nMaxMessages. /// Returns the number of messages returned into your array, up to nMaxMessages.
@ -955,26 +997,7 @@ bool GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickCo
if (!pStats) if (!pStats)
return false; return false;
std::lock_guard<std::recursive_mutex> lock(global_mutex); return GetConnectionRealTimeStatus(hConn, pStats, 0, NULL) == k_EResultOK;
auto connect_socket = connect_sockets.find(hConn);
if (connect_socket == connect_sockets.end()) return false;
pStats->m_eState = convert_status(connect_socket->second.status);
pStats->m_nPing = 10; //TODO: calculate real numbers?
pStats->m_flConnectionQualityLocal = 1.0;
pStats->m_flConnectionQualityRemote = 1.0;
//TODO: rest
pStats->m_flOutPacketsPerSec = 0.0;
pStats->m_flOutBytesPerSec = 0.0;
pStats->m_flInPacketsPerSec = 0.0;
pStats->m_flInBytesPerSec = 0.0;
pStats->m_cbSentUnackedReliable = 0.0;
pStats->m_usecQueueTime = 0.0;
//Note some games (volcanoids) might not allocate a struct the whole size of SteamNetworkingQuickConnectionStatus
//keep this in mind in future interface updates
return true;
} }
@ -1079,6 +1102,85 @@ bool CreateSocketPair( HSteamNetConnection *pOutConnection1, HSteamNetConnection
return true; return true;
} }
/// Configure multiple outbound messages streams ("lanes") on a connection, and
/// control head-of-line blocking between them. Messages within a given lane
/// are always sent in the order they are queued, but messages from different
/// lanes may be sent out of order. Each lane has its own message number
/// sequence. The first message sent on each lane will be assigned the number 1.
///
/// Each lane has a "priority". Lower priority lanes will only be processed
/// when all higher-priority lanes are empty. The magnitudes of the priority
/// values are not relevant, only their sort order. Higher numeric values
/// take priority over lower numeric values.
///
/// Each lane also is assigned a weight, which controls the approximate proportion
/// of the bandwidth that will be consumed by the lane, relative to other lanes
/// of the same priority. (This is assuming the lane stays busy. An idle lane
/// does not build up "credits" to be be spent once a message is queued.)
/// This value is only meaningful as a proportion, relative to other lanes with
/// the same priority. For lanes with different priorities, the strict priority
/// order will prevail, and their weights relative to each other are not relevant.
/// Thus, if a lane has a unique priority value, the weight value for that lane is
/// not relevant.
///
/// Example: 3 lanes, with priorities [ 0, 10, 10 ] and weights [ (NA), 20, 5 ].
/// Messages sent on the first will always be sent first, before messages in the
/// other two lanes. Its weight value is irrelevant, since there are no other
/// lanes with priority=0. The other two lanes will share bandwidth, with the second
/// and third lanes sharing bandwidth using a ratio of approximately 4:1.
/// (The weights [ NA, 4, 1 ] would be equivalent.)
///
/// Notes:
/// - At the time of this writing, some code has performance cost that is linear
/// in the number of lanes, so keep the number of lanes to an absolute minimum.
/// 3 or so is fine; >8 is a lot. The max number of lanes on Steam is 255,
/// which is a very large number and not recommended! If you are compiling this
/// library from source, see STEAMNETWORKINGSOCKETS_MAX_LANES.)
/// - Lane priority values may be any int. Their absolute value is not relevant,
/// only the order matters.
/// - Weights must be positive, and due to implementation details, they are restricted
/// to 16-bit values. The absolute magnitudes don't matter, just the proportions.
/// - Messages sent on a lane index other than 0 have a small overhead on the wire,
/// so for maximum wire efficiency, lane 0 should be the "most common" lane, regardless
/// of priorities or weights.
/// - A connection has a single lane by default. Calling this function with
/// nNumLanes=1 is legal, but pointless, since the priority and weight values are
/// irrelevant in that case.
/// - You may reconfigure connection lanes at any time, however reducing the number of
/// lanes is not allowed.
/// - Reconfiguring lanes might restart any bandwidth sharing balancing. Usually you
/// will call this function once, near the start of the connection, perhaps after
/// exchanging a few messages.
/// - To assign all lanes the same priority, you may use pLanePriorities=NULL.
/// - If you wish all lanes with the same priority to share bandwidth equally (or
/// if no two lanes have the same priority value, and thus priority values are
/// irrelevant), you may use pLaneWeights=NULL
/// - Priorities and weights determine the order that messages are SENT on the wire.
/// There are NO GUARANTEES on the order that messages are RECEIVED! Due to packet
/// loss, out-of-order delivery, and subtle details of packet serialization, messages
/// might still be received slightly out-of-order! The *only* strong guarantee is that
/// *reliable* messages on the *same lane* will be delivered in the order they are sent.
/// - Each host configures the lanes for the packets they send; the lanes for the flow
/// in one direction are completely unrelated to the lanes in the opposite direction.
///
/// Return value:
/// - k_EResultNoConnection - bad hConn
/// - k_EResultInvalidParam - Invalid number of lanes, bad weights, or you tried to reduce the number of lanes
/// - k_EResultInvalidState - Connection is already dead, etc
///
/// See also:
/// SteamNetworkingMessage_t::m_idxLane
EResult ConfigureConnectionLanes( HSteamNetConnection hConn, int nNumLanes, const int *pLanePriorities, const uint16 *pLaneWeights )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
std::lock_guard<std::recursive_mutex> lock(global_mutex);
auto connect_socket = connect_sockets.find(hConn);
if (connect_socket == connect_sockets.end()) return k_EResultNoConnection;
//TODO
return k_EResultOK;
}
/// Get the identity assigned to this interface. /// 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 /// 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 /// to the gameserver. Returns false and sets the result to an invalid identity if we don't know
@ -1684,6 +1786,152 @@ bool SetCertificate( const void *pCertificate, int cbCertificate, SteamNetworkin
return false; return false;
} }
/// Reset the identity associated with this instance.
/// Any open connections are closed. Any previous certificates, etc are discarded.
/// You can pass a specific identity that you want to use, or you can pass NULL,
/// in which case the identity will be invalid until you set it using SetCertificate
///
/// NOTE: This function is not actually supported on Steam! It is included
/// for use on other platforms where the active user can sign out and
/// a new user can sign in.
void ResetIdentity( const SteamNetworkingIdentity *pIdentity )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
}
//
// "FakeIP" system.
//
// A FakeIP is essentially a temporary, arbitrary identifier that
// happens to be a valid IPv4 address. The purpose of this system is to make it
// easy to integrate with existing code that identifies hosts using IPv4 addresses.
// The FakeIP address will never actually be used to send or receive any packets
// on the Internet, it is strictly an identifier.
//
// FakeIP addresses are designed to (hopefully) pass through existing code as
// transparently as possible, while conflicting with "real" addresses that might
// be in use on networks (both the Internet and LANs) in the same code as little
// as possible. At the time this comment is being written, they come from the
// 169.254.0.0/16 range, and the port number will always be >1024. HOWEVER,
// this is subject to change! Do not make assumptions about these addresses,
// or your code might break in the future. In particular, you should use
// functions such as ISteamNetworkingUtils::IsFakeIP to determine if an IP
// address is a "fake" one used by this system.
//
/// Begin asynchronous process of allocating a fake IPv4 address that other
/// peers can use to contact us via P2P. IP addresses returned by this
/// function are globally unique for a given appid.
///
/// nNumPorts is the numbers of ports you wish to reserve. This is useful
/// for the same reason that listening on multiple UDP ports is useful for
/// different types of traffic. Because these allocations come from a global
/// namespace, there is a relatively strict limit on the maximum number of
/// ports you may request. (At the time of this writing, the limit is 4.)
/// The Port assignments are *not* guaranteed to have any particular order
/// or relationship! Do *not* assume they are contiguous, even though that
/// may often occur in practice.
///
/// Returns false if a request was already in progress, true if a new request
/// was started. A SteamNetworkingFakeIPResult_t will be posted when the request
/// completes.
///
/// For gameservers, you *must* call this after initializing the SDK but before
/// beginning login. Steam needs to know in advance that FakeIP will be used.
/// Everywhere your public IP would normally appear (such as the server browser) will be
/// replaced by the FakeIP, and the fake port at index 0. The request is actually queued
/// until the logon completes, so you must not wait until the allocation completes
/// before logging in. Except for trivial failures that can be detected locally
/// (e.g. invalid parameter), a SteamNetworkingFakeIPResult_t callback (whether success or
/// failure) will not be posted until after we have logged in. Furthermore, it is assumed
/// that FakeIP allocation is essential for your application to function, and so failure
/// will not be reported until *several* retries have been attempted. This process may
/// last several minutes. It is *highly* recommended to treat failure as fatal.
///
/// To communicate using a connection-oriented (TCP-style) API:
/// - Server creates a listen socket using CreateListenSocketP2PFakeIP
/// - Client connects using ConnectByIPAddress, passing in the FakeIP address.
/// - The connection will behave mostly like a P2P connection. The identities
/// that appear in SteamNetConnectionInfo_t will be the FakeIP identity until
/// we know the real identity. Then it will be the real identity. If the
/// SteamNetConnectionInfo_t::m_addrRemote is valid, it will be a real IPv4
/// address of a NAT-punched connection. Otherwise, it will not be valid.
///
/// To communicate using an ad-hoc sendto/recv from (UDP-style) API,
/// use CreateFakeUDPPort.
bool BeginAsyncRequestFakeIP( int nNumPorts )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
return false;
}
/// Return info about the FakeIP and port(s) that we have been assigned,
/// if any. idxFirstPort is currently reserved and must be zero.
/// Make sure and check SteamNetworkingFakeIPResult_t::m_eResult
void GetFakeIP( int idxFirstPort, SteamNetworkingFakeIPResult_t *pInfo )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
}
/// Create a listen socket that will listen for P2P connections sent
/// to our FakeIP. A peer can initiate connections to this listen
/// socket by calling ConnectByIPAddress.
///
/// idxFakePort refers to the *index* of the fake port requested,
/// not the actual port number. For example, pass 0 to refer to the
/// first port in the reservation. You must call this only after calling
/// BeginAsyncRequestFakeIP. However, you do not need to wait for the
/// request to complete before creating the listen socket.
HSteamListenSocket CreateListenSocketP2PFakeIP( int idxFakePort, int nOptions, const SteamNetworkingConfigValue_t *pOptions )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
return k_HSteamListenSocket_Invalid;
}
/// If the connection was initiated using the "FakeIP" system, then we
/// we can get an IP address for the remote host. If the remote host had
/// a global FakeIP at the time the connection was established, this
/// function will return that global IP. Otherwise, a FakeIP that is
/// unique locally will be allocated from the local FakeIP address space,
/// and that will be returned.
///
/// The allocation of local FakeIPs attempts to assign addresses in
/// a consistent manner. If multiple connections are made to the
/// same remote host, they *probably* will return the same FakeIP.
/// However, since the namespace is limited, this cannot be guaranteed.
///
/// On failure, returns:
/// - k_EResultInvalidParam: invalid connection handle
/// - k_EResultIPNotFound: This connection wasn't made using FakeIP system
EResult GetRemoteFakeIPForConnection( HSteamNetConnection hConn, SteamNetworkingIPAddr *pOutAddr )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
return k_EResultNone;
}
/// Get an interface that can be used like a UDP port to send/receive
/// datagrams to a FakeIP address. This is intended to make it easy
/// to port existing UDP-based code to take advantage of SDR.
///
/// idxFakeServerPort refers to the *index* of the port allocated using
/// BeginAsyncRequestFakeIP and is used to create "server" ports. You may
/// call this before the allocation has completed. However, any attempts
/// to send packets will fail until the allocation has succeeded. When
/// the peer receives packets sent from this interface, the from address
/// of the packet will be the globally-unique FakeIP. If you call this
/// function multiple times and pass the same (nonnegative) fake port index,
/// the same object will be returned, and this object is not reference counted.
///
/// To create a "client" port (e.g. the equivalent of an ephemeral UDP port)
/// pass -1. In this case, a distinct object will be returned for each call.
/// When the peer receives packets sent from this interface, the peer will
/// assign a FakeIP from its own locally-controlled namespace.
ISteamNetworkingFakeUDPPort *CreateFakeUDPPort( int idxFakeServerPort )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
return NULL;
}
// TEMP KLUDGE Call to invoke all queued callbacks. // TEMP KLUDGE Call to invoke all queued callbacks.
// Eventually this function will go away, and callwacks will be ordinary Steamworks callbacks. // Eventually this function will go away, and callwacks will be ordinary Steamworks callbacks.
// You should call this at the same time you call SteamAPI_RunCallbacks and SteamGameServer_RunCallbacks // You should call this at the same time you call SteamAPI_RunCallbacks and SteamGameServer_RunCallbacks
@ -1699,6 +1947,7 @@ void RunCallbacks()
//TODO: timeout unaccepted connections after a few seconds or so //TODO: timeout unaccepted connections after a few seconds or so
} }
void Callback(Common_Message *msg) void Callback(Common_Message *msg)
{ {
if (msg->has_low_level()) { if (msg->has_low_level()) {

View file

@ -20,6 +20,7 @@
class Steam_Networking_Utils : class Steam_Networking_Utils :
public ISteamNetworkingUtils001, public ISteamNetworkingUtils001,
public ISteamNetworkingUtils002, public ISteamNetworkingUtils002,
public ISteamNetworkingUtils003,
public ISteamNetworkingUtils public ISteamNetworkingUtils
{ {
class Settings *settings; class Settings *settings;
@ -275,6 +276,40 @@ void SetDebugOutputFunction( ESteamNetworkingSocketsDebugOutputType eDetailLevel
} }
} }
//
// Fake IP
//
// Useful for interfacing with code that assumes peers are identified using an IPv4 address
//
/// Return true if an IPv4 address is one that might be used as a "fake" one.
/// This function is fast; it just does some logical tests on the IP and does
/// not need to do any lookup operations.
// inline bool IsFakeIPv4( uint32 nIPv4 ) { return GetIPv4FakeIPType( nIPv4 ) > k_ESteamNetworkingFakeIPType_NotFake; }
ESteamNetworkingFakeIPType GetIPv4FakeIPType( uint32 nIPv4 )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
return k_ESteamNetworkingFakeIPType_NotFake;
}
/// Get the real identity associated with a given FakeIP.
///
/// On failure, returns:
/// - k_EResultInvalidParam: the IP is not a FakeIP.
/// - k_EResultNoMatch: we don't recognize that FakeIP and don't know the corresponding identity.
///
/// FakeIP's used by active connections, or the FakeIPs assigned to local identities,
/// will always work. FakeIPs for recently destroyed connections will continue to
/// return results for a little while, but not forever. At some point, we will forget
/// FakeIPs to save space. It's reasonably safe to assume that you can read back the
/// real identity of a connection very soon after it is destroyed. But do not wait
/// indefinitely.
EResult GetRealIdentityForFakeIP( const SteamNetworkingIPAddr &fakeIP, SteamNetworkingIdentity *pOutRealIdentity )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
return k_EResultNoMatch;
}
// //
// Set and get configuration values, see ESteamNetworkingConfigValue for individual descriptions. // Set and get configuration values, see ESteamNetworkingConfigValue for individual descriptions.
@ -328,10 +363,20 @@ ESteamNetworkingGetConfigValueResult GetConfigValue( ESteamNetworkingConfigValue
/// Any of the output parameters can be NULL if you do not need that information. /// Any of the output parameters can be NULL if you do not need that information.
bool GetConfigValueInfo( ESteamNetworkingConfigValue eValue, const char **pOutName, ESteamNetworkingConfigDataType *pOutDataType, ESteamNetworkingConfigScope *pOutScope, ESteamNetworkingConfigValue *pOutNextValue ) bool GetConfigValueInfo( ESteamNetworkingConfigValue eValue, const char **pOutName, ESteamNetworkingConfigDataType *pOutDataType, ESteamNetworkingConfigScope *pOutScope, ESteamNetworkingConfigValue *pOutNextValue )
{ {
PRINT_DEBUG("Steam_Networking_Utils::GetConfigValueInfo\n"); PRINT_DEBUG("TODO: Steam_Networking_Utils::GetConfigValueInfo old\n");
//TODO flat api
return false; return false;
} }
/// Get info about a configuration value. Returns the name of the value,
/// or NULL if the value doesn't exist. Other output parameters can be NULL
/// if you do not need them.
const char *GetConfigValueInfo( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigDataType *pOutDataType, ESteamNetworkingConfigScope *pOutScope )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
//TODO flat api
return NULL;
}
/// Return the lowest numbered configuration value available in the current environment. /// Return the lowest numbered configuration value available in the current environment.
ESteamNetworkingConfigValue GetFirstConfigValue() ESteamNetworkingConfigValue GetFirstConfigValue()
@ -340,6 +385,20 @@ ESteamNetworkingConfigValue GetFirstConfigValue()
return k_ESteamNetworkingConfig_Invalid; return k_ESteamNetworkingConfig_Invalid;
} }
/// Iterate the list of all configuration values in the current environment that it might
/// be possible to display or edit using a generic UI. To get the first iterable value,
/// pass k_ESteamNetworkingConfig_Invalid. Returns k_ESteamNetworkingConfig_Invalid
/// to signal end of list.
///
/// The bEnumerateDevVars argument can be used to include "dev" vars. These are vars that
/// are recommended to only be editable in "debug" or "dev" mode and typically should not be
/// shown in a retail environment where a malicious local user might use this to cheat.
ESteamNetworkingConfigValue IterateGenericEditableConfigValues( ESteamNetworkingConfigValue eCurrent, bool bEnumerateDevVars )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
return k_ESteamNetworkingConfig_Invalid;
}
// String conversions. You'll usually access these using the respective // String conversions. You'll usually access these using the respective
// inline methods. // inline methods.
@ -501,6 +560,13 @@ bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char
return valid; return valid;
} }
ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType( const SteamNetworkingIPAddr &addr )
{
PRINT_DEBUG("TODO: %s\n", __FUNCTION__);
return k_ESteamNetworkingFakeIPType_NotFake;
}
void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ) void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf )
{ {
PRINT_DEBUG("Steam_Networking_Utils::SteamNetworkingIdentity_ToString\n"); PRINT_DEBUG("Steam_Networking_Utils::SteamNetworkingIdentity_ToString\n");

View file

@ -39,6 +39,7 @@ public ISteamUGC010,
public ISteamUGC012, public ISteamUGC012,
public ISteamUGC013, public ISteamUGC013,
public ISteamUGC014, public ISteamUGC014,
public ISteamUGC015,
public ISteamUGC public ISteamUGC
{ {
class Settings *settings; class Settings *settings;
@ -413,6 +414,17 @@ bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const ch
return true; return true;
} }
bool SetTimeCreatedDateRange( UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd )
{
PRINT_DEBUG("Steam_UGC::SetTimeCreatedDateRange\n");
return true;
}
bool SetTimeUpdatedDateRange( UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd )
{
PRINT_DEBUG("Steam_UGC::SetTimeUpdatedDateRange\n");
return true;
}
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead! // DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds )

View file

@ -416,6 +416,81 @@ enum EControllerActionOrigin
k_EControllerActionOrigin_XBoxOne_RightGrip_Upper, k_EControllerActionOrigin_XBoxOne_RightGrip_Upper,
k_EControllerActionOrigin_XBoxOne_Share, k_EControllerActionOrigin_XBoxOne_Share,
// Added in SDK 1.53
k_EControllerActionOrigin_SteamDeck_A,
k_EControllerActionOrigin_SteamDeck_B,
k_EControllerActionOrigin_SteamDeck_X,
k_EControllerActionOrigin_SteamDeck_Y,
k_EControllerActionOrigin_SteamDeck_L1,
k_EControllerActionOrigin_SteamDeck_R1,
k_EControllerActionOrigin_SteamDeck_Menu,
k_EControllerActionOrigin_SteamDeck_View,
k_EControllerActionOrigin_SteamDeck_LeftPad_Touch,
k_EControllerActionOrigin_SteamDeck_LeftPad_Swipe,
k_EControllerActionOrigin_SteamDeck_LeftPad_Click,
k_EControllerActionOrigin_SteamDeck_LeftPad_DPadNorth,
k_EControllerActionOrigin_SteamDeck_LeftPad_DPadSouth,
k_EControllerActionOrigin_SteamDeck_LeftPad_DPadWest,
k_EControllerActionOrigin_SteamDeck_LeftPad_DPadEast,
k_EControllerActionOrigin_SteamDeck_RightPad_Touch,
k_EControllerActionOrigin_SteamDeck_RightPad_Swipe,
k_EControllerActionOrigin_SteamDeck_RightPad_Click,
k_EControllerActionOrigin_SteamDeck_RightPad_DPadNorth,
k_EControllerActionOrigin_SteamDeck_RightPad_DPadSouth,
k_EControllerActionOrigin_SteamDeck_RightPad_DPadWest,
k_EControllerActionOrigin_SteamDeck_RightPad_DPadEast,
k_EControllerActionOrigin_SteamDeck_L2_SoftPull,
k_EControllerActionOrigin_SteamDeck_L2,
k_EControllerActionOrigin_SteamDeck_R2_SoftPull,
k_EControllerActionOrigin_SteamDeck_R2,
k_EControllerActionOrigin_SteamDeck_LeftStick_Move,
k_EControllerActionOrigin_SteamDeck_L3,
k_EControllerActionOrigin_SteamDeck_LeftStick_DPadNorth,
k_EControllerActionOrigin_SteamDeck_LeftStick_DPadSouth,
k_EControllerActionOrigin_SteamDeck_LeftStick_DPadWest,
k_EControllerActionOrigin_SteamDeck_LeftStick_DPadEast,
k_EControllerActionOrigin_SteamDeck_LeftStick_Touch,
k_EControllerActionOrigin_SteamDeck_RightStick_Move,
k_EControllerActionOrigin_SteamDeck_R3,
k_EControllerActionOrigin_SteamDeck_RightStick_DPadNorth,
k_EControllerActionOrigin_SteamDeck_RightStick_DPadSouth,
k_EControllerActionOrigin_SteamDeck_RightStick_DPadWest,
k_EControllerActionOrigin_SteamDeck_RightStick_DPadEast,
k_EControllerActionOrigin_SteamDeck_RightStick_Touch,
k_EControllerActionOrigin_SteamDeck_L4,
k_EControllerActionOrigin_SteamDeck_R4,
k_EControllerActionOrigin_SteamDeck_L5,
k_EControllerActionOrigin_SteamDeck_R5,
k_EControllerActionOrigin_SteamDeck_DPad_Move,
k_EControllerActionOrigin_SteamDeck_DPad_North,
k_EControllerActionOrigin_SteamDeck_DPad_South,
k_EControllerActionOrigin_SteamDeck_DPad_West,
k_EControllerActionOrigin_SteamDeck_DPad_East,
k_EControllerActionOrigin_SteamDeck_Gyro_Move,
k_EControllerActionOrigin_SteamDeck_Gyro_Pitch,
k_EControllerActionOrigin_SteamDeck_Gyro_Yaw,
k_EControllerActionOrigin_SteamDeck_Gyro_Roll,
k_EControllerActionOrigin_SteamDeck_Reserved1,
k_EControllerActionOrigin_SteamDeck_Reserved2,
k_EControllerActionOrigin_SteamDeck_Reserved3,
k_EControllerActionOrigin_SteamDeck_Reserved4,
k_EControllerActionOrigin_SteamDeck_Reserved5,
k_EControllerActionOrigin_SteamDeck_Reserved6,
k_EControllerActionOrigin_SteamDeck_Reserved7,
k_EControllerActionOrigin_SteamDeck_Reserved8,
k_EControllerActionOrigin_SteamDeck_Reserved9,
k_EControllerActionOrigin_SteamDeck_Reserved10,
k_EControllerActionOrigin_SteamDeck_Reserved11,
k_EControllerActionOrigin_SteamDeck_Reserved12,
k_EControllerActionOrigin_SteamDeck_Reserved13,
k_EControllerActionOrigin_SteamDeck_Reserved14,
k_EControllerActionOrigin_SteamDeck_Reserved15,
k_EControllerActionOrigin_SteamDeck_Reserved16,
k_EControllerActionOrigin_SteamDeck_Reserved17,
k_EControllerActionOrigin_SteamDeck_Reserved18,
k_EControllerActionOrigin_SteamDeck_Reserved19,
k_EControllerActionOrigin_SteamDeck_Reserved20,
k_EControllerActionOrigin_Count, // If Steam has added support for new controllers origins will go here. k_EControllerActionOrigin_Count, // If Steam has added support for new controllers origins will go here.
k_EControllerActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits. k_EControllerActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits.
}; };

View file

@ -163,7 +163,7 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamHTTP *, SteamGameServerHTTP, S
struct HTTPRequestCompleted_t struct HTTPRequestCompleted_t
{ {
enum { k_iCallback = k_iClientHTTPCallbacks + 1 }; enum { k_iCallback = k_iSteamHTTPCallbacks + 1 };
// Handle value for the request that has completed. // Handle value for the request that has completed.
HTTPRequestHandle m_hRequest; HTTPRequestHandle m_hRequest;
@ -186,7 +186,7 @@ struct HTTPRequestCompleted_t
struct HTTPRequestHeadersReceived_t struct HTTPRequestHeadersReceived_t
{ {
enum { k_iCallback = k_iClientHTTPCallbacks + 2 }; enum { k_iCallback = k_iSteamHTTPCallbacks + 2 };
// Handle value for the request that has received headers. // Handle value for the request that has received headers.
HTTPRequestHandle m_hRequest; HTTPRequestHandle m_hRequest;
@ -198,7 +198,7 @@ struct HTTPRequestHeadersReceived_t
struct HTTPRequestDataReceived_t struct HTTPRequestDataReceived_t
{ {
enum { k_iCallback = k_iClientHTTPCallbacks + 3 }; enum { k_iCallback = k_iSteamHTTPCallbacks + 3 };
// Handle value for the request that has received data. // Handle value for the request that has received data.
HTTPRequestHandle m_hRequest; HTTPRequestHandle m_hRequest;

View file

@ -429,6 +429,81 @@ enum EInputActionOrigin
k_EInputActionOrigin_PS5_Reserved19, k_EInputActionOrigin_PS5_Reserved19,
k_EInputActionOrigin_PS5_Reserved20, k_EInputActionOrigin_PS5_Reserved20,
// Added in SDK 1.53
k_EInputActionOrigin_SteamDeck_A,
k_EInputActionOrigin_SteamDeck_B,
k_EInputActionOrigin_SteamDeck_X,
k_EInputActionOrigin_SteamDeck_Y,
k_EInputActionOrigin_SteamDeck_L1,
k_EInputActionOrigin_SteamDeck_R1,
k_EInputActionOrigin_SteamDeck_Menu,
k_EInputActionOrigin_SteamDeck_View,
k_EInputActionOrigin_SteamDeck_LeftPad_Touch,
k_EInputActionOrigin_SteamDeck_LeftPad_Swipe,
k_EInputActionOrigin_SteamDeck_LeftPad_Click,
k_EInputActionOrigin_SteamDeck_LeftPad_DPadNorth,
k_EInputActionOrigin_SteamDeck_LeftPad_DPadSouth,
k_EInputActionOrigin_SteamDeck_LeftPad_DPadWest,
k_EInputActionOrigin_SteamDeck_LeftPad_DPadEast,
k_EInputActionOrigin_SteamDeck_RightPad_Touch,
k_EInputActionOrigin_SteamDeck_RightPad_Swipe,
k_EInputActionOrigin_SteamDeck_RightPad_Click,
k_EInputActionOrigin_SteamDeck_RightPad_DPadNorth,
k_EInputActionOrigin_SteamDeck_RightPad_DPadSouth,
k_EInputActionOrigin_SteamDeck_RightPad_DPadWest,
k_EInputActionOrigin_SteamDeck_RightPad_DPadEast,
k_EInputActionOrigin_SteamDeck_L2_SoftPull,
k_EInputActionOrigin_SteamDeck_L2,
k_EInputActionOrigin_SteamDeck_R2_SoftPull,
k_EInputActionOrigin_SteamDeck_R2,
k_EInputActionOrigin_SteamDeck_LeftStick_Move,
k_EInputActionOrigin_SteamDeck_L3,
k_EInputActionOrigin_SteamDeck_LeftStick_DPadNorth,
k_EInputActionOrigin_SteamDeck_LeftStick_DPadSouth,
k_EInputActionOrigin_SteamDeck_LeftStick_DPadWest,
k_EInputActionOrigin_SteamDeck_LeftStick_DPadEast,
k_EInputActionOrigin_SteamDeck_LeftStick_Touch,
k_EInputActionOrigin_SteamDeck_RightStick_Move,
k_EInputActionOrigin_SteamDeck_R3,
k_EInputActionOrigin_SteamDeck_RightStick_DPadNorth,
k_EInputActionOrigin_SteamDeck_RightStick_DPadSouth,
k_EInputActionOrigin_SteamDeck_RightStick_DPadWest,
k_EInputActionOrigin_SteamDeck_RightStick_DPadEast,
k_EInputActionOrigin_SteamDeck_RightStick_Touch,
k_EInputActionOrigin_SteamDeck_L4,
k_EInputActionOrigin_SteamDeck_R4,
k_EInputActionOrigin_SteamDeck_L5,
k_EInputActionOrigin_SteamDeck_R5,
k_EInputActionOrigin_SteamDeck_DPad_Move,
k_EInputActionOrigin_SteamDeck_DPad_North,
k_EInputActionOrigin_SteamDeck_DPad_South,
k_EInputActionOrigin_SteamDeck_DPad_West,
k_EInputActionOrigin_SteamDeck_DPad_East,
k_EInputActionOrigin_SteamDeck_Gyro_Move,
k_EInputActionOrigin_SteamDeck_Gyro_Pitch,
k_EInputActionOrigin_SteamDeck_Gyro_Yaw,
k_EInputActionOrigin_SteamDeck_Gyro_Roll,
k_EInputActionOrigin_SteamDeck_Reserved1,
k_EInputActionOrigin_SteamDeck_Reserved2,
k_EInputActionOrigin_SteamDeck_Reserved3,
k_EInputActionOrigin_SteamDeck_Reserved4,
k_EInputActionOrigin_SteamDeck_Reserved5,
k_EInputActionOrigin_SteamDeck_Reserved6,
k_EInputActionOrigin_SteamDeck_Reserved7,
k_EInputActionOrigin_SteamDeck_Reserved8,
k_EInputActionOrigin_SteamDeck_Reserved9,
k_EInputActionOrigin_SteamDeck_Reserved10,
k_EInputActionOrigin_SteamDeck_Reserved11,
k_EInputActionOrigin_SteamDeck_Reserved12,
k_EInputActionOrigin_SteamDeck_Reserved13,
k_EInputActionOrigin_SteamDeck_Reserved14,
k_EInputActionOrigin_SteamDeck_Reserved15,
k_EInputActionOrigin_SteamDeck_Reserved16,
k_EInputActionOrigin_SteamDeck_Reserved17,
k_EInputActionOrigin_SteamDeck_Reserved18,
k_EInputActionOrigin_SteamDeck_Reserved19,
k_EInputActionOrigin_SteamDeck_Reserved20,
k_EInputActionOrigin_Count, // If Steam has added support for new controllers origins will go here. k_EInputActionOrigin_Count, // If Steam has added support for new controllers origins will go here.
k_EInputActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits. k_EInputActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits.
}; };
@ -502,6 +577,7 @@ enum ESteamInputType
k_ESteamInputType_MobileTouch, // Steam Link App On-screen Virtual Controller k_ESteamInputType_MobileTouch, // Steam Link App On-screen Virtual Controller
k_ESteamInputType_PS3Controller, // Currently uses PS4 Origins k_ESteamInputType_PS3Controller, // Currently uses PS4 Origins
k_ESteamInputType_PS5Controller, // Added in SDK 151 k_ESteamInputType_PS5Controller, // Added in SDK 151
k_ESteamInputType_SteamDeckController, // Added in SDK 153
k_ESteamInputType_Count, k_ESteamInputType_Count,
k_ESteamInputType_MaximumPossibleValue = 255, k_ESteamInputType_MaximumPossibleValue = 255,
}; };
@ -528,9 +604,24 @@ enum ESteamInputLEDFlag
// These values are passed into GetGlyphPNGForActionOrigin // These values are passed into GetGlyphPNGForActionOrigin
enum ESteamInputGlyphSize enum ESteamInputGlyphSize
{ {
k_ESteamInputGlyphSize_Small, k_ESteamInputGlyphSize_Small, // 32x32 pixels
k_ESteamInputGlyphSize_Medium, k_ESteamInputGlyphSize_Medium, // 128x128 pixels
k_ESteamInputGlyphSize_Large, k_ESteamInputGlyphSize_Large, // 256x256 pixels
k_ESteamInputGlyphSize_Count,
};
enum ESteamInputGlyphStyle
{
// Base-styles - cannot mix
ESteamInputGlyphStyle_Knockout = 0x0, // Face buttons will have colored labels/outlines on a knocked out background
// Rest of inputs will have white detail/borders on a knocked out background
ESteamInputGlyphStyle_Light = 0x1, // Black detail/borders on a white background
ESteamInputGlyphStyle_Dark = 0x2, // White detail/borders on a black background
// Modifiers
// Default ABXY/PS equivalent glyphs have a solid fill w/ color matching the physical buttons on the device
ESteamInputGlyphStyle_NeutralColorABXY = 0x10, // ABXY Buttons will match the base style color instead of their normal associated color
ESteamInputGlyphStyle_SolidABXY = 0x20, // ABXY Buttons will have a solid fill
}; };
enum ESteamInputActionEventType enum ESteamInputActionEventType
@ -599,16 +690,18 @@ struct SteamInputActionEvent_t
{ {
InputHandle_t controllerHandle; InputHandle_t controllerHandle;
ESteamInputActionEventType eEventType; ESteamInputActionEventType eEventType;
union { struct AnalogAction_t {
struct { InputAnalogActionHandle_t actionHandle;
InputAnalogActionHandle_t actionHandle; InputAnalogActionData_t analogActionData;
InputAnalogActionData_t analogActionData;
} analogAction;
struct {
InputDigitalActionHandle_t actionHandle;
InputDigitalActionData_t digitalActionData;
} digitalAction;
}; };
struct DigitalAction_t {
InputDigitalActionHandle_t actionHandle;
InputDigitalActionData_t digitalActionData;
};
union {
AnalogAction_t analogAction;
DigitalAction_t digitalAction;
} x;
}; };
#pragma pack( pop ) #pragma pack( pop )
@ -826,7 +919,7 @@ public:
virtual uint16 GetSessionInputConfigurationSettings() = 0; virtual uint16 GetSessionInputConfigurationSettings() = 0;
}; };
#define STEAMINPUT_INTERFACE_VERSION "SteamInput005" #define STEAMINPUT_INTERFACE_VERSION "SteamInput006"
// Global interface accessor // Global interface accessor
inline ISteamInput *SteamInput(); inline ISteamInput *SteamInput();
@ -880,4 +973,4 @@ struct SteamInputConfigurationLoaded_t
#pragma pack( pop ) #pragma pack( pop )
#endif // ISTEAMINPUT_H #endif // ISTEAMINPUT_H

View file

@ -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

View file

@ -387,7 +387,7 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamInventory *, SteamGameServerIn
// always be exactly one callback per handle. // always be exactly one callback per handle.
struct SteamInventoryResultReady_t struct SteamInventoryResultReady_t
{ {
enum { k_iCallback = k_iClientInventoryCallbacks + 0 }; enum { k_iCallback = k_iSteamInventoryCallbacks + 0 };
SteamInventoryResult_t m_handle; SteamInventoryResult_t m_handle;
EResult m_result; EResult m_result;
}; };
@ -402,7 +402,7 @@ struct SteamInventoryResultReady_t
// afterwards; this is an additional notification for your convenience. // afterwards; this is an additional notification for your convenience.
struct SteamInventoryFullUpdate_t struct SteamInventoryFullUpdate_t
{ {
enum { k_iCallback = k_iClientInventoryCallbacks + 1 }; enum { k_iCallback = k_iSteamInventoryCallbacks + 1 };
SteamInventoryResult_t m_handle; SteamInventoryResult_t m_handle;
}; };
@ -413,13 +413,13 @@ struct SteamInventoryFullUpdate_t
// a definition update in order to process results from the server. // a definition update in order to process results from the server.
struct SteamInventoryDefinitionUpdate_t struct SteamInventoryDefinitionUpdate_t
{ {
enum { k_iCallback = k_iClientInventoryCallbacks + 2 }; enum { k_iCallback = k_iSteamInventoryCallbacks + 2 };
}; };
// Returned // Returned
struct SteamInventoryEligiblePromoItemDefIDs_t struct SteamInventoryEligiblePromoItemDefIDs_t
{ {
enum { k_iCallback = k_iClientInventoryCallbacks + 3 }; enum { k_iCallback = k_iSteamInventoryCallbacks + 3 };
EResult m_result; EResult m_result;
CSteamID m_steamID; CSteamID m_steamID;
int m_numEligiblePromoItemDefs; int m_numEligiblePromoItemDefs;
@ -429,7 +429,7 @@ struct SteamInventoryEligiblePromoItemDefIDs_t
// Triggered from StartPurchase call // Triggered from StartPurchase call
struct SteamInventoryStartPurchaseResult_t struct SteamInventoryStartPurchaseResult_t
{ {
enum { k_iCallback = k_iClientInventoryCallbacks + 4 }; enum { k_iCallback = k_iSteamInventoryCallbacks + 4 };
EResult m_result; EResult m_result;
uint64 m_ulOrderID; uint64 m_ulOrderID;
uint64 m_ulTransID; uint64 m_ulTransID;
@ -439,7 +439,7 @@ struct SteamInventoryStartPurchaseResult_t
// Triggered from RequestPrices // Triggered from RequestPrices
struct SteamInventoryRequestPricesResult_t struct SteamInventoryRequestPricesResult_t
{ {
enum { k_iCallback = k_iClientInventoryCallbacks + 5 }; enum { k_iCallback = k_iSteamInventoryCallbacks + 5 };
EResult m_result; EResult m_result;
char m_rgchCurrency[4]; char m_rgchCurrency[4];
}; };

View file

@ -73,10 +73,12 @@ public:
/// ///
/// Returns: /// Returns:
/// - k_EREsultOK on success. /// - k_EREsultOK on success.
/// - k_EResultNoConnection will be returned if the session has failed or was closed by the peer, /// - k_EResultNoConnection, if the session has failed or was closed by the peer and
/// and k_nSteamNetworkingSend_AutoRestartBrokenSession is not used. (You can use /// k_nSteamNetworkingSend_AutoRestartBrokenSession was not specified. (You can
/// GetSessionConnectionInfo to get the details.) In order to acknowledge the broken session /// use GetSessionConnectionInfo to get the details.) In order to acknowledge the
/// and start a new one, you must call CloseSessionWithUser /// broken session and start a new one, you must call CloseSessionWithUser, or you may
/// repeat the call with k_nSteamNetworkingSend_AutoRestartBrokenSession. See
/// k_nSteamNetworkingSend_AutoRestartBrokenSession for more details.
/// - See ISteamNetworkingSockets::SendMessageToConnection for more possible return values /// - See ISteamNetworkingSockets::SendMessageToConnection for more possible return values
virtual EResult SendMessageToUser( const SteamNetworkingIdentity &identityRemote, const void *pubData, uint32 cubData, int nSendFlags, int nRemoteChannel ) = 0; virtual EResult SendMessageToUser( const SteamNetworkingIdentity &identityRemote, const void *pubData, uint32 cubData, int nSendFlags, int nRemoteChannel ) = 0;
@ -120,7 +122,7 @@ public:
/// you do not need the corresponding details. Note that sessions time out after a while, /// you do not need the corresponding details. Note that sessions time out after a while,
/// so if a connection fails, or SendMessageToUser returns k_EResultNoConnection, you cannot wait /// so if a connection fails, or SendMessageToUser returns k_EResultNoConnection, you cannot wait
/// indefinitely to obtain the reason for failure. /// indefinitely to obtain the reason for failure.
virtual ESteamNetworkingConnectionState GetSessionConnectionInfo( const SteamNetworkingIdentity &identityRemote, SteamNetConnectionInfo_t *pConnectionInfo, SteamNetworkingQuickConnectionStatus *pQuickStatus ) = 0; virtual ESteamNetworkingConnectionState GetSessionConnectionInfo( const SteamNetworkingIdentity &identityRemote, SteamNetConnectionInfo_t *pConnectionInfo, SteamNetConnectionRealTimeStatus_t *pQuickStatus ) = 0;
}; };
#define STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "SteamNetworkingMessages002" #define STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "SteamNetworkingMessages002"

View file

@ -11,9 +11,10 @@ struct SteamNetAuthenticationStatus_t;
class ISteamNetworkingConnectionCustomSignaling; class ISteamNetworkingConnectionCustomSignaling;
class ISteamNetworkingCustomSignalingRecvContext; class ISteamNetworkingCustomSignalingRecvContext;
struct SteamNetworkingFakeIPResult_t;
class ISteamNetworkingConnectionSignaling; class ISteamNetworkingConnectionSignaling;
class ISteamNetworkingSignalingRecvContext; class ISteamNetworkingSignalingRecvContext;
class ISteamNetworkingFakeUDPPort;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/// Lower level networking API. /// Lower level networking API.
@ -208,7 +209,7 @@ public:
/// WARNING: Be *very careful* when using the value provided in callbacks structs. /// WARNING: Be *very careful* when using the value provided in callbacks structs.
/// Callbacks are queued, and the value that you will receive in your /// Callbacks are queued, and the value that you will receive in your
/// callback is the userdata that was effective at the time the callback /// callback is the userdata that was effective at the time the callback
/// was queued. There are subtle race conditions that can happen if you /// was queued. There are subtle race conditions that can hapen if you
/// don't understand this! /// don't understand this!
/// ///
/// If any incoming messages for this connection are queued, the userdata /// If any incoming messages for this connection are queued, the userdata
@ -339,8 +340,21 @@ public:
virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0; virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0;
/// Returns a small set of information about the real-time state of the connection /// 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. /// and the queue status of each lane.
virtual bool GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats ) = 0; ///
/// - pStatus may be NULL if the information is not desired. (E.g. you are only interested
/// in the lane information.)
/// - On entry, nLanes specifies the length of the pLanes array. This may be 0
/// if you do not wish to receive any lane data. It's OK for this to be smaller than
/// the total number of configured lanes.
/// - pLanes points to an array that will receive lane-specific info. It can be NULL
/// if this is not needed.
///
/// Return value:
/// - k_EResultNoConnection - connection handle is invalid or connection has been closed.
/// - k_EResultInvalidParam - nLanes is bad
virtual EResult GetConnectionRealTimeStatus( HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t *pStatus,
int nLanes, SteamNetConnectionRealTimeLaneStatus_t *pLanes ) = 0;
/// Returns detailed connection stats in text format. Useful /// Returns detailed connection stats in text format. Useful
/// for dumping to a log, etc. /// for dumping to a log, etc.
@ -380,6 +394,80 @@ public:
/// actual bound loopback port. Otherwise, the port will be zero. /// 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; virtual bool CreateSocketPair( HSteamNetConnection *pOutConnection1, HSteamNetConnection *pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity *pIdentity1, const SteamNetworkingIdentity *pIdentity2 ) = 0;
/// Configure multiple outbound messages streams ("lanes") on a connection, and
/// control head-of-line blocking between them. Messages within a given lane
/// are always sent in the order they are queued, but messages from different
/// lanes may be sent out of order. Each lane has its own message number
/// sequence. The first message sent on each lane will be assigned the number 1.
///
/// Each lane has a "priority". Lower priority lanes will only be processed
/// when all higher-priority lanes are empty. The magnitudes of the priority
/// values are not relevant, only their sort order. Higher numeric values
/// take priority over lower numeric values.
///
/// Each lane also is assigned a weight, which controls the approximate proportion
/// of the bandwidth that will be consumed by the lane, relative to other lanes
/// of the same priority. (This is assuming the lane stays busy. An idle lane
/// does not build up "credits" to be be spent once a message is queued.)
/// This value is only meaningful as a proportion, relative to other lanes with
/// the same priority. For lanes with different priorities, the strict priority
/// order will prevail, and their weights relative to each other are not relevant.
/// Thus, if a lane has a unique priority value, the weight value for that lane is
/// not relevant.
///
/// Example: 3 lanes, with priorities [ 0, 10, 10 ] and weights [ (NA), 20, 5 ].
/// Messages sent on the first will always be sent first, before messages in the
/// other two lanes. Its weight value is irrelevant, since there are no other
/// lanes with priority=0. The other two lanes will share bandwidth, with the second
/// and third lanes sharing bandwidth using a ratio of approximately 4:1.
/// (The weights [ NA, 4, 1 ] would be equivalent.)
///
/// Notes:
/// - At the time of this writing, some code has performance cost that is linear
/// in the number of lanes, so keep the number of lanes to an absolute minimum.
/// 3 or so is fine; >8 is a lot. The max number of lanes on Steam is 255,
/// which is a very large number and not recommended! If you are compiling this
/// library from source, see STEAMNETWORKINGSOCKETS_MAX_LANES.)
/// - Lane priority values may be any int. Their absolute value is not relevant,
/// only the order matters.
/// - Weights must be positive, and due to implementation details, they are restricted
/// to 16-bit values. The absolute magnitudes don't matter, just the proportions.
/// - Messages sent on a lane index other than 0 have a small overhead on the wire,
/// so for maximum wire efficiency, lane 0 should be the "most common" lane, regardless
/// of priorities or weights.
/// - A connection has a single lane by default. Calling this function with
/// nNumLanes=1 is legal, but pointless, since the priority and weight values are
/// irrelevant in that case.
/// - You may reconfigure connection lanes at any time, however reducing the number of
/// lanes is not allowed.
/// - Reconfiguring lanes might restart any bandwidth sharing balancing. Usually you
/// will call this function once, near the start of the connection, perhaps after
/// exchanging a few messages.
/// - To assign all lanes the same priority, you may use pLanePriorities=NULL.
/// - If you wish all lanes with the same priority to share bandwidth equally (or
/// if no two lanes have the same priority value, and thus priority values are
/// irrelevant), you may use pLaneWeights=NULL
/// - Priorities and weights determine the order that messages are SENT on the wire.
/// There are NO GUARANTEES on the order that messages are RECEIVED! Due to packet
/// loss, out-of-order delivery, and subtle details of packet serialization, messages
/// might still be received slightly out-of-order! The *only* strong guarantee is that
/// *reliable* messages on the *same lane* will be delivered in the order they are sent.
/// - Each host configures the lanes for the packets they send; the lanes for the flow
/// in one direction are completely unrelated to the lanes in the opposite direction.
///
/// Return value:
/// - k_EResultNoConnection - bad hConn
/// - k_EResultInvalidParam - Invalid number of lanes, bad weights, or you tried to reduce the number of lanes
/// - k_EResultInvalidState - Connection is already dead, etc
///
/// See also:
/// SteamNetworkingMessage_t::m_idxLane
virtual EResult ConfigureConnectionLanes( HSteamNetConnection hConn, int nNumLanes, const int *pLanePriorities, const uint16 *pLaneWeights ) = 0;
//
// Identity and authentication
//
/// Get the identity assigned to this interface. /// 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 /// 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 /// to the gameserver. Returns false and sets the result to an invalid identity if we don't know
@ -694,36 +782,165 @@ public:
/// SteamDatagram_CreateCert. /// SteamDatagram_CreateCert.
virtual bool SetCertificate( const void *pCertificate, int cbCertificate, SteamNetworkingErrMsg &errMsg ) = 0; virtual bool SetCertificate( const void *pCertificate, int cbCertificate, SteamNetworkingErrMsg &errMsg ) = 0;
/// Reset the identity associated with this instance.
/// Any open connections are closed. Any previous certificates, etc are discarded.
/// You can pass a specific identity that you want to use, or you can pass NULL,
/// in which case the identity will be invalid until you set it using SetCertificate
///
/// NOTE: This function is not actually supported on Steam! It is included
/// for use on other platforms where the active user can sign out and
/// a new user can sign in.
virtual void ResetIdentity( const SteamNetworkingIdentity *pIdentity ) = 0;
//
// Misc
//
/// Invoke all callback functions queued for this interface. /// Invoke all callback functions queued for this interface.
/// See k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, etc /// See k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, etc
/// ///
/// You don't need to call this if you are using Steam's callback dispatch /// You don't need to call this if you are using Steam's callback dispatch
/// mechanism (SteamAPI_RunCallbacks and SteamGameserver_RunCallbacks). /// mechanism (SteamAPI_RunCallbacks and SteamGameserver_RunCallbacks).
virtual void RunCallbacks() = 0; virtual void RunCallbacks() = 0;
//
// "FakeIP" system.
//
// A FakeIP is essentially a temporary, arbitrary identifier that
// happens to be a valid IPv4 address. The purpose of this system is to make it
// easy to integrate with existing code that identifies hosts using IPv4 addresses.
// The FakeIP address will never actually be used to send or receive any packets
// on the Internet, it is strictly an identifier.
//
// FakeIP addresses are designed to (hopefully) pass through existing code as
// transparently as possible, while conflicting with "real" addresses that might
// be in use on networks (both the Internet and LANs) in the same code as little
// as possible. At the time this comment is being written, they come from the
// 169.254.0.0/16 range, and the port number will always be >1024. HOWEVER,
// this is subject to change! Do not make assumptions about these addresses,
// or your code might break in the future. In particular, you should use
// functions such as ISteamNetworkingUtils::IsFakeIP to determine if an IP
// address is a "fake" one used by this system.
//
/// Begin asynchronous process of allocating a fake IPv4 address that other
/// peers can use to contact us via P2P. IP addresses returned by this
/// function are globally unique for a given appid.
///
/// nNumPorts is the numbers of ports you wish to reserve. This is useful
/// for the same reason that listening on multiple UDP ports is useful for
/// different types of traffic. Because these allocations come from a global
/// namespace, there is a relatively strict limit on the maximum number of
/// ports you may request. (At the time of this writing, the limit is 4.)
/// The Port assignments are *not* guaranteed to have any particular order
/// or relationship! Do *not* assume they are contiguous, even though that
/// may often occur in practice.
///
/// Returns false if a request was already in progress, true if a new request
/// was started. A SteamNetworkingFakeIPResult_t will be posted when the request
/// completes.
///
/// For gameservers, you *must* call this after initializing the SDK but before
/// beginning login. Steam needs to know in advance that FakeIP will be used.
/// Everywhere your public IP would normally appear (such as the server browser) will be
/// replaced by the FakeIP, and the fake port at index 0. The request is actually queued
/// until the logon completes, so you must not wait until the allocation completes
/// before logging in. Except for trivial failures that can be detected locally
/// (e.g. invalid parameter), a SteamNetworkingFakeIPResult_t callback (whether success or
/// failure) will not be posted until after we have logged in. Furthermore, it is assumed
/// that FakeIP allocation is essential for your application to function, and so failure
/// will not be reported until *several* retries have been attempted. This process may
/// last several minutes. It is *highly* recommended to treat failure as fatal.
///
/// To communicate using a connection-oriented (TCP-style) API:
/// - Server creates a listen socket using CreateListenSocketP2PFakeIP
/// - Client connects using ConnectByIPAddress, passing in the FakeIP address.
/// - The connection will behave mostly like a P2P connection. The identities
/// that appear in SteamNetConnectionInfo_t will be the FakeIP identity until
/// we know the real identity. Then it will be the real identity. If the
/// SteamNetConnectionInfo_t::m_addrRemote is valid, it will be a real IPv4
/// address of a NAT-punched connection. Otherwise, it will not be valid.
///
/// To communicate using an ad-hoc sendto/recv from (UDP-style) API,
/// use CreateFakeUDPPort.
virtual bool BeginAsyncRequestFakeIP( int nNumPorts ) = 0;
/// Return info about the FakeIP and port(s) that we have been assigned,
/// if any. idxFirstPort is currently reserved and must be zero.
/// Make sure and check SteamNetworkingFakeIPResult_t::m_eResult
virtual void GetFakeIP( int idxFirstPort, SteamNetworkingFakeIPResult_t *pInfo ) = 0;
/// Create a listen socket that will listen for P2P connections sent
/// to our FakeIP. A peer can initiate connections to this listen
/// socket by calling ConnectByIPAddress.
///
/// idxFakePort refers to the *index* of the fake port requested,
/// not the actual port number. For example, pass 0 to refer to the
/// first port in the reservation. You must call this only after calling
/// BeginAsyncRequestFakeIP. However, you do not need to wait for the
/// request to complete before creating the listen socket.
virtual HSteamListenSocket CreateListenSocketP2PFakeIP( int idxFakePort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
/// If the connection was initiated using the "FakeIP" system, then we
/// we can get an IP address for the remote host. If the remote host had
/// a global FakeIP at the time the connection was established, this
/// function will return that global IP. Otherwise, a FakeIP that is
/// unique locally will be allocated from the local FakeIP address space,
/// and that will be returned.
///
/// The allocation of local FakeIPs attempts to assign addresses in
/// a consistent manner. If multiple connections are made to the
/// same remote host, they *probably* will return the same FakeIP.
/// However, since the namespace is limited, this cannot be guaranteed.
///
/// On failure, returns:
/// - k_EResultInvalidParam: invalid connection handle
/// - k_EResultIPNotFound: This connection wasn't made using FakeIP system
virtual EResult GetRemoteFakeIPForConnection( HSteamNetConnection hConn, SteamNetworkingIPAddr *pOutAddr ) = 0;
/// Get an interface that can be used like a UDP port to send/receive
/// datagrams to a FakeIP address. This is intended to make it easy
/// to port existing UDP-based code to take advantage of SDR.
///
/// idxFakeServerPort refers to the *index* of the port allocated using
/// BeginAsyncRequestFakeIP and is used to create "server" ports. You may
/// call this before the allocation has completed. However, any attempts
/// to send packets will fail until the allocation has succeeded. When
/// the peer receives packets sent from this interface, the from address
/// of the packet will be the globally-unique FakeIP. If you call this
/// function multiple times and pass the same (nonnegative) fake port index,
/// the same object will be returned, and this object is not reference counted.
///
/// To create a "client" port (e.g. the equivalent of an ephemeral UDP port)
/// pass -1. In this case, a distinct object will be returned for each call.
/// When the peer receives packets sent from this interface, the peer will
/// assign a FakeIP from its own locally-controlled namespace.
virtual ISteamNetworkingFakeUDPPort *CreateFakeUDPPort( int idxFakeServerPort ) = 0;
protected: protected:
// ~ISteamNetworkingSockets(); // Silence some warnings // ~ISteamNetworkingSockets(); // Silence some warnings
}; };
#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets009" #define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets012"
// Global accessors // Global accessors
// Using standalone lib // Using standalone lib
#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB #ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB
// Standalone lib. // Standalone lib.
static_assert( STEAMNETWORKINGSOCKETS_INTERFACE_VERSION[24] == '9', "Version mismatch" ); static_assert( STEAMNETWORKINGSOCKETS_INTERFACE_VERSION[24] == '2', "Version mismatch" );
STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamNetworkingSockets_LibV9(); STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamNetworkingSockets_LibV12();
inline ISteamNetworkingSockets *SteamNetworkingSockets_Lib() { return SteamNetworkingSockets_LibV9(); } inline ISteamNetworkingSockets *SteamNetworkingSockets_Lib() { return SteamNetworkingSockets_LibV12(); }
// If running in context of steam, we also define a gameserver instance. // If running in context of steam, we also define a gameserver instance.
#ifdef STEAMNETWORKINGSOCKETS_STEAM #ifdef STEAMNETWORKINGSOCKETS_STEAM
STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamGameServerNetworkingSockets_LibV9(); STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamGameServerNetworkingSockets_LibV12();
inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets_Lib() { return SteamGameServerNetworkingSockets_LibV9(); } inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets_Lib() { return SteamGameServerNetworkingSockets_LibV12(); }
#endif #endif
#ifndef STEAMNETWORKINGSOCKETS_STEAMAPI #ifndef STEAMNETWORKINGSOCKETS_STEAMAPI
inline ISteamNetworkingSockets *SteamNetworkingSockets() { return SteamNetworkingSockets_LibV9(); } inline ISteamNetworkingSockets *SteamNetworkingSockets() { return SteamNetworkingSockets_LibV12(); }
#ifdef STEAMNETWORKINGSOCKETS_STEAM #ifdef STEAMNETWORKINGSOCKETS_STEAM
inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_LibV9(); } inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_LibV12(); }
#endif #endif
#endif #endif
#endif #endif

View file

@ -130,7 +130,7 @@ public:
/// currently answer the question for some other reason. /// currently answer the question for some other reason.
/// ///
/// Do you need to be able to do this from a backend/matchmaking server? /// Do you need to be able to do this from a backend/matchmaking server?
/// You are looking for the "ticketgen" library. /// You are looking for the "game coordinator" library.
virtual int EstimatePingTimeBetweenTwoLocations( const SteamNetworkPingLocation_t &location1, const SteamNetworkPingLocation_t &location2 ) = 0; virtual int EstimatePingTimeBetweenTwoLocations( const SteamNetworkPingLocation_t &location1, const SteamNetworkPingLocation_t &location2 ) = 0;
/// Same as EstimatePingTime, but assumes that one location is the local host. /// Same as EstimatePingTime, but assumes that one location is the local host.
@ -241,6 +241,32 @@ public:
/// Steamworks calls from within the handler. /// Steamworks calls from within the handler.
virtual void SetDebugOutputFunction( ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) = 0; virtual void SetDebugOutputFunction( ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) = 0;
//
// Fake IP
//
// Useful for interfacing with code that assumes peers are identified using an IPv4 address
//
/// Return true if an IPv4 address is one that might be used as a "fake" one.
/// This function is fast; it just does some logical tests on the IP and does
/// not need to do any lookup operations.
inline bool IsFakeIPv4( uint32 nIPv4 ) { return GetIPv4FakeIPType( nIPv4 ) > k_ESteamNetworkingFakeIPType_NotFake; }
virtual ESteamNetworkingFakeIPType GetIPv4FakeIPType( uint32 nIPv4 ) = 0;
/// Get the real identity associated with a given FakeIP.
///
/// On failure, returns:
/// - k_EResultInvalidParam: the IP is not a FakeIP.
/// - k_EResultNoMatch: we don't recognize that FakeIP and don't know the corresponding identity.
///
/// FakeIP's used by active connections, or the FakeIPs assigned to local identities,
/// will always work. FakeIPs for recently destroyed connections will continue to
/// return results for a little while, but not forever. At some point, we will forget
/// FakeIPs to save space. It's reasonably safe to assume that you can read back the
/// real identity of a connection very soon after it is destroyed. But do not wait
/// indefinitely.
virtual EResult GetRealIdentityForFakeIP( const SteamNetworkingIPAddr &fakeIP, SteamNetworkingIdentity *pOutRealIdentity ) = 0;
// //
// Set and get configuration values, see ESteamNetworkingConfigValue for individual descriptions. // Set and get configuration values, see ESteamNetworkingConfigValue for individual descriptions.
// //
@ -263,6 +289,7 @@ public:
bool SetGlobalCallback_SteamNetConnectionStatusChanged( FnSteamNetConnectionStatusChanged fnCallback ); bool SetGlobalCallback_SteamNetConnectionStatusChanged( FnSteamNetConnectionStatusChanged fnCallback );
bool SetGlobalCallback_SteamNetAuthenticationStatusChanged( FnSteamNetAuthenticationStatusChanged fnCallback ); bool SetGlobalCallback_SteamNetAuthenticationStatusChanged( FnSteamNetAuthenticationStatusChanged fnCallback );
bool SetGlobalCallback_SteamRelayNetworkStatusChanged( FnSteamRelayNetworkStatusChanged fnCallback ); bool SetGlobalCallback_SteamRelayNetworkStatusChanged( FnSteamRelayNetworkStatusChanged fnCallback );
bool SetGlobalCallback_FakeIPResult( FnSteamNetworkingFakeIPResult fnCallback );
bool SetGlobalCallback_MessagesSessionRequest( FnSteamNetworkingMessagesSessionRequest fnCallback ); bool SetGlobalCallback_MessagesSessionRequest( FnSteamNetworkingMessagesSessionRequest fnCallback );
bool SetGlobalCallback_MessagesSessionFailed( FnSteamNetworkingMessagesSessionFailed fnCallback ); bool SetGlobalCallback_MessagesSessionFailed( FnSteamNetworkingMessagesSessionFailed fnCallback );
@ -295,41 +322,48 @@ public:
virtual ESteamNetworkingGetConfigValueResult GetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, virtual ESteamNetworkingGetConfigValueResult GetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj,
ESteamNetworkingConfigDataType *pOutDataType, void *pResult, size_t *cbResult ) = 0; ESteamNetworkingConfigDataType *pOutDataType, void *pResult, size_t *cbResult ) = 0;
/// Returns info about a configuration value. Returns false if the value does not exist. /// Get info about a configuration value. Returns the name of the value,
/// pOutNextValue can be used to iterate through all of the known configuration values. /// or NULL if the value doesn't exist. Other output parameters can be NULL
/// (Use GetFirstConfigValue() to begin the iteration, will be k_ESteamNetworkingConfig_Invalid on the last value) /// if you do not need them.
/// Any of the output parameters can be NULL if you do not need that information. virtual const char *GetConfigValueInfo( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigDataType *pOutDataType,
ESteamNetworkingConfigScope *pOutScope ) = 0;
/// Iterate the list of all configuration values in the current environment that it might
/// be possible to display or edit using a generic UI. To get the first iterable value,
/// pass k_ESteamNetworkingConfig_Invalid. Returns k_ESteamNetworkingConfig_Invalid
/// to signal end of list.
/// ///
/// See k_ESteamNetworkingConfig_EnumerateDevVars for some more info about "dev" variables, /// The bEnumerateDevVars argument can be used to include "dev" vars. These are vars that
/// which are usually excluded from the set of variables enumerated using this function. /// are recommended to only be editable in "debug" or "dev" mode and typically should not be
virtual bool GetConfigValueInfo( ESteamNetworkingConfigValue eValue, const char **pOutName, ESteamNetworkingConfigDataType *pOutDataType, ESteamNetworkingConfigScope *pOutScope, ESteamNetworkingConfigValue *pOutNextValue ) = 0; /// shown in a retail environment where a malicious local user might use this to cheat.
virtual ESteamNetworkingConfigValue IterateGenericEditableConfigValues( ESteamNetworkingConfigValue eCurrent, bool bEnumerateDevVars ) = 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 // String conversions. You'll usually access these using the respective
// inline methods. // inline methods.
//
virtual void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr &addr, char *buf, size_t cbBuf, bool bWithPort ) = 0; 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 bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ) = 0;
virtual ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType( const SteamNetworkingIPAddr &addr ) = 0;
virtual void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ) = 0; virtual void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ) = 0;
virtual bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr ) = 0; virtual bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr ) = 0;
protected: protected:
// ~ISteamNetworkingUtils(); // Silence some warnings // ~ISteamNetworkingUtils(); // Silence some warnings
}; };
#define STEAMNETWORKINGUTILS_INTERFACE_VERSION "SteamNetworkingUtils003" #define STEAMNETWORKINGUTILS_INTERFACE_VERSION "SteamNetworkingUtils004"
// Global accessors // Global accessors
// Using standalone lib // Using standalone lib
#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB #ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB
// Standalone lib // Standalone lib
static_assert( STEAMNETWORKINGUTILS_INTERFACE_VERSION[22] == '3', "Version mismatch" ); static_assert( STEAMNETWORKINGUTILS_INTERFACE_VERSION[22] == '4', "Version mismatch" );
STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingUtils *SteamNetworkingUtils_LibV3(); STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingUtils *SteamNetworkingUtils_LibV4();
inline ISteamNetworkingUtils *SteamNetworkingUtils_Lib() { return SteamNetworkingUtils_LibV3(); } inline ISteamNetworkingUtils *SteamNetworkingUtils_Lib() { return SteamNetworkingUtils_LibV4(); }
#ifndef STEAMNETWORKINGSOCKETS_STEAMAPI #ifndef STEAMNETWORKINGSOCKETS_STEAMAPI
inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_LibV3(); } inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_LibV4(); }
#endif #endif
#endif #endif
@ -385,6 +419,8 @@ struct SteamRelayNetworkStatus_t
char m_debugMsg[ 256 ]; char m_debugMsg[ 256 ];
}; };
#ifndef API_GEN
/// Utility class for printing a SteamNetworkingIdentity. /// Utility class for printing a SteamNetworkingIdentity.
/// E.g. printf( "Identity is '%s'\n", SteamNetworkingIdentityRender( identity ).c_str() ); /// E.g. printf( "Identity is '%s'\n", SteamNetworkingIdentityRender( identity ).c_str() );
struct SteamNetworkingIdentityRender struct SteamNetworkingIdentityRender
@ -404,6 +440,8 @@ private:
char buf[ SteamNetworkingIPAddr::k_cchMaxString ]; char buf[ SteamNetworkingIPAddr::k_cchMaxString ];
}; };
#endif
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
// Internal stuff // Internal stuff
@ -419,6 +457,7 @@ inline bool ISteamNetworkingUtils::SetConnectionConfigValueString( HSteamNetConn
inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamNetConnectionStatusChanged( FnSteamNetConnectionStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, (void*)fnCallback ); } inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamNetConnectionStatusChanged( FnSteamNetConnectionStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, (void*)fnCallback ); }
inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamNetAuthenticationStatusChanged( FnSteamNetAuthenticationStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_AuthStatusChanged, (void*)fnCallback ); } inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamNetAuthenticationStatusChanged( FnSteamNetAuthenticationStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_AuthStatusChanged, (void*)fnCallback ); }
inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamRelayNetworkStatusChanged( FnSteamRelayNetworkStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged, (void*)fnCallback ); } inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamRelayNetworkStatusChanged( FnSteamRelayNetworkStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged, (void*)fnCallback ); }
inline bool ISteamNetworkingUtils::SetGlobalCallback_FakeIPResult( FnSteamNetworkingFakeIPResult fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_FakeIPResult, (void*)fnCallback ); }
inline bool ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionRequest( FnSteamNetworkingMessagesSessionRequest fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_MessagesSessionRequest, (void*)fnCallback ); } inline bool ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionRequest( FnSteamNetworkingMessagesSessionRequest fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_MessagesSessionRequest, (void*)fnCallback ); }
inline bool ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionFailed( FnSteamNetworkingMessagesSessionFailed fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_MessagesSessionFailed, (void*)fnCallback ); } inline bool ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionFailed( FnSteamNetworkingMessagesSessionFailed fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_MessagesSessionFailed, (void*)fnCallback ); }
@ -433,15 +472,17 @@ inline bool ISteamNetworkingUtils::SetConfigValueStruct( const SteamNetworkingCo
} }
// How to get helper functions. // How to get helper functions.
#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) || defined( STEAMNETWORKINGSOCKETS_STANDALONELIB ) #if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) || defined(STEAMNETWORKINGSOCKETS_FOREXPORT) || defined( STEAMNETWORKINGSOCKETS_STANDALONELIB )
// Call direct to static functions // Call direct to static functions
STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr *pAddr, char *buf, size_t cbBuf, bool bWithPort ); STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr *pAddr, char *buf, size_t cbBuf, bool bWithPort );
STEAMNETWORKINGSOCKETS_INTERFACE bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ); STEAMNETWORKINGSOCKETS_INTERFACE bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr );
STEAMNETWORKINGSOCKETS_INTERFACE ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType( const SteamNetworkingIPAddr *pAddr );
STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity *pIdentity, char *buf, size_t cbBuf ); STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity *pIdentity, char *buf, size_t cbBuf );
STEAMNETWORKINGSOCKETS_INTERFACE bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, size_t sizeofIdentity, const char *pszStr ); STEAMNETWORKINGSOCKETS_INTERFACE bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, size_t sizeofIdentity, const char *pszStr );
inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingIPAddr_ToString( this, buf, cbBuf, bWithPort ); } inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingIPAddr_ToString( this, buf, cbBuf, bWithPort ); }
inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingIPAddr_ParseString( this, pszStr ); } inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingIPAddr_ParseString( this, pszStr ); }
inline ESteamNetworkingFakeIPType SteamNetworkingIPAddr::GetFakeIPType() const { return SteamNetworkingIPAddr_GetFakeIPType( this ); }
inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingIdentity_ToString( this, buf, cbBuf ); } inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingIdentity_ToString( this, buf, cbBuf ); }
inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamNetworkingIdentity_ParseString( this, sizeof(*this), pszStr ); } inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamNetworkingIdentity_ParseString( this, sizeof(*this), pszStr ); }
@ -449,6 +490,7 @@ inline bool ISteamNetworkingUtils::SetConfigValueStruct( const SteamNetworkingCo
// Using steamworks SDK - go through SteamNetworkingUtils() // Using steamworks SDK - go through SteamNetworkingUtils()
inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingUtils()->SteamNetworkingIPAddr_ToString( *this, buf, cbBuf, bWithPort ); } inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingUtils()->SteamNetworkingIPAddr_ToString( *this, buf, cbBuf, bWithPort ); }
inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIPAddr_ParseString( this, pszStr ); } inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIPAddr_ParseString( this, pszStr ); }
inline ESteamNetworkingFakeIPType SteamNetworkingIPAddr::GetFakeIPType() const { return SteamNetworkingUtils()->SteamNetworkingIPAddr_GetFakeIPType( *this ); }
inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingUtils()->SteamNetworkingIdentity_ToString( *this, buf, cbBuf ); } inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingUtils()->SteamNetworkingIdentity_ToString( *this, buf, cbBuf ); }
inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIdentity_ParseString( this, pszStr ); } inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIdentity_ParseString( this, pszStr ); }
#else #else

View file

@ -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

View file

@ -339,24 +339,20 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemoteStorage *, SteamRemoteStorage,
//
// IMPORTANT! k_iClientRemoteStorageCallbacks 1 through 6 are used, see iclientremotestorage.h
//
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: The result of a call to FileShare() // Purpose: The result of a call to FileShare()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageFileShareResult_t struct RemoteStorageFileShareResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 7 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 7 };
EResult m_eResult; // The result of the operation EResult m_eResult; // The result of the operation
UGCHandle_t m_hFile; // The handle that can be shared with users and features UGCHandle_t m_hFile; // The handle that can be shared with users and features
char m_rgchFilename[k_cchFilenameMax]; // The name of the file that was shared char m_rgchFilename[k_cchFilenameMax]; // The name of the file that was shared
}; };
// k_iClientRemoteStorageCallbacks + 8 is deprecated! Do not reuse // k_iSteamRemoteStorageCallbacks + 8 is deprecated! Do not reuse
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -364,13 +360,13 @@ struct RemoteStorageFileShareResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStoragePublishFileResult_t struct RemoteStoragePublishFileResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 9 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 9 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
bool m_bUserNeedsToAcceptWorkshopLegalAgreement; bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
}; };
// k_iClientRemoteStorageCallbacks + 10 is deprecated! Do not reuse // k_iSteamRemoteStorageCallbacks + 10 is deprecated! Do not reuse
@ -379,7 +375,7 @@ struct RemoteStoragePublishFileResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageDeletePublishedFileResult_t struct RemoteStorageDeletePublishedFileResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 11 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 11 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
}; };
@ -390,7 +386,7 @@ struct RemoteStorageDeletePublishedFileResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageEnumerateUserPublishedFilesResult_t struct RemoteStorageEnumerateUserPublishedFilesResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 12 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 12 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
int32 m_nResultsReturned; int32 m_nResultsReturned;
int32 m_nTotalResultCount; int32 m_nTotalResultCount;
@ -403,7 +399,7 @@ struct RemoteStorageEnumerateUserPublishedFilesResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageSubscribePublishedFileResult_t struct RemoteStorageSubscribePublishedFileResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 13 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 13 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
}; };
@ -414,7 +410,7 @@ struct RemoteStorageSubscribePublishedFileResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageEnumerateUserSubscribedFilesResult_t struct RemoteStorageEnumerateUserSubscribedFilesResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 14 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 14 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
int32 m_nResultsReturned; int32 m_nResultsReturned;
int32 m_nTotalResultCount; int32 m_nTotalResultCount;
@ -435,7 +431,7 @@ struct RemoteStorageEnumerateUserSubscribedFilesResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageUnsubscribePublishedFileResult_t struct RemoteStorageUnsubscribePublishedFileResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 15 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 15 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
}; };
@ -446,7 +442,7 @@ struct RemoteStorageUnsubscribePublishedFileResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageUpdatePublishedFileResult_t struct RemoteStorageUpdatePublishedFileResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 16 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 16 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
bool m_bUserNeedsToAcceptWorkshopLegalAgreement; bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
@ -458,7 +454,7 @@ struct RemoteStorageUpdatePublishedFileResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageDownloadUGCResult_t struct RemoteStorageDownloadUGCResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 17 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 17 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded. UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded.
AppId_t m_nAppID; // ID of the app that created this file. AppId_t m_nAppID; // ID of the app that created this file.
@ -473,7 +469,7 @@ struct RemoteStorageDownloadUGCResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageGetPublishedFileDetailsResult_t struct RemoteStorageGetPublishedFileDetailsResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 18 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 18 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
AppId_t m_nCreatorAppID; // ID of the app that created this file. AppId_t m_nCreatorAppID; // ID of the app that created this file.
@ -500,7 +496,7 @@ struct RemoteStorageGetPublishedFileDetailsResult_t
struct RemoteStorageEnumerateWorkshopFilesResult_t struct RemoteStorageEnumerateWorkshopFilesResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 19 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 19 };
EResult m_eResult; EResult m_eResult;
int32 m_nResultsReturned; int32 m_nResultsReturned;
int32 m_nTotalResultCount; int32 m_nTotalResultCount;
@ -516,7 +512,7 @@ struct RemoteStorageEnumerateWorkshopFilesResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageGetPublishedItemVoteDetailsResult_t struct RemoteStorageGetPublishedItemVoteDetailsResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 20 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 20 };
EResult m_eResult; EResult m_eResult;
PublishedFileId_t m_unPublishedFileId; PublishedFileId_t m_unPublishedFileId;
int32 m_nVotesFor; int32 m_nVotesFor;
@ -531,7 +527,7 @@ struct RemoteStorageGetPublishedItemVoteDetailsResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStoragePublishedFileSubscribed_t struct RemoteStoragePublishedFileSubscribed_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 21 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 21 };
PublishedFileId_t m_nPublishedFileId; // The published file id PublishedFileId_t m_nPublishedFileId; // The published file id
AppId_t m_nAppID; // ID of the app that will consume this file. AppId_t m_nAppID; // ID of the app that will consume this file.
}; };
@ -541,7 +537,7 @@ struct RemoteStoragePublishedFileSubscribed_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStoragePublishedFileUnsubscribed_t struct RemoteStoragePublishedFileUnsubscribed_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 22 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 22 };
PublishedFileId_t m_nPublishedFileId; // The published file id PublishedFileId_t m_nPublishedFileId; // The published file id
AppId_t m_nAppID; // ID of the app that will consume this file. AppId_t m_nAppID; // ID of the app that will consume this file.
}; };
@ -552,7 +548,7 @@ struct RemoteStoragePublishedFileUnsubscribed_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStoragePublishedFileDeleted_t struct RemoteStoragePublishedFileDeleted_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 23 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 23 };
PublishedFileId_t m_nPublishedFileId; // The published file id PublishedFileId_t m_nPublishedFileId; // The published file id
AppId_t m_nAppID; // ID of the app that will consume this file. AppId_t m_nAppID; // ID of the app that will consume this file.
}; };
@ -563,7 +559,7 @@ struct RemoteStoragePublishedFileDeleted_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageUpdateUserPublishedItemVoteResult_t struct RemoteStorageUpdateUserPublishedItemVoteResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 24 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 24 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; // The published file id PublishedFileId_t m_nPublishedFileId; // The published file id
}; };
@ -574,7 +570,7 @@ struct RemoteStorageUpdateUserPublishedItemVoteResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageUserVoteDetails_t struct RemoteStorageUserVoteDetails_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 25 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 25 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; // The published file id PublishedFileId_t m_nPublishedFileId; // The published file id
EWorkshopVote m_eVote; // what the user voted EWorkshopVote m_eVote; // what the user voted
@ -582,7 +578,7 @@ struct RemoteStorageUserVoteDetails_t
struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 26 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 26 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
int32 m_nResultsReturned; int32 m_nResultsReturned;
int32 m_nTotalResultCount; int32 m_nTotalResultCount;
@ -591,7 +587,7 @@ struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t
struct RemoteStorageSetUserPublishedFileActionResult_t struct RemoteStorageSetUserPublishedFileActionResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 27 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 27 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; // The published file id PublishedFileId_t m_nPublishedFileId; // The published file id
EWorkshopFileAction m_eAction; // the action that was attempted EWorkshopFileAction m_eAction; // the action that was attempted
@ -599,7 +595,7 @@ struct RemoteStorageSetUserPublishedFileActionResult_t
struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 28 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 28 };
EResult m_eResult; // The result of the operation. EResult m_eResult; // The result of the operation.
EWorkshopFileAction m_eAction; // the action that was filtered on EWorkshopFileAction m_eAction; // the action that was filtered on
int32 m_nResultsReturned; int32 m_nResultsReturned;
@ -614,7 +610,7 @@ struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStoragePublishFileProgress_t struct RemoteStoragePublishFileProgress_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 29 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 29 };
double m_dPercentFile; double m_dPercentFile;
bool m_bPreview; bool m_bPreview;
}; };
@ -625,7 +621,7 @@ struct RemoteStoragePublishFileProgress_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStoragePublishedFileUpdated_t struct RemoteStoragePublishedFileUpdated_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 30 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 30 };
PublishedFileId_t m_nPublishedFileId; // The published file id PublishedFileId_t m_nPublishedFileId; // The published file id
AppId_t m_nAppID; // ID of the app that will consume this file. AppId_t m_nAppID; // ID of the app that will consume this file.
uint64 m_ulUnused; // not used anymore uint64 m_ulUnused; // not used anymore
@ -636,7 +632,7 @@ struct RemoteStoragePublishedFileUpdated_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageFileWriteAsyncComplete_t struct RemoteStorageFileWriteAsyncComplete_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 31 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 31 };
EResult m_eResult; // result EResult m_eResult; // result
}; };
@ -645,7 +641,7 @@ struct RemoteStorageFileWriteAsyncComplete_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoteStorageFileReadAsyncComplete_t struct RemoteStorageFileReadAsyncComplete_t
{ {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 32 }; enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 32 };
SteamAPICall_t m_hFileReadAsync; // call handle of the async read which was made SteamAPICall_t m_hFileReadAsync; // call handle of the async read which was made
EResult m_eResult; // result EResult m_eResult; // result
uint32 m_nOffset; // offset in the file this read was at uint32 m_nOffset; // offset in the file this read was at
@ -657,7 +653,7 @@ struct RemoteStorageFileReadAsyncComplete_t
// to remote session changes // to remote session changes
// Note: only posted if this happens DURING the local app session // Note: only posted if this happens DURING the local app session
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
STEAM_CALLBACK_BEGIN( RemoteStorageLocalFileChange_t, k_iClientRemoteStorageCallbacks + 33 ) STEAM_CALLBACK_BEGIN( RemoteStorageLocalFileChange_t, k_iSteamRemoteStorageCallbacks + 33 )
STEAM_CALLBACK_END( 0 ) STEAM_CALLBACK_END( 0 )
#pragma pack( pop ) #pragma pack( pop )

View file

@ -262,6 +262,8 @@ public:
virtual bool SetMatchAnyTag( UGCQueryHandle_t handle, bool bMatchAnyTag ) = 0; virtual bool SetMatchAnyTag( UGCQueryHandle_t handle, bool bMatchAnyTag ) = 0;
virtual bool SetSearchText( UGCQueryHandle_t handle, const char *pSearchText ) = 0; virtual bool SetSearchText( UGCQueryHandle_t handle, const char *pSearchText ) = 0;
virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0; virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0;
virtual bool SetTimeCreatedDateRange( UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd ) = 0;
virtual bool SetTimeUpdatedDateRange( UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd ) = 0;
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0; virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead! // DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
@ -369,7 +371,7 @@ public:
virtual SteamAPICall_t GetWorkshopEULAStatus() = 0; virtual SteamAPICall_t GetWorkshopEULAStatus() = 0;
}; };
#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION015" #define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION016"
#ifndef STEAM_API_EXPORTS #ifndef STEAM_API_EXPORTS
// Global interface accessor // Global interface accessor
@ -386,7 +388,7 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamUGC *, SteamGameServerUGC, STE
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct SteamUGCQueryCompleted_t struct SteamUGCQueryCompleted_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 1 }; enum { k_iCallback = k_iSteamUGCCallbacks + 1 };
UGCQueryHandle_t m_handle; UGCQueryHandle_t m_handle;
EResult m_eResult; EResult m_eResult;
uint32 m_unNumResultsReturned; uint32 m_unNumResultsReturned;
@ -401,7 +403,7 @@ struct SteamUGCQueryCompleted_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct SteamUGCRequestUGCDetailsResult_t struct SteamUGCRequestUGCDetailsResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 2 }; enum { k_iCallback = k_iSteamUGCCallbacks + 2 };
SteamUGCDetails_t m_details; SteamUGCDetails_t m_details;
bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache
}; };
@ -412,7 +414,7 @@ struct SteamUGCRequestUGCDetailsResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct CreateItemResult_t struct CreateItemResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 3 }; enum { k_iCallback = k_iSteamUGCCallbacks + 3 };
EResult m_eResult; EResult m_eResult;
PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID
bool m_bUserNeedsToAcceptWorkshopLegalAgreement; bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
@ -424,7 +426,7 @@ struct CreateItemResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct SubmitItemUpdateResult_t struct SubmitItemUpdateResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 4 }; enum { k_iCallback = k_iSteamUGCCallbacks + 4 };
EResult m_eResult; EResult m_eResult;
bool m_bUserNeedsToAcceptWorkshopLegalAgreement; bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
@ -436,7 +438,7 @@ struct SubmitItemUpdateResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct ItemInstalled_t struct ItemInstalled_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 5 }; enum { k_iCallback = k_iSteamUGCCallbacks + 5 };
AppId_t m_unAppID; AppId_t m_unAppID;
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
}; };
@ -447,7 +449,7 @@ struct ItemInstalled_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct DownloadItemResult_t struct DownloadItemResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 6 }; enum { k_iCallback = k_iSteamUGCCallbacks + 6 };
AppId_t m_unAppID; AppId_t m_unAppID;
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
EResult m_eResult; EResult m_eResult;
@ -458,7 +460,7 @@ struct DownloadItemResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct UserFavoriteItemsListChanged_t struct UserFavoriteItemsListChanged_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 7 }; enum { k_iCallback = k_iSteamUGCCallbacks + 7 };
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
EResult m_eResult; EResult m_eResult;
bool m_bWasAddRequest; bool m_bWasAddRequest;
@ -469,7 +471,7 @@ struct UserFavoriteItemsListChanged_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct SetUserItemVoteResult_t struct SetUserItemVoteResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 8 }; enum { k_iCallback = k_iSteamUGCCallbacks + 8 };
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
EResult m_eResult; EResult m_eResult;
bool m_bVoteUp; bool m_bVoteUp;
@ -480,7 +482,7 @@ struct SetUserItemVoteResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct GetUserItemVoteResult_t struct GetUserItemVoteResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 9 }; enum { k_iCallback = k_iSteamUGCCallbacks + 9 };
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
EResult m_eResult; EResult m_eResult;
bool m_bVotedUp; bool m_bVotedUp;
@ -493,7 +495,7 @@ struct GetUserItemVoteResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct StartPlaytimeTrackingResult_t struct StartPlaytimeTrackingResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 10 }; enum { k_iCallback = k_iSteamUGCCallbacks + 10 };
EResult m_eResult; EResult m_eResult;
}; };
@ -502,7 +504,7 @@ struct StartPlaytimeTrackingResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct StopPlaytimeTrackingResult_t struct StopPlaytimeTrackingResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 11 }; enum { k_iCallback = k_iSteamUGCCallbacks + 11 };
EResult m_eResult; EResult m_eResult;
}; };
@ -511,7 +513,7 @@ struct StopPlaytimeTrackingResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct AddUGCDependencyResult_t struct AddUGCDependencyResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 12 }; enum { k_iCallback = k_iSteamUGCCallbacks + 12 };
EResult m_eResult; EResult m_eResult;
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
PublishedFileId_t m_nChildPublishedFileId; PublishedFileId_t m_nChildPublishedFileId;
@ -522,7 +524,7 @@ struct AddUGCDependencyResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoveUGCDependencyResult_t struct RemoveUGCDependencyResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 13 }; enum { k_iCallback = k_iSteamUGCCallbacks + 13 };
EResult m_eResult; EResult m_eResult;
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
PublishedFileId_t m_nChildPublishedFileId; PublishedFileId_t m_nChildPublishedFileId;
@ -534,7 +536,7 @@ struct RemoveUGCDependencyResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct AddAppDependencyResult_t struct AddAppDependencyResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 14 }; enum { k_iCallback = k_iSteamUGCCallbacks + 14 };
EResult m_eResult; EResult m_eResult;
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
AppId_t m_nAppID; AppId_t m_nAppID;
@ -545,7 +547,7 @@ struct AddAppDependencyResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct RemoveAppDependencyResult_t struct RemoveAppDependencyResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 15 }; enum { k_iCallback = k_iSteamUGCCallbacks + 15 };
EResult m_eResult; EResult m_eResult;
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
AppId_t m_nAppID; AppId_t m_nAppID;
@ -557,7 +559,7 @@ struct RemoveAppDependencyResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct GetAppDependenciesResult_t struct GetAppDependenciesResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 16 }; enum { k_iCallback = k_iSteamUGCCallbacks + 16 };
EResult m_eResult; EResult m_eResult;
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
AppId_t m_rgAppIDs[32]; AppId_t m_rgAppIDs[32];
@ -570,7 +572,7 @@ struct GetAppDependenciesResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct DeleteItemResult_t struct DeleteItemResult_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 17 }; enum { k_iCallback = k_iSteamUGCCallbacks + 17 };
EResult m_eResult; EResult m_eResult;
PublishedFileId_t m_nPublishedFileId; PublishedFileId_t m_nPublishedFileId;
}; };
@ -581,7 +583,7 @@ struct DeleteItemResult_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct UserSubscribedItemsListChanged_t struct UserSubscribedItemsListChanged_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 18 }; enum { k_iCallback = k_iSteamUGCCallbacks + 18 };
AppId_t m_nAppID; AppId_t m_nAppID;
}; };
@ -591,7 +593,7 @@ struct UserSubscribedItemsListChanged_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
struct WorkshopEULAStatus_t struct WorkshopEULAStatus_t
{ {
enum { k_iCallback = k_iClientUGCCallbacks + 20 }; enum { k_iCallback = k_iSteamUGCCallbacks + 20 };
EResult m_eResult; EResult m_eResult;
AppId_t m_nAppID; AppId_t m_nAppID;
uint32 m_unVersion; uint32 m_unVersion;

180
sdk_includes/isteamugc015.h Normal file
View file

@ -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

View file

@ -58,14 +58,14 @@ STEAM_CALLBACK_BEGIN( BroadcastUploadStop_t, k_iClientVideoCallbacks + 5 )
STEAM_CALLBACK_MEMBER( 0, EBroadcastUploadResult, m_eResult ) STEAM_CALLBACK_MEMBER( 0, EBroadcastUploadResult, m_eResult )
STEAM_CALLBACK_END(1) STEAM_CALLBACK_END(1)
STEAM_CALLBACK_BEGIN( GetVideoURLResult_t, k_iClientVideoCallbacks + 11 ) STEAM_CALLBACK_BEGIN( GetVideoURLResult_t, k_iSteamVideoCallbacks + 11 )
STEAM_CALLBACK_MEMBER( 0, EResult, m_eResult ) STEAM_CALLBACK_MEMBER( 0, EResult, m_eResult )
STEAM_CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) STEAM_CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID )
STEAM_CALLBACK_MEMBER( 2, char, m_rgchURL[256] ) STEAM_CALLBACK_MEMBER( 2, char, m_rgchURL[256] )
STEAM_CALLBACK_END(3) STEAM_CALLBACK_END(3)
STEAM_CALLBACK_BEGIN( GetOPFSettingsResult_t, k_iClientVideoCallbacks + 24 ) STEAM_CALLBACK_BEGIN( GetOPFSettingsResult_t, k_iSteamVideoCallbacks + 24 )
STEAM_CALLBACK_MEMBER( 0, EResult, m_eResult ) STEAM_CALLBACK_MEMBER( 0, EResult, m_eResult )
STEAM_CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) STEAM_CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID )
STEAM_CALLBACK_END(2) STEAM_CALLBACK_END(2)

View file

@ -104,6 +104,7 @@
#include "isteamnetworkingutils.h" #include "isteamnetworkingutils.h"
#include "isteamnetworkingutils001.h" #include "isteamnetworkingutils001.h"
#include "isteamnetworkingutils002.h" #include "isteamnetworkingutils002.h"
#include "isteamnetworkingutils003.h"
#include "isteamnetworkingsockets001.h" #include "isteamnetworkingsockets001.h"
#include "isteamnetworkingsockets002.h" #include "isteamnetworkingsockets002.h"
#include "isteamnetworkingsockets003.h" #include "isteamnetworkingsockets003.h"
@ -153,6 +154,7 @@
#include "isteamugc012.h" #include "isteamugc012.h"
#include "isteamugc013.h" #include "isteamugc013.h"
#include "isteamugc014.h" #include "isteamugc014.h"
#include "isteamugc015.h"
#include "isteamapplist.h" #include "isteamapplist.h"
#include "isteamhtmlsurface.h" #include "isteamhtmlsurface.h"
#include "isteamhtmlsurface001.h" #include "isteamhtmlsurface001.h"
@ -170,11 +172,13 @@
#include "isteaminput.h" #include "isteaminput.h"
#include "isteaminput001.h" #include "isteaminput001.h"
#include "isteaminput002.h" #include "isteaminput002.h"
#include "isteaminput005.h"
#include "isteamremoteplay.h" #include "isteamremoteplay.h"
#include "isteamnetworkingmessages.h" #include "isteamnetworkingmessages.h"
#include "isteamnetworkingsockets.h" #include "isteamnetworkingsockets.h"
#include "isteamnetworkingutils.h" #include "isteamnetworkingutils.h"
#include "isteamtv.h" #include "isteamtv.h"
#include "steamnetworkingfakeip.h"
//----------------------------------------------------------------------------------------------------------------------------------------------------------// //----------------------------------------------------------------------------------------------------------------------------------------------------------//

View file

@ -212,7 +212,9 @@ STEAMAPI_API int SteamAPI_ISteamUtils_FilterText( ISteamUtils* self, ETextFilter
STEAMAPI_API ESteamIPv6ConnectivityState SteamAPI_ISteamUtils_GetIPv6ConnectivityState( ISteamUtils* self, ESteamIPv6ConnectivityProtocol eProtocol ); STEAMAPI_API ESteamIPv6ConnectivityState SteamAPI_ISteamUtils_GetIPv6ConnectivityState( ISteamUtils* self, ESteamIPv6ConnectivityProtocol eProtocol );
STEAMAPI_API bool SteamAPI_ISteamUtils_IsSteamRunningOnSteamDeck( ISteamUtils* self ); STEAMAPI_API bool SteamAPI_ISteamUtils_IsSteamRunningOnSteamDeck( ISteamUtils* self );
STEAMAPI_API bool SteamAPI_ISteamUtils_ShowModalGamepadTextInput( ISteamUtils* self, EGamepadTextInputLineMode eLineInputMode ); STEAMAPI_API bool SteamAPI_ISteamUtils_ShowModalGamepadTextInput( ISteamUtils* self, EGamepadTextInputLineMode eLineInputMode );
STEAMAPI_API bool SteamAPI_ISteamUtils_ShowFloatingGamepadTextInput( ISteamUtils* self, EFloatingGamepadTextInputMode eKeyboardMode, int nTextFieldXPosition, int nTextFieldYPosition, int nTextFieldWidth, int nTextFieldHeight );
STEAMAPI_API void SteamAPI_ISteamUtils_SetGameLauncherMode( ISteamUtils* self, bool bLauncherMode ); STEAMAPI_API void SteamAPI_ISteamUtils_SetGameLauncherMode( ISteamUtils* self, bool bLauncherMode );
STEAMAPI_API bool SteamAPI_ISteamUtils_DismissFloatingGamepadTextInput( ISteamUtils* self );
// ISteamMatchmaking // ISteamMatchmaking
STEAMAPI_API ISteamMatchmaking *SteamAPI_SteamMatchmaking_v009(); STEAMAPI_API ISteamMatchmaking *SteamAPI_SteamMatchmaking_v009();
@ -590,6 +592,7 @@ STEAMAPI_API bool SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( ISteamHTTP* sel
STEAMAPI_API ISteamInput *SteamAPI_SteamInput_v001(); STEAMAPI_API ISteamInput *SteamAPI_SteamInput_v001();
STEAMAPI_API ISteamInput *SteamAPI_SteamInput_v002(); STEAMAPI_API ISteamInput *SteamAPI_SteamInput_v002();
STEAMAPI_API ISteamInput *SteamAPI_SteamInput_v005(); STEAMAPI_API ISteamInput *SteamAPI_SteamInput_v005();
STEAMAPI_API ISteamInput *SteamAPI_SteamInput_v006();
STEAMAPI_API bool SteamAPI_ISteamInput_Init( ISteamInput* self, bool bExplicitlyCallRunFrame ); STEAMAPI_API bool SteamAPI_ISteamInput_Init( ISteamInput* self, bool bExplicitlyCallRunFrame );
STEAMAPI_API bool SteamAPI_ISteamInput_Shutdown( ISteamInput* self ); STEAMAPI_API bool SteamAPI_ISteamInput_Shutdown( ISteamInput* self );
STEAMAPI_API bool SteamAPI_ISteamInput_SetInputActionManifestFilePath( ISteamInput* self, const char * pchInputActionManifestAbsolutePath ); STEAMAPI_API bool SteamAPI_ISteamInput_SetInputActionManifestFilePath( ISteamInput* self, const char * pchInputActionManifestAbsolutePath );
@ -682,8 +685,10 @@ STEAMAPI_API bool SteamAPI_ISteamController_GetControllerBindingRevision( ISteam
// ISteamUGC // ISteamUGC
STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v014(); STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v014();
STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v015(); STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v015();
STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v016();
STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v014(); STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v014();
STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v015(); STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v015();
STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v016();
STEAMAPI_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( ISteamUGC* self, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ); STEAMAPI_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( ISteamUGC* self, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage );
STEAMAPI_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestPage( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ); STEAMAPI_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestPage( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage );
STEAMAPI_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestCursor( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char * pchCursor ); STEAMAPI_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestCursor( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char * pchCursor );
@ -720,6 +725,8 @@ STEAMAPI_API bool SteamAPI_ISteamUGC_SetCloudFileNameFilter( ISteamUGC* self, UG
STEAMAPI_API bool SteamAPI_ISteamUGC_SetMatchAnyTag( ISteamUGC* self, UGCQueryHandle_t handle, bool bMatchAnyTag ); STEAMAPI_API bool SteamAPI_ISteamUGC_SetMatchAnyTag( ISteamUGC* self, UGCQueryHandle_t handle, bool bMatchAnyTag );
STEAMAPI_API bool SteamAPI_ISteamUGC_SetSearchText( ISteamUGC* self, UGCQueryHandle_t handle, const char * pSearchText ); STEAMAPI_API bool SteamAPI_ISteamUGC_SetSearchText( ISteamUGC* self, UGCQueryHandle_t handle, const char * pSearchText );
STEAMAPI_API bool SteamAPI_ISteamUGC_SetRankedByTrendDays( ISteamUGC* self, UGCQueryHandle_t handle, uint32 unDays ); STEAMAPI_API bool SteamAPI_ISteamUGC_SetRankedByTrendDays( ISteamUGC* self, UGCQueryHandle_t handle, uint32 unDays );
STEAMAPI_API bool SteamAPI_ISteamUGC_SetTimeCreatedDateRange( ISteamUGC* self, UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd );
STEAMAPI_API bool SteamAPI_ISteamUGC_SetTimeUpdatedDateRange( ISteamUGC* self, UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd );
STEAMAPI_API bool SteamAPI_ISteamUGC_AddRequiredKeyValueTag( ISteamUGC* self, UGCQueryHandle_t handle, const char * pKey, const char * pValue ); STEAMAPI_API bool SteamAPI_ISteamUGC_AddRequiredKeyValueTag( ISteamUGC* self, UGCQueryHandle_t handle, const char * pKey, const char * pValue );
STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_RequestUGCDetails( ISteamUGC* self, PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ); STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_RequestUGCDetails( ISteamUGC* self, PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds );
STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_CreateItem( ISteamUGC* self, AppId_t nConsumerAppId, EWorkshopFileType eFileType ); STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_CreateItem( ISteamUGC* self, AppId_t nConsumerAppId, EWorkshopFileType eFileType );
@ -908,6 +915,10 @@ STEAMAPI_API bool SteamAPI_ISteamNetworkingMessages_CloseChannelWithUser( ISteam
STEAMAPI_API ESteamNetworkingConnectionState SteamAPI_ISteamNetworkingMessages_GetSessionConnectionInfo( ISteamNetworkingMessages* self, const SteamNetworkingIdentity & identityRemote, SteamNetConnectionInfo_t * pConnectionInfo, SteamNetworkingQuickConnectionStatus * pQuickStatus ); STEAMAPI_API ESteamNetworkingConnectionState SteamAPI_ISteamNetworkingMessages_GetSessionConnectionInfo( ISteamNetworkingMessages* self, const SteamNetworkingIdentity & identityRemote, SteamNetConnectionInfo_t * pConnectionInfo, SteamNetworkingQuickConnectionStatus * pQuickStatus );
// ISteamNetworkingSockets // ISteamNetworkingSockets
STEAMAPI_API ISteamNetworkingSockets *SteamAPI_SteamNetworkingSockets_SteamAPI_v012();
STEAMAPI_API ISteamNetworkingSockets *SteamAPI_SteamGameServerNetworkingSockets_SteamAPI_v012();
STEAMAPI_API ISteamNetworkingSockets *SteamAPI_SteamNetworkingSockets_SteamAPI_v011();
STEAMAPI_API ISteamNetworkingSockets *SteamAPI_SteamGameServerNetworkingSockets_SteamAPI_v011();
STEAMAPI_API ISteamNetworkingSockets *SteamAPI_SteamNetworkingSockets_SteamAPI_v009(); STEAMAPI_API ISteamNetworkingSockets *SteamAPI_SteamNetworkingSockets_SteamAPI_v009();
STEAMAPI_API ISteamNetworkingSockets *SteamAPI_SteamGameServerNetworkingSockets_SteamAPI_v009(); STEAMAPI_API ISteamNetworkingSockets *SteamAPI_SteamGameServerNetworkingSockets_SteamAPI_v009();
STEAMAPI_API ISteamNetworkingSockets *SteamAPI_SteamNetworkingSockets_v009(); STEAMAPI_API ISteamNetworkingSockets *SteamAPI_SteamNetworkingSockets_v009();
@ -930,10 +941,12 @@ STEAMAPI_API void SteamAPI_ISteamNetworkingSockets_SendMessages( ISteamNetworkin
STEAMAPI_API EResult SteamAPI_ISteamNetworkingSockets_FlushMessagesOnConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn ); STEAMAPI_API EResult SteamAPI_ISteamNetworkingSockets_FlushMessagesOnConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn );
STEAMAPI_API int SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetworkingMessage_t ** ppOutMessages, int nMaxMessages ); STEAMAPI_API int SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetworkingMessage_t ** ppOutMessages, int nMaxMessages );
STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_GetConnectionInfo( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetConnectionInfo_t * pInfo ); STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_GetConnectionInfo( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetConnectionInfo_t * pInfo );
STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_GetQuickConnectionStatus( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus * pStats ); STEAMAPI_API EResult SteamAPI_ISteamNetworkingSockets_GetConnectionRealTimeStatus( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetConnectionRealTimeStatus_t * pStatus, int nLanes, SteamNetConnectionRealTimeLaneStatus_t * pLanes );
STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_GetQuickConnectionStatus( ISteamNetworkingSockets009* self, HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus * pStats );
STEAMAPI_API int SteamAPI_ISteamNetworkingSockets_GetDetailedConnectionStatus( ISteamNetworkingSockets* self, HSteamNetConnection hConn, char * pszBuf, int cbBuf ); STEAMAPI_API int SteamAPI_ISteamNetworkingSockets_GetDetailedConnectionStatus( ISteamNetworkingSockets* self, HSteamNetConnection hConn, char * pszBuf, int cbBuf );
STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_GetListenSocketAddress( ISteamNetworkingSockets* self, HSteamListenSocket hSocket, SteamNetworkingIPAddr * address ); STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_GetListenSocketAddress( ISteamNetworkingSockets* self, HSteamListenSocket hSocket, SteamNetworkingIPAddr * address );
STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_CreateSocketPair( ISteamNetworkingSockets* self, HSteamNetConnection * pOutConnection1, HSteamNetConnection * pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity * pIdentity1, const SteamNetworkingIdentity * pIdentity2 ); STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_CreateSocketPair( ISteamNetworkingSockets* self, HSteamNetConnection * pOutConnection1, HSteamNetConnection * pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity * pIdentity1, const SteamNetworkingIdentity * pIdentity2 );
STEAMAPI_API EResult SteamAPI_ISteamNetworkingSockets_ConfigureConnectionLanes( ISteamNetworkingSockets* self, HSteamNetConnection hConn, int nNumLanes, const int * pLanePriorities, const uint16 * pLaneWeights );
STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_GetIdentity( ISteamNetworkingSockets* self, SteamNetworkingIdentity * pIdentity ); STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_GetIdentity( ISteamNetworkingSockets* self, SteamNetworkingIdentity * pIdentity );
STEAMAPI_API ESteamNetworkingAvailability SteamAPI_ISteamNetworkingSockets_InitAuthentication( ISteamNetworkingSockets* self ); STEAMAPI_API ESteamNetworkingAvailability SteamAPI_ISteamNetworkingSockets_InitAuthentication( ISteamNetworkingSockets* self );
STEAMAPI_API ESteamNetworkingAvailability SteamAPI_ISteamNetworkingSockets_GetAuthenticationStatus( ISteamNetworkingSockets* self, SteamNetAuthenticationStatus_t * pDetails ); STEAMAPI_API ESteamNetworkingAvailability SteamAPI_ISteamNetworkingSockets_GetAuthenticationStatus( ISteamNetworkingSockets* self, SteamNetAuthenticationStatus_t * pDetails );
@ -953,7 +966,13 @@ STEAMAPI_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2PCust
STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal( ISteamNetworkingSockets* self, const void * pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext * pContext ); STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal( ISteamNetworkingSockets* self, const void * pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext * pContext );
STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_GetCertificateRequest( ISteamNetworkingSockets* self, int * pcbBlob, void * pBlob, SteamNetworkingErrMsg & errMsg ); STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_GetCertificateRequest( ISteamNetworkingSockets* self, int * pcbBlob, void * pBlob, SteamNetworkingErrMsg & errMsg );
STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_SetCertificate( ISteamNetworkingSockets* self, const void * pCertificate, int cbCertificate, SteamNetworkingErrMsg & errMsg ); STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_SetCertificate( ISteamNetworkingSockets* self, const void * pCertificate, int cbCertificate, SteamNetworkingErrMsg & errMsg );
STEAMAPI_API void SteamAPI_ISteamNetworkingSockets_ResetIdentity( ISteamNetworkingSockets* self, const SteamNetworkingIdentity * pIdentity );
STEAMAPI_API void SteamAPI_ISteamNetworkingSockets_RunCallbacks( ISteamNetworkingSockets* self ); STEAMAPI_API void SteamAPI_ISteamNetworkingSockets_RunCallbacks( ISteamNetworkingSockets* self );
STEAMAPI_API bool SteamAPI_ISteamNetworkingSockets_BeginAsyncRequestFakeIP( ISteamNetworkingSockets* self, int nNumPorts );
STEAMAPI_API void SteamAPI_ISteamNetworkingSockets_GetFakeIP( ISteamNetworkingSockets* self, int idxFirstPort, SteamNetworkingFakeIPResult_t * pInfo );
STEAMAPI_API HSteamListenSocket SteamAPI_ISteamNetworkingSockets_CreateListenSocketP2PFakeIP( ISteamNetworkingSockets* self, int idxFakePort, int nOptions, const SteamNetworkingConfigValue_t * pOptions );
STEAMAPI_API EResult SteamAPI_ISteamNetworkingSockets_GetRemoteFakeIPForConnection( ISteamNetworkingSockets* self, HSteamNetConnection hConn, SteamNetworkingIPAddr * pOutAddr );
STEAMAPI_API ISteamNetworkingFakeUDPPort * SteamAPI_ISteamNetworkingSockets_CreateFakeUDPPort( ISteamNetworkingSockets* self, int idxFakeServerPort );
// ISteamNetworkingConnectionCustomSignaling // ISteamNetworkingConnectionCustomSignaling
STEAMAPI_API bool SteamAPI_ISteamNetworkingConnectionCustomSignaling_SendSignal( ISteamNetworkingConnectionCustomSignaling* self, HSteamNetConnection hConn, const SteamNetConnectionInfo_t & info, const void * pMsg, int cbMsg ); STEAMAPI_API bool SteamAPI_ISteamNetworkingConnectionCustomSignaling_SendSignal( ISteamNetworkingConnectionCustomSignaling* self, HSteamNetConnection hConn, const SteamNetConnectionInfo_t & info, const void * pMsg, int cbMsg );
@ -982,6 +1001,9 @@ STEAMAPI_API int SteamAPI_ISteamNetworkingUtils_GetPOPCount( ISteamNetworkingUti
STEAMAPI_API int SteamAPI_ISteamNetworkingUtils_GetPOPList( ISteamNetworkingUtils* self, SteamNetworkingPOPID * list, int nListSz ); STEAMAPI_API int SteamAPI_ISteamNetworkingUtils_GetPOPList( ISteamNetworkingUtils* self, SteamNetworkingPOPID * list, int nListSz );
STEAMAPI_API SteamNetworkingMicroseconds SteamAPI_ISteamNetworkingUtils_GetLocalTimestamp( ISteamNetworkingUtils* self ); STEAMAPI_API SteamNetworkingMicroseconds SteamAPI_ISteamNetworkingUtils_GetLocalTimestamp( ISteamNetworkingUtils* self );
STEAMAPI_API void SteamAPI_ISteamNetworkingUtils_SetDebugOutputFunction( ISteamNetworkingUtils* self, ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ); STEAMAPI_API void SteamAPI_ISteamNetworkingUtils_SetDebugOutputFunction( ISteamNetworkingUtils* self, ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_IsFakeIPv4( ISteamNetworkingUtils* self, uint32 nIPv4 );
STEAMAPI_API ESteamNetworkingFakeIPType SteamAPI_ISteamNetworkingUtils_GetIPv4FakeIPType( ISteamNetworkingUtils* self, uint32 nIPv4 );
STEAMAPI_API EResult SteamAPI_ISteamNetworkingUtils_GetRealIdentityForFakeIP( ISteamNetworkingUtils* self, const SteamNetworkingIPAddr & fakeIP, SteamNetworkingIdentity * pOutRealIdentity );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueInt32( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, int32 val ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueInt32( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, int32 val );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueFloat( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, float val ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueFloat( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, float val );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueString( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, const char * val ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueString( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, const char * val );
@ -992,15 +1014,18 @@ STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueString(
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamNetConnectionStatusChanged( ISteamNetworkingUtils* self, FnSteamNetConnectionStatusChanged fnCallback ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamNetConnectionStatusChanged( ISteamNetworkingUtils* self, FnSteamNetConnectionStatusChanged fnCallback );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamNetAuthenticationStatusChanged( ISteamNetworkingUtils* self, FnSteamNetAuthenticationStatusChanged fnCallback ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamNetAuthenticationStatusChanged( ISteamNetworkingUtils* self, FnSteamNetAuthenticationStatusChanged fnCallback );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamRelayNetworkStatusChanged( ISteamNetworkingUtils* self, FnSteamRelayNetworkStatusChanged fnCallback ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_SteamRelayNetworkStatusChanged( ISteamNetworkingUtils* self, FnSteamRelayNetworkStatusChanged fnCallback );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_FakeIPResult( ISteamNetworkingUtils* self, FnSteamNetworkingFakeIPResult fnCallback );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_MessagesSessionRequest( ISteamNetworkingUtils* self, FnSteamNetworkingMessagesSessionRequest fnCallback ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_MessagesSessionRequest( ISteamNetworkingUtils* self, FnSteamNetworkingMessagesSessionRequest fnCallback );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_MessagesSessionFailed( ISteamNetworkingUtils* self, FnSteamNetworkingMessagesSessionFailed fnCallback ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetGlobalCallback_MessagesSessionFailed( ISteamNetworkingUtils* self, FnSteamNetworkingMessagesSessionFailed fnCallback );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetConfigValue( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, ESteamNetworkingConfigDataType eDataType, const void * pArg ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetConfigValue( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, ESteamNetworkingConfigDataType eDataType, const void * pArg );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetConfigValueStruct( ISteamNetworkingUtils* self, const SteamNetworkingConfigValue_t & opt, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SetConfigValueStruct( ISteamNetworkingUtils* self, const SteamNetworkingConfigValue_t & opt, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj );
STEAMAPI_API ESteamNetworkingGetConfigValueResult SteamAPI_ISteamNetworkingUtils_GetConfigValue( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, ESteamNetworkingConfigDataType * pOutDataType, void * pResult, size_t * cbResult ); STEAMAPI_API ESteamNetworkingGetConfigValueResult SteamAPI_ISteamNetworkingUtils_GetConfigValue( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, ESteamNetworkingConfigDataType * pOutDataType, void * pResult, size_t * cbResult );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_GetConfigValueInfo( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, const char ** pOutName, ESteamNetworkingConfigDataType * pOutDataType, ESteamNetworkingConfigScope * pOutScope, ESteamNetworkingConfigValue * pOutNextValue ); STEAMAPI_API const char * SteamAPI_ISteamNetworkingUtils_GetConfigValueInfo( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigDataType * pOutDataType, ESteamNetworkingConfigScope * pOutScope );
STEAMAPI_API ESteamNetworkingConfigValue SteamAPI_ISteamNetworkingUtils_GetFirstConfigValue( ISteamNetworkingUtils* self ); STEAMAPI_API ESteamNetworkingConfigValue SteamAPI_ISteamNetworkingUtils_GetFirstConfigValue( ISteamNetworkingUtils* self );
STEAMAPI_API ESteamNetworkingConfigValue SteamAPI_ISteamNetworkingUtils_IterateGenericEditableConfigValues( ISteamNetworkingUtils* self, ESteamNetworkingConfigValue eCurrent, bool bEnumerateDevVars );
STEAMAPI_API void SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString( ISteamNetworkingUtils* self, const SteamNetworkingIPAddr & addr, char * buf, uint32 cbBuf, bool bWithPort ); STEAMAPI_API void SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString( ISteamNetworkingUtils* self, const SteamNetworkingIPAddr & addr, char * buf, uint32 cbBuf, bool bWithPort );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString( ISteamNetworkingUtils* self, SteamNetworkingIPAddr * pAddr, const char * pszStr ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString( ISteamNetworkingUtils* self, SteamNetworkingIPAddr * pAddr, const char * pszStr );
STEAMAPI_API ESteamNetworkingFakeIPType SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_GetFakeIPType( ISteamNetworkingUtils* self, const SteamNetworkingIPAddr & addr );
STEAMAPI_API void SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ToString( ISteamNetworkingUtils* self, const SteamNetworkingIdentity & identity, char * buf, uint32 cbBuf ); STEAMAPI_API void SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ToString( ISteamNetworkingUtils* self, const SteamNetworkingIdentity & identity, char * buf, uint32 cbBuf );
STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString( ISteamNetworkingUtils* self, SteamNetworkingIdentity * pIdentity, const char * pszStr ); STEAMAPI_API bool SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString( ISteamNetworkingUtils* self, SteamNetworkingIdentity * pIdentity, const char * pszStr );
@ -1068,6 +1093,12 @@ STEAMAPI_API bool SteamAPI_ISteamGameServerStats_SetUserAchievement( ISteamGameS
STEAMAPI_API bool SteamAPI_ISteamGameServerStats_ClearUserAchievement( ISteamGameServerStats* self, uint64_steamid steamIDUser, const char * pchName ); STEAMAPI_API bool SteamAPI_ISteamGameServerStats_ClearUserAchievement( ISteamGameServerStats* self, uint64_steamid steamIDUser, const char * pchName );
STEAMAPI_API SteamAPICall_t SteamAPI_ISteamGameServerStats_StoreUserStats( ISteamGameServerStats* self, uint64_steamid steamIDUser ); STEAMAPI_API SteamAPICall_t SteamAPI_ISteamGameServerStats_StoreUserStats( ISteamGameServerStats* self, uint64_steamid steamIDUser );
// ISteamNetworkingFakeUDPPort
STEAMAPI_API void SteamAPI_ISteamNetworkingFakeUDPPort_DestroyFakeUDPPort( ISteamNetworkingFakeUDPPort* self );
STEAMAPI_API EResult SteamAPI_ISteamNetworkingFakeUDPPort_SendMessageToFakeIP( ISteamNetworkingFakeUDPPort* self, const SteamNetworkingIPAddr & remoteAddress, const void * pData, uint32 cbData, int nSendFlags );
STEAMAPI_API int SteamAPI_ISteamNetworkingFakeUDPPort_ReceiveMessages( ISteamNetworkingFakeUDPPort* self, SteamNetworkingMessage_t ** ppOutMessages, int nMaxMessages );
STEAMAPI_API void SteamAPI_ISteamNetworkingFakeUDPPort_ScheduleCleanup( ISteamNetworkingFakeUDPPort* self, const SteamNetworkingIPAddr & remoteAddress );
// SteamIPAddress_t // SteamIPAddress_t
STEAMAPI_API bool SteamAPI_SteamIPAddress_t_IsSet( SteamIPAddress_t* self ); STEAMAPI_API bool SteamAPI_SteamIPAddress_t_IsSet( SteamIPAddress_t* self );
@ -1105,6 +1136,8 @@ STEAMAPI_API bool SteamAPI_SteamNetworkingIPAddr_IsLocalHost( SteamNetworkingIPA
STEAMAPI_API void SteamAPI_SteamNetworkingIPAddr_ToString( SteamNetworkingIPAddr* self, char * buf, uint32 cbBuf, bool bWithPort ); STEAMAPI_API void SteamAPI_SteamNetworkingIPAddr_ToString( SteamNetworkingIPAddr* self, char * buf, uint32 cbBuf, bool bWithPort );
STEAMAPI_API bool SteamAPI_SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr* self, const char * pszStr ); STEAMAPI_API bool SteamAPI_SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr* self, const char * pszStr );
STEAMAPI_API bool SteamAPI_SteamNetworkingIPAddr_IsEqualTo( SteamNetworkingIPAddr* self, const SteamNetworkingIPAddr & x ); STEAMAPI_API bool SteamAPI_SteamNetworkingIPAddr_IsEqualTo( SteamNetworkingIPAddr* self, const SteamNetworkingIPAddr & x );
STEAMAPI_API ESteamNetworkingFakeIPType SteamAPI_SteamNetworkingIPAddr_GetFakeIPType( SteamNetworkingIPAddr* self );
STEAMAPI_API bool SteamAPI_SteamNetworkingIPAddr_IsFakeIP( SteamNetworkingIPAddr* self );
// SteamNetworkingIdentity // SteamNetworkingIdentity
STEAMAPI_API void SteamAPI_SteamNetworkingIdentity_Clear( SteamNetworkingIdentity* self ); STEAMAPI_API void SteamAPI_SteamNetworkingIdentity_Clear( SteamNetworkingIdentity* self );
@ -1121,6 +1154,10 @@ STEAMAPI_API void SteamAPI_SteamNetworkingIdentity_SetStadiaID( SteamNetworkingI
STEAMAPI_API uint64 SteamAPI_SteamNetworkingIdentity_GetStadiaID( SteamNetworkingIdentity* self ); STEAMAPI_API uint64 SteamAPI_SteamNetworkingIdentity_GetStadiaID( SteamNetworkingIdentity* self );
STEAMAPI_API void SteamAPI_SteamNetworkingIdentity_SetIPAddr( SteamNetworkingIdentity* self, const SteamNetworkingIPAddr & addr ); STEAMAPI_API void SteamAPI_SteamNetworkingIdentity_SetIPAddr( SteamNetworkingIdentity* self, const SteamNetworkingIPAddr & addr );
STEAMAPI_API const SteamNetworkingIPAddr * SteamAPI_SteamNetworkingIdentity_GetIPAddr( SteamNetworkingIdentity* self ); STEAMAPI_API const SteamNetworkingIPAddr * SteamAPI_SteamNetworkingIdentity_GetIPAddr( SteamNetworkingIdentity* self );
STEAMAPI_API void SteamAPI_SteamNetworkingIdentity_SetIPv4Addr( SteamNetworkingIdentity* self, uint32 nIPv4, uint16 nPort );
STEAMAPI_API uint32 SteamAPI_SteamNetworkingIdentity_GetIPv4( SteamNetworkingIdentity* self );
STEAMAPI_API ESteamNetworkingFakeIPType SteamAPI_SteamNetworkingIdentity_GetFakeIPType( SteamNetworkingIdentity* self );
STEAMAPI_API bool SteamAPI_SteamNetworkingIdentity_IsFakeIP( SteamNetworkingIdentity* self );
STEAMAPI_API void SteamAPI_SteamNetworkingIdentity_SetLocalHost( SteamNetworkingIdentity* self ); STEAMAPI_API void SteamAPI_SteamNetworkingIdentity_SetLocalHost( SteamNetworkingIdentity* self );
STEAMAPI_API bool SteamAPI_SteamNetworkingIdentity_IsLocalHost( SteamNetworkingIdentity* self ); STEAMAPI_API bool SteamAPI_SteamNetworkingIdentity_IsLocalHost( SteamNetworkingIdentity* self );
STEAMAPI_API bool SteamAPI_SteamNetworkingIdentity_SetGenericString( SteamNetworkingIdentity* self, const char * pszString ); STEAMAPI_API bool SteamAPI_SteamNetworkingIdentity_SetGenericString( SteamNetworkingIdentity* self, const char * pszString );

View file

@ -265,6 +265,7 @@ enum { k_iSteamNetworkingSocketsCallbacks = 1220 };
enum { k_iSteamNetworkingMessagesCallbacks = 1250 }; enum { k_iSteamNetworkingMessagesCallbacks = 1250 };
enum { k_iSteamNetworkingUtilsCallbacks = 1280 }; enum { k_iSteamNetworkingUtilsCallbacks = 1280 };
enum { k_iClientRemoteStorageCallbacks = 1300 }; enum { k_iClientRemoteStorageCallbacks = 1300 };
enum { k_iSteamRemoteStorageCallbacks = 1300 };
enum { k_iClientDepotBuilderCallbacks = 1400 }; enum { k_iClientDepotBuilderCallbacks = 1400 };
enum { k_iSteamGameServerItemsCallbacks = 1500 }; enum { k_iSteamGameServerItemsCallbacks = 1500 };
enum { k_iClientUtilsCallbacks = 1600 }; enum { k_iClientUtilsCallbacks = 1600 };
@ -273,6 +274,7 @@ enum { k_iSteamGameServerStatsCallbacks = 1800 };
enum { k_iSteam2AsyncCallbacks = 1900 }; enum { k_iSteam2AsyncCallbacks = 1900 };
enum { k_iSteamGameStatsCallbacks = 2000 }; enum { k_iSteamGameStatsCallbacks = 2000 };
enum { k_iClientHTTPCallbacks = 2100 }; enum { k_iClientHTTPCallbacks = 2100 };
enum { k_iSteamHTTPCallbacks = 2100 };
enum { k_iClientScreenshotsCallbacks = 2200 }; enum { k_iClientScreenshotsCallbacks = 2200 };
enum { k_iSteamScreenshotsCallbacks = 2300 }; enum { k_iSteamScreenshotsCallbacks = 2300 };
enum { k_iClientAudioCallbacks = 2400 }; enum { k_iClientAudioCallbacks = 2400 };
@ -286,6 +288,7 @@ enum { k_iClientNetworkDeviceManagerCallbacks = 3100 };
enum { k_iClientMusicCallbacks = 3200 }; enum { k_iClientMusicCallbacks = 3200 };
enum { k_iClientRemoteClientManagerCallbacks = 3300 }; enum { k_iClientRemoteClientManagerCallbacks = 3300 };
enum { k_iClientUGCCallbacks = 3400 }; enum { k_iClientUGCCallbacks = 3400 };
enum { k_iSteamUGCCallbacks = 3400 };
enum { k_iSteamStreamClientCallbacks = 3500 }; enum { k_iSteamStreamClientCallbacks = 3500 };
enum { k_IClientProductBuilderCallbacks = 3600 }; enum { k_IClientProductBuilderCallbacks = 3600 };
enum { k_iClientShortcutsCallbacks = 3700 }; enum { k_iClientShortcutsCallbacks = 3700 };
@ -298,7 +301,9 @@ enum { k_iClientGameNotificationCallbacks = 4300 };
enum { k_iSteamGameNotificationCallbacks = 4400 }; enum { k_iSteamGameNotificationCallbacks = 4400 };
enum { k_iSteamHTMLSurfaceCallbacks = 4500 }; enum { k_iSteamHTMLSurfaceCallbacks = 4500 };
enum { k_iClientVideoCallbacks = 4600 }; enum { k_iClientVideoCallbacks = 4600 };
enum { k_iSteamVideoCallbacks = 4600 };
enum { k_iClientInventoryCallbacks = 4700 }; enum { k_iClientInventoryCallbacks = 4700 };
enum { k_iSteamInventoryCallbacks = 4700 };
enum { k_iClientBluetoothManagerCallbacks = 4800 }; enum { k_iClientBluetoothManagerCallbacks = 4800 };
enum { k_iClientSharedConnectionCallbacks = 4900 }; enum { k_iClientSharedConnectionCallbacks = 4900 };
enum { k_ISteamParentalSettingsCallbacks = 5000 }; enum { k_ISteamParentalSettingsCallbacks = 5000 };

View file

@ -1,6 +1,6 @@
//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ //========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============
// //
// Purpose: // Declare common types used by the Steamworks SDK.
// //
//============================================================================= //=============================================================================
@ -145,9 +145,10 @@ enum EResult
k_EResultNoLauncherSpecified = 117, // No launcher was specified, but a launcher was needed to choose correct realm for operation. k_EResultNoLauncherSpecified = 117, // No launcher was specified, but a launcher was needed to choose correct realm for operation.
k_EResultMustAgreeToSSA = 118, // User must agree to china SSA or global SSA before login k_EResultMustAgreeToSSA = 118, // User must agree to china SSA or global SSA before login
k_EResultLauncherMigrated = 119, // The specified launcher type is no longer supported; the user should be directed elsewhere k_EResultLauncherMigrated = 119, // The specified launcher type is no longer supported; the user should be directed elsewhere
k_EResultSteamRealmMismatch = 120, // The user's realm does not match the realm of the requested resource k_EResultSteamRealmMismatch = 120, // The user's realm does not match the realm of the requested resource
k_EResultInvalidSignature = 121, // signature check did not match k_EResultInvalidSignature = 121, // signature check did not match
k_EResultParseFailure = 122, // Failed to parse input k_EResultParseFailure = 122, // Failed to parse input
k_EResultNoVerifiedPhone = 123, // account does not have a verified phone number
}; };
// Error codes for use with the voice functions // Error codes for use with the voice functions

View file

@ -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

View file

@ -57,12 +57,14 @@ struct SteamNetAuthenticationStatus_t;
struct SteamRelayNetworkStatus_t; struct SteamRelayNetworkStatus_t;
struct SteamNetworkingMessagesSessionRequest_t; struct SteamNetworkingMessagesSessionRequest_t;
struct SteamNetworkingMessagesSessionFailed_t; struct SteamNetworkingMessagesSessionFailed_t;
struct SteamNetworkingFakeIPResult_t;
typedef void (*FnSteamNetConnectionStatusChanged)( SteamNetConnectionStatusChangedCallback_t * ); typedef void (*FnSteamNetConnectionStatusChanged)( SteamNetConnectionStatusChangedCallback_t * );
typedef void (*FnSteamNetAuthenticationStatusChanged)( SteamNetAuthenticationStatus_t * ); typedef void (*FnSteamNetAuthenticationStatusChanged)( SteamNetAuthenticationStatus_t * );
typedef void (*FnSteamRelayNetworkStatusChanged)(SteamRelayNetworkStatus_t *); typedef void (*FnSteamRelayNetworkStatusChanged)(SteamRelayNetworkStatus_t *);
typedef void (*FnSteamNetworkingMessagesSessionRequest)(SteamNetworkingMessagesSessionRequest_t *); typedef void (*FnSteamNetworkingMessagesSessionRequest)(SteamNetworkingMessagesSessionRequest_t *);
typedef void (*FnSteamNetworkingMessagesSessionFailed)(SteamNetworkingMessagesSessionFailed_t *); typedef void (*FnSteamNetworkingMessagesSessionFailed)(SteamNetworkingMessagesSessionFailed_t *);
typedef void (*FnSteamNetworkingFakeIPResult)(SteamNetworkingFakeIPResult_t *);
/// Handle used to identify a connection to a remote host. /// Handle used to identify a connection to a remote host.
typedef uint32 HSteamNetConnection; typedef uint32 HSteamNetConnection;
@ -132,7 +134,7 @@ enum ESteamNetworkingAvailability
enum ESteamNetworkingIdentityType enum ESteamNetworkingIdentityType
{ {
// Dummy/empty/invalid. // Dummy/empty/invalid.
// Plese note that if we parse a string that we don't recognize // Please note that if we parse a string that we don't recognize
// but that appears reasonable, we will NOT use this type. Instead // but that appears reasonable, we will NOT use this type. Instead
// we'll use k_ESteamNetworkingIdentityType_UnknownType. // we'll use k_ESteamNetworkingIdentityType_UnknownType.
k_ESteamNetworkingIdentityType_Invalid = 0, k_ESteamNetworkingIdentityType_Invalid = 0,
@ -176,6 +178,18 @@ enum ESteamNetworkingIdentityType
k_ESteamNetworkingIdentityType__Force32bit = 0x7fffffff, k_ESteamNetworkingIdentityType__Force32bit = 0x7fffffff,
}; };
/// "Fake IPs" are assigned to hosts, to make it easier to interface with
/// older code that assumed all hosts will have an IPv4 address
enum ESteamNetworkingFakeIPType
{
k_ESteamNetworkingFakeIPType_Invalid, // Error, argument was not even an IP address, etc.
k_ESteamNetworkingFakeIPType_NotFake, // Argument was a valid IP, but was not from the reserved "fake" range
k_ESteamNetworkingFakeIPType_GlobalIPv4, // Globally unique (for a given app) IPv4 address. Address space managed by Steam
k_ESteamNetworkingFakeIPType_LocalIPv4, // Locally unique IPv4 address. Address space managed by the local process. For internal use only; should not be shared!
k_ESteamNetworkingFakeIPType__Force32Bit = 0x7fffffff
};
#pragma pack(push,1) #pragma pack(push,1)
/// Store an IP and port. IPv6 is always used; IPv4 is represented using /// Store an IP and port. IPv6 is always used; IPv4 is represented using
@ -226,6 +240,13 @@ struct SteamNetworkingIPAddr
/// See if two addresses are identical /// See if two addresses are identical
bool operator==(const SteamNetworkingIPAddr &x ) const; bool operator==(const SteamNetworkingIPAddr &x ) const;
/// Classify address as FakeIP. This function never returns
/// k_ESteamNetworkingFakeIPType_Invalid.
ESteamNetworkingFakeIPType GetFakeIPType() const;
/// Return true if we are a FakeIP
bool IsFakeIP() const { return GetFakeIPType() > k_ESteamNetworkingFakeIPType_NotFake; }
}; };
/// An abstract way to represent the identity of a network host. All identities can /// An abstract way to represent the identity of a network host. All identities can
@ -252,6 +273,11 @@ struct SteamNetworkingIdentity
void SetIPAddr( const SteamNetworkingIPAddr &addr ); // Set to specified IP:port void SetIPAddr( const SteamNetworkingIPAddr &addr ); // Set to specified IP:port
const SteamNetworkingIPAddr *GetIPAddr() const; // returns null if we are not an IP address. const SteamNetworkingIPAddr *GetIPAddr() const; // returns null if we are not an IP address.
void SetIPv4Addr( uint32 nIPv4, uint16 nPort ); // Set to specified IPv4:port
uint32 GetIPv4() const; // returns 0 if we are not an IPv4 address.
ESteamNetworkingFakeIPType GetFakeIPType() const;
bool IsFakeIP() const { return GetFakeIPType() > k_ESteamNetworkingFakeIPType_NotFake; }
// "localhost" is equivalent for many purposes to "anonymous." Our remote // "localhost" is equivalent for many purposes to "anonymous." Our remote
// will identify us by the network address we use. // will identify us by the network address we use.
@ -535,13 +561,9 @@ enum ESteamNetConnectionEnd
// - etc // - etc
k_ESteamNetConnectionEnd_Remote_BadCert = 4003, k_ESteamNetConnectionEnd_Remote_BadCert = 4003,
// We couldn't rendezvous with the remote host because // These will never be returned
// they aren't logged into Steam //k_ESteamNetConnectionEnd_Remote_NotLoggedIn_DEPRECATED = 4004,
k_ESteamNetConnectionEnd_Remote_NotLoggedIn = 4004, //k_ESteamNetConnectionEnd_Remote_NotRunningApp_DEPRECATED = 4005,
// We couldn't rendezvous with the remote host because
// they aren't running the right application.
k_ESteamNetConnectionEnd_Remote_NotRunningApp = 4005,
// Something wrong with the protocol version you are using. // Something wrong with the protocol version you are using.
// (Probably the code you are running is too old.) // (Probably the code you are running is too old.)
@ -575,10 +597,7 @@ enum ESteamNetConnectionEnd
// or on their end. // or on their end.
k_ESteamNetConnectionEnd_Misc_Timeout = 5003, k_ESteamNetConnectionEnd_Misc_Timeout = 5003,
// We're having trouble talking to the relevant relay. //k_ESteamNetConnectionEnd_Misc_RelayConnectivity_DEPRECATED = 5004,
// We don't have enough information to say whether the
// problem is on our end or not.
k_ESteamNetConnectionEnd_Misc_RelayConnectivity = 5004,
// There's some trouble talking to Steam. // There's some trouble talking to Steam.
k_ESteamNetConnectionEnd_Misc_SteamConnectivity = 5005, k_ESteamNetConnectionEnd_Misc_SteamConnectivity = 5005,
@ -631,6 +650,16 @@ const int k_cchSteamNetworkingMaxConnectionCloseReason = 128;
/// of a connection. /// of a connection.
const int k_cchSteamNetworkingMaxConnectionDescription = 128; const int k_cchSteamNetworkingMaxConnectionDescription = 128;
/// Max length of the app's part of the description
const int k_cchSteamNetworkingMaxConnectionAppName = 32;
const int k_nSteamNetworkConnectionInfoFlags_Unauthenticated = 1; // We don't have a certificate for the remote host.
const int k_nSteamNetworkConnectionInfoFlags_Unencrypted = 2; // Information is being sent out over a wire unencrypted (by this library)
const int k_nSteamNetworkConnectionInfoFlags_LoopbackBuffers = 4; // Internal loopback buffers. Won't be true for localhost. (You can check the address to determine that.) This implies k_nSteamNetworkConnectionInfoFlags_FastLAN
const int k_nSteamNetworkConnectionInfoFlags_Fast = 8; // The connection is "fast" and "reliable". Either internal/localhost (check the address to find out), or the peer is on the same LAN. (Probably. It's based on the address and the ping time, this is actually hard to determine unambiguously).
const int k_nSteamNetworkConnectionInfoFlags_Relayed = 16; // The connection is relayed somehow (SDR or TURN).
const int k_nSteamNetworkConnectionInfoFlags_DualWifi = 32; // We're taking advantage of dual-wifi multi-path
/// Describe the state of a connection. /// Describe the state of a connection.
struct SteamNetConnectionInfo_t struct SteamNetConnectionInfo_t
{ {
@ -678,13 +707,16 @@ struct SteamNetConnectionInfo_t
/// handle, but in certain cases with symmetric connections it might not. /// handle, but in certain cases with symmetric connections it might not.
char m_szConnectionDescription[ k_cchSteamNetworkingMaxConnectionDescription ]; char m_szConnectionDescription[ k_cchSteamNetworkingMaxConnectionDescription ];
/// Misc flags. Bitmask of k_nSteamNetworkConnectionInfoFlags_Xxxx
int m_nFlags;
/// Internal stuff, room to change API easily /// Internal stuff, room to change API easily
uint32 reserved[64]; uint32 reserved[63];
}; };
/// Quick connection state, pared down to something you could call /// Quick connection state, pared down to something you could call
/// more frequently without it being too big of a perf hit. /// more frequently without it being too big of a perf hit.
struct SteamNetworkingQuickConnectionStatus struct SteamNetConnectionRealTimeStatus_t
{ {
/// High level state of the connection /// High level state of the connection
@ -727,17 +759,16 @@ struct SteamNetworkingQuickConnectionStatus
/// have to re-transmit. /// have to re-transmit.
int m_cbSentUnackedReliable; int m_cbSentUnackedReliable;
/// If you asked us to send a message right now, how long would that message /// If you queued a message right now, approximately how long would that message
/// sit in the queue before we actually started putting packets on the wire? /// wait in the queue before we actually started putting its data on the wire in
/// (And assuming Nagle does not cause any packets to be delayed.) /// a packet?
/// ///
/// In general, data that is sent by the application is limited by the /// In general, data that is sent by the application is limited by the bandwidth
/// bandwidth of the channel. If you send data faster than this, it must /// of the channel. If you send data faster than this, it must be queued and
/// be queued and put on the wire at a metered rate. Even sending a small amount /// put on the wire at a metered rate. Even sending a small amount of data (e.g.
/// of data (e.g. a few MTU, say ~3k) will require some of the data to be delayed /// a few MTU, say ~3k) will require some of the data to be delayed a bit.
/// a bit. ///
/// /// Ignoring multiple lanes, the estimated delay will be approximately equal to
/// In general, the estimated delay will be approximately equal to
/// ///
/// ( m_cbPendingUnreliable+m_cbPendingReliable ) / m_nSendRateBytesPerSecond /// ( m_cbPendingUnreliable+m_cbPendingReliable ) / m_nSendRateBytesPerSecond
/// ///
@ -746,15 +777,42 @@ struct SteamNetworkingQuickConnectionStatus
/// and the last packet placed on the wire, and we are exactly up against the send /// and the last packet placed on the wire, and we are exactly up against the send
/// rate limit. In that case we might need to wait for one packet's worth of time to /// rate limit. In that case we might need to wait for one packet's worth of time to
/// elapse before we can send again. On the other extreme, the queue might have data /// elapse before we can send again. On the other extreme, the queue might have data
/// in it waiting for Nagle. (This will always be less than one packet, because as soon /// in it waiting for Nagle. (This will always be less than one packet, because as
/// as we have a complete packet we would send it.) In that case, we might be ready /// soon as we have a complete packet we would send it.) In that case, we might be
/// to send data now, and this value will be 0. /// ready to send data now, and this value will be 0.
///
/// This value is only valid if multiple lanes are not used. If multiple lanes are
/// in use, then the queue time will be different for each lane, and you must use
/// the value in SteamNetConnectionRealTimeLaneStatus_t.
///
/// Nagle delay is ignored for the purposes of this calculation.
SteamNetworkingMicroseconds m_usecQueueTime; SteamNetworkingMicroseconds m_usecQueueTime;
/// Internal stuff, room to change API easily // Internal stuff, room to change API easily
uint32 reserved[16]; uint32 reserved[16];
}; };
#define SteamNetworkingQuickConnectionStatus SteamNetConnectionRealTimeStatus_t
/// Quick status of a particular lane
struct SteamNetConnectionRealTimeLaneStatus_t
{
// Counters for this particular lane. See the corresponding variables
// in SteamNetConnectionRealTimeStatus_t
int m_cbPendingUnreliable;
int m_cbPendingReliable;
int m_cbSentUnackedReliable;
int _reservePad1; // Reserved for future use
/// Lane-specific queue time. This value takes into consideration lane priorities
/// and weights, and how much data is queued in each lane, and attempts to predict
/// how any data currently queued will be sent out.
SteamNetworkingMicroseconds m_usecQueueTime;
// Internal stuff, room to change API easily
uint32 reserved[10];
};
#pragma pack( pop ) #pragma pack( pop )
// //
@ -801,15 +859,17 @@ struct SteamNetworkingMessage_t
/// - You might have closed the connection, so fetching the user data /// - You might have closed the connection, so fetching the user data
/// would not be possible. /// would not be possible.
/// ///
/// Not used when sending messages, /// Not used when sending messages.
int64 m_nConnUserData; int64 m_nConnUserData;
/// Local timestamp when the message was received /// Local timestamp when the message was received
/// Not used for outbound messages. /// Not used for outbound messages.
SteamNetworkingMicroseconds m_usecTimeReceived; SteamNetworkingMicroseconds m_usecTimeReceived;
/// Message number assigned by the sender. /// Message number assigned by the sender. This is not used for outbound
/// This is not used for outbound messages /// messages. Note that if multiple lanes are used, each lane has its own
/// message numbers, which are assigned sequentially, so messages from
/// different lanes will share the same numbers.
int64 m_nMessageNumber; int64 m_nMessageNumber;
/// Function used to free up m_pData. This mechanism exists so that /// Function used to free up m_pData. This mechanism exists so that
@ -841,6 +901,11 @@ struct SteamNetworkingMessage_t
/// Not used for received messages. /// Not used for received messages.
int64 m_nUserData; int64 m_nUserData;
/// For outbound messages, which lane to use? See ISteamNetworkingSockets::ConfigureConnectionLanes.
/// For inbound messages, what lane was the message received on?
uint16 m_idxLane;
uint16 _pad1__;
/// You MUST call this when you're done with the object, /// You MUST call this when you're done with the object,
/// to free up memory, etc. /// to free up memory, etc.
inline void Release(); inline void Release();
@ -1057,7 +1122,6 @@ enum ESteamNetworkingConfigValue
{ {
k_ESteamNetworkingConfig_Invalid = 0, k_ESteamNetworkingConfig_Invalid = 0,
// //
// Connection options // Connection options
// //
@ -1153,19 +1217,6 @@ enum ESteamNetworkingConfigValue
/// the peer to also modify their value in order for encryption to be disabled.) /// the peer to also modify their value in order for encryption to be disabled.)
k_ESteamNetworkingConfig_Unencrypted = 34, k_ESteamNetworkingConfig_Unencrypted = 34,
/// [global int32] 0 or 1. Some variables are "dev" variables. They are useful
/// for debugging, but should not be adjusted in production. When this flag is false (the default),
/// such variables will not be enumerated by the ISteamnetworkingUtils::GetFirstConfigValue
/// ISteamNetworkingUtils::GetConfigValueInfo functions. The idea here is that you
/// can use those functions to provide a generic mechanism to set any configuration
/// value from a console or configuration file, looking up the variable by name. Depending
/// on your game, modifying other configuration values may also have negative effects, and
/// you may wish to further lock down which variables are allowed to be modified by the user.
/// (Maybe no variables!) Or maybe you use a whitelist or blacklist approach.
///
/// (This flag is itself a dev variable.)
k_ESteamNetworkingConfig_EnumerateDevVars = 35,
/// [connection int32] Set this to 1 on outbound connections and listen sockets, /// [connection int32] Set this to 1 on outbound connections and listen sockets,
/// to enable "symmetric connect mode", which is useful in the following /// to enable "symmetric connect mode", which is useful in the following
/// common peer-to-peer use case: /// common peer-to-peer use case:
@ -1267,6 +1318,14 @@ enum ESteamNetworkingConfigValue
/// This value should not be read or written in any other context. /// This value should not be read or written in any other context.
k_ESteamNetworkingConfig_LocalVirtualPort = 38, k_ESteamNetworkingConfig_LocalVirtualPort = 38,
/// [connection int32] Enable Dual wifi band support for this connection
/// 0 = no, 1 = yes, 2 = simulate it for debugging, even if dual wifi not available
k_ESteamNetworkingConfig_DualWifi_Enable = 39,
/// [connection int32] True to enable diagnostics reporting through
/// generic platform UI. (Only available on Steam.)
k_ESteamNetworkingConfig_EnableDiagnosticsUI = 46,
// //
// Simulating network conditions // Simulating network conditions
// //
@ -1319,9 +1378,9 @@ enum ESteamNetworkingConfigValue
k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate = 44, k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate = 44,
k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst = 45, k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst = 45,
// //
// Callbacks // Callbacks
// //
// On Steam, you may use the default Steam callback dispatch mechanism. If you prefer // On Steam, you may use the default Steam callback dispatch mechanism. If you prefer
// to not use this dispatch mechanism (or you are not running with Steam), or you want // to not use this dispatch mechanism (or you are not running with Steam), or you want
@ -1386,9 +1445,14 @@ enum ESteamNetworkingConfigValue
/// ISteamNetworkingMessages. /// ISteamNetworkingMessages.
k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling = 206, k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling = 206,
// /// [global FnSteamNetworkingFakeIPResult] Callback that's invoked when
// P2P settings /// a FakeIP allocation finishes. See: ISteamNetworkingSockets::BeginAsyncRequestFakeIP,
// /// ISteamNetworkingUtils::SetGlobalCallback_FakeIPResult
k_ESteamNetworkingConfig_Callback_FakeIPResult = 207,
//
// P2P connection settings
//
// /// [listen socket int32] When you create a P2P listen socket, we will automatically // /// [listen socket int32] When you create a P2P listen socket, we will automatically
// /// open up a UDP port to listen for LAN connections. LAN connections can be made // /// open up a UDP port to listen for LAN connections. LAN connections can be made
@ -1419,9 +1483,9 @@ enum ESteamNetworkingConfigValue
k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty = 106, k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty = 106,
//k_ESteamNetworkingConfig_P2P_Transport_LANBeacon_Penalty = 107, //k_ESteamNetworkingConfig_P2P_Transport_LANBeacon_Penalty = 107,
// //
// Settings for SDR relayed connections // Settings for SDR relayed connections
// //
/// [int32 global] If the first N pings to a port all fail, mark that port as unavailable for /// [int32 global] If the first N pings to a port all fail, mark that port as unavailable for
/// a while, and try a different one. Some ISPs and routers may drop the first /// a while, and try a different one. Some ISPs and routers may drop the first
@ -1468,14 +1532,14 @@ enum ESteamNetworkingConfigValue
/// in production. /// in production.
k_ESteamNetworkingConfig_SDRClient_FakeClusterPing = 36, k_ESteamNetworkingConfig_SDRClient_FakeClusterPing = 36,
// //
// Log levels for debugging information of various subsystems. // Log levels for debugging information of various subsystems.
// Higher numeric values will cause more stuff to be printed. // Higher numeric values will cause more stuff to be printed.
// See ISteamNetworkingUtils::SetDebugOutputFunction for more // See ISteamNetworkingUtils::SetDebugOutputFunction for more
// information // information
// //
// The default for all values is k_ESteamNetworkingSocketsDebugOutputType_Warning. // The default for all values is k_ESteamNetworkingSocketsDebugOutputType_Warning.
// //
k_ESteamNetworkingConfig_LogLevel_AckRTT = 13, // [connection int32] RTT calculations for inline pings and replies k_ESteamNetworkingConfig_LogLevel_AckRTT = 13, // [connection int32] RTT calculations for inline pings and replies
k_ESteamNetworkingConfig_LogLevel_PacketDecode = 14, // [connection int32] log SNP packets send/recv k_ESteamNetworkingConfig_LogLevel_PacketDecode = 14, // [connection int32] log SNP packets send/recv
k_ESteamNetworkingConfig_LogLevel_Message = 15, // [connection int32] log each message send/recv k_ESteamNetworkingConfig_LogLevel_Message = 15, // [connection int32] log each message send/recv
@ -1483,6 +1547,10 @@ enum ESteamNetworkingConfigValue
k_ESteamNetworkingConfig_LogLevel_P2PRendezvous = 17, // [connection int32] P2P rendezvous messages k_ESteamNetworkingConfig_LogLevel_P2PRendezvous = 17, // [connection int32] P2P rendezvous messages
k_ESteamNetworkingConfig_LogLevel_SDRRelayPings = 18, // [global int32] Ping relays k_ESteamNetworkingConfig_LogLevel_SDRRelayPings = 18, // [global int32] Ping relays
// Deleted, do not use
k_ESteamNetworkingConfig_DELETED_EnumerateDevVars = 35,
k_ESteamNetworkingConfigValue__Force32Bit = 0x7fffffff k_ESteamNetworkingConfigValue__Force32Bit = 0x7fffffff
}; };
@ -1640,6 +1708,8 @@ inline void GetSteamNetworkingLocationPOPStringFromID( SteamNetworkingPOPID id,
/// The POPID "dev" is used in non-production environments for testing. /// The POPID "dev" is used in non-production environments for testing.
const SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ( (uint32)'d' << 16U ) | ( (uint32)'e' << 8U ) | (uint32)'v'; const SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ( (uint32)'d' << 16U ) | ( (uint32)'e' << 8U ) | (uint32)'v';
#ifndef API_GEN
/// Utility class for printing a SteamNetworkingPOPID. /// Utility class for printing a SteamNetworkingPOPID.
struct SteamNetworkingPOPIDRender struct SteamNetworkingPOPIDRender
{ {
@ -1649,6 +1719,7 @@ private:
char buf[ 8 ]; char buf[ 8 ];
}; };
#endif
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //