mirror of
https://github.com/acidicoala/SmokeAPI.git
synced 2025-12-05 21:15:39 -05:00
Reworked linker exports generation
This commit is contained in:
Binary file not shown.
40
res/steamworks/100/headers/isteamapps.h
Normal file
40
res/steamworks/100/headers/isteamapps.h
Normal file
@@ -0,0 +1,40 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to app data in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMAPPS_H
|
||||
#define ISTEAMAPPS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam/isteamapps.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to app data
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamApps
|
||||
{
|
||||
public:
|
||||
// returns 0 if the key does not exist
|
||||
// this may be true on first call, since the app data may not be cached locally yet
|
||||
// If you expect it to exists wait for the AppDataChanged_t after the first failure and ask again
|
||||
virtual int GetAppData( AppId_t nAppID, const char *pchKey, char *pchValue, int cchValueMax ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION001"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when new information about an app has arrived
|
||||
//-----------------------------------------------------------------------------
|
||||
struct AppDataChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamAppsCallbacks + 1 };
|
||||
uint32 m_nAppID; // appid that changed
|
||||
bool m_bBySteamUI; // change came from SteamUI
|
||||
bool m_bCDDBUpdate; // the cddb entry for this app changed
|
||||
};
|
||||
|
||||
#endif // ISTEAMAPPS_H
|
||||
142
res/steamworks/100/headers/isteamclient.h
Normal file
142
res/steamworks/100/headers/isteamclient.h
Normal file
@@ -0,0 +1,142 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: Main interface for loading and accessing Steamworks API's from the
|
||||
// Steam client.
|
||||
// For most uses, this code is wrapped inside of SteamAPI_Init()
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMCLIENT_H
|
||||
#define ISTEAMCLIENT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a communication pipe to the Steam client
|
||||
typedef int32 HSteamPipe;
|
||||
// handle to single instance of a steam user
|
||||
typedef int32 HSteamUser;
|
||||
// function prototype
|
||||
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
|
||||
|
||||
// interface predec
|
||||
class ISteamUser;
|
||||
class ISteamGameServer;
|
||||
class ISteamFriends;
|
||||
class ISteamUtils;
|
||||
class ISteamMatchmaking;
|
||||
class ISteamContentServer;
|
||||
class ISteamMasterServerUpdater;
|
||||
class ISteamMatchmakingServers;
|
||||
class ISteamUserStats;
|
||||
class ISteamApps;
|
||||
class ISteamNetworking;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Interface to creating a new steam instance, or to
|
||||
// connect to an existing steam instance, whether it's in a
|
||||
// different process or is local.
|
||||
//
|
||||
// For most scenarios this is all handled automatically via SteamAPI_Init().
|
||||
// You'll only need to use these interfaces if you have a more complex versioning scheme,
|
||||
// where you want to get different versions of the same interface in different dll's in your project.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamClient
|
||||
{
|
||||
public:
|
||||
// Creates a communication pipe to the Steam client
|
||||
virtual HSteamPipe CreateSteamPipe() = 0;
|
||||
|
||||
// Releases a previously created communications pipe
|
||||
virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// connects to an existing global user, failing if none exists
|
||||
// used by the game to coordinate with the steamUI
|
||||
virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// used by game servers, create a steam user that won't be shared with anyone else
|
||||
virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe ) = 0;
|
||||
|
||||
// removes an allocated user
|
||||
virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0;
|
||||
|
||||
// retrieves the ISteamUser interface associated with the handle
|
||||
virtual ISteamUser *GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// retrieves the ISteamGameServer interface associated with the handle
|
||||
virtual ISteamGameServer *GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// set the local IP and Port to bind to
|
||||
// this must be set before CreateLocalUser()
|
||||
virtual void SetLocalIPBinding( uint32 unIP, uint16 usPort ) = 0;
|
||||
|
||||
// returns the ISteamFriends interface
|
||||
virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamUtils interface
|
||||
virtual ISteamUtils *GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmaking interface
|
||||
virtual ISteamMatchmaking *GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamContentServer interface
|
||||
virtual ISteamContentServer *GetISteamContentServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMasterServerUpdater interface
|
||||
virtual ISteamMasterServerUpdater *GetISteamMasterServerUpdater( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmakingServers interface
|
||||
virtual ISteamMatchmakingServers *GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the a generic interface
|
||||
virtual void *GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// this needs to be called every frame to process matchmaking results
|
||||
// redundant if you're already calling SteamAPI_RunCallbacks()
|
||||
virtual void RunFrame() = 0;
|
||||
|
||||
// returns the number of IPC calls made since the last time this function was called
|
||||
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
||||
// Every IPC call is at minimum a thread context switch if not a process one so you want to rate
|
||||
// control how often you do them.
|
||||
virtual uint32 GetIPCCallCount() = 0;
|
||||
|
||||
// returns the ISteamUserStats interface
|
||||
virtual ISteamUserStats *GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns apps interface
|
||||
virtual ISteamApps *GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// networking
|
||||
virtual ISteamNetworking *GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// API warning handling
|
||||
// 'int' is the severity; 0 for msg, 1 for warning
|
||||
// 'const char *' is the text of the message
|
||||
// callbacks will occur directly after the API function is called that generated the warning or message
|
||||
virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient007"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Base values for callback identifiers, each callback must
|
||||
// have a unique ID.
|
||||
//-----------------------------------------------------------------------------
|
||||
enum { k_iSteamUserCallbacks = 100 };
|
||||
enum { k_iSteamGameServerCallbacks = 200 };
|
||||
enum { k_iSteamFriendsCallbacks = 300 };
|
||||
enum { k_iSteamBillingCallbacks = 400 };
|
||||
enum { k_iSteamMatchmakingCallbacks = 500 };
|
||||
enum { k_iSteamContentServerCallbacks = 600 };
|
||||
enum { k_iSteamUtilsCallbacks = 700 };
|
||||
enum { k_iClientFriendsCallbacks = 800 };
|
||||
enum { k_iClientUserCallbacks = 900 };
|
||||
enum { k_iSteamAppsCallbacks = 1000 };
|
||||
enum { k_iSteamUserStatsCallbacks = 1100 };
|
||||
enum { k_iSteamNetworkingCallbacks = 1200 };
|
||||
|
||||
|
||||
#endif // ISTEAMCLIENT_H
|
||||
200
res/steamworks/100/headers/isteamfriends.h
Normal file
200
res/steamworks/100/headers/isteamfriends.h
Normal file
@@ -0,0 +1,200 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to both friends list data and general information about users
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMFRIENDS_H
|
||||
#define ISTEAMFRIENDS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: set of relationships to other users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EFriendRelationship
|
||||
{
|
||||
k_EFriendRelationshipNone = 0,
|
||||
k_EFriendRelationshipBlocked = 1,
|
||||
k_EFriendRelationshipRequestRecipient = 2,
|
||||
k_EFriendRelationshipFriend = 3,
|
||||
k_EFriendRelationshipRequestInitiator = 4,
|
||||
k_EFriendRelationshipIgnored = 5,
|
||||
k_EFriendRelationshipIgnoredFriend = 6,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: list of states a friend can be in
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EPersonaState
|
||||
{
|
||||
k_EPersonaStateOffline = 0, // friend is not currently logged on
|
||||
k_EPersonaStateOnline = 1, // friend is logged on
|
||||
k_EPersonaStateBusy = 2, // user is on, but busy
|
||||
k_EPersonaStateAway = 3, // auto-away feature
|
||||
k_EPersonaStateSnooze = 4, // auto-away for a long time
|
||||
k_EPersonaStateMax,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: flags for enumerating friends list, or quickly checking a the relationship between users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum k_EFriendFlags
|
||||
{
|
||||
k_EFriendFlagNone = 0x00,
|
||||
k_EFriendFlagBlocked = 0x01,
|
||||
k_EFriendFlagFriendshipRequested = 0x02,
|
||||
k_EFriendFlagImmediate = 0x04, // "regular" friend
|
||||
k_EFriendFlagClanMember = 0x08,
|
||||
k_EFriendFlagOnGameServer = 0x10,
|
||||
// k_EFriendFlagHasPlayedWith = 0x20, // not currently used
|
||||
// k_EFriendFlagFriendOfFriend = 0x40, // not currently used
|
||||
k_EFriendFlagRequestingFriendship = 0x80,
|
||||
k_EFriendFlagRequestingInfo = 0x100,
|
||||
k_EFriendFlagIgnored = 0x200,
|
||||
k_EFriendFlagIgnoredFriend = 0x400,
|
||||
k_EFriendFlagAll = 0xFFFF,
|
||||
};
|
||||
|
||||
// maximum number of characters in a users name
|
||||
enum { k_cchPersonaNameMax = 128 };
|
||||
|
||||
// size limit on chat room or member metadata
|
||||
const uint32 k_cubChatMetadataMax = 4096;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to accessing information about individual users,
|
||||
// that can be a friend, in a group, on a game server or in a lobby with the local user
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamFriends
|
||||
{
|
||||
public:
|
||||
// returns the local players name - guaranteed to not be NULL.
|
||||
// this is the same name as on the users community profile page
|
||||
// this is stored in UTF-8 format
|
||||
// like all the other interface functions that return a char *, it's important that this pointer is not saved
|
||||
// off; it will eventually be free'd or re-allocated
|
||||
virtual const char *GetPersonaName() = 0;
|
||||
|
||||
// sets the player name, stores it on the server and publishes the changes to all friends who are online
|
||||
virtual void SetPersonaName( const char *pchPersonaName ) = 0;
|
||||
|
||||
// gets the status of the current user
|
||||
virtual EPersonaState GetPersonaState() = 0;
|
||||
|
||||
// friend iteration
|
||||
// takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria
|
||||
// then GetFriendByIndex() can then be used to return the id's of each of those users
|
||||
virtual int GetFriendCount( int iFriendFlags ) = 0;
|
||||
|
||||
// returns the steamID of a user
|
||||
// iFriend is a index of range [0, GetFriendCount())
|
||||
// iFriendsFlags must be the same value as used in GetFriendCount()
|
||||
// the returned CSteamID can then be used by all the functions below to access details about the user
|
||||
virtual CSteamID GetFriendByIndex( int iFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// returns a relationship to a user
|
||||
virtual EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the current status of the specified user
|
||||
// this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user
|
||||
virtual EPersonaState GetFriendPersonaState( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the name another user - guaranteed to not be NULL.
|
||||
// same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user
|
||||
// note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously
|
||||
//
|
||||
virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// gets the avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetFriendAvatar( CSteamID steamIDFriend ) = 0;
|
||||
// returns true if the friend is actually in a game
|
||||
virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, uint64 *pulGameID, uint32 *punGameIP, uint16 *pusGamePort, uint16 *pusQueryPort ) = 0;
|
||||
// accesses old friends names - returns an empty string when their are no more items in the history
|
||||
virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0;
|
||||
|
||||
// returns true if the specified user meets any of the criteria specified in iFriendFlags
|
||||
// iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values
|
||||
virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// clan (group) iteration and access functions
|
||||
virtual int GetClanCount() = 0;
|
||||
virtual CSteamID GetClanByIndex( int iClan ) = 0;
|
||||
virtual const char *GetClanName( CSteamID steamIDClan ) = 0;
|
||||
|
||||
// iterators for getting users in a chat room, lobby, game server or clan
|
||||
// note that large clans that cannot be iterated by the local user
|
||||
// steamIDSource can be the steamID of a group, game server, lobby or chat room
|
||||
virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0;
|
||||
virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0;
|
||||
|
||||
// returns true if the local user can see that steamIDUser is a member or in steamIDSource
|
||||
virtual bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) = 0;
|
||||
|
||||
// User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI)
|
||||
virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0;
|
||||
|
||||
// activates the game overlay, with an optional dialog to open ("Friends", "Community", "Players", "Settings")
|
||||
virtual void ActivateGameOverlay( const char *pchDialog ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends003"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a friends' status changes
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PersonaStateChange_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamID; // steamID of the friend who changed
|
||||
int m_nChangeFlags; // what's changed
|
||||
};
|
||||
|
||||
|
||||
// used in PersonaStateChange_t::m_nChangeFlags to describe what's changed about a user
|
||||
// these flags describe what the client has learned has changed recently, so on startup you'll see a name, avatar & relationship change for every friend
|
||||
enum EPersonaChange
|
||||
{
|
||||
k_EPersonaChangeName = 0x001,
|
||||
k_EPersonaChangeStatus = 0x002,
|
||||
k_EPersonaChangeComeOnline = 0x004,
|
||||
k_EPersonaChangeGoneOffline = 0x008,
|
||||
k_EPersonaChangeGamePlayed = 0x010,
|
||||
k_EPersonaChangeGameServer = 0x020,
|
||||
k_EPersonaChangeAvatar = 0x040,
|
||||
k_EPersonaChangeJoinedSource= 0x080,
|
||||
k_EPersonaChangeLeftSource = 0x100,
|
||||
k_EPersonaChangeRelationshipChanged = 0x200,
|
||||
k_EPersonaChangeNameFirstSet = 0x400,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: posted when game overlay activates or deactivates
|
||||
// the game can use this to be pause or resume single player games
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameOverlayActivated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 31 };
|
||||
uint8 m_bActive; // true if it's just been activated, false otherwise
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the user tries to join a different game server from their friends list
|
||||
// game client should attempt to connect to specified server when this is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameServerChangeRequested_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 32 };
|
||||
char m_rgchServer[64]; // server address ("127.0.0.1:27015", "tf2.valvesoftware.com")
|
||||
char m_rgchPassword[64]; // server password, if any
|
||||
};
|
||||
|
||||
#endif // ISTEAMFRIENDS_H
|
||||
160
res/steamworks/100/headers/isteamgameserver.h
Normal file
160
res/steamworks/100/headers/isteamgameserver.h
Normal file
@@ -0,0 +1,160 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMGAMESERVER_H
|
||||
#define ISTEAMGAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for authenticating users via Steam to play on a game server
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamGameServer
|
||||
{
|
||||
public:
|
||||
// connection functions
|
||||
virtual void LogOn() = 0;
|
||||
virtual void LogOff() = 0;
|
||||
|
||||
// status functions
|
||||
virtual bool BLoggedOn() = 0;
|
||||
virtual bool BSecure() = 0;
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Handles receiving a new connection from a Steam user. This call will ask the Steam
|
||||
// servers to validate the users identity, app ownership, and VAC status. If the Steam servers
|
||||
// are off-line, then it will validate the cached ticket itself which will validate app ownership
|
||||
// and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection()
|
||||
// and must then be sent up to the game server for authentication.
|
||||
//
|
||||
// Return Value: true/false depending on whether the call succeeds. If the call succeeds then you
|
||||
// should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication
|
||||
// for the user has succeeded or failed.
|
||||
virtual void SendUserConnectAndAuthenticate( CSteamID steamIDUser, uint32 unIPClient, void *pvAuthBlob, uint32 cubAuthBlobSize ) = 0;
|
||||
|
||||
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||
//
|
||||
// Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect()
|
||||
// when this user leaves the server just like you would for a real user.
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection() = 0;
|
||||
|
||||
// Should be called whenever a user leaves our game server, this lets Steam internally
|
||||
// track which users are currently on which servers for the purposes of preventing a single
|
||||
// account being logged into multiple servers, showing who is currently on a server, etc.
|
||||
virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// Update the data to be displayed in the server browser and matchmaking interfaces for a user
|
||||
// currently connected to the server. For regular users you must call this after you receive a
|
||||
// GSUserValidationSuccess callback.
|
||||
//
|
||||
// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
|
||||
virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
|
||||
|
||||
// You shouldn't need to call this as it is called internally by SteamGameServer_Init() and can only be called once.
|
||||
//
|
||||
// To update the data in this call which may change during the servers lifetime see UpdateServerStatus() below.
|
||||
//
|
||||
// Input: nGameAppID - The Steam assigned AppID for the game
|
||||
// unServerFlags - Any applicable combination of flags (see k_unServerFlag____ constants below)
|
||||
// unGameIP - The IP Address the server is listening for client connections on (might be INADDR_ANY)
|
||||
// unGamePort - The port which the server is listening for client connections on
|
||||
// unSpectatorPort - the port on which spectators can join to observe the server, 0 if spectating is not supported
|
||||
// usQueryPort - The port which the ISteamMasterServerUpdater API should use in order to listen for matchmaking requests
|
||||
// pchGameDir - A unique string identifier for your game
|
||||
// pchVersion - The current version of the server as a string like 1.0.0.0
|
||||
// bLanMode - Is this a LAN only server?
|
||||
//
|
||||
// bugbug jmccaskey - figure out how to remove this from the API and only expose via SteamGameServer_Init... or make this actually used,
|
||||
// and stop calling it in SteamGameServer_Init()?
|
||||
virtual bool BSetServerType( int32 nGameAppId, uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort,
|
||||
uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode ) = 0;
|
||||
|
||||
// Updates server status values which shows up in the server browser and matchmaking APIs
|
||||
virtual void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers,
|
||||
const char *pchServerName, const char *pSpectatorServerName,
|
||||
const char *pchMapName ) = 0;
|
||||
|
||||
// This can be called if spectator goes away or comes back (passing 0 means there is no spectator server now).
|
||||
virtual void UpdateSpectatorPort( uint16 unSpectatorPort ) = 0;
|
||||
|
||||
// Sets a string defining the "gametype" for this server, this is optional, but if it is set
|
||||
// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||
virtual void SetGameType( const char *pchGameType ) = 0;
|
||||
|
||||
// Ask if a user has a specific achievement for this game, will get a callback on reply
|
||||
virtual bool BGetUserAchievementStatus( CSteamID steamID, const char *pchAchievementName ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer004"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unServerFlagNone = 0x00;
|
||||
const uint32 k_unServerFlagActive = 0x01; // server has users playing
|
||||
const uint32 k_unServerFlagSecure = 0x02; // server wants to be secure
|
||||
const uint32 k_unServerFlagDedicated = 0x04; // server is dedicated
|
||||
const uint32 k_unServerFlagLinux = 0x08; // linux build
|
||||
const uint32 k_unServerFlagPassworded = 0x10; // password protected
|
||||
const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and
|
||||
// won't enforce authentication of users that connect to the server.
|
||||
// Useful when you run a server where the clients may not
|
||||
// be connected to the internet but you want them to play (i.e LANs)
|
||||
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
// client has been approved to connect to this game server
|
||||
struct GSClientApprove_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 1 };
|
||||
CSteamID m_SteamID;
|
||||
};
|
||||
|
||||
|
||||
// client has been denied to connection to this game server
|
||||
struct GSClientDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 2 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
char m_rgchOptionalText[128];
|
||||
};
|
||||
|
||||
|
||||
// request the game server should kick the user
|
||||
struct GSClientKick_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 3 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
};
|
||||
|
||||
// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks,
|
||||
// do not reuse them here.
|
||||
|
||||
// client achievement info
|
||||
struct GSClientAchievementStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 6 };
|
||||
uint64 m_SteamID;
|
||||
char m_pchAchievement[128];
|
||||
bool m_bUnlocked;
|
||||
};
|
||||
|
||||
|
||||
// received when the game server requests to be displayed as secure (VAC protected)
|
||||
// m_bSecure is true if the game server should display itself as secure to users, false otherwise
|
||||
struct GSPolicyResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 15 };
|
||||
uint8 m_bSecure;
|
||||
};
|
||||
|
||||
#endif // ISTEAMGAMESERVER_H
|
||||
103
res/steamworks/100/headers/isteammasterserverupdater.h
Normal file
103
res/steamworks/100/headers/isteammasterserverupdater.h
Normal file
@@ -0,0 +1,103 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for retrieving list of game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMASTERSERVERUPDATER_H
|
||||
#define ISTEAMMASTERSERVERUPDATER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Game engines use this to tell the Steam master servers
|
||||
// about their games so their games can show up in the server browser.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMasterServerUpdater
|
||||
{
|
||||
public:
|
||||
|
||||
// Call this as often as you like to tell the master server updater whether or not
|
||||
// you want it to be active (default: off).
|
||||
virtual void SetActive( bool bActive ) = 0;
|
||||
|
||||
// You usually don't need to modify this.
|
||||
// Pass -1 to use the default value for iHeartbeatInterval.
|
||||
// Some mods change this.
|
||||
virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0;
|
||||
|
||||
|
||||
// These are in GameSocketShare mode, where instead of ISteamMasterServerUpdater creating its own
|
||||
// socket to talk to the master server on, it lets the game use its socket to forward messages
|
||||
// back and forth. This prevents us from requiring server ops to open up yet another port
|
||||
// in their firewalls.
|
||||
//
|
||||
// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001
|
||||
|
||||
// These are used when you've elected to multiplex the game server's UDP socket
|
||||
// rather than having the master server updater use its own sockets.
|
||||
//
|
||||
// Source games use this to simplify the job of the server admins, so they
|
||||
// don't have to open up more ports on their firewalls.
|
||||
|
||||
// Call this when a packet that starts with 0xFFFFFFFF comes in. That means
|
||||
// it's for us.
|
||||
virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0;
|
||||
|
||||
// AFTER calling HandleIncomingPacket for any packets that came in that frame, call this.
|
||||
// This gets a packet that the master server updater needs to send out on UDP.
|
||||
// It returns the length of the packet it wants to send, or 0 if there are no more packets to send.
|
||||
// Call this each frame until it returns 0.
|
||||
virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0;
|
||||
|
||||
|
||||
// Functions to set various fields that are used to respond to queries.
|
||||
|
||||
// Call this to set basic data that is passed to the server browser.
|
||||
virtual void SetBasicServerData(
|
||||
unsigned short nProtocolVersion,
|
||||
bool bDedicatedServer,
|
||||
const char *pRegionName,
|
||||
const char *pProductName,
|
||||
unsigned short nMaxReportedClients,
|
||||
bool bPasswordProtected,
|
||||
const char *pGameDescription ) = 0;
|
||||
|
||||
// Call this to clear the whole list of key/values that are sent in rules queries.
|
||||
virtual void ClearAllKeyValues() = 0;
|
||||
|
||||
// Call this to add/update a key/value pair.
|
||||
virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
|
||||
// You can call this upon shutdown to clear out data stored for this game server and
|
||||
// to tell the master servers that this server is going away.
|
||||
virtual void NotifyShutdown() = 0;
|
||||
|
||||
// Returns true if the master server has requested a restart.
|
||||
// Only returns true once per request.
|
||||
virtual bool WasRestartRequested() = 0;
|
||||
|
||||
// Force it to request a heartbeat from the master servers.
|
||||
virtual void ForceHeartbeat() = 0;
|
||||
|
||||
// Manually edit and query the master server list.
|
||||
// It will provide name resolution and use the default master server port if none is provided.
|
||||
virtual bool AddMasterServer( const char *pServerAddress ) = 0;
|
||||
virtual bool RemoveMasterServer( const char *pServerAddress ) = 0;
|
||||
|
||||
virtual int GetNumMasterServers() = 0;
|
||||
|
||||
// Returns the # of bytes written to pOut.
|
||||
virtual int GetMasterServerAddress( int iServer, char *pOut, int outBufferSize ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMMASTERSERVERUPDATER_INTERFACE_VERSION "SteamMasterServerUpdater001"
|
||||
|
||||
#endif // ISTEAMMASTERSERVERUPDATER_H
|
||||
477
res/steamworks/100/headers/isteammatchmaking.h
Normal file
477
res/steamworks/100/headers/isteammatchmaking.h
Normal file
@@ -0,0 +1,477 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing game server/client match making
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMATCHMAKING
|
||||
#define ISTEAMMATCHMAKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
#include "matchmakingtypes.h"
|
||||
#include "isteamclient.h"
|
||||
#include "isteamfriends.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to favorites
|
||||
// and to operate on game lobbies.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmaking
|
||||
{
|
||||
public:
|
||||
// game server favorites storage
|
||||
// saves basic details about a multiplayer game server locally
|
||||
|
||||
// returns the number of favorites servers the user has stored
|
||||
virtual int GetFavoriteGameCount() = 0;
|
||||
|
||||
// returns the details of the game server
|
||||
// iGame is of range [0,GetFavoriteGameCount())
|
||||
// *pnIP, *pnConnPort are filled in the with IP:port of the game server
|
||||
// *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections
|
||||
// *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added
|
||||
virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0;
|
||||
|
||||
// adds the game server to the local list; updates the time played of the server if it already exists in the list
|
||||
virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0;
|
||||
|
||||
// removes the game server from the local storage; returns true if one was removed
|
||||
virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0;
|
||||
|
||||
///////
|
||||
// Game lobby functions
|
||||
|
||||
// Get a list of relevant lobbies
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyMatchList_t callback, with the number of servers requested
|
||||
// if the user is not currently connected to Steam (i.e. SteamUser()->BLoggedOn() returns false) then
|
||||
// a LobbyMatchList_t callback will be posted immediately with no servers
|
||||
virtual void RequestLobbyList() = 0;
|
||||
|
||||
// returns the CSteamID of a lobby, as retrieved by a RequestLobbyList call
|
||||
// should only be called after a LobbyMatchList_t callback is received
|
||||
// iLobby is of the range [0, LobbyMatchList_t::m_nLobbiesMatching)
|
||||
// the returned CSteamID::IsValid() will be false if iLobby is out of range
|
||||
virtual CSteamID GetLobbyByIndex( int iLobby ) = 0;
|
||||
|
||||
// Create a lobby on the Steam servers.
|
||||
// If bPrivate is true, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID
|
||||
// of the lobby will need to be communicated via game channels or via InviteUserToLobby()
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyCreated_t callback when the lobby has been created;
|
||||
// local user will the join the lobby, resulting in an additional LobbyEnter_t callback being sent
|
||||
// operations on the chat room can only proceed once the LobbyEnter_t has been received
|
||||
virtual void CreateLobby( bool bPrivate ) = 0;
|
||||
|
||||
// Joins an existing lobby
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyEnter_t callback when the lobby has been joined
|
||||
virtual void JoinLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Leave a lobby; this will take effect immediately on the client side
|
||||
// other users in the lobby will be notified by a LobbyChatUpdate_t callback
|
||||
virtual void LeaveLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Invite another user to the lobby
|
||||
// the target user will receive a LobbyInvite_t callback
|
||||
// will return true if the invite is successfully sent, whether or not the target responds
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0;
|
||||
|
||||
// Lobby iteration, for viewing details of users in a lobby
|
||||
// only accessible if the lobby user is a member of the specified lobby
|
||||
// persona information for other lobby members (name, avatar, etc.) will be asynchronously received
|
||||
// and accessible via ISteamFriends interface
|
||||
|
||||
// returns the number of users in the specified lobby
|
||||
virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0;
|
||||
// returns the CSteamID of a user in the lobby
|
||||
// iMember is of range [0,GetNumLobbyMembers())
|
||||
virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0;
|
||||
|
||||
// Get data associated with this lobby
|
||||
// takes a simple key, and returns the string associated with it
|
||||
// "" will be returned if no value is set, or if steamIDLobby is invalid
|
||||
virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0;
|
||||
// Sets a key/value pair in the lobby metadata
|
||||
// each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data
|
||||
// this can be used to set lobby names, map, etc.
|
||||
// to reset a key, just set it to ""
|
||||
// other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback
|
||||
virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// As above, but gets per-user data for someone in this lobby
|
||||
virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0;
|
||||
// Sets per-user metadata (for the local user implicitly)
|
||||
virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// Broadcasts a chat message to the all the users in the lobby
|
||||
// users in the lobby (including the local user) will receive a LobbyChatMsg_t callback
|
||||
// returns true if the message is successfully sent
|
||||
virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0;
|
||||
// Get a chat message as specified in a LobbyChatMsg_t callback
|
||||
// iChatID is the LobbyChatMsg_t::m_iChatID value in the callback
|
||||
// *pSteamIDUser is filled in with the CSteamID of the member
|
||||
// *pvData is filled in with the message itself
|
||||
// return value is the number of bytes written into the buffer
|
||||
virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0;
|
||||
|
||||
// Fetch metadata for a lobby you're not necessarily in right now
|
||||
// this will send down all the metadata associated with a lobby
|
||||
// this is an asynchronous call
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// sets the game server associated with the lobby
|
||||
// usually at this point, the users will leave the lobby and join the specified game server
|
||||
// either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect
|
||||
virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0;
|
||||
|
||||
};
|
||||
#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking002"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callback interfaces for server list functions (see ISteamMatchmakingServers below)
|
||||
//
|
||||
// The idea here is that your game code implements objects that implement these
|
||||
// interfaces to receive callback notifications after calling asynchronous functions
|
||||
// inside the ISteamMatchmakingServers() interface below.
|
||||
//
|
||||
// This is different than normal Steam callback handling due to the potentially
|
||||
// large size of server lists.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after a server list refresh
|
||||
// or an individual server update.
|
||||
//
|
||||
// Since you get these callbacks after requesting full list refreshes you will
|
||||
// usually implement this interface inside an object like CServerBrowser. If that
|
||||
// object is getting destructed you should use ISteamMatchMakingServers()->CancelQuery()
|
||||
// to cancel any in-progress queries so you don't get a callback into the destructed
|
||||
// object and crash.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServerListResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded ok with updated data
|
||||
virtual void ServerResponded( int iServer ) = 0;
|
||||
|
||||
// Server has failed to respond
|
||||
virtual void ServerFailedToRespond( int iServer ) = 0;
|
||||
|
||||
// A list refresh you had initiated is now 100% completed
|
||||
virtual void RefreshComplete( EMatchMakingServerResponse response ) = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after pinging an individual server
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PingServer() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPingResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded successfully and has updated data
|
||||
virtual void ServerResponded( gameserveritem_t &server ) = 0;
|
||||
|
||||
// Server failed to respond to the ping request
|
||||
virtual void ServerFailedToRespond() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting details on
|
||||
// who is playing on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPlayersResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a new player on the server -- you'll get this callback once per player
|
||||
// on the server which you have requested player data on.
|
||||
virtual void AddPlayerToList( const char *pchName, int nScore, float flTimePlayed ) = 0;
|
||||
|
||||
// The server failed to respond to the request for player details
|
||||
virtual void PlayersFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the player details request
|
||||
// (ie, you won't get anymore AddPlayerToList callbacks)
|
||||
virtual void PlayersRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting rules
|
||||
// details on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->ServerRules() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingRulesResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a rule on the server -- you'll get one of these per rule defined on
|
||||
// the server you are querying
|
||||
virtual void RulesResponded( const char *pchRule, const char *pchValue ) = 0;
|
||||
|
||||
// The server failed to respond to the request for rule details
|
||||
virtual void RulesFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the rule details request
|
||||
// (ie, you won't get anymore RulesResponded callbacks)
|
||||
virtual void RulesRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Typedef for handle type you will receive when querying details on an individual server.
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef int HServerQuery;
|
||||
const int HSERVERQUERY_INVALID = 0xffffffff;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to game lists and details
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServers
|
||||
{
|
||||
public:
|
||||
// Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values.
|
||||
virtual void RequestInternetServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFriendsServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFavoritesServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestHistoryServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestSpectatorServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Get details on a given server in the list, you can get the valid range of index
|
||||
// values by calling GetServerCount(). You will also receive index values in
|
||||
// ISteamMatchmakingServerListResponse::ServerResponded() callbacks
|
||||
virtual gameserveritem_t *GetServerDetails( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
// Cancel an request which is operation on the given list type. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above list request calls. Not doing so may result in a crash when a callback
|
||||
// occurs on the destructed object.
|
||||
virtual void CancelQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Ping every server in your list again but don't update the list of servers
|
||||
virtual void RefreshQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Returns true if the list is currently refreshing its server list
|
||||
virtual bool IsRefreshing( EMatchMakingType eType ) = 0;
|
||||
|
||||
// How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1
|
||||
virtual int GetServerCount( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Refresh a single server inside of a query (rather than all the servers )
|
||||
virtual void RefreshServer( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Queries to individual servers directly via IP/Port
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Request updated ping time and other details from a single server
|
||||
virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of players currently playing on a server
|
||||
virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of rules that the server is running (See ISteamMasterServerUpdater->SetKeyValue() to set the rules server side)
|
||||
virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above calls to avoid crashing when callbacks occur.
|
||||
virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0;
|
||||
};
|
||||
#define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "SteamMatchMakingServers001"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callbacks for ISteamMatchmaking which go through the regular Steam callback registration system
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unFavoriteFlagNone = 0x00;
|
||||
const uint32 k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list
|
||||
const uint32 k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: a server was added/removed from the favorites list, you should refresh now
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FavoritesListChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 2 };
|
||||
uint32 m_nIP; // an IP of 0 means reload the whole list, any other value means just one server
|
||||
uint32 m_nQueryPort;
|
||||
uint32 m_nConnPort;
|
||||
uint32 m_nAppID;
|
||||
uint32 m_nFlags;
|
||||
bool m_bAdd; // true if this is adding the entry, otherwise it is a remove
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Someone has invited you to join a Lobby
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyInvite_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 3 };
|
||||
|
||||
uint64 m_ulSteamIDUser; // Steam ID of the person making the invite
|
||||
uint64 m_ulSteamIDLobby; // Steam ID of the Lobby
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent on entering a Lobby
|
||||
// m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success,
|
||||
// or a higher value on failure (see enum EChatRoomEnterResponse)
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyEnter_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // SteamID of the Lobby you have entered
|
||||
uint32 m_rgfChatPermissions; // Permissions of the current user
|
||||
bool m_bLocked; // If true, then only invited users may join
|
||||
uint32 m_EChatRoomEnterResponse; // EChatRoomEnterResponse
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby metadata has changed
|
||||
// if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details
|
||||
// if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyDataUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 5 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // steamID of the Lobby
|
||||
uint64 m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby chat room state has changed
|
||||
// this is usually sent when a user has joined or left the lobby
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 6 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // Lobby ID
|
||||
uint64 m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient
|
||||
uint64 m_ulSteamIDMakingChange; // Chat member who made the change (different from SteamIDUserChange if kicking, muting, etc.)
|
||||
// for example, if one user kicks another from the lobby, this will be set to the id of the user who initiated the kick
|
||||
uint32 m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A chat message for this lobby has been sent
|
||||
// use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatMsg_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 7 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby id this is in
|
||||
uint64 m_ulSteamIDUser; // steamID of the user who has sent this message
|
||||
uint8 m_eChatEntryType; // type of message
|
||||
uint32 m_iChatID; // index of the chat entry to lookup
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A game created a game for all the members of the lobby to join,
|
||||
// as triggered by a SetLobbyGameServer()
|
||||
// it's up to the individual clients to take action on this; the usual
|
||||
// game behavior is to leave the lobby and connect to the specified game server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyGameCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 9 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby we were in
|
||||
uint64 m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members
|
||||
uint32 m_unIP; // IP & Port of the game server (if any)
|
||||
uint16 m_usPort;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Number of matching lobbies found
|
||||
// iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyMatchList_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 10 };
|
||||
uint32 m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when the lobby is being forcefully closed
|
||||
// lobby details functions will no longer be updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyClosing_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 11 };
|
||||
uint64 m_ulSteamIDLobby; // Lobby
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when the local user has been kicked from the lobby
|
||||
// lobby details functions will no longer be updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyKicked_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 12 };
|
||||
uint64 m_ulSteamIDLobby; // Lobby
|
||||
uint64 m_ulSteamIDAdmin; // User who kicked you
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Result of our request to create a Lobby
|
||||
// m_eResult == k_EResultOK on success
|
||||
// at this point, the local user may not have finishing joining this lobby;
|
||||
// game code should wait until the subsequent LobbyEnter_t callback is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 };
|
||||
EResult m_eResult; // Result
|
||||
uint64 m_ulSteamIDLobby; // chat room, zero if failed
|
||||
};
|
||||
|
||||
#endif // ISTEAMMATCHMAKING
|
||||
135
res/steamworks/100/headers/isteamnetworking.h
Normal file
135
res/steamworks/100/headers/isteamnetworking.h
Normal file
@@ -0,0 +1,135 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing network connections between game clients & servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMNETWORKING
|
||||
#define ISTEAMNETWORKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a socket
|
||||
typedef uint32 SNetSocket_t;
|
||||
typedef uint32 SNetListenSocket_t;
|
||||
|
||||
|
||||
// connection progress indicators
|
||||
enum ESNetSocketState
|
||||
{
|
||||
k_ESNetSocketStateInvalid = 0,
|
||||
|
||||
// communication is valid
|
||||
k_ESNetSocketStateConnected = 1,
|
||||
|
||||
// states while establishing a connection
|
||||
k_ESNetSocketStateInitiated = 10, // the connection state machine has started
|
||||
|
||||
// p2p connections
|
||||
k_ESNetSocketStateLocalCandidatesFound = 11, // we've found our local IP info
|
||||
k_ESNetSocketStateReceivedRemoteCandidates = 12,// we've received information from the remote machine, via the Steam back-end, about their IP info
|
||||
|
||||
// direct connections
|
||||
k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server
|
||||
|
||||
// failure states
|
||||
k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end
|
||||
k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown
|
||||
k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection
|
||||
k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us
|
||||
k_ESNetSocketStateConnectionBroken = 25, // connection has been broken; either the other end has disappeared or our local network connection has broke
|
||||
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for making connections and sending data between clients,
|
||||
// traversing NAT's where possible
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamNetworking
|
||||
{
|
||||
public:
|
||||
// creates a socket and listens others to connect
|
||||
// will trigger a SocketStatusCallback_t callback on another client connecting
|
||||
// nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports
|
||||
// this can usually just be 0 unless you want multiple sets of connections
|
||||
// unIP is the local IP address to bind to
|
||||
// pass in 0 if you just want the default local IP
|
||||
// unPort is the port to use
|
||||
// pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only
|
||||
virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort ) = 0;
|
||||
|
||||
// creates a socket and begin connection to a remote destination
|
||||
// can connect via a known steamID (client or game server), or directly to an IP
|
||||
// on success will trigger a SocketConnectCallback_t callback
|
||||
// on failure or timeout will trigger a SocketConnectionFailureCallback_t callback
|
||||
virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec ) = 0;
|
||||
virtual SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec ) = 0;
|
||||
|
||||
// disconnects the connection to the socket, if any, and invalidates the handle
|
||||
// any unread data on the socket will be thrown away
|
||||
// if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect
|
||||
virtual bool DestroySocket( SNetSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
// destroying a listen socket will automatically kill all the regular sockets generated from it
|
||||
virtual bool DestroyListenSocket( SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
|
||||
// sending data
|
||||
// must be a handle to a connected socket
|
||||
// data size cannot be more than 8k, although in UDP mode (default),
|
||||
// it's recommended packets be no larger than 1300 bytes
|
||||
// use the reliable flag with caution; although the resend rate is pretty aggressive,
|
||||
// it can still cause stalls in receiving data (like TCP)
|
||||
virtual bool SendDataOnSocket( SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable ) = 0;
|
||||
|
||||
// receiving data
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// checks for data from any socket that has been connected off this listen socket
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool IsDataAvailable( SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// retrieves data from any socket that has been connected off this listen socket
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// returns information about the specified socket, filling out the contents of the pointers
|
||||
virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote ) = 0;
|
||||
|
||||
// returns which local port the listen socket is bound to
|
||||
// *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only
|
||||
virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort ) = 0;
|
||||
|
||||
};
|
||||
#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking001"
|
||||
|
||||
|
||||
// callback notification - status of a socket has changed
|
||||
struct SocketStatusCallback_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 };
|
||||
SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host
|
||||
SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection
|
||||
CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one
|
||||
int m_eSNetSocketState; // socket state, ESNetSocketState
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMNETWORKING
|
||||
150
res/steamworks/100/headers/isteamuser.h
Normal file
150
res/steamworks/100/headers/isteamuser.h
Normal file
@@ -0,0 +1,150 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSER_H
|
||||
#define ISTEAMUSER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// structure that contains client callback data
|
||||
// see callbacks documentation for more details
|
||||
struct CallbackMsg_t
|
||||
{
|
||||
HSteamUser m_hSteamUser;
|
||||
int m_iCallback;
|
||||
uint8 *m_pubParam;
|
||||
int m_cubParam;
|
||||
};
|
||||
|
||||
// reference to a steam call, to filter results by
|
||||
typedef int32 HSteamCall;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing and manipulating a steam account
|
||||
// associated with one client instance
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUser
|
||||
{
|
||||
public:
|
||||
// returns the HSteamUser this interface represents
|
||||
// this is only used internally by the API, and by a few select interfaces that support multi-user
|
||||
virtual HSteamUser GetHSteamUser() = 0;
|
||||
|
||||
// returns true if the Steam client current has a live connection to the Steam servers.
|
||||
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
|
||||
// The Steam client will automatically be trying to recreate the connection as often as possible.
|
||||
virtual bool BLoggedOn() = 0;
|
||||
|
||||
// returns the CSteamID of the account currently logged into the Steam client
|
||||
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Multiplayer Authentication functions
|
||||
|
||||
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
|
||||
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
|
||||
//
|
||||
// Parameters:
|
||||
// void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.
|
||||
// int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
|
||||
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
|
||||
// CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )
|
||||
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
|
||||
// bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)
|
||||
//
|
||||
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
|
||||
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
|
||||
virtual int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, CGameID gameID, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
|
||||
|
||||
// notify of disconnect
|
||||
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
|
||||
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
|
||||
|
||||
// Legacy functions
|
||||
|
||||
// used by only a few games to track usage events
|
||||
virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
|
||||
|
||||
// legacy authentication support - need to be called if the game server rejects the user with a 'bad ticket' error
|
||||
// this is only needed under very specific circumstances
|
||||
virtual void RefreshSteam2Login() = 0;
|
||||
};
|
||||
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser009"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connections to the Steam back-end has been established
|
||||
// this means the Steam client now has a working connection to the Steam servers
|
||||
// usually this will have occurred before the game has launched, and should
|
||||
// only be seen if the user has dropped connection due to a networking issue
|
||||
// or a Steam server update
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersConnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 1 };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connection attempt has failed
|
||||
// this will occur periodically if the Steam client is not connected,
|
||||
// and has failed in it's retry to establish a connection
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServerConnectFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 2 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called if the client has lost connection to the Steam servers
|
||||
// real-time services will be disabled until a matching SteamServersConnected_t has been posted
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersDisconnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 3 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server,
|
||||
// which it may be in the process of or already connected to.
|
||||
// The game client should immediately disconnect upon receiving this message.
|
||||
// This can usually occur if the user doesn't have rights to play on the game server.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ClientGameServerDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 13 };
|
||||
|
||||
uint32 m_uAppID;
|
||||
uint32 m_unGameServerIP;
|
||||
uint16 m_usGameServerPort;
|
||||
uint16 m_bSecure;
|
||||
uint32 m_uReason;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks)
|
||||
// When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect.
|
||||
// This usually occurs in the rare event the Steam client has some kind of fatal error.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct CallbackPipeFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 17 };
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
98
res/steamworks/100/headers/isteamuserstats.h
Normal file
98
res/steamworks/100/headers/isteamuserstats.h
Normal file
@@ -0,0 +1,98 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSERSTATS_H
|
||||
#define ISTEAMUSERSTATS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// size limit on stat or achievement name
|
||||
const uint32 k_cchStatNameMax = 128;
|
||||
|
||||
class ISteamUserStats
|
||||
{
|
||||
public:
|
||||
|
||||
// Ask the server to send down this user's data and achievements for nGameID
|
||||
virtual bool RequestCurrentStats( ) = 0;
|
||||
|
||||
// Data accessors
|
||||
virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetStat( const char *pchName, float *pData ) = 0;
|
||||
|
||||
// Set / update data
|
||||
virtual bool SetStat( const char *pchName, int32 nData ) = 0;
|
||||
virtual bool SetStat( const char *pchName, float fData ) = 0;
|
||||
virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||
|
||||
// Achievement flag accessors
|
||||
virtual bool GetAchievement( const char *pchName, bool *pbAchieved ) = 0;
|
||||
virtual bool SetAchievement( const char *pchName ) = 0;
|
||||
virtual bool ClearAchievement( const char *pchName ) = 0;
|
||||
|
||||
// Store the current data on the server, will get a callback when set
|
||||
// And one callback for every new achievement
|
||||
virtual bool StoreStats( ) = 0;
|
||||
|
||||
// Achievement / GroupAchievement metadata
|
||||
|
||||
// Gets the icon of the achievement, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetAchievementIcon( const char *pchName ) = 0;
|
||||
// Get general attributes (display name / text, etc) for an Achievement
|
||||
virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0;
|
||||
|
||||
// Achievement progress - triggers an AchievementProgress callback, that is all.
|
||||
// Calling this w/ N out of N progress will NOT set the achievement, the game must still do that.
|
||||
virtual bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint32 nMaxProgress ) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION003"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the latests stats and achievements have been received
|
||||
// from the server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsReceived_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // Success / error fetching the stats
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the user stats for a game
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // success / error
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the achievements for a game, or an
|
||||
// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress
|
||||
// are zero, that means the achievement has been fully unlocked.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserAchievementStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 };
|
||||
|
||||
uint64 m_nGameID; // Game this is for
|
||||
bool m_bGroupAchievement; // if this is a "group" achievement
|
||||
char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement
|
||||
uint32 m_nCurProgress; // current progress towards the achievement
|
||||
uint32 m_nMaxProgress; // "out of" this many
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
77
res/steamworks/100/headers/isteamutils.h
Normal file
77
res/steamworks/100/headers/isteamutils.h
Normal file
@@ -0,0 +1,77 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to utility functions in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUTILS_H
|
||||
#define ISTEAMUTILS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to user independent utility functions
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUtils
|
||||
{
|
||||
public:
|
||||
// return the number of seconds since the user
|
||||
virtual uint32 GetSecondsSinceAppActive() = 0;
|
||||
virtual uint32 GetSecondsSinceComputerActive() = 0;
|
||||
|
||||
// the universe this client is connecting to
|
||||
virtual EUniverse GetConnectedUniverse() = 0;
|
||||
|
||||
// Steam server time - in PST, number of seconds since January 1, 1970 (i.e unix time)
|
||||
virtual uint32 GetServerRealTime() = 0;
|
||||
|
||||
// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
|
||||
// e.g "US" or "UK".
|
||||
virtual const char *GetIPCountry() = 0;
|
||||
|
||||
// returns true if the image exists, and valid sizes were filled out
|
||||
virtual bool GetImageSize( int iImage, uint32 *pnWidth, uint32 *pnHeight ) = 0;
|
||||
|
||||
// returns true if the image exists, and the buffer was successfully filled out
|
||||
// results are returned in RGBA format
|
||||
// the destination buffer size should be 4 * height * width * sizeof(char)
|
||||
virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0;
|
||||
|
||||
// returns the IP of the reporting server for valve - currently only used in Source engine games
|
||||
virtual bool GetCSERIPPort( uint32 *unIP, uint16 *usPort ) = 0;
|
||||
|
||||
// return the amount of battery power left in the current system in % [0..100], 255 for being on AC power
|
||||
virtual uint8 GetCurrentBatteryPower() = 0;
|
||||
|
||||
// returns the appID of the current process
|
||||
virtual uint32 GetAppID() = 0;
|
||||
};
|
||||
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils002"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The country of the user changed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct IPCountry_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 1 };
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LowBatteryPower_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 2 };
|
||||
uint8 m_nMinutesBatteryLeft;
|
||||
};
|
||||
|
||||
#endif // ISTEAMUTILS_H
|
||||
235
res/steamworks/100/headers/matchmakingtypes.h
Normal file
235
res/steamworks/100/headers/matchmakingtypes.h
Normal file
@@ -0,0 +1,235 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef MATCHMAKINGTYPES_H
|
||||
#define MATCHMAKINGTYPES_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
struct MatchMakingKeyValuePair_t
|
||||
{
|
||||
MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; }
|
||||
MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue )
|
||||
{
|
||||
strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only!
|
||||
strncpy( m_szValue, pchValue, sizeof(m_szValue) );
|
||||
}
|
||||
char m_szKey[ 256 ];
|
||||
char m_szValue[ 256 ];
|
||||
};
|
||||
|
||||
|
||||
enum EMatchMakingServerResponse
|
||||
{
|
||||
eServerResponded = 0,
|
||||
eServerFailedToRespond,
|
||||
eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match
|
||||
};
|
||||
|
||||
enum EMatchMakingType
|
||||
{
|
||||
eInternetServer = 0,
|
||||
eLANServer,
|
||||
eFriendsServer,
|
||||
eFavoritesServer,
|
||||
eHistoryServer,
|
||||
eSpectatorServer,
|
||||
eInvalidServer
|
||||
};
|
||||
|
||||
|
||||
// servernetadr_t is all the addressing info the serverbrowser needs to know about a game server,
|
||||
// namely: its IP, its connection port, and its query port.
|
||||
class servernetadr_t
|
||||
{
|
||||
public:
|
||||
|
||||
void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort );
|
||||
#ifdef NETADR_H
|
||||
void Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort );
|
||||
netadr_t& GetIPAndQueryPort();
|
||||
#endif
|
||||
|
||||
// Access the query port.
|
||||
uint16 GetQueryPort() const;
|
||||
void SetQueryPort( uint16 usPort );
|
||||
|
||||
// Access the connection port.
|
||||
uint16 GetConnectionPort() const;
|
||||
void SetConnectionPort( uint16 usPort );
|
||||
|
||||
// Access the IP
|
||||
uint32 GetIP() const;
|
||||
void SetIP( uint32 );
|
||||
|
||||
// This gets the 'a.b.c.d:port' string with the connection port (instead of the query port).
|
||||
const char *GetConnectionAddressString() const;
|
||||
const char *GetQueryAddressString() const;
|
||||
|
||||
// Comparison operators and functions.
|
||||
bool operator<(const servernetadr_t &netadr) const;
|
||||
void operator=( const servernetadr_t &that )
|
||||
{
|
||||
m_usConnectionPort = that.m_usConnectionPort;
|
||||
m_usQueryPort = that.m_usQueryPort;
|
||||
m_unIP = that.m_unIP;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
const char *ToString( uint32 unIP, uint16 usPort ) const;
|
||||
uint16 m_usConnectionPort; // (in HOST byte order)
|
||||
uint16 m_usQueryPort;
|
||||
uint32 m_unIP;
|
||||
};
|
||||
|
||||
|
||||
inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
m_unIP = ip;
|
||||
m_usQueryPort = usQueryPort;
|
||||
m_usConnectionPort = usConnectionPort;
|
||||
}
|
||||
|
||||
#ifdef NETADR_H
|
||||
inline void servernetadr_t::Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
Init( ipAndQueryPort.GetIP(), ipAndQueryPort.GetPort(), usConnectionPort );
|
||||
}
|
||||
|
||||
inline netadr_t& servernetadr_t::GetIPAndQueryPort()
|
||||
{
|
||||
static netadr_t netAdr;
|
||||
netAdr.SetIP( m_unIP );
|
||||
netAdr.SetPort( m_usQueryPort );
|
||||
return netAdr;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline uint16 servernetadr_t::GetQueryPort() const
|
||||
{
|
||||
return m_usQueryPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetQueryPort( uint16 usPort )
|
||||
{
|
||||
m_usQueryPort = usPort;
|
||||
}
|
||||
|
||||
inline uint16 servernetadr_t::GetConnectionPort() const
|
||||
{
|
||||
return m_usConnectionPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetConnectionPort( uint16 usPort )
|
||||
{
|
||||
m_usConnectionPort = usPort;
|
||||
}
|
||||
|
||||
inline uint32 servernetadr_t::GetIP() const
|
||||
{
|
||||
return m_unIP;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetIP( uint32 unIP )
|
||||
{
|
||||
m_unIP = unIP;
|
||||
}
|
||||
|
||||
inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const
|
||||
{
|
||||
static char s[4][64];
|
||||
static int nBuf = 0;
|
||||
unsigned char *ipByte = (unsigned char *)&unIP;
|
||||
_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
|
||||
const char *pchRet = s[nBuf];
|
||||
++nBuf;
|
||||
nBuf %= ( (sizeof(s)/sizeof(s[0])) );
|
||||
return pchRet;
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetConnectionAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usConnectionPort );
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetQueryAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usQueryPort );
|
||||
}
|
||||
|
||||
inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const
|
||||
{
|
||||
return ( m_unIP < netadr.m_unIP ) || ( m_unIP == netadr.m_unIP && m_usQueryPort < netadr.m_usQueryPort );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Data describing a single server
|
||||
//-----------------------------------------------------------------------------
|
||||
class gameserveritem_t
|
||||
{
|
||||
public:
|
||||
gameserveritem_t();
|
||||
|
||||
const char* GetName() const;
|
||||
void SetName( const char *pName );
|
||||
|
||||
public:
|
||||
servernetadr_t m_NetAdr; // IP/Query Port/Connection Port for this server
|
||||
int m_nPing; // current ping time in milliseconds
|
||||
bool m_bHadSuccessfulResponse; // server has responded successfully in the past
|
||||
bool m_bDoNotRefresh; // server is marked as not responding and should no longer be refreshed
|
||||
char m_szGameDir[32]; // current game directory
|
||||
char m_szMap[32]; // current map
|
||||
char m_szGameDescription[64]; // game description
|
||||
int m_nAppID; // Steam App ID of this server
|
||||
int m_nPlayers; // current number of players on the server
|
||||
int m_nMaxPlayers; // Maximum players that can join this server
|
||||
int m_nBotPlayers; // Number of bots (i.e simulated players) on this server
|
||||
bool m_bPassword; // true if this server needs a password to join
|
||||
bool m_bSecure; // Is this server protected by VAC
|
||||
uint32 m_ulTimeLastPlayed; // time (in unix time) when this server was last played on (for favorite/history servers)
|
||||
int m_nServerVersion; // server version as reported to Steam
|
||||
|
||||
private:
|
||||
char m_szServerName[64]; // Game server name
|
||||
|
||||
// For data added after SteamMatchMaking001 add it here
|
||||
public:
|
||||
char m_szGameTags[128]; // the tags this server exposes
|
||||
};
|
||||
|
||||
|
||||
inline gameserveritem_t::gameserveritem_t()
|
||||
{
|
||||
m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0;
|
||||
m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false;
|
||||
m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0;
|
||||
m_szGameTags[0] = 0;
|
||||
}
|
||||
|
||||
inline const char* gameserveritem_t::GetName() const
|
||||
{
|
||||
// Use the IP address as the name if nothing is set yet.
|
||||
if ( m_szServerName[0] == 0 )
|
||||
return m_NetAdr.GetConnectionAddressString();
|
||||
else
|
||||
return m_szServerName;
|
||||
}
|
||||
|
||||
inline void gameserveritem_t::SetName( const char *pName )
|
||||
{
|
||||
strncpy( m_szServerName, pName, sizeof( m_szServerName ) );
|
||||
}
|
||||
|
||||
|
||||
#endif // MATCHMAKINGTYPES_H
|
||||
308
res/steamworks/100/headers/steam_api.h
Normal file
308
res/steamworks/100/headers/steam_api.h
Normal file
@@ -0,0 +1,308 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_API_H
|
||||
#define STEAM_API_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "isteamuser.h"
|
||||
#include "isteamfriends.h"
|
||||
#include "isteamutils.h"
|
||||
#include "isteammatchmaking.h"
|
||||
#include "isteamuserstats.h"
|
||||
#include "isteamapps.h"
|
||||
#include "isteamnetworking.h"
|
||||
|
||||
// Steam API export macro
|
||||
#if defined( _WIN32 ) && !defined( _X360 )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __declspec( dllexport )
|
||||
#elif defined( STEAM_API_NODLL )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C" __declspec( dllimport )
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#elif defined( _LINUX )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#else // !WIN32
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// Steam API setup & shutdown
|
||||
//
|
||||
// These functions manage loading, initializing and shutdown of the steamclient.dll
|
||||
//
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// S_API void SteamAPI_Init(); (see below)
|
||||
S_API void SteamAPI_Shutdown();
|
||||
|
||||
// crash dump recording functions
|
||||
S_API void SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID );
|
||||
S_API void SteamAPI_SetMiniDumpComment( const char *pchMsg );
|
||||
|
||||
// interface pointers, configured by SteamAPI_Init()
|
||||
S_API ISteamClient *SteamClient();
|
||||
|
||||
|
||||
//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES is usually not necessary, but it provides safety against releasing
|
||||
// new steam_api.dll's without recompiling/rereleasing modules that use it.
|
||||
//
|
||||
// If you use VERSION_SAFE_STEAM_API_INTERFACES, then you should call SteamAPI_InitSafe(). Also, to get the
|
||||
// Steam interfaces, you must create and Init() a CSteamAPIContext (below) and use the interfaces in there.
|
||||
//
|
||||
// If you don't use VERSION_SAFE_STEAM_API_INTERFACES, then you can use SteamAPI_Init() and the SteamXXXX()
|
||||
// functions below to get at the Steam interfaces.
|
||||
//
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamAPI_InitSafe();
|
||||
#else
|
||||
S_API bool SteamAPI_Init();
|
||||
|
||||
S_API ISteamUser *SteamUser();
|
||||
S_API ISteamFriends *SteamFriends();
|
||||
S_API ISteamUtils *SteamUtils();
|
||||
S_API ISteamMatchmaking *SteamMatchmaking();
|
||||
S_API ISteamUserStats *SteamUserStats();
|
||||
S_API ISteamApps *SteamApps();
|
||||
S_API ISteamNetworking *SteamNetworking();
|
||||
S_API ISteamMatchmakingServers *SteamMatchmakingServers();
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steam callback helper functions
|
||||
//
|
||||
// The following classes/macros are used to be able to easily multiplex callbacks
|
||||
// from the Steam API into various objects in the app in a thread-safe manner
|
||||
//
|
||||
// These functors are triggered via the SteamAPI_RunCallbacks() function, mapping the callback
|
||||
// to as many functions/objects as are registered to it
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API void SteamAPI_RunCallbacks();
|
||||
|
||||
|
||||
|
||||
// functions used by the utility CCallback objects to receive callbacks
|
||||
S_API void SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback );
|
||||
S_API void SteamAPI_UnregisterCallback( class CCallbackBase *pCallback );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: base for callbacks,
|
||||
// used only by CCallback, shouldn't be used directly
|
||||
//-----------------------------------------------------------------------------
|
||||
class CCallbackBase
|
||||
{
|
||||
public:
|
||||
CCallbackBase() { m_nCallbackFlags = 0; }
|
||||
// don't add a virtual destructor because we export this binary interface across dll's
|
||||
virtual void Run( void *pvParam ) = 0;
|
||||
|
||||
protected:
|
||||
enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 };
|
||||
uint8 m_nCallbackFlags;
|
||||
private:
|
||||
int m_iCallback;
|
||||
friend class CCallbackMgr;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: maps a steam callback to a class member function
|
||||
// template params: T = local class, P = parameter struct
|
||||
//-----------------------------------------------------------------------------
|
||||
template< class T, class P, bool bGameServer >
|
||||
class CCallback : private CCallbackBase
|
||||
{
|
||||
public:
|
||||
typedef void (T::*func_t)( P* );
|
||||
|
||||
// If you can't support constructing a callback with the correct parameters
|
||||
// then uncomment the empty constructor below and manually call
|
||||
// ::Register() for your object
|
||||
//CCallback() {}
|
||||
|
||||
// constructor for initializing this object in owner's constructor
|
||||
CCallback( T *pObj, func_t func ) : m_pObj( pObj ), m_Func( func )
|
||||
{
|
||||
if ( bGameServer )
|
||||
{
|
||||
m_nCallbackFlags |= k_ECallbackFlagsGameServer;
|
||||
}
|
||||
|
||||
Register( pObj, func );
|
||||
}
|
||||
|
||||
~CCallback()
|
||||
{
|
||||
SteamAPI_UnregisterCallback( this );
|
||||
}
|
||||
|
||||
// manual registration of the callback
|
||||
void Register( T *pObj, func_t func )
|
||||
{
|
||||
m_pObj = pObj;
|
||||
m_Func = func;
|
||||
SteamAPI_RegisterCallback( this, P::k_iCallback );
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
|
||||
T *m_pObj;
|
||||
func_t m_Func;
|
||||
};
|
||||
|
||||
|
||||
// utility macro for declaring the function and callback object together
|
||||
#define STEAM_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, false > var; void func( param *pParam )
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
// disable this warning; this pattern need for steam callback registration
|
||||
#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// pumps out all the steam messages, calling the register callback
|
||||
S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks );
|
||||
|
||||
// register the callback funcs to use to interact with the steam dll
|
||||
S_API void Steam_RegisterInterfaceFuncs( void *hModule );
|
||||
|
||||
// returns the HSteamUser of the last user to dispatch a callback
|
||||
S_API HSteamUser Steam_GetHSteamUserCurrent();
|
||||
|
||||
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name
|
||||
S_API const char *SteamAPI_GetSteamInstallPath();
|
||||
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamPipe GetHSteamPipe();
|
||||
S_API HSteamUser GetHSteamUser();
|
||||
|
||||
class CSteamAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamUser* SteamUser() { return m_pSteamUser; }
|
||||
ISteamFriends* SteamFriends() { return m_pSteamFriends; }
|
||||
ISteamUtils* SteamUtils() { return m_pSteamUtils; }
|
||||
ISteamMatchmaking* SteamMatchmaking() { return m_pSteamMatchmaking; }
|
||||
ISteamUserStats* SteamUserStats() { return m_pSteamUserStats; }
|
||||
ISteamApps* SteamApps() { return m_pSteamApps; }
|
||||
ISteamMatchmakingServers* SteamMatchmakingServers() { return m_pSteamMatchmakingServers; }
|
||||
ISteamNetworking* SteamNetworking() { return m_pSteamNetworking; }
|
||||
|
||||
private:
|
||||
ISteamUser *m_pSteamUser;
|
||||
ISteamFriends *m_pSteamFriends;
|
||||
ISteamUtils *m_pSteamUtils;
|
||||
ISteamMatchmaking *m_pSteamMatchmaking;
|
||||
ISteamUserStats *m_pSteamUserStats;
|
||||
ISteamApps *m_pSteamApps;
|
||||
ISteamMatchmakingServers *m_pSteamMatchmakingServers;
|
||||
ISteamNetworking *m_pSteamNetworking;
|
||||
};
|
||||
|
||||
inline CSteamAPIContext::CSteamAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamAPIContext::Clear()
|
||||
{
|
||||
m_pSteamUser = NULL;
|
||||
m_pSteamFriends = NULL;
|
||||
m_pSteamUtils = NULL;
|
||||
m_pSteamMatchmaking = NULL;
|
||||
m_pSteamUserStats = NULL;
|
||||
m_pSteamApps = NULL;
|
||||
m_pSteamMatchmakingServers = NULL;
|
||||
m_pSteamNetworking = NULL;
|
||||
}
|
||||
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamAPIContext::Init()
|
||||
{
|
||||
if ( !SteamClient() )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = GetHSteamPipe();
|
||||
|
||||
m_pSteamUser = SteamClient()->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUser )
|
||||
return false;
|
||||
|
||||
m_pSteamFriends = SteamClient()->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamFriends )
|
||||
return false;
|
||||
|
||||
m_pSteamUtils = SteamClient()->GetISteamUtils( hSteamUser, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmaking = SteamClient()->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmaking )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmakingServers = SteamClient()->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmakingServers )
|
||||
return false;
|
||||
|
||||
m_pSteamUserStats = SteamClient()->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUserStats )
|
||||
return false;
|
||||
|
||||
m_pSteamApps = SteamClient()->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamApps )
|
||||
return false;
|
||||
|
||||
m_pSteamNetworking = SteamClient()->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamNetworking )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
#endif // STEAM_API_H
|
||||
45
res/steamworks/100/headers/steam_gameserver.h
Normal file
45
res/steamworks/100/headers/steam_gameserver.h
Normal file
@@ -0,0 +1,45 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_GAMESERVER_H
|
||||
#define STEAM_GAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api.h"
|
||||
#include "isteamgameserver.h"
|
||||
#include "isteammasterserverupdater.h"
|
||||
|
||||
enum EServerMode
|
||||
{
|
||||
eServerModeNoAuthentication = 1, // Don't authenticate user logins and don't list on the server list
|
||||
eServerModeAuthentication = 2, // Authenticate users, list on the server list, don't run VAC on clients that connect
|
||||
eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients
|
||||
};
|
||||
|
||||
// Note: if you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it will use "GameSocketShare" mode,
|
||||
// which means that the game is responsible for sending and receiving UDP packets for the master
|
||||
// server updater. See references to GameSocketShare in isteammasterserverupdater.h.
|
||||
//
|
||||
// Pass 0 for usGamePort or usSpectatorPort if you're not using that. Then, the master server updater will report
|
||||
// what's running based on that.
|
||||
S_API bool SteamGameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, int nGameAppId, const char *pchGameDir, const char *pchVersionString );
|
||||
S_API void SteamGameServer_Shutdown();
|
||||
S_API void SteamGameServer_RunCallbacks();
|
||||
|
||||
S_API bool SteamGameServer_BSecure();
|
||||
S_API uint64 SteamGameServer_GetSteamID();
|
||||
|
||||
S_API ISteamGameServer *SteamGameServer();
|
||||
S_API ISteamUtils *SteamGameServerUtils();
|
||||
S_API ISteamMasterServerUpdater *SteamMasterServerUpdater();
|
||||
S_API ISteamNetworking *SteamGameServerNetworking();
|
||||
|
||||
#define STEAM_GAMESERVER_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, true > var; void func( param *pParam )
|
||||
|
||||
|
||||
#endif // STEAM_GAMESERVER_H
|
||||
732
res/steamworks/100/headers/steamclientpublic.h
Normal file
732
res/steamworks/100/headers/steamclientpublic.h
Normal file
@@ -0,0 +1,732 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMCLIENTPUBLIC_H
|
||||
#define STEAMCLIENTPUBLIC_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
//lint -save -e1931 -e1927 -e1924 -e613 -e726
|
||||
|
||||
// This header file defines the interface between the calling application and the code that
|
||||
// knows how to communicate with the connection manager (CM) from the Steam service
|
||||
|
||||
// This header file is intended to be portable; ideally this 1 header file plus a lib or dll
|
||||
// is all you need to integrate the client library into some other tree. So please avoid
|
||||
// including or requiring other header files if possible. This header should only describe the
|
||||
// interface layer, no need to include anything about the implementation.
|
||||
|
||||
#include "steamtypes.h"
|
||||
|
||||
|
||||
// General result codes
|
||||
enum EResult
|
||||
{
|
||||
k_EResultOK = 1, // success
|
||||
k_EResultFail = 2, // generic failure
|
||||
k_EResultNoConnection = 3, // no/failed network connection
|
||||
// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed
|
||||
k_EResultInvalidPassword = 5, // password/ticket is invalid
|
||||
k_EResultLoggedInElsewhere = 6, // same user logged in elsewhere
|
||||
k_EResultInvalidProtocolVer = 7, // protocol version is incorrect
|
||||
k_EResultInvalidParam = 8, // a parameter is incorrect
|
||||
k_EResultFileNotFound = 9, // file was not found
|
||||
k_EResultBusy = 10, // called method busy - action not taken
|
||||
k_EResultInvalidState = 11, // called object was in an invalid state
|
||||
k_EResultInvalidName = 12, // name is invalid
|
||||
k_EResultInvalidEmail = 13, // email is invalid
|
||||
k_EResultDuplicateName = 14, // name is not unique
|
||||
k_EResultAccessDenied = 15, // access is denied
|
||||
k_EResultTimeout = 16, // operation timed out
|
||||
k_EResultBanned = 17, // VAC2 banned
|
||||
k_EResultAccountNotFound = 18, // account not found
|
||||
k_EResultInvalidSteamID = 19, // steamID is invalid
|
||||
k_EResultServiceUnavailable = 20, // The requested service is currently unavailable
|
||||
k_EResultNotLoggedOn = 21, // The user is not logged on
|
||||
k_EResultPending = 22, // Request is pending (may be in process, or waiting on third party)
|
||||
k_EResultEncryptionFailure = 23, // Encryption or Decryption failed
|
||||
k_EResultInsufficientPrivilege = 24, // Insufficient privilege
|
||||
k_EResultLimitExceeded = 25, // Too much of a good thing
|
||||
k_EResultRevoked = 26, // Access has been revoked (used for revoked guest passes)
|
||||
k_EResultExpired = 27, // License/Guest pass the user is trying to access is expired
|
||||
k_EResultAlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again
|
||||
k_EResultDuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time
|
||||
k_EResultAlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user
|
||||
k_EResultIPNotFound = 31, // IP address not found
|
||||
k_EResultPersistFailed = 32, // failed to write change to the data store
|
||||
k_EResultLockingFailed = 33, // failed to acquire access lock for this operation
|
||||
k_EResultLogonSessionReplaced = 34,
|
||||
k_EResultConnectFailed = 35,
|
||||
k_EResultHandshakeFailed = 36,
|
||||
k_EResultIOFailure = 37,
|
||||
k_EResultRemoteDisconnect = 38,
|
||||
k_EResultShoppingCartNotFound = 39, // failed to find the shopping cart requested
|
||||
k_EResultBlocked = 40, // a user didn't allow it
|
||||
k_EResultIgnored = 41, // target is ignoring sender
|
||||
};
|
||||
|
||||
// Result codes to GSHandleClientDeny/Kick
|
||||
typedef enum
|
||||
{
|
||||
k_EDenyInvalidVersion = 1,
|
||||
k_EDenyGeneric = 2,
|
||||
k_EDenyNotLoggedOn = 3,
|
||||
k_EDenyNoLicense = 4,
|
||||
k_EDenyCheater = 5,
|
||||
k_EDenyLoggedInElseWhere = 6,
|
||||
k_EDenyUnknownText = 7,
|
||||
k_EDenyIncompatibleAnticheat = 8,
|
||||
k_EDenyMemoryCorruption = 9,
|
||||
k_EDenyIncompatibleSoftware = 10,
|
||||
k_EDenySteamConnectionLost = 11,
|
||||
k_EDenySteamConnectionError = 12,
|
||||
k_EDenySteamResponseTimedOut = 13,
|
||||
k_EDenySteamValidationStalled = 14,
|
||||
} EDenyReason;
|
||||
|
||||
// Steam universes. Each universe is a self-contained Steam instance.
|
||||
enum EUniverse
|
||||
{
|
||||
k_EUniverseInvalid = 0,
|
||||
k_EUniversePublic = 1,
|
||||
k_EUniverseBeta = 2,
|
||||
k_EUniverseInternal = 3,
|
||||
k_EUniverseDev = 4,
|
||||
k_EUniverseRC = 5,
|
||||
|
||||
k_EUniverseMax
|
||||
};
|
||||
|
||||
// Steam account types
|
||||
enum EAccountType
|
||||
{
|
||||
k_EAccountTypeInvalid = 0,
|
||||
k_EAccountTypeIndividual = 1, // single user account
|
||||
k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account
|
||||
k_EAccountTypeGameServer = 3, // game server account
|
||||
k_EAccountTypeAnonGameServer = 4, // anonymous game server account
|
||||
k_EAccountTypePending = 5, // pending
|
||||
k_EAccountTypeContentServer = 6, // content server
|
||||
k_EAccountTypeClan = 7,
|
||||
k_EAccountTypeChat = 8,
|
||||
k_EAccountTypeP2PSuperSeeder = 9, // a fake steamid used by superpeers to seed content to users of Steam P2P stuff
|
||||
k_EAccountTypeAnonUser = 10,
|
||||
|
||||
// Max of 16 items in this field
|
||||
k_EAccountTypeMax
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// types of user game stats fields
|
||||
// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ESteamUserStatType
|
||||
{
|
||||
k_ESteamUserStatTypeINVALID = 0,
|
||||
k_ESteamUserStatTypeINT = 1,
|
||||
k_ESteamUserStatTypeFLOAT = 2,
|
||||
// Read as FLOAT, set with count / session length
|
||||
k_ESteamUserStatTypeAVGRATE = 3,
|
||||
k_ESteamUserStatTypeACHIEVEMENTS = 4,
|
||||
k_ESteamUserStatTypeGROUPACHIEVEMENTS = 5,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Entry Types (previously was only friend-to-friend message types)
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatEntryType
|
||||
{
|
||||
k_EChatEntryTypeChatMsg = 1, // Normal text message from another user
|
||||
k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat)
|
||||
k_EChatEntryTypeInviteGame = 3, // Invite from other user into that users current game
|
||||
k_EChatEntryTypeEmote = 4, // text emote message
|
||||
k_EChatEntryTypeLobbyGameStart = 5, // lobby game is starting
|
||||
// Above are previous FriendMsgType entries, now merged into more generic chat entry types
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Room Enter Responses
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatRoomEnterResponse
|
||||
{
|
||||
k_EChatRoomEnterResponseSuccess = 1, // Success
|
||||
k_EChatRoomEnterResponseDoesntExist = 2, // Chat doesn't exist (probably closed)
|
||||
k_EChatRoomEnterResponseNotAllowed = 3, // General Denied - You don't have the permissions needed to join the chat
|
||||
k_EChatRoomEnterResponseFull = 4, // Chat room has reached its maximum size
|
||||
k_EChatRoomEnterResponseError = 5, // Unexpected Error
|
||||
k_EChatRoomEnterResponseBanned = 6, // You are banned from this chat room and may not join
|
||||
};
|
||||
|
||||
|
||||
typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath );
|
||||
typedef bool (*PFNLegacyKeyInstalled)();
|
||||
|
||||
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
// Steam ID structure (64 bits total)
|
||||
class CSteamID
|
||||
{
|
||||
public:
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID()
|
||||
{
|
||||
m_unAccountID = 0;
|
||||
m_EAccountType = k_EAccountTypeInvalid;
|
||||
m_EUniverse = k_EUniverseInvalid;
|
||||
m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
Set( unAccountID, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// unAccountInstance - instance
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
#if defined(_SERVER) && defined(Assert)
|
||||
Assert( ! ( ( k_EAccountTypeIndividual == eAccountType ) && ( 1 != unAccountInstance ) ) ); // enforce that for individual accounts, instance is always 1
|
||||
#endif // _SERVER
|
||||
InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
// Note: Will not accept a uint32 or int32 as input, as that is a probable mistake.
|
||||
// See the stubbed out overloads in the private: section for more info.
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint64 ulSteamID )
|
||||
{
|
||||
SetFromUint64( ulSteamID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void Set( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_unAccountID = unAccountID;
|
||||
m_EUniverse = eUniverse;
|
||||
m_EAccountType = eAccountType;
|
||||
m_unAccountInstance = 1;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void InstancedSet( uint32 unAccountID, uint32 unInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_unAccountID = unAccountID;
|
||||
m_EUniverse = eUniverse;
|
||||
m_EAccountType = eAccountType;
|
||||
m_unAccountInstance = unInstance;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 52 bit parts and universe/type
|
||||
// Input : ulIdentifier - 52 bits of goodness
|
||||
//-----------------------------------------------------------------------------
|
||||
void FullSet( uint64 ulIdentifier, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_unAccountID = ( ulIdentifier & 0xFFFFFFFF ); // account ID is low 32 bits
|
||||
m_unAccountInstance = ( ( ulIdentifier >> 32 ) & 0xFFFFF ); // account instance is next 20 bits
|
||||
m_EUniverse = eUniverse;
|
||||
m_EAccountType = eAccountType;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 64-bit representation
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromUint64( uint64 ulSteamID )
|
||||
{
|
||||
m_unAccountID = ( ulSteamID & 0xFFFFFFFF ); // account ID is low 32 bits
|
||||
m_unAccountInstance = ( ( ulSteamID >> 32 ) & 0xFFFFF ); // account instance is next 20 bits
|
||||
|
||||
m_EAccountType = ( EAccountType ) ( ( ulSteamID >> 52 ) & 0xF ); // type is next 4 bits
|
||||
m_EUniverse = ( EUniverse ) ( ( ulSteamID >> 56 ) & 0xFF ); // universe is next 8 bits
|
||||
}
|
||||
|
||||
|
||||
#if defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to convert
|
||||
// eUniverse - universe this ID belongs to
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromSteam2( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse )
|
||||
{
|
||||
m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 +
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits;
|
||||
m_EUniverse = eUniverse; // set the universe
|
||||
m_EAccountType = k_EAccountTypeIndividual; // Steam 2 accounts always map to account type of individual
|
||||
m_unAccountInstance = 1; // individual accounts always have an account instance ID of 1
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fills out a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to write to
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConvertToSteam2( TSteamGlobalUserID *pTSteamGlobalUserID ) const
|
||||
{
|
||||
// only individual accounts have any meaning in Steam 2, only they can be mapped
|
||||
// Assert( m_EAccountType == k_EAccountTypeIndividual );
|
||||
|
||||
pTSteamGlobalUserID->m_SteamInstanceID = 0;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits = m_unAccountID % 2;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits = m_unAccountID / 2;
|
||||
}
|
||||
#endif // defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts steam ID to its 64-bit representation
|
||||
// Output : 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 ConvertToUint64() const
|
||||
{
|
||||
return (uint64) ( ( ( (uint64) m_EUniverse ) << 56 ) + ( ( (uint64) m_EAccountType ) << 52 ) +
|
||||
( ( (uint64) m_unAccountInstance ) << 32 ) + m_unAccountID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts the static parts of a steam ID to a 64-bit representation.
|
||||
// For multiseat accounts, all instances of that account will have the
|
||||
// same static account key, so they can be grouped together by the static
|
||||
// account key.
|
||||
// Output : 64-bit static account key
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 GetStaticAccountKey() const
|
||||
{
|
||||
// note we do NOT include the account instance (which is a dynamic property) in the static account key
|
||||
return (uint64) ( ( ( (uint64) m_EUniverse ) << 56 ) + ((uint64) m_EAccountType << 52 ) + m_unAccountID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_unAccountID = 0;
|
||||
m_EAccountType = k_EAccountTypeAnonGameServer;
|
||||
m_EUniverse = eUniverse;
|
||||
m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonUserLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_unAccountID = 0;
|
||||
m_EAccountType = k_EAccountTypeAnonUser;
|
||||
m_EUniverse = eUniverse;
|
||||
m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous game server login that will be filled in?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BBlankAnonAccount() const
|
||||
{
|
||||
return m_unAccountID == 0 && BAnonAccount() && m_unAccountInstance == 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a game server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BGameServerAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeGameServer || m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a content server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BContentServerAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeContentServer;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a clan account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BClanAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeClan;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a chat account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BChatAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeChat;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an individual user account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BIndividualAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeIndividual;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous account?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BAnonAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeAnonUser || m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
|
||||
// simple accessors
|
||||
void SetAccountID( uint32 unAccountID ) { m_unAccountID = unAccountID; }
|
||||
uint32 GetAccountID() const { return m_unAccountID; }
|
||||
uint32 GetUnAccountInstance() const { return m_unAccountInstance; }
|
||||
EAccountType GetEAccountType() const { return ( EAccountType ) m_EAccountType; }
|
||||
EUniverse GetEUniverse() const { return m_EUniverse; }
|
||||
void SetEUniverse( EUniverse eUniverse ) { m_EUniverse = eUniverse; }
|
||||
bool IsValid() const { return ( m_EAccountType != k_EAccountTypeInvalid && m_EUniverse != k_EUniverseInvalid ); }
|
||||
|
||||
// this set of functions is hidden, will be moved out of class
|
||||
explicit CSteamID( const char *pchSteamID, EUniverse eDefaultUniverse = k_EUniverseInvalid );
|
||||
char * Render() const; // renders this steam ID to string
|
||||
static char * Render( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string
|
||||
|
||||
void SetFromString( const char *pchSteamID, EUniverse eDefaultUniverse );
|
||||
bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse );
|
||||
|
||||
bool operator==( const CSteamID &val ) const
|
||||
{
|
||||
return ( ( val.m_unAccountID == m_unAccountID ) && ( val.m_unAccountInstance == m_unAccountInstance )
|
||||
&& ( val.m_EAccountType == m_EAccountType ) && ( val.m_EUniverse == m_EUniverse ) );
|
||||
}
|
||||
|
||||
bool operator!=( const CSteamID &val ) const { return !operator==( val ); }
|
||||
bool operator<( const CSteamID &val ) const { return ConvertToUint64() < val.ConvertToUint64(); }
|
||||
bool operator>( const CSteamID &val ) const { return ConvertToUint64() > val.ConvertToUint64(); }
|
||||
|
||||
// DEBUG function
|
||||
bool BValidExternalSteamID() const;
|
||||
|
||||
private:
|
||||
// These are defined here to prevent accidental implicit conversion of a u32AccountID to a CSteamID.
|
||||
// If you get a compiler error about an ambiguous constructor/function then it may be because you're
|
||||
// passing a 32-bit int to a function that takes a CSteamID. You should explicitly create the SteamID
|
||||
// using the correct Universe and account Type/Instance values.
|
||||
CSteamID( uint32 );
|
||||
CSteamID( int32 );
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4201) // nameless union is nonstandard
|
||||
// 64 bits total
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
#endif
|
||||
uint32 m_unAccountID : 32; // unique account identifier
|
||||
unsigned int m_unAccountInstance : 20; // dynamic instance ID (used for multiseat type accounts only)
|
||||
unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference
|
||||
EUniverse m_EUniverse : 8; // universe this account belongs to
|
||||
#ifdef _WIN32
|
||||
};
|
||||
|
||||
uint64 m_unAll64Bits;
|
||||
};
|
||||
#pragma warning(pop) // no more anonymous unions until next time
|
||||
#endif
|
||||
};
|
||||
|
||||
const int k_unSteamAccountIDMask = 0xFFFFFFFF;
|
||||
const int k_unSteamAccountInstanceMask = 0x000FFFFF;
|
||||
|
||||
|
||||
// Special flags for Chat accounts - they go in the top 8 bits
|
||||
// of the steam ID's "instance", leaving 12 for the actual instances
|
||||
enum EChatSteamIDInstanceFlags
|
||||
{
|
||||
k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags
|
||||
|
||||
k_EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) >> 1, // top bit
|
||||
k_EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 2, // next one down, etc
|
||||
|
||||
// Max of 8 flags
|
||||
};
|
||||
|
||||
|
||||
// generic invalid CSteamID
|
||||
const CSteamID k_steamIDNil;
|
||||
|
||||
// This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol
|
||||
// to provide its steamID
|
||||
const CSteamID k_steamIDOutofDateGS( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
// This steamID comes from a user game connection to an sv_lan GS
|
||||
const CSteamID k_steamIDLanModeGS( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid );
|
||||
// This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized
|
||||
// its steam3 component and started logging on.
|
||||
const CSteamID k_steamIDNotInitYetGS( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
|
||||
|
||||
#ifdef STEAM
|
||||
// Returns the matching chat steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance
|
||||
CSteamID ChatIDFromSteamID( CSteamID &steamID );
|
||||
// Returns the matching clan steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance
|
||||
CSteamID ClanIDFromSteamID( CSteamID &steamID );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ChatIDFromClanID( CSteamID &steamIDClan );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ClanIDFromChatID( CSteamID &steamIDChat );
|
||||
|
||||
#endif // _STEAM
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: encapsulates an appID/modID pair
|
||||
//-----------------------------------------------------------------------------
|
||||
class CGameID
|
||||
{
|
||||
public:
|
||||
CGameID()
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
}
|
||||
|
||||
explicit CGameID( uint64 ulGameID )
|
||||
{
|
||||
m_ulGameID = ulGameID;
|
||||
}
|
||||
|
||||
explicit CGameID( int32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
explicit CGameID( uint32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
CGameID( uint32 nAppID, uint32 nModID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nModID = nModID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
}
|
||||
|
||||
// Hidden functions used only by Steam
|
||||
explicit CGameID( const char *pchGameID );
|
||||
char * Render() const; // renders this Game ID to string
|
||||
static char * Render( uint64 ulGameID ); // static method to render a uint64 representation of a Game ID to a string
|
||||
|
||||
// must include checksum_crc.h first to get this functionality
|
||||
#if defined( CHECKSUM_CRC_H )
|
||||
CGameID( uint32 nAppID, const char *pchModPath )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
|
||||
char rgchModDir[MAX_PATH];
|
||||
Q_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) );
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, rgchModDir, Q_strlen( rgchModDir ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
CGameID( const char *pchExePath, const char *pchAppName )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = 0;
|
||||
m_gameID.m_nType = k_EGameIDTypeShortcut;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, pchExePath, Q_strlen( pchExePath ) );
|
||||
CRC32_ProcessBuffer( &crc32, pchAppName, Q_strlen( pchAppName ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
#endif
|
||||
|
||||
void SetAsShortcut()
|
||||
{
|
||||
m_gameID.m_nAppID = 0;
|
||||
m_gameID.m_nType = k_EGameIDTypeShortcut;
|
||||
}
|
||||
|
||||
void SetAsP2PFile()
|
||||
{
|
||||
m_gameID.m_nAppID = 0;
|
||||
m_gameID.m_nType = k_EGameIDTypeP2P;
|
||||
}
|
||||
|
||||
uint64 ToUint64() const
|
||||
{
|
||||
return m_ulGameID;
|
||||
}
|
||||
|
||||
uint64 *GetUint64Ptr()
|
||||
{
|
||||
return &m_ulGameID;
|
||||
}
|
||||
|
||||
bool IsMod() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeGameMod );
|
||||
}
|
||||
|
||||
bool IsShortcut() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeShortcut );
|
||||
}
|
||||
|
||||
bool IsP2PFile() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeP2P );
|
||||
}
|
||||
|
||||
bool IsSteamApp() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeApp );
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint32 ModID() const
|
||||
{
|
||||
return m_gameID.m_nModID;
|
||||
}
|
||||
|
||||
uint32 AppID() const
|
||||
{
|
||||
return m_gameID.m_nAppID;
|
||||
}
|
||||
|
||||
bool operator == ( const CGameID &rhs ) const
|
||||
{
|
||||
return m_ulGameID == rhs.m_ulGameID;
|
||||
}
|
||||
|
||||
bool operator != ( const CGameID &rhs ) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
bool operator < ( const CGameID &rhs ) const
|
||||
{
|
||||
return ( m_ulGameID < rhs.m_ulGameID );
|
||||
}
|
||||
|
||||
bool IsValid() const
|
||||
{
|
||||
return ( m_ulGameID != 0 );
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
enum EGameIDType
|
||||
{
|
||||
k_EGameIDTypeApp = 0,
|
||||
k_EGameIDTypeGameMod = 1,
|
||||
k_EGameIDTypeShortcut = 2,
|
||||
k_EGameIDTypeP2P = 3,
|
||||
};
|
||||
|
||||
struct GameID_t
|
||||
{
|
||||
unsigned int m_nAppID : 24;
|
||||
unsigned int m_nType : 8;
|
||||
unsigned int m_nModID : 32;
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
uint64 m_ulGameID;
|
||||
GameID_t m_gameID;
|
||||
};
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
const int k_cchGameExtraInfoMax = 64;
|
||||
|
||||
|
||||
// Max number of credit cards stored for one account
|
||||
const int k_nMaxNumCardsPerAccount = 1;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constants used for query ports.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define QUERY_PORT_NOT_INITIALIZED 0xFFFF // We haven't asked the GS for this query port's actual value yet.
|
||||
#define QUERY_PORT_ERROR 0xFFFE // We were unable to get the query port for this server.
|
||||
|
||||
#endif // STEAMCLIENTPUBLIC_H
|
||||
85
res/steamworks/100/headers/steamtypes.h
Normal file
85
res/steamworks/100/headers/steamtypes.h
Normal file
@@ -0,0 +1,85 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMTYPES_H
|
||||
#define STEAMTYPES_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Steam-specific types. Defined here so this header file can be included in other code bases.
|
||||
#ifndef WCHARTYPES_H
|
||||
typedef unsigned char uint8;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(_WIN64)
|
||||
#define X64BITS
|
||||
#endif
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef signed char int8;
|
||||
|
||||
#if defined( _WIN32 )
|
||||
|
||||
typedef __int16 int16;
|
||||
typedef unsigned __int16 uint16;
|
||||
typedef __int32 int32;
|
||||
typedef unsigned __int32 uint32;
|
||||
typedef __int64 int64;
|
||||
typedef unsigned __int64 uint64;
|
||||
|
||||
#ifdef X64BITS
|
||||
typedef __int64 intp; // intp is an integer that can accomodate a pointer
|
||||
typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *)
|
||||
#else
|
||||
typedef __int32 intp;
|
||||
typedef unsigned __int32 uintp;
|
||||
#endif
|
||||
|
||||
#else // _WIN32
|
||||
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
#ifdef X64BITS
|
||||
typedef long long intp;
|
||||
typedef unsigned long long uintp;
|
||||
#else
|
||||
typedef int intp;
|
||||
typedef unsigned int uintp;
|
||||
#endif
|
||||
|
||||
#endif // else _WIN32
|
||||
|
||||
const int k_cubDigestSize = 20; // CryptoPP::SHA::DIGESTSIZE
|
||||
const int k_cubSaltSize = 8;
|
||||
|
||||
typedef uint8 SHADigest_t[ k_cubDigestSize ];
|
||||
typedef uint8 Salt_t[ k_cubSaltSize ];
|
||||
|
||||
typedef uint64 GID_t; // globally unique identifier
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 PackageId_t;
|
||||
const PackageId_t k_uPackageIdInvalid = 0xFFFFFFFF;
|
||||
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 AppId_t;
|
||||
const AppId_t k_uAppIdInvalid = 0xFFFFFFFF;
|
||||
|
||||
// RTime32
|
||||
// We use this 32 bit time representing real world time.
|
||||
// It offers 1 second resolution beginning on January 1, 1970 (Unix time)
|
||||
typedef uint32 RTime32;
|
||||
|
||||
#endif // STEAMTYPES_H
|
||||
32
res/steamworks/101/headers/isteamapps.h
Normal file
32
res/steamworks/101/headers/isteamapps.h
Normal file
@@ -0,0 +1,32 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to app data in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMAPPS_H
|
||||
#define ISTEAMAPPS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to app data
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamApps
|
||||
{
|
||||
public:
|
||||
virtual bool BIsSubscribed() = 0;
|
||||
virtual bool BIsLowViolence() = 0;
|
||||
virtual bool BIsCybercafe() = 0;
|
||||
virtual bool BIsVACBanned() = 0;
|
||||
virtual const char *GetCurrentGameLanguage() = 0;
|
||||
virtual const char *GetAvailableGameLanguages() = 0;
|
||||
|
||||
// only use this member if you need to check ownership of another game related to yours, a demo for example
|
||||
virtual bool BIsSubscribedApp( AppId_t appID ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION002"
|
||||
|
||||
#endif // ISTEAMAPPS_H
|
||||
146
res/steamworks/101/headers/isteamclient.h
Normal file
146
res/steamworks/101/headers/isteamclient.h
Normal file
@@ -0,0 +1,146 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: Main interface for loading and accessing Steamworks API's from the
|
||||
// Steam client.
|
||||
// For most uses, this code is wrapped inside of SteamAPI_Init()
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMCLIENT_H
|
||||
#define ISTEAMCLIENT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a communication pipe to the Steam client
|
||||
typedef int32 HSteamPipe;
|
||||
// handle to single instance of a steam user
|
||||
typedef int32 HSteamUser;
|
||||
// function prototype
|
||||
#ifdef _LINUX
|
||||
#define __cdecl
|
||||
#endif
|
||||
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
|
||||
|
||||
// interface predec
|
||||
class ISteamUser;
|
||||
class ISteamGameServer;
|
||||
class ISteamFriends;
|
||||
class ISteamUtils;
|
||||
class ISteamMatchmaking;
|
||||
class ISteamContentServer;
|
||||
class ISteamMasterServerUpdater;
|
||||
class ISteamMatchmakingServers;
|
||||
class ISteamUserStats;
|
||||
class ISteamApps;
|
||||
class ISteamNetworking;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Interface to creating a new steam instance, or to
|
||||
// connect to an existing steam instance, whether it's in a
|
||||
// different process or is local.
|
||||
//
|
||||
// For most scenarios this is all handled automatically via SteamAPI_Init().
|
||||
// You'll only need to use these interfaces if you have a more complex versioning scheme,
|
||||
// where you want to get different versions of the same interface in different dll's in your project.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamClient
|
||||
{
|
||||
public:
|
||||
// Creates a communication pipe to the Steam client
|
||||
virtual HSteamPipe CreateSteamPipe() = 0;
|
||||
|
||||
// Releases a previously created communications pipe
|
||||
virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// connects to an existing global user, failing if none exists
|
||||
// used by the game to coordinate with the steamUI
|
||||
virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// used by game servers, create a steam user that won't be shared with anyone else
|
||||
virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe ) = 0;
|
||||
|
||||
// removes an allocated user
|
||||
virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0;
|
||||
|
||||
// retrieves the ISteamUser interface associated with the handle
|
||||
virtual ISteamUser *GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// retrieves the ISteamGameServer interface associated with the handle
|
||||
virtual ISteamGameServer *GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// set the local IP and Port to bind to
|
||||
// this must be set before CreateLocalUser()
|
||||
virtual void SetLocalIPBinding( uint32 unIP, uint16 usPort ) = 0;
|
||||
|
||||
// returns the ISteamFriends interface
|
||||
virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamUtils interface
|
||||
virtual ISteamUtils *GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmaking interface
|
||||
virtual ISteamMatchmaking *GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamContentServer interface
|
||||
virtual ISteamContentServer *GetISteamContentServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMasterServerUpdater interface
|
||||
virtual ISteamMasterServerUpdater *GetISteamMasterServerUpdater( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmakingServers interface
|
||||
virtual ISteamMatchmakingServers *GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the a generic interface
|
||||
virtual void *GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// this needs to be called every frame to process matchmaking results
|
||||
// redundant if you're already calling SteamAPI_RunCallbacks()
|
||||
virtual void RunFrame() = 0;
|
||||
|
||||
// returns the number of IPC calls made since the last time this function was called
|
||||
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
||||
// Every IPC call is at minimum a thread context switch if not a process one so you want to rate
|
||||
// control how often you do them.
|
||||
virtual uint32 GetIPCCallCount() = 0;
|
||||
|
||||
// returns the ISteamUserStats interface
|
||||
virtual ISteamUserStats *GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns apps interface
|
||||
virtual ISteamApps *GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// networking
|
||||
virtual ISteamNetworking *GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// API warning handling
|
||||
// 'int' is the severity; 0 for msg, 1 for warning
|
||||
// 'const char *' is the text of the message
|
||||
// callbacks will occur directly after the API function is called that generated the warning or message
|
||||
virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient007"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Base values for callback identifiers, each callback must
|
||||
// have a unique ID.
|
||||
//-----------------------------------------------------------------------------
|
||||
enum { k_iSteamUserCallbacks = 100 };
|
||||
enum { k_iSteamGameServerCallbacks = 200 };
|
||||
enum { k_iSteamFriendsCallbacks = 300 };
|
||||
enum { k_iSteamBillingCallbacks = 400 };
|
||||
enum { k_iSteamMatchmakingCallbacks = 500 };
|
||||
enum { k_iSteamContentServerCallbacks = 600 };
|
||||
enum { k_iSteamUtilsCallbacks = 700 };
|
||||
enum { k_iClientFriendsCallbacks = 800 };
|
||||
enum { k_iClientUserCallbacks = 900 };
|
||||
enum { k_iSteamAppsCallbacks = 1000 };
|
||||
enum { k_iSteamUserStatsCallbacks = 1100 };
|
||||
enum { k_iSteamNetworkingCallbacks = 1200 };
|
||||
enum { k_iClientRemoteStorageCallbacks = 1300 };
|
||||
|
||||
|
||||
#endif // ISTEAMCLIENT_H
|
||||
200
res/steamworks/101/headers/isteamfriends.h
Normal file
200
res/steamworks/101/headers/isteamfriends.h
Normal file
@@ -0,0 +1,200 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to both friends list data and general information about users
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMFRIENDS_H
|
||||
#define ISTEAMFRIENDS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: set of relationships to other users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EFriendRelationship
|
||||
{
|
||||
k_EFriendRelationshipNone = 0,
|
||||
k_EFriendRelationshipBlocked = 1,
|
||||
k_EFriendRelationshipRequestRecipient = 2,
|
||||
k_EFriendRelationshipFriend = 3,
|
||||
k_EFriendRelationshipRequestInitiator = 4,
|
||||
k_EFriendRelationshipIgnored = 5,
|
||||
k_EFriendRelationshipIgnoredFriend = 6,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: list of states a friend can be in
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EPersonaState
|
||||
{
|
||||
k_EPersonaStateOffline = 0, // friend is not currently logged on
|
||||
k_EPersonaStateOnline = 1, // friend is logged on
|
||||
k_EPersonaStateBusy = 2, // user is on, but busy
|
||||
k_EPersonaStateAway = 3, // auto-away feature
|
||||
k_EPersonaStateSnooze = 4, // auto-away for a long time
|
||||
k_EPersonaStateMax,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: flags for enumerating friends list, or quickly checking a the relationship between users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum k_EFriendFlags
|
||||
{
|
||||
k_EFriendFlagNone = 0x00,
|
||||
k_EFriendFlagBlocked = 0x01,
|
||||
k_EFriendFlagFriendshipRequested = 0x02,
|
||||
k_EFriendFlagImmediate = 0x04, // "regular" friend
|
||||
k_EFriendFlagClanMember = 0x08,
|
||||
k_EFriendFlagOnGameServer = 0x10,
|
||||
// k_EFriendFlagHasPlayedWith = 0x20, // not currently used
|
||||
// k_EFriendFlagFriendOfFriend = 0x40, // not currently used
|
||||
k_EFriendFlagRequestingFriendship = 0x80,
|
||||
k_EFriendFlagRequestingInfo = 0x100,
|
||||
k_EFriendFlagIgnored = 0x200,
|
||||
k_EFriendFlagIgnoredFriend = 0x400,
|
||||
k_EFriendFlagAll = 0xFFFF,
|
||||
};
|
||||
|
||||
// maximum number of characters in a users name
|
||||
enum { k_cchPersonaNameMax = 128 };
|
||||
|
||||
// size limit on chat room or member metadata
|
||||
const uint32 k_cubChatMetadataMax = 8192;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to accessing information about individual users,
|
||||
// that can be a friend, in a group, on a game server or in a lobby with the local user
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamFriends
|
||||
{
|
||||
public:
|
||||
// returns the local players name - guaranteed to not be NULL.
|
||||
// this is the same name as on the users community profile page
|
||||
// this is stored in UTF-8 format
|
||||
// like all the other interface functions that return a char *, it's important that this pointer is not saved
|
||||
// off; it will eventually be free'd or re-allocated
|
||||
virtual const char *GetPersonaName() = 0;
|
||||
|
||||
// sets the player name, stores it on the server and publishes the changes to all friends who are online
|
||||
virtual void SetPersonaName( const char *pchPersonaName ) = 0;
|
||||
|
||||
// gets the status of the current user
|
||||
virtual EPersonaState GetPersonaState() = 0;
|
||||
|
||||
// friend iteration
|
||||
// takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria
|
||||
// then GetFriendByIndex() can then be used to return the id's of each of those users
|
||||
virtual int GetFriendCount( int iFriendFlags ) = 0;
|
||||
|
||||
// returns the steamID of a user
|
||||
// iFriend is a index of range [0, GetFriendCount())
|
||||
// iFriendsFlags must be the same value as used in GetFriendCount()
|
||||
// the returned CSteamID can then be used by all the functions below to access details about the user
|
||||
virtual CSteamID GetFriendByIndex( int iFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// returns a relationship to a user
|
||||
virtual EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the current status of the specified user
|
||||
// this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user
|
||||
virtual EPersonaState GetFriendPersonaState( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the name another user - guaranteed to not be NULL.
|
||||
// same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user
|
||||
// note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously
|
||||
//
|
||||
virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// gets the avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetFriendAvatar( CSteamID steamIDFriend ) = 0;
|
||||
// returns true if the friend is actually in a game
|
||||
virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, uint64 *pulGameID, uint32 *punGameIP, uint16 *pusGamePort, uint16 *pusQueryPort ) = 0;
|
||||
// accesses old friends names - returns an empty string when their are no more items in the history
|
||||
virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0;
|
||||
|
||||
// returns true if the specified user meets any of the criteria specified in iFriendFlags
|
||||
// iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values
|
||||
virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// clan (group) iteration and access functions
|
||||
virtual int GetClanCount() = 0;
|
||||
virtual CSteamID GetClanByIndex( int iClan ) = 0;
|
||||
virtual const char *GetClanName( CSteamID steamIDClan ) = 0;
|
||||
|
||||
// iterators for getting users in a chat room, lobby, game server or clan
|
||||
// note that large clans that cannot be iterated by the local user
|
||||
// steamIDSource can be the steamID of a group, game server, lobby or chat room
|
||||
virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0;
|
||||
virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0;
|
||||
|
||||
// returns true if the local user can see that steamIDUser is a member or in steamIDSource
|
||||
virtual bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) = 0;
|
||||
|
||||
// User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI)
|
||||
virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0;
|
||||
|
||||
// activates the game overlay, with an optional dialog to open ("Friends", "Community", "Players", "Settings")
|
||||
virtual void ActivateGameOverlay( const char *pchDialog ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends003"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a friends' status changes
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PersonaStateChange_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamID; // steamID of the friend who changed
|
||||
int m_nChangeFlags; // what's changed
|
||||
};
|
||||
|
||||
|
||||
// used in PersonaStateChange_t::m_nChangeFlags to describe what's changed about a user
|
||||
// these flags describe what the client has learned has changed recently, so on startup you'll see a name, avatar & relationship change for every friend
|
||||
enum EPersonaChange
|
||||
{
|
||||
k_EPersonaChangeName = 0x001,
|
||||
k_EPersonaChangeStatus = 0x002,
|
||||
k_EPersonaChangeComeOnline = 0x004,
|
||||
k_EPersonaChangeGoneOffline = 0x008,
|
||||
k_EPersonaChangeGamePlayed = 0x010,
|
||||
k_EPersonaChangeGameServer = 0x020,
|
||||
k_EPersonaChangeAvatar = 0x040,
|
||||
k_EPersonaChangeJoinedSource= 0x080,
|
||||
k_EPersonaChangeLeftSource = 0x100,
|
||||
k_EPersonaChangeRelationshipChanged = 0x200,
|
||||
k_EPersonaChangeNameFirstSet = 0x400,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: posted when game overlay activates or deactivates
|
||||
// the game can use this to be pause or resume single player games
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameOverlayActivated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 31 };
|
||||
uint8 m_bActive; // true if it's just been activated, false otherwise
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the user tries to join a different game server from their friends list
|
||||
// game client should attempt to connect to specified server when this is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameServerChangeRequested_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 32 };
|
||||
char m_rgchServer[64]; // server address ("127.0.0.1:27015", "tf2.valvesoftware.com")
|
||||
char m_rgchPassword[64]; // server password, if any
|
||||
};
|
||||
|
||||
#endif // ISTEAMFRIENDS_H
|
||||
161
res/steamworks/101/headers/isteamgameserver.h
Normal file
161
res/steamworks/101/headers/isteamgameserver.h
Normal file
@@ -0,0 +1,161 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMGAMESERVER_H
|
||||
#define ISTEAMGAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for authenticating users via Steam to play on a game server
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamGameServer
|
||||
{
|
||||
public:
|
||||
// connection functions
|
||||
virtual void LogOn() = 0;
|
||||
virtual void LogOff() = 0;
|
||||
|
||||
// status functions
|
||||
virtual bool BLoggedOn() = 0;
|
||||
virtual bool BSecure() = 0;
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Handles receiving a new connection from a Steam user. This call will ask the Steam
|
||||
// servers to validate the users identity, app ownership, and VAC status. If the Steam servers
|
||||
// are off-line, then it will validate the cached ticket itself which will validate app ownership
|
||||
// and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection()
|
||||
// and must then be sent up to the game server for authentication.
|
||||
//
|
||||
// Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL
|
||||
// If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication
|
||||
// for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)
|
||||
virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0;
|
||||
|
||||
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||
//
|
||||
// Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect()
|
||||
// when this user leaves the server just like you would for a real user.
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection() = 0;
|
||||
|
||||
// Should be called whenever a user leaves our game server, this lets Steam internally
|
||||
// track which users are currently on which servers for the purposes of preventing a single
|
||||
// account being logged into multiple servers, showing who is currently on a server, etc.
|
||||
virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// Update the data to be displayed in the server browser and matchmaking interfaces for a user
|
||||
// currently connected to the server. For regular users you must call this after you receive a
|
||||
// GSUserValidationSuccess callback.
|
||||
//
|
||||
// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
|
||||
virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
|
||||
|
||||
// You shouldn't need to call this as it is called internally by SteamGameServer_Init() and can only be called once.
|
||||
//
|
||||
// To update the data in this call which may change during the servers lifetime see UpdateServerStatus() below.
|
||||
//
|
||||
// Input: nGameAppID - The Steam assigned AppID for the game
|
||||
// unServerFlags - Any applicable combination of flags (see k_unServerFlag____ constants below)
|
||||
// unGameIP - The IP Address the server is listening for client connections on (might be INADDR_ANY)
|
||||
// unGamePort - The port which the server is listening for client connections on
|
||||
// unSpectatorPort - the port on which spectators can join to observe the server, 0 if spectating is not supported
|
||||
// usQueryPort - The port which the ISteamMasterServerUpdater API should use in order to listen for matchmaking requests
|
||||
// pchGameDir - A unique string identifier for your game
|
||||
// pchVersion - The current version of the server as a string like 1.0.0.0
|
||||
// bLanMode - Is this a LAN only server?
|
||||
//
|
||||
// bugbug jmccaskey - figure out how to remove this from the API and only expose via SteamGameServer_Init... or make this actually used,
|
||||
// and stop calling it in SteamGameServer_Init()?
|
||||
virtual bool BSetServerType( uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort,
|
||||
uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode ) = 0;
|
||||
|
||||
// Updates server status values which shows up in the server browser and matchmaking APIs
|
||||
virtual void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers,
|
||||
const char *pchServerName, const char *pSpectatorServerName,
|
||||
const char *pchMapName ) = 0;
|
||||
|
||||
// This can be called if spectator goes away or comes back (passing 0 means there is no spectator server now).
|
||||
virtual void UpdateSpectatorPort( uint16 unSpectatorPort ) = 0;
|
||||
|
||||
// Sets a string defining the "gametype" for this server, this is optional, but if it is set
|
||||
// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||
virtual void SetGameType( const char *pchGameType ) = 0;
|
||||
|
||||
// Ask if a user has a specific achievement for this game, will get a callback on reply
|
||||
virtual bool BGetUserAchievementStatus( CSteamID steamID, const char *pchAchievementName ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer005"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unServerFlagNone = 0x00;
|
||||
const uint32 k_unServerFlagActive = 0x01; // server has users playing
|
||||
const uint32 k_unServerFlagSecure = 0x02; // server wants to be secure
|
||||
const uint32 k_unServerFlagDedicated = 0x04; // server is dedicated
|
||||
const uint32 k_unServerFlagLinux = 0x08; // linux build
|
||||
const uint32 k_unServerFlagPassworded = 0x10; // password protected
|
||||
const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and
|
||||
// won't enforce authentication of users that connect to the server.
|
||||
// Useful when you run a server where the clients may not
|
||||
// be connected to the internet but you want them to play (i.e LANs)
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
// client has been approved to connect to this game server
|
||||
struct GSClientApprove_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 1 };
|
||||
CSteamID m_SteamID;
|
||||
};
|
||||
|
||||
|
||||
// client has been denied to connection to this game server
|
||||
struct GSClientDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 2 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
char m_rgchOptionalText[128];
|
||||
};
|
||||
|
||||
|
||||
// request the game server should kick the user
|
||||
struct GSClientKick_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 3 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
};
|
||||
|
||||
// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks,
|
||||
// do not reuse them here.
|
||||
|
||||
// client achievement info
|
||||
struct GSClientAchievementStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 6 };
|
||||
uint64 m_SteamID;
|
||||
char m_pchAchievement[128];
|
||||
bool m_bUnlocked;
|
||||
};
|
||||
|
||||
|
||||
// received when the game server requests to be displayed as secure (VAC protected)
|
||||
// m_bSecure is true if the game server should display itself as secure to users, false otherwise
|
||||
struct GSPolicyResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 15 };
|
||||
uint8 m_bSecure;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // ISTEAMGAMESERVER_H
|
||||
103
res/steamworks/101/headers/isteammasterserverupdater.h
Normal file
103
res/steamworks/101/headers/isteammasterserverupdater.h
Normal file
@@ -0,0 +1,103 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for retrieving list of game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMASTERSERVERUPDATER_H
|
||||
#define ISTEAMMASTERSERVERUPDATER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Game engines use this to tell the Steam master servers
|
||||
// about their games so their games can show up in the server browser.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMasterServerUpdater
|
||||
{
|
||||
public:
|
||||
|
||||
// Call this as often as you like to tell the master server updater whether or not
|
||||
// you want it to be active (default: off).
|
||||
virtual void SetActive( bool bActive ) = 0;
|
||||
|
||||
// You usually don't need to modify this.
|
||||
// Pass -1 to use the default value for iHeartbeatInterval.
|
||||
// Some mods change this.
|
||||
virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0;
|
||||
|
||||
|
||||
// These are in GameSocketShare mode, where instead of ISteamMasterServerUpdater creating its own
|
||||
// socket to talk to the master server on, it lets the game use its socket to forward messages
|
||||
// back and forth. This prevents us from requiring server ops to open up yet another port
|
||||
// in their firewalls.
|
||||
//
|
||||
// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001
|
||||
|
||||
// These are used when you've elected to multiplex the game server's UDP socket
|
||||
// rather than having the master server updater use its own sockets.
|
||||
//
|
||||
// Source games use this to simplify the job of the server admins, so they
|
||||
// don't have to open up more ports on their firewalls.
|
||||
|
||||
// Call this when a packet that starts with 0xFFFFFFFF comes in. That means
|
||||
// it's for us.
|
||||
virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0;
|
||||
|
||||
// AFTER calling HandleIncomingPacket for any packets that came in that frame, call this.
|
||||
// This gets a packet that the master server updater needs to send out on UDP.
|
||||
// It returns the length of the packet it wants to send, or 0 if there are no more packets to send.
|
||||
// Call this each frame until it returns 0.
|
||||
virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0;
|
||||
|
||||
|
||||
// Functions to set various fields that are used to respond to queries.
|
||||
|
||||
// Call this to set basic data that is passed to the server browser.
|
||||
virtual void SetBasicServerData(
|
||||
unsigned short nProtocolVersion,
|
||||
bool bDedicatedServer,
|
||||
const char *pRegionName,
|
||||
const char *pProductName,
|
||||
unsigned short nMaxReportedClients,
|
||||
bool bPasswordProtected,
|
||||
const char *pGameDescription ) = 0;
|
||||
|
||||
// Call this to clear the whole list of key/values that are sent in rules queries.
|
||||
virtual void ClearAllKeyValues() = 0;
|
||||
|
||||
// Call this to add/update a key/value pair.
|
||||
virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
|
||||
// You can call this upon shutdown to clear out data stored for this game server and
|
||||
// to tell the master servers that this server is going away.
|
||||
virtual void NotifyShutdown() = 0;
|
||||
|
||||
// Returns true if the master server has requested a restart.
|
||||
// Only returns true once per request.
|
||||
virtual bool WasRestartRequested() = 0;
|
||||
|
||||
// Force it to request a heartbeat from the master servers.
|
||||
virtual void ForceHeartbeat() = 0;
|
||||
|
||||
// Manually edit and query the master server list.
|
||||
// It will provide name resolution and use the default master server port if none is provided.
|
||||
virtual bool AddMasterServer( const char *pServerAddress ) = 0;
|
||||
virtual bool RemoveMasterServer( const char *pServerAddress ) = 0;
|
||||
|
||||
virtual int GetNumMasterServers() = 0;
|
||||
|
||||
// Returns the # of bytes written to pOut.
|
||||
virtual int GetMasterServerAddress( int iServer, char *pOut, int outBufferSize ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMMASTERSERVERUPDATER_INTERFACE_VERSION "SteamMasterServerUpdater001"
|
||||
|
||||
#endif // ISTEAMMASTERSERVERUPDATER_H
|
||||
509
res/steamworks/101/headers/isteammatchmaking.h
Normal file
509
res/steamworks/101/headers/isteammatchmaking.h
Normal file
@@ -0,0 +1,509 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing game server/client match making
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMATCHMAKING
|
||||
#define ISTEAMMATCHMAKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
#include "matchmakingtypes.h"
|
||||
#include "isteamclient.h"
|
||||
#include "isteamfriends.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to favorites
|
||||
// and to operate on game lobbies.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmaking
|
||||
{
|
||||
public:
|
||||
// game server favorites storage
|
||||
// saves basic details about a multiplayer game server locally
|
||||
|
||||
// returns the number of favorites servers the user has stored
|
||||
virtual int GetFavoriteGameCount() = 0;
|
||||
|
||||
// returns the details of the game server
|
||||
// iGame is of range [0,GetFavoriteGameCount())
|
||||
// *pnIP, *pnConnPort are filled in the with IP:port of the game server
|
||||
// *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections
|
||||
// *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added
|
||||
virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0;
|
||||
|
||||
// adds the game server to the local list; updates the time played of the server if it already exists in the list
|
||||
virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0;
|
||||
|
||||
// removes the game server from the local storage; returns true if one was removed
|
||||
virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0;
|
||||
|
||||
///////
|
||||
// Game lobby functions
|
||||
|
||||
// Get a list of relevant lobbies
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyMatchList_t callback, with the number of servers requested
|
||||
// if the user is not currently connected to Steam (i.e. SteamUser()->BLoggedOn() returns false) then
|
||||
// a LobbyMatchList_t callback will be posted immediately with no servers
|
||||
virtual void RequestLobbyList() = 0;
|
||||
|
||||
// returns the CSteamID of a lobby, as retrieved by a RequestLobbyList call
|
||||
// should only be called after a LobbyMatchList_t callback is received
|
||||
// iLobby is of the range [0, LobbyMatchList_t::m_nLobbiesMatching)
|
||||
// the returned CSteamID::IsValid() will be false if iLobby is out of range
|
||||
virtual CSteamID GetLobbyByIndex( int iLobby ) = 0;
|
||||
|
||||
// Create a lobby on the Steam servers.
|
||||
// If bPrivate is true, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID
|
||||
// of the lobby will need to be communicated via game channels or via InviteUserToLobby()
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyCreated_t callback when the lobby has been created;
|
||||
// local user will the join the lobby, resulting in an additional LobbyEnter_t callback being sent
|
||||
// operations on the chat room can only proceed once the LobbyEnter_t has been received
|
||||
virtual void CreateLobby( bool bPrivate ) = 0;
|
||||
|
||||
// Joins an existing lobby
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyEnter_t callback when the lobby has been joined
|
||||
virtual void JoinLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Leave a lobby; this will take effect immediately on the client side
|
||||
// other users in the lobby will be notified by a LobbyChatUpdate_t callback
|
||||
virtual void LeaveLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Invite another user to the lobby
|
||||
// the target user will receive a LobbyInvite_t callback
|
||||
// will return true if the invite is successfully sent, whether or not the target responds
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0;
|
||||
|
||||
// Lobby iteration, for viewing details of users in a lobby
|
||||
// only accessible if the lobby user is a member of the specified lobby
|
||||
// persona information for other lobby members (name, avatar, etc.) will be asynchronously received
|
||||
// and accessible via ISteamFriends interface
|
||||
|
||||
// returns the number of users in the specified lobby
|
||||
virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0;
|
||||
// returns the CSteamID of a user in the lobby
|
||||
// iMember is of range [0,GetNumLobbyMembers())
|
||||
virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0;
|
||||
|
||||
// Get data associated with this lobby
|
||||
// takes a simple key, and returns the string associated with it
|
||||
// "" will be returned if no value is set, or if steamIDLobby is invalid
|
||||
virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0;
|
||||
// Sets a key/value pair in the lobby metadata
|
||||
// each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data
|
||||
// this can be used to set lobby names, map, etc.
|
||||
// to reset a key, just set it to ""
|
||||
// other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback
|
||||
virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// As above, but gets per-user data for someone in this lobby
|
||||
virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0;
|
||||
// Sets per-user metadata (for the local user implicitly)
|
||||
virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// Broadcasts a chat message to the all the users in the lobby
|
||||
// users in the lobby (including the local user) will receive a LobbyChatMsg_t callback
|
||||
// returns true if the message is successfully sent
|
||||
// pvMsgBody can be binary or text data, up to 4k
|
||||
// if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator
|
||||
virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0;
|
||||
// Get a chat message as specified in a LobbyChatMsg_t callback
|
||||
// iChatID is the LobbyChatMsg_t::m_iChatID value in the callback
|
||||
// *pSteamIDUser is filled in with the CSteamID of the member
|
||||
// *pvData is filled in with the message itself
|
||||
// return value is the number of bytes written into the buffer
|
||||
virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0;
|
||||
|
||||
// Fetch metadata for a lobby you're not necessarily in right now
|
||||
// this will send down all the metadata associated with a lobby
|
||||
// this is an asynchronous call
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// sets the game server associated with the lobby
|
||||
// usually at this point, the users will leave the lobby and join the specified game server
|
||||
// either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect
|
||||
virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0;
|
||||
|
||||
};
|
||||
#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking002"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callback interfaces for server list functions (see ISteamMatchmakingServers below)
|
||||
//
|
||||
// The idea here is that your game code implements objects that implement these
|
||||
// interfaces to receive callback notifications after calling asynchronous functions
|
||||
// inside the ISteamMatchmakingServers() interface below.
|
||||
//
|
||||
// This is different than normal Steam callback handling due to the potentially
|
||||
// large size of server lists.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after a server list refresh
|
||||
// or an individual server update.
|
||||
//
|
||||
// Since you get these callbacks after requesting full list refreshes you will
|
||||
// usually implement this interface inside an object like CServerBrowser. If that
|
||||
// object is getting destructed you should use ISteamMatchMakingServers()->CancelQuery()
|
||||
// to cancel any in-progress queries so you don't get a callback into the destructed
|
||||
// object and crash.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServerListResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded ok with updated data
|
||||
virtual void ServerResponded( int iServer ) = 0;
|
||||
|
||||
// Server has failed to respond
|
||||
virtual void ServerFailedToRespond( int iServer ) = 0;
|
||||
|
||||
// A list refresh you had initiated is now 100% completed
|
||||
virtual void RefreshComplete( EMatchMakingServerResponse response ) = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after pinging an individual server
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PingServer() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPingResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded successfully and has updated data
|
||||
virtual void ServerResponded( gameserveritem_t &server ) = 0;
|
||||
|
||||
// Server failed to respond to the ping request
|
||||
virtual void ServerFailedToRespond() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting details on
|
||||
// who is playing on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPlayersResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a new player on the server -- you'll get this callback once per player
|
||||
// on the server which you have requested player data on.
|
||||
virtual void AddPlayerToList( const char *pchName, int nScore, float flTimePlayed ) = 0;
|
||||
|
||||
// The server failed to respond to the request for player details
|
||||
virtual void PlayersFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the player details request
|
||||
// (ie, you won't get anymore AddPlayerToList callbacks)
|
||||
virtual void PlayersRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting rules
|
||||
// details on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->ServerRules() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingRulesResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a rule on the server -- you'll get one of these per rule defined on
|
||||
// the server you are querying
|
||||
virtual void RulesResponded( const char *pchRule, const char *pchValue ) = 0;
|
||||
|
||||
// The server failed to respond to the request for rule details
|
||||
virtual void RulesFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the rule details request
|
||||
// (ie, you won't get anymore RulesResponded callbacks)
|
||||
virtual void RulesRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Typedef for handle type you will receive when querying details on an individual server.
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef int HServerQuery;
|
||||
const int HSERVERQUERY_INVALID = 0xffffffff;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to game lists and details
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServers
|
||||
{
|
||||
public:
|
||||
// Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values.
|
||||
virtual void RequestInternetServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFriendsServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFavoritesServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestHistoryServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestSpectatorServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
/* the filters that are available in the ppchFilters params are:
|
||||
|
||||
"map" - map the server is running, as set in the dedicated server api
|
||||
"dedicated" - reports bDedicated from the API
|
||||
"secure" - VAC-enabled
|
||||
"full" - not full
|
||||
"empty" - not empty
|
||||
"noplayers" - is empty
|
||||
"proxy" - a relay server
|
||||
|
||||
*/
|
||||
|
||||
// Get details on a given server in the list, you can get the valid range of index
|
||||
// values by calling GetServerCount(). You will also receive index values in
|
||||
// ISteamMatchmakingServerListResponse::ServerResponded() callbacks
|
||||
virtual gameserveritem_t *GetServerDetails( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
// Cancel an request which is operation on the given list type. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above list request calls. Not doing so may result in a crash when a callback
|
||||
// occurs on the destructed object.
|
||||
virtual void CancelQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Ping every server in your list again but don't update the list of servers
|
||||
virtual void RefreshQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Returns true if the list is currently refreshing its server list
|
||||
virtual bool IsRefreshing( EMatchMakingType eType ) = 0;
|
||||
|
||||
// How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1
|
||||
virtual int GetServerCount( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Refresh a single server inside of a query (rather than all the servers )
|
||||
virtual void RefreshServer( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Queries to individual servers directly via IP/Port
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Request updated ping time and other details from a single server
|
||||
virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of players currently playing on a server
|
||||
virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of rules that the server is running (See ISteamMasterServerUpdater->SetKeyValue() to set the rules server side)
|
||||
virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above calls to avoid crashing when callbacks occur.
|
||||
virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0;
|
||||
};
|
||||
#define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "SteamMatchMakingServers001"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unFavoriteFlagNone = 0x00;
|
||||
const uint32 k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list
|
||||
const uint32 k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Used in ChatInfo messages - fields specific to a chat member - must fit in a uint32
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatMemberStateChange
|
||||
{
|
||||
// Specific to joining / leaving the chatroom
|
||||
k_EChatMemberStateChangeEntered = 0x01, // This user has joined or is joining the chat room
|
||||
k_EChatMemberStateChangeLeft = 0x02, // This user has left or is leaving the chat room
|
||||
k_EChatMemberStateChangeDisconnected = 0x04, // User disconnected without leaving the chat first
|
||||
k_EChatMemberStateChangeKicked = 0x08, // User kicked
|
||||
k_EChatMemberStateChangeBanned = 0x10, // User kicked and banned
|
||||
|
||||
k_EChatMemberInfoVoiceSpeaking = 0x20, // User started talking (using speaker slot)
|
||||
k_EChatMemberInfoVoiceDoneSpeaking = 0x40, // User relinquished speaker slot
|
||||
};
|
||||
|
||||
// returns true of the flags indicate that a user has been removed from the chat
|
||||
#define BChatMemberStateChangeRemoved( rgfChatMemberStateChangeFlags ) ( rgfChatMemberStateChangeFlags & ( k_EChatMemberStateChangeDisconnected | k_EChatMemberStateChangeLeft | k_EChatMemberStateChangeKicked | k_EChatMemberStateChangeBanned ) )
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: a server was added/removed from the favorites list, you should refresh now
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FavoritesListChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 2 };
|
||||
uint32 m_nIP; // an IP of 0 means reload the whole list, any other value means just one server
|
||||
uint32 m_nQueryPort;
|
||||
uint32 m_nConnPort;
|
||||
uint32 m_nAppID;
|
||||
uint32 m_nFlags;
|
||||
bool m_bAdd; // true if this is adding the entry, otherwise it is a remove
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Someone has invited you to join a Lobby
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyInvite_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 3 };
|
||||
|
||||
uint64 m_ulSteamIDUser; // Steam ID of the person making the invite
|
||||
uint64 m_ulSteamIDLobby; // Steam ID of the Lobby
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent on entering a Lobby
|
||||
// m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success,
|
||||
// or a higher value on failure (see enum EChatRoomEnterResponse)
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyEnter_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // SteamID of the Lobby you have entered
|
||||
uint32 m_rgfChatPermissions; // Permissions of the current user
|
||||
bool m_bLocked; // If true, then only invited users may join
|
||||
uint32 m_EChatRoomEnterResponse; // EChatRoomEnterResponse
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby metadata has changed
|
||||
// if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details
|
||||
// if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyDataUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 5 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // steamID of the Lobby
|
||||
uint64 m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby chat room state has changed
|
||||
// this is usually sent when a user has joined or left the lobby
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 6 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // Lobby ID
|
||||
uint64 m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient
|
||||
uint64 m_ulSteamIDMakingChange; // Chat member who made the change (different from SteamIDUserChange if kicking, muting, etc.)
|
||||
// for example, if one user kicks another from the lobby, this will be set to the id of the user who initiated the kick
|
||||
uint32 m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A chat message for this lobby has been sent
|
||||
// use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatMsg_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 7 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby id this is in
|
||||
uint64 m_ulSteamIDUser; // steamID of the user who has sent this message
|
||||
uint8 m_eChatEntryType; // type of message
|
||||
uint32 m_iChatID; // index of the chat entry to lookup
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A game created a game for all the members of the lobby to join,
|
||||
// as triggered by a SetLobbyGameServer()
|
||||
// it's up to the individual clients to take action on this; the usual
|
||||
// game behavior is to leave the lobby and connect to the specified game server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyGameCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 9 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby we were in
|
||||
uint64 m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members
|
||||
uint32 m_unIP; // IP & Port of the game server (if any)
|
||||
uint16 m_usPort;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Number of matching lobbies found
|
||||
// iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyMatchList_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 10 };
|
||||
uint32 m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when the lobby is being forcefully closed
|
||||
// lobby details functions will no longer be updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyClosing_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 11 };
|
||||
uint64 m_ulSteamIDLobby; // Lobby
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when the local user has been kicked from the lobby
|
||||
// lobby details functions will no longer be updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyKicked_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 12 };
|
||||
uint64 m_ulSteamIDLobby; // Lobby
|
||||
uint64 m_ulSteamIDAdmin; // User who kicked you
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Result of our request to create a Lobby
|
||||
// m_eResult == k_EResultOK on success
|
||||
// at this point, the local user may not have finishing joining this lobby;
|
||||
// game code should wait until the subsequent LobbyEnter_t callback is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 };
|
||||
EResult m_eResult; // Result
|
||||
uint64 m_ulSteamIDLobby; // chat room, zero if failed
|
||||
};
|
||||
|
||||
#endif // ISTEAMMATCHMAKING
|
||||
134
res/steamworks/101/headers/isteamnetworking.h
Normal file
134
res/steamworks/101/headers/isteamnetworking.h
Normal file
@@ -0,0 +1,134 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing network connections between game clients & servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMNETWORKING
|
||||
#define ISTEAMNETWORKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a socket
|
||||
typedef uint32 SNetSocket_t;
|
||||
typedef uint32 SNetListenSocket_t;
|
||||
|
||||
|
||||
// connection progress indicators
|
||||
enum ESNetSocketState
|
||||
{
|
||||
k_ESNetSocketStateInvalid = 0,
|
||||
|
||||
// communication is valid
|
||||
k_ESNetSocketStateConnected = 1,
|
||||
|
||||
// states while establishing a connection
|
||||
k_ESNetSocketStateInitiated = 10, // the connection state machine has started
|
||||
|
||||
// p2p connections
|
||||
k_ESNetSocketStateLocalCandidatesFound = 11, // we've found our local IP info
|
||||
k_ESNetSocketStateReceivedRemoteCandidates = 12,// we've received information from the remote machine, via the Steam back-end, about their IP info
|
||||
|
||||
// direct connections
|
||||
k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server
|
||||
|
||||
// failure states
|
||||
k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end
|
||||
k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown
|
||||
k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection
|
||||
k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us
|
||||
k_ESNetSocketStateConnectionBroken = 25, // connection has been broken; either the other end has disappeared or our local network connection has broke
|
||||
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for making connections and sending data between clients,
|
||||
// traversing NAT's where possible
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamNetworking
|
||||
{
|
||||
public:
|
||||
// creates a socket and listens others to connect
|
||||
// will trigger a SocketStatusCallback_t callback on another client connecting
|
||||
// nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports
|
||||
// this can usually just be 0 unless you want multiple sets of connections
|
||||
// unIP is the local IP address to bind to
|
||||
// pass in 0 if you just want the default local IP
|
||||
// unPort is the port to use
|
||||
// pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only
|
||||
virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort ) = 0;
|
||||
|
||||
// creates a socket and begin connection to a remote destination
|
||||
// can connect via a known steamID (client or game server), or directly to an IP
|
||||
// on success will trigger a SocketConnectCallback_t callback
|
||||
// on failure or timeout will trigger a SocketConnectionFailureCallback_t callback
|
||||
virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec ) = 0;
|
||||
virtual SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec ) = 0;
|
||||
|
||||
// disconnects the connection to the socket, if any, and invalidates the handle
|
||||
// any unread data on the socket will be thrown away
|
||||
// if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect
|
||||
virtual bool DestroySocket( SNetSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
// destroying a listen socket will automatically kill all the regular sockets generated from it
|
||||
virtual bool DestroyListenSocket( SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
|
||||
// sending data
|
||||
// must be a handle to a connected socket
|
||||
// data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets
|
||||
// use the reliable flag with caution; although the resend rate is pretty aggressive,
|
||||
// it can still cause stalls in receiving data (like TCP)
|
||||
virtual bool SendDataOnSocket( SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable ) = 0;
|
||||
|
||||
// receiving data
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// checks for data from any socket that has been connected off this listen socket
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool IsDataAvailable( SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// retrieves data from any socket that has been connected off this listen socket
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// returns information about the specified socket, filling out the contents of the pointers
|
||||
virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote ) = 0;
|
||||
|
||||
// returns which local port the listen socket is bound to
|
||||
// *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only
|
||||
virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort ) = 0;
|
||||
|
||||
};
|
||||
#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking001"
|
||||
|
||||
|
||||
// callback notification - status of a socket has changed
|
||||
struct SocketStatusCallback_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 };
|
||||
SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host
|
||||
SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection
|
||||
CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one
|
||||
int m_eSNetSocketState; // socket state, ESNetSocketState
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMNETWORKING
|
||||
146
res/steamworks/101/headers/isteamuser.h
Normal file
146
res/steamworks/101/headers/isteamuser.h
Normal file
@@ -0,0 +1,146 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSER_H
|
||||
#define ISTEAMUSER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// structure that contains client callback data
|
||||
// see callbacks documentation for more details
|
||||
struct CallbackMsg_t
|
||||
{
|
||||
HSteamUser m_hSteamUser;
|
||||
int m_iCallback;
|
||||
uint8 *m_pubParam;
|
||||
int m_cubParam;
|
||||
};
|
||||
|
||||
// reference to a steam call, to filter results by
|
||||
typedef int32 HSteamCall;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing and manipulating a steam account
|
||||
// associated with one client instance
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUser
|
||||
{
|
||||
public:
|
||||
// returns the HSteamUser this interface represents
|
||||
// this is only used internally by the API, and by a few select interfaces that support multi-user
|
||||
virtual HSteamUser GetHSteamUser() = 0;
|
||||
|
||||
// returns true if the Steam client current has a live connection to the Steam servers.
|
||||
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
|
||||
// The Steam client will automatically be trying to recreate the connection as often as possible.
|
||||
virtual bool BLoggedOn() = 0;
|
||||
|
||||
// returns the CSteamID of the account currently logged into the Steam client
|
||||
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Multiplayer Authentication functions
|
||||
|
||||
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
|
||||
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
|
||||
//
|
||||
// Parameters:
|
||||
// void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.
|
||||
// int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
|
||||
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
|
||||
// CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )
|
||||
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
|
||||
// bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)
|
||||
//
|
||||
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
|
||||
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
|
||||
virtual int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
|
||||
|
||||
// notify of disconnect
|
||||
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
|
||||
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
|
||||
|
||||
// Legacy functions
|
||||
|
||||
// used by only a few games to track usage events
|
||||
virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser010"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connections to the Steam back-end has been established
|
||||
// this means the Steam client now has a working connection to the Steam servers
|
||||
// usually this will have occurred before the game has launched, and should
|
||||
// only be seen if the user has dropped connection due to a networking issue
|
||||
// or a Steam server update
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersConnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 1 };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connection attempt has failed
|
||||
// this will occur periodically if the Steam client is not connected,
|
||||
// and has failed in it's retry to establish a connection
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServerConnectFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 2 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called if the client has lost connection to the Steam servers
|
||||
// real-time services will be disabled until a matching SteamServersConnected_t has been posted
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersDisconnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 3 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server,
|
||||
// which it may be in the process of or already connected to.
|
||||
// The game client should immediately disconnect upon receiving this message.
|
||||
// This can usually occur if the user doesn't have rights to play on the game server.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ClientGameServerDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 13 };
|
||||
|
||||
uint32 m_uAppID;
|
||||
uint32 m_unGameServerIP;
|
||||
uint16 m_usGameServerPort;
|
||||
uint16 m_bSecure;
|
||||
uint32 m_uReason;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks)
|
||||
// When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect.
|
||||
// This usually occurs in the rare event the Steam client has some kind of fatal error.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct CallbackPipeFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 17 };
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
98
res/steamworks/101/headers/isteamuserstats.h
Normal file
98
res/steamworks/101/headers/isteamuserstats.h
Normal file
@@ -0,0 +1,98 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSERSTATS_H
|
||||
#define ISTEAMUSERSTATS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// size limit on stat or achievement name
|
||||
const uint32 k_cchStatNameMax = 128;
|
||||
|
||||
class ISteamUserStats
|
||||
{
|
||||
public:
|
||||
|
||||
// Ask the server to send down this user's data and achievements for nGameID
|
||||
virtual bool RequestCurrentStats( ) = 0;
|
||||
|
||||
// Data accessors
|
||||
virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetStat( const char *pchName, float *pData ) = 0;
|
||||
|
||||
// Set / update data
|
||||
virtual bool SetStat( const char *pchName, int32 nData ) = 0;
|
||||
virtual bool SetStat( const char *pchName, float fData ) = 0;
|
||||
virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||
|
||||
// Achievement flag accessors
|
||||
virtual bool GetAchievement( const char *pchName, bool *pbAchieved ) = 0;
|
||||
virtual bool SetAchievement( const char *pchName ) = 0;
|
||||
virtual bool ClearAchievement( const char *pchName ) = 0;
|
||||
|
||||
// Store the current data on the server, will get a callback when set
|
||||
// And one callback for every new achievement
|
||||
virtual bool StoreStats( ) = 0;
|
||||
|
||||
// Achievement / GroupAchievement metadata
|
||||
|
||||
// Gets the icon of the achievement, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetAchievementIcon( const char *pchName ) = 0;
|
||||
// Get general attributes (display name / text, etc) for an Achievement
|
||||
virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0;
|
||||
|
||||
// Achievement progress - triggers an AchievementProgress callback, that is all.
|
||||
// Calling this w/ N out of N progress will NOT set the achievement, the game must still do that.
|
||||
virtual bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint32 nMaxProgress ) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION003"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the latests stats and achievements have been received
|
||||
// from the server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsReceived_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // Success / error fetching the stats
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the user stats for a game
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // success / error
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the achievements for a game, or an
|
||||
// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress
|
||||
// are zero, that means the achievement has been fully unlocked.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserAchievementStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 };
|
||||
|
||||
uint64 m_nGameID; // Game this is for
|
||||
bool m_bGroupAchievement; // if this is a "group" achievement
|
||||
char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement
|
||||
uint32 m_nCurProgress; // current progress towards the achievement
|
||||
uint32 m_nMaxProgress; // "out of" this many
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
77
res/steamworks/101/headers/isteamutils.h
Normal file
77
res/steamworks/101/headers/isteamutils.h
Normal file
@@ -0,0 +1,77 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to utility functions in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUTILS_H
|
||||
#define ISTEAMUTILS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to user independent utility functions
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUtils
|
||||
{
|
||||
public:
|
||||
// return the number of seconds since the user
|
||||
virtual uint32 GetSecondsSinceAppActive() = 0;
|
||||
virtual uint32 GetSecondsSinceComputerActive() = 0;
|
||||
|
||||
// the universe this client is connecting to
|
||||
virtual EUniverse GetConnectedUniverse() = 0;
|
||||
|
||||
// Steam server time - in PST, number of seconds since January 1, 1970 (i.e unix time)
|
||||
virtual uint32 GetServerRealTime() = 0;
|
||||
|
||||
// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
|
||||
// e.g "US" or "UK".
|
||||
virtual const char *GetIPCountry() = 0;
|
||||
|
||||
// returns true if the image exists, and valid sizes were filled out
|
||||
virtual bool GetImageSize( int iImage, uint32 *pnWidth, uint32 *pnHeight ) = 0;
|
||||
|
||||
// returns true if the image exists, and the buffer was successfully filled out
|
||||
// results are returned in RGBA format
|
||||
// the destination buffer size should be 4 * height * width * sizeof(char)
|
||||
virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0;
|
||||
|
||||
// returns the IP of the reporting server for valve - currently only used in Source engine games
|
||||
virtual bool GetCSERIPPort( uint32 *unIP, uint16 *usPort ) = 0;
|
||||
|
||||
// return the amount of battery power left in the current system in % [0..100], 255 for being on AC power
|
||||
virtual uint8 GetCurrentBatteryPower() = 0;
|
||||
|
||||
// returns the appID of the current process
|
||||
virtual uint32 GetAppID() = 0;
|
||||
};
|
||||
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils002"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The country of the user changed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct IPCountry_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 1 };
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LowBatteryPower_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 2 };
|
||||
uint8 m_nMinutesBatteryLeft;
|
||||
};
|
||||
|
||||
#endif // ISTEAMUTILS_H
|
||||
235
res/steamworks/101/headers/matchmakingtypes.h
Normal file
235
res/steamworks/101/headers/matchmakingtypes.h
Normal file
@@ -0,0 +1,235 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef MATCHMAKINGTYPES_H
|
||||
#define MATCHMAKINGTYPES_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
struct MatchMakingKeyValuePair_t
|
||||
{
|
||||
MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; }
|
||||
MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue )
|
||||
{
|
||||
strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only!
|
||||
strncpy( m_szValue, pchValue, sizeof(m_szValue) );
|
||||
}
|
||||
char m_szKey[ 256 ];
|
||||
char m_szValue[ 256 ];
|
||||
};
|
||||
|
||||
|
||||
enum EMatchMakingServerResponse
|
||||
{
|
||||
eServerResponded = 0,
|
||||
eServerFailedToRespond,
|
||||
eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match
|
||||
};
|
||||
|
||||
enum EMatchMakingType
|
||||
{
|
||||
eInternetServer = 0,
|
||||
eLANServer,
|
||||
eFriendsServer,
|
||||
eFavoritesServer,
|
||||
eHistoryServer,
|
||||
eSpectatorServer,
|
||||
eInvalidServer
|
||||
};
|
||||
|
||||
|
||||
// servernetadr_t is all the addressing info the serverbrowser needs to know about a game server,
|
||||
// namely: its IP, its connection port, and its query port.
|
||||
class servernetadr_t
|
||||
{
|
||||
public:
|
||||
|
||||
void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort );
|
||||
#ifdef NETADR_H
|
||||
void Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort );
|
||||
netadr_t& GetIPAndQueryPort();
|
||||
#endif
|
||||
|
||||
// Access the query port.
|
||||
uint16 GetQueryPort() const;
|
||||
void SetQueryPort( uint16 usPort );
|
||||
|
||||
// Access the connection port.
|
||||
uint16 GetConnectionPort() const;
|
||||
void SetConnectionPort( uint16 usPort );
|
||||
|
||||
// Access the IP
|
||||
uint32 GetIP() const;
|
||||
void SetIP( uint32 );
|
||||
|
||||
// This gets the 'a.b.c.d:port' string with the connection port (instead of the query port).
|
||||
const char *GetConnectionAddressString() const;
|
||||
const char *GetQueryAddressString() const;
|
||||
|
||||
// Comparison operators and functions.
|
||||
bool operator<(const servernetadr_t &netadr) const;
|
||||
void operator=( const servernetadr_t &that )
|
||||
{
|
||||
m_usConnectionPort = that.m_usConnectionPort;
|
||||
m_usQueryPort = that.m_usQueryPort;
|
||||
m_unIP = that.m_unIP;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
const char *ToString( uint32 unIP, uint16 usPort ) const;
|
||||
uint16 m_usConnectionPort; // (in HOST byte order)
|
||||
uint16 m_usQueryPort;
|
||||
uint32 m_unIP;
|
||||
};
|
||||
|
||||
|
||||
inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
m_unIP = ip;
|
||||
m_usQueryPort = usQueryPort;
|
||||
m_usConnectionPort = usConnectionPort;
|
||||
}
|
||||
|
||||
#ifdef NETADR_H
|
||||
inline void servernetadr_t::Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
Init( ipAndQueryPort.GetIP(), ipAndQueryPort.GetPort(), usConnectionPort );
|
||||
}
|
||||
|
||||
inline netadr_t& servernetadr_t::GetIPAndQueryPort()
|
||||
{
|
||||
static netadr_t netAdr;
|
||||
netAdr.SetIP( m_unIP );
|
||||
netAdr.SetPort( m_usQueryPort );
|
||||
return netAdr;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline uint16 servernetadr_t::GetQueryPort() const
|
||||
{
|
||||
return m_usQueryPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetQueryPort( uint16 usPort )
|
||||
{
|
||||
m_usQueryPort = usPort;
|
||||
}
|
||||
|
||||
inline uint16 servernetadr_t::GetConnectionPort() const
|
||||
{
|
||||
return m_usConnectionPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetConnectionPort( uint16 usPort )
|
||||
{
|
||||
m_usConnectionPort = usPort;
|
||||
}
|
||||
|
||||
inline uint32 servernetadr_t::GetIP() const
|
||||
{
|
||||
return m_unIP;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetIP( uint32 unIP )
|
||||
{
|
||||
m_unIP = unIP;
|
||||
}
|
||||
|
||||
inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const
|
||||
{
|
||||
static char s[4][64];
|
||||
static int nBuf = 0;
|
||||
unsigned char *ipByte = (unsigned char *)&unIP;
|
||||
_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
|
||||
const char *pchRet = s[nBuf];
|
||||
++nBuf;
|
||||
nBuf %= ( (sizeof(s)/sizeof(s[0])) );
|
||||
return pchRet;
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetConnectionAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usConnectionPort );
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetQueryAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usQueryPort );
|
||||
}
|
||||
|
||||
inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const
|
||||
{
|
||||
return ( m_unIP < netadr.m_unIP ) || ( m_unIP == netadr.m_unIP && m_usQueryPort < netadr.m_usQueryPort );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Data describing a single server
|
||||
//-----------------------------------------------------------------------------
|
||||
class gameserveritem_t
|
||||
{
|
||||
public:
|
||||
gameserveritem_t();
|
||||
|
||||
const char* GetName() const;
|
||||
void SetName( const char *pName );
|
||||
|
||||
public:
|
||||
servernetadr_t m_NetAdr; // IP/Query Port/Connection Port for this server
|
||||
int m_nPing; // current ping time in milliseconds
|
||||
bool m_bHadSuccessfulResponse; // server has responded successfully in the past
|
||||
bool m_bDoNotRefresh; // server is marked as not responding and should no longer be refreshed
|
||||
char m_szGameDir[32]; // current game directory
|
||||
char m_szMap[32]; // current map
|
||||
char m_szGameDescription[64]; // game description
|
||||
int m_nAppID; // Steam App ID of this server
|
||||
int m_nPlayers; // current number of players on the server
|
||||
int m_nMaxPlayers; // Maximum players that can join this server
|
||||
int m_nBotPlayers; // Number of bots (i.e simulated players) on this server
|
||||
bool m_bPassword; // true if this server needs a password to join
|
||||
bool m_bSecure; // Is this server protected by VAC
|
||||
uint32 m_ulTimeLastPlayed; // time (in unix time) when this server was last played on (for favorite/history servers)
|
||||
int m_nServerVersion; // server version as reported to Steam
|
||||
|
||||
private:
|
||||
char m_szServerName[64]; // Game server name
|
||||
|
||||
// For data added after SteamMatchMaking001 add it here
|
||||
public:
|
||||
char m_szGameTags[128]; // the tags this server exposes
|
||||
};
|
||||
|
||||
|
||||
inline gameserveritem_t::gameserveritem_t()
|
||||
{
|
||||
m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0;
|
||||
m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false;
|
||||
m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0;
|
||||
m_szGameTags[0] = 0;
|
||||
}
|
||||
|
||||
inline const char* gameserveritem_t::GetName() const
|
||||
{
|
||||
// Use the IP address as the name if nothing is set yet.
|
||||
if ( m_szServerName[0] == 0 )
|
||||
return m_NetAdr.GetConnectionAddressString();
|
||||
else
|
||||
return m_szServerName;
|
||||
}
|
||||
|
||||
inline void gameserveritem_t::SetName( const char *pName )
|
||||
{
|
||||
strncpy( m_szServerName, pName, sizeof( m_szServerName ) );
|
||||
}
|
||||
|
||||
|
||||
#endif // MATCHMAKINGTYPES_H
|
||||
318
res/steamworks/101/headers/steam_api.h
Normal file
318
res/steamworks/101/headers/steam_api.h
Normal file
@@ -0,0 +1,318 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_API_H
|
||||
#define STEAM_API_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "isteamuser.h"
|
||||
#include "isteamfriends.h"
|
||||
#include "isteamutils.h"
|
||||
#include "isteammatchmaking.h"
|
||||
#include "isteamuserstats.h"
|
||||
#include "isteamapps.h"
|
||||
#include "isteamnetworking.h"
|
||||
|
||||
// Steam API export macro
|
||||
#if defined( _WIN32 ) && !defined( _X360 )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __declspec( dllexport )
|
||||
#elif defined( STEAM_API_NODLL )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C" __declspec( dllimport )
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#elif defined( _LINUX )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#else // !WIN32
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// Steam API setup & shutdown
|
||||
//
|
||||
// These functions manage loading, initializing and shutdown of the steamclient.dll
|
||||
//
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// S_API void SteamAPI_Init(); (see below)
|
||||
S_API void SteamAPI_Shutdown();
|
||||
|
||||
// crash dump recording functions
|
||||
S_API void SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID );
|
||||
S_API void SteamAPI_SetMiniDumpComment( const char *pchMsg );
|
||||
|
||||
// interface pointers, configured by SteamAPI_Init()
|
||||
S_API ISteamClient *SteamClient();
|
||||
|
||||
|
||||
//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES is usually not necessary, but it provides safety against releasing
|
||||
// new steam_api.dll's without recompiling/rereleasing modules that use it.
|
||||
//
|
||||
// If you use VERSION_SAFE_STEAM_API_INTERFACES, then you should call SteamAPI_InitSafe(). Also, to get the
|
||||
// Steam interfaces, you must create and Init() a CSteamAPIContext (below) and use the interfaces in there.
|
||||
//
|
||||
// If you don't use VERSION_SAFE_STEAM_API_INTERFACES, then you can use SteamAPI_Init() and the SteamXXXX()
|
||||
// functions below to get at the Steam interfaces.
|
||||
//
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamAPI_InitSafe();
|
||||
#else
|
||||
S_API bool SteamAPI_Init();
|
||||
|
||||
S_API ISteamUser *SteamUser();
|
||||
S_API ISteamFriends *SteamFriends();
|
||||
S_API ISteamUtils *SteamUtils();
|
||||
S_API ISteamMatchmaking *SteamMatchmaking();
|
||||
S_API ISteamUserStats *SteamUserStats();
|
||||
S_API ISteamApps *SteamApps();
|
||||
S_API ISteamNetworking *SteamNetworking();
|
||||
S_API ISteamMatchmakingServers *SteamMatchmakingServers();
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steam callback helper functions
|
||||
//
|
||||
// The following classes/macros are used to be able to easily multiplex callbacks
|
||||
// from the Steam API into various objects in the app in a thread-safe manner
|
||||
//
|
||||
// These functors are triggered via the SteamAPI_RunCallbacks() function, mapping the callback
|
||||
// to as many functions/objects as are registered to it
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API void SteamAPI_RunCallbacks();
|
||||
|
||||
|
||||
|
||||
// functions used by the utility CCallback objects to receive callbacks
|
||||
S_API void SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback );
|
||||
S_API void SteamAPI_UnregisterCallback( class CCallbackBase *pCallback );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: base for callbacks,
|
||||
// used only by CCallback, shouldn't be used directly
|
||||
//-----------------------------------------------------------------------------
|
||||
class CCallbackBase
|
||||
{
|
||||
public:
|
||||
CCallbackBase() { m_nCallbackFlags = 0; }
|
||||
// don't add a virtual destructor because we export this binary interface across dll's
|
||||
virtual void Run( void *pvParam ) = 0;
|
||||
|
||||
protected:
|
||||
enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 };
|
||||
uint8 m_nCallbackFlags;
|
||||
private:
|
||||
int m_iCallback;
|
||||
friend class CCallbackMgr;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: maps a steam callback to a class member function
|
||||
// template params: T = local class, P = parameter struct
|
||||
//-----------------------------------------------------------------------------
|
||||
template< class T, class P, bool bGameServer >
|
||||
class CCallback : private CCallbackBase
|
||||
{
|
||||
public:
|
||||
typedef void (T::*func_t)( P* );
|
||||
|
||||
// If you can't support constructing a callback with the correct parameters
|
||||
// then uncomment the empty constructor below and manually call
|
||||
// ::Register() for your object
|
||||
// Or, just call the regular constructor with (NULL, NULL)
|
||||
// CCallback() {}
|
||||
|
||||
// constructor for initializing this object in owner's constructor
|
||||
CCallback( T *pObj, func_t func ) : m_pObj( pObj ), m_Func( func )
|
||||
{
|
||||
if ( pObj && func )
|
||||
Register( pObj, func );
|
||||
}
|
||||
|
||||
~CCallback()
|
||||
{
|
||||
Unregister();
|
||||
}
|
||||
|
||||
// manual registration of the callback
|
||||
void Register( T *pObj, func_t func )
|
||||
{
|
||||
if ( m_nCallbackFlags & k_ECallbackFlagsRegistered )
|
||||
Unregister();
|
||||
|
||||
if ( bGameServer )
|
||||
{
|
||||
m_nCallbackFlags |= k_ECallbackFlagsGameServer;
|
||||
}
|
||||
m_pObj = pObj;
|
||||
m_Func = func;
|
||||
SteamAPI_RegisterCallback( this, P::k_iCallback );
|
||||
}
|
||||
|
||||
void Unregister()
|
||||
{
|
||||
SteamAPI_UnregisterCallback( this );
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
|
||||
T *m_pObj;
|
||||
func_t m_Func;
|
||||
};
|
||||
|
||||
|
||||
// utility macro for declaring the function and callback object together
|
||||
#define STEAM_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, false > var; void func( param *pParam )
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
// disable this warning; this pattern need for steam callback registration
|
||||
#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// pumps out all the steam messages, calling the register callback
|
||||
S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks );
|
||||
|
||||
// register the callback funcs to use to interact with the steam dll
|
||||
S_API void Steam_RegisterInterfaceFuncs( void *hModule );
|
||||
|
||||
// returns the HSteamUser of the last user to dispatch a callback
|
||||
S_API HSteamUser Steam_GetHSteamUserCurrent();
|
||||
|
||||
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name
|
||||
S_API const char *SteamAPI_GetSteamInstallPath();
|
||||
|
||||
// returns the pipe we are communicating to Steam with
|
||||
S_API HSteamPipe SteamAPI_GetHSteamPipe();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamAPI_GetHSteamUser();
|
||||
|
||||
class CSteamAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamUser* SteamUser() { return m_pSteamUser; }
|
||||
ISteamFriends* SteamFriends() { return m_pSteamFriends; }
|
||||
ISteamUtils* SteamUtils() { return m_pSteamUtils; }
|
||||
ISteamMatchmaking* SteamMatchmaking() { return m_pSteamMatchmaking; }
|
||||
ISteamUserStats* SteamUserStats() { return m_pSteamUserStats; }
|
||||
ISteamApps* SteamApps() { return m_pSteamApps; }
|
||||
ISteamMatchmakingServers* SteamMatchmakingServers() { return m_pSteamMatchmakingServers; }
|
||||
ISteamNetworking* SteamNetworking() { return m_pSteamNetworking; }
|
||||
|
||||
private:
|
||||
ISteamUser *m_pSteamUser;
|
||||
ISteamFriends *m_pSteamFriends;
|
||||
ISteamUtils *m_pSteamUtils;
|
||||
ISteamMatchmaking *m_pSteamMatchmaking;
|
||||
ISteamUserStats *m_pSteamUserStats;
|
||||
ISteamApps *m_pSteamApps;
|
||||
ISteamMatchmakingServers *m_pSteamMatchmakingServers;
|
||||
ISteamNetworking *m_pSteamNetworking;
|
||||
};
|
||||
|
||||
inline CSteamAPIContext::CSteamAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamAPIContext::Clear()
|
||||
{
|
||||
m_pSteamUser = NULL;
|
||||
m_pSteamFriends = NULL;
|
||||
m_pSteamUtils = NULL;
|
||||
m_pSteamMatchmaking = NULL;
|
||||
m_pSteamUserStats = NULL;
|
||||
m_pSteamApps = NULL;
|
||||
m_pSteamMatchmakingServers = NULL;
|
||||
m_pSteamNetworking = NULL;
|
||||
}
|
||||
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamAPIContext::Init()
|
||||
{
|
||||
if ( !SteamClient() )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamAPI_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe();
|
||||
|
||||
m_pSteamUser = SteamClient()->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUser )
|
||||
return false;
|
||||
|
||||
m_pSteamFriends = SteamClient()->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamFriends )
|
||||
return false;
|
||||
|
||||
m_pSteamUtils = SteamClient()->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmaking = SteamClient()->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmaking )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmakingServers = SteamClient()->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmakingServers )
|
||||
return false;
|
||||
|
||||
m_pSteamUserStats = SteamClient()->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUserStats )
|
||||
return false;
|
||||
|
||||
m_pSteamApps = SteamClient()->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamApps )
|
||||
return false;
|
||||
|
||||
m_pSteamNetworking = SteamClient()->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamNetworking )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
#endif // STEAM_API_H
|
||||
134
res/steamworks/101/headers/steam_gameserver.h
Normal file
134
res/steamworks/101/headers/steam_gameserver.h
Normal file
@@ -0,0 +1,134 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_GAMESERVER_H
|
||||
#define STEAM_GAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api.h"
|
||||
#include "isteamgameserver.h"
|
||||
#include "isteammasterserverupdater.h"
|
||||
|
||||
enum EServerMode
|
||||
{
|
||||
eServerModeInvalid = 0, // DO NOT USE
|
||||
eServerModeNoAuthentication = 1, // Don't authenticate user logins and don't list on the server list
|
||||
eServerModeAuthentication = 2, // Authenticate users, list on the server list, don't run VAC on clients that connect
|
||||
eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients
|
||||
};
|
||||
|
||||
// Note: if you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it will use "GameSocketShare" mode,
|
||||
// which means that the game is responsible for sending and receiving UDP packets for the master
|
||||
// server updater. See references to GameSocketShare in isteammasterserverupdater.h.
|
||||
//
|
||||
// Pass 0 for usGamePort or usSpectatorPort if you're not using that. Then, the master server updater will report
|
||||
// what's running based on that.
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamGameServer_InitSafe( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString );
|
||||
#else
|
||||
S_API bool SteamGameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString );
|
||||
|
||||
S_API ISteamGameServer *SteamGameServer();
|
||||
S_API ISteamUtils *SteamGameServerUtils();
|
||||
S_API ISteamMasterServerUpdater *SteamMasterServerUpdater();
|
||||
S_API ISteamNetworking *SteamGameServerNetworking();
|
||||
#endif
|
||||
|
||||
S_API void SteamGameServer_Shutdown();
|
||||
S_API void SteamGameServer_RunCallbacks();
|
||||
|
||||
S_API bool SteamGameServer_BSecure();
|
||||
S_API uint64 SteamGameServer_GetSteamID();
|
||||
|
||||
#define STEAM_GAMESERVER_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, true > var; void func( param *pParam )
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
S_API HSteamPipe SteamGameServer_GetHSteamPipe();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamGameServer_GetHSteamUser();
|
||||
|
||||
class CSteamGameServerAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamGameServerAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamGameServer *SteamGameServer() { return m_pSteamGameServer; }
|
||||
ISteamUtils *SteamGameServerUtils() { return m_pSteamGameServerUtils; }
|
||||
ISteamMasterServerUpdater *SteamMasterServerUpdater() { return m_pSteamMasterServerUpdater; }
|
||||
ISteamNetworking *SteamGameServerNetworking() { return m_pSteamGameServerNetworking; }
|
||||
|
||||
private:
|
||||
ISteamGameServer *m_pSteamGameServer;
|
||||
ISteamUtils *m_pSteamGameServerUtils;
|
||||
ISteamMasterServerUpdater *m_pSteamMasterServerUpdater;
|
||||
ISteamNetworking *m_pSteamGameServerNetworking;
|
||||
};
|
||||
|
||||
inline CSteamGameServerAPIContext::CSteamGameServerAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamGameServerAPIContext::Clear()
|
||||
{
|
||||
m_pSteamGameServer = NULL;
|
||||
m_pSteamGameServerUtils = NULL;
|
||||
m_pSteamMasterServerUpdater = NULL;
|
||||
m_pSteamGameServerNetworking = NULL;
|
||||
}
|
||||
|
||||
S_API ISteamClient *g_pSteamClientGameServer;
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamGameServerAPIContext::Init()
|
||||
{
|
||||
if ( !g_pSteamClientGameServer )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamGameServer_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe();
|
||||
|
||||
m_pSteamGameServer = g_pSteamClientGameServer->GetISteamGameServer( hSteamUser, hSteamPipe, STEAMGAMESERVER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServer )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerUtils = g_pSteamClientGameServer->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMasterServerUpdater = g_pSteamClientGameServer->GetISteamMasterServerUpdater( hSteamUser, hSteamPipe, STEAMMASTERSERVERUPDATER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMasterServerUpdater )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerNetworking = g_pSteamClientGameServer->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerNetworking )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
|
||||
#endif // STEAM_GAMESERVER_H
|
||||
768
res/steamworks/101/headers/steamclientpublic.h
Normal file
768
res/steamworks/101/headers/steamclientpublic.h
Normal file
@@ -0,0 +1,768 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMCLIENTPUBLIC_H
|
||||
#define STEAMCLIENTPUBLIC_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
//lint -save -e1931 -e1927 -e1924 -e613 -e726
|
||||
|
||||
// This header file defines the interface between the calling application and the code that
|
||||
// knows how to communicate with the connection manager (CM) from the Steam service
|
||||
|
||||
// This header file is intended to be portable; ideally this 1 header file plus a lib or dll
|
||||
// is all you need to integrate the client library into some other tree. So please avoid
|
||||
// including or requiring other header files if possible. This header should only describe the
|
||||
// interface layer, no need to include anything about the implementation.
|
||||
|
||||
#include "steamtypes.h"
|
||||
|
||||
|
||||
// General result codes
|
||||
enum EResult
|
||||
{
|
||||
k_EResultOK = 1, // success
|
||||
k_EResultFail = 2, // generic failure
|
||||
k_EResultNoConnection = 3, // no/failed network connection
|
||||
// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed
|
||||
k_EResultInvalidPassword = 5, // password/ticket is invalid
|
||||
k_EResultLoggedInElsewhere = 6, // same user logged in elsewhere
|
||||
k_EResultInvalidProtocolVer = 7, // protocol version is incorrect
|
||||
k_EResultInvalidParam = 8, // a parameter is incorrect
|
||||
k_EResultFileNotFound = 9, // file was not found
|
||||
k_EResultBusy = 10, // called method busy - action not taken
|
||||
k_EResultInvalidState = 11, // called object was in an invalid state
|
||||
k_EResultInvalidName = 12, // name is invalid
|
||||
k_EResultInvalidEmail = 13, // email is invalid
|
||||
k_EResultDuplicateName = 14, // name is not unique
|
||||
k_EResultAccessDenied = 15, // access is denied
|
||||
k_EResultTimeout = 16, // operation timed out
|
||||
k_EResultBanned = 17, // VAC2 banned
|
||||
k_EResultAccountNotFound = 18, // account not found
|
||||
k_EResultInvalidSteamID = 19, // steamID is invalid
|
||||
k_EResultServiceUnavailable = 20, // The requested service is currently unavailable
|
||||
k_EResultNotLoggedOn = 21, // The user is not logged on
|
||||
k_EResultPending = 22, // Request is pending (may be in process, or waiting on third party)
|
||||
k_EResultEncryptionFailure = 23, // Encryption or Decryption failed
|
||||
k_EResultInsufficientPrivilege = 24, // Insufficient privilege
|
||||
k_EResultLimitExceeded = 25, // Too much of a good thing
|
||||
k_EResultRevoked = 26, // Access has been revoked (used for revoked guest passes)
|
||||
k_EResultExpired = 27, // License/Guest pass the user is trying to access is expired
|
||||
k_EResultAlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again
|
||||
k_EResultDuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time
|
||||
k_EResultAlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user
|
||||
k_EResultIPNotFound = 31, // IP address not found
|
||||
k_EResultPersistFailed = 32, // failed to write change to the data store
|
||||
k_EResultLockingFailed = 33, // failed to acquire access lock for this operation
|
||||
k_EResultLogonSessionReplaced = 34,
|
||||
k_EResultConnectFailed = 35,
|
||||
k_EResultHandshakeFailed = 36,
|
||||
k_EResultIOFailure = 37,
|
||||
k_EResultRemoteDisconnect = 38,
|
||||
k_EResultShoppingCartNotFound = 39, // failed to find the shopping cart requested
|
||||
k_EResultBlocked = 40, // a user didn't allow it
|
||||
k_EResultIgnored = 41, // target is ignoring sender
|
||||
k_EResultNoMatch = 42, // nothing matching the request found
|
||||
};
|
||||
|
||||
// Result codes to GSHandleClientDeny/Kick
|
||||
typedef enum
|
||||
{
|
||||
k_EDenyInvalidVersion = 1,
|
||||
k_EDenyGeneric = 2,
|
||||
k_EDenyNotLoggedOn = 3,
|
||||
k_EDenyNoLicense = 4,
|
||||
k_EDenyCheater = 5,
|
||||
k_EDenyLoggedInElseWhere = 6,
|
||||
k_EDenyUnknownText = 7,
|
||||
k_EDenyIncompatibleAnticheat = 8,
|
||||
k_EDenyMemoryCorruption = 9,
|
||||
k_EDenyIncompatibleSoftware = 10,
|
||||
k_EDenySteamConnectionLost = 11,
|
||||
k_EDenySteamConnectionError = 12,
|
||||
k_EDenySteamResponseTimedOut = 13,
|
||||
k_EDenySteamValidationStalled = 14,
|
||||
} EDenyReason;
|
||||
|
||||
// Steam universes. Each universe is a self-contained Steam instance.
|
||||
enum EUniverse
|
||||
{
|
||||
k_EUniverseInvalid = 0,
|
||||
k_EUniversePublic = 1,
|
||||
k_EUniverseBeta = 2,
|
||||
k_EUniverseInternal = 3,
|
||||
k_EUniverseDev = 4,
|
||||
k_EUniverseRC = 5,
|
||||
|
||||
k_EUniverseMax
|
||||
};
|
||||
|
||||
// Steam account types
|
||||
enum EAccountType
|
||||
{
|
||||
k_EAccountTypeInvalid = 0,
|
||||
k_EAccountTypeIndividual = 1, // single user account
|
||||
k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account
|
||||
k_EAccountTypeGameServer = 3, // game server account
|
||||
k_EAccountTypeAnonGameServer = 4, // anonymous game server account
|
||||
k_EAccountTypePending = 5, // pending
|
||||
k_EAccountTypeContentServer = 6, // content server
|
||||
k_EAccountTypeClan = 7,
|
||||
k_EAccountTypeChat = 8,
|
||||
k_EAccountTypeP2PSuperSeeder = 9, // a fake steamid used by superpeers to seed content to users of Steam P2P stuff
|
||||
k_EAccountTypeAnonUser = 10,
|
||||
|
||||
// Max of 16 items in this field
|
||||
k_EAccountTypeMax
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// types of user game stats fields
|
||||
// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ESteamUserStatType
|
||||
{
|
||||
k_ESteamUserStatTypeINVALID = 0,
|
||||
k_ESteamUserStatTypeINT = 1,
|
||||
k_ESteamUserStatTypeFLOAT = 2,
|
||||
// Read as FLOAT, set with count / session length
|
||||
k_ESteamUserStatTypeAVGRATE = 3,
|
||||
k_ESteamUserStatTypeACHIEVEMENTS = 4,
|
||||
k_ESteamUserStatTypeGROUPACHIEVEMENTS = 5,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Entry Types (previously was only friend-to-friend message types)
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatEntryType
|
||||
{
|
||||
k_EChatEntryTypeChatMsg = 1, // Normal text message from another user
|
||||
k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat)
|
||||
k_EChatEntryTypeInviteGame = 3, // Invite from other user into that users current game
|
||||
k_EChatEntryTypeEmote = 4, // text emote message
|
||||
k_EChatEntryTypeLobbyGameStart = 5, // lobby game is starting
|
||||
// Above are previous FriendMsgType entries, now merged into more generic chat entry types
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Room Enter Responses
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatRoomEnterResponse
|
||||
{
|
||||
k_EChatRoomEnterResponseSuccess = 1, // Success
|
||||
k_EChatRoomEnterResponseDoesntExist = 2, // Chat doesn't exist (probably closed)
|
||||
k_EChatRoomEnterResponseNotAllowed = 3, // General Denied - You don't have the permissions needed to join the chat
|
||||
k_EChatRoomEnterResponseFull = 4, // Chat room has reached its maximum size
|
||||
k_EChatRoomEnterResponseError = 5, // Unexpected Error
|
||||
k_EChatRoomEnterResponseBanned = 6, // You are banned from this chat room and may not join
|
||||
};
|
||||
|
||||
|
||||
typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath );
|
||||
typedef bool (*PFNLegacyKeyInstalled)();
|
||||
|
||||
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
// Steam ID structure (64 bits total)
|
||||
class CSteamID
|
||||
{
|
||||
public:
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID()
|
||||
{
|
||||
m_unAccountID = 0;
|
||||
m_EAccountType = k_EAccountTypeInvalid;
|
||||
m_EUniverse = k_EUniverseInvalid;
|
||||
m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
Set( unAccountID, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// unAccountInstance - instance
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
#if defined(_SERVER) && defined(Assert)
|
||||
Assert( ! ( ( k_EAccountTypeIndividual == eAccountType ) && ( 1 != unAccountInstance ) ) ); // enforce that for individual accounts, instance is always 1
|
||||
#endif // _SERVER
|
||||
InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
// Note: Will not accept a uint32 or int32 as input, as that is a probable mistake.
|
||||
// See the stubbed out overloads in the private: section for more info.
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint64 ulSteamID )
|
||||
{
|
||||
SetFromUint64( ulSteamID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void Set( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_unAccountID = unAccountID;
|
||||
m_EUniverse = eUniverse;
|
||||
m_EAccountType = eAccountType;
|
||||
m_unAccountInstance = 1;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void InstancedSet( uint32 unAccountID, uint32 unInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_unAccountID = unAccountID;
|
||||
m_EUniverse = eUniverse;
|
||||
m_EAccountType = eAccountType;
|
||||
m_unAccountInstance = unInstance;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 52 bit parts and universe/type
|
||||
// Input : ulIdentifier - 52 bits of goodness
|
||||
//-----------------------------------------------------------------------------
|
||||
void FullSet( uint64 ulIdentifier, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_unAccountID = ( ulIdentifier & 0xFFFFFFFF ); // account ID is low 32 bits
|
||||
m_unAccountInstance = ( ( ulIdentifier >> 32 ) & 0xFFFFF ); // account instance is next 20 bits
|
||||
m_EUniverse = eUniverse;
|
||||
m_EAccountType = eAccountType;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 64-bit representation
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromUint64( uint64 ulSteamID )
|
||||
{
|
||||
m_unAccountID = ( ulSteamID & 0xFFFFFFFF ); // account ID is low 32 bits
|
||||
m_unAccountInstance = ( ( ulSteamID >> 32 ) & 0xFFFFF ); // account instance is next 20 bits
|
||||
|
||||
m_EAccountType = ( EAccountType ) ( ( ulSteamID >> 52 ) & 0xF ); // type is next 4 bits
|
||||
m_EUniverse = ( EUniverse ) ( ( ulSteamID >> 56 ) & 0xFF ); // universe is next 8 bits
|
||||
}
|
||||
|
||||
|
||||
#if defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to convert
|
||||
// eUniverse - universe this ID belongs to
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromSteam2( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse )
|
||||
{
|
||||
m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 +
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits;
|
||||
m_EUniverse = eUniverse; // set the universe
|
||||
m_EAccountType = k_EAccountTypeIndividual; // Steam 2 accounts always map to account type of individual
|
||||
m_unAccountInstance = 1; // individual accounts always have an account instance ID of 1
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fills out a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to write to
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConvertToSteam2( TSteamGlobalUserID *pTSteamGlobalUserID ) const
|
||||
{
|
||||
// only individual accounts have any meaning in Steam 2, only they can be mapped
|
||||
// Assert( m_EAccountType == k_EAccountTypeIndividual );
|
||||
|
||||
pTSteamGlobalUserID->m_SteamInstanceID = 0;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits = m_unAccountID % 2;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits = m_unAccountID / 2;
|
||||
}
|
||||
#endif // defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts steam ID to its 64-bit representation
|
||||
// Output : 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 ConvertToUint64() const
|
||||
{
|
||||
return (uint64) ( ( ( (uint64) m_EUniverse ) << 56 ) + ( ( (uint64) m_EAccountType ) << 52 ) +
|
||||
( ( (uint64) m_unAccountInstance ) << 32 ) + m_unAccountID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts the static parts of a steam ID to a 64-bit representation.
|
||||
// For multiseat accounts, all instances of that account will have the
|
||||
// same static account key, so they can be grouped together by the static
|
||||
// account key.
|
||||
// Output : 64-bit static account key
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 GetStaticAccountKey() const
|
||||
{
|
||||
// note we do NOT include the account instance (which is a dynamic property) in the static account key
|
||||
return (uint64) ( ( ( (uint64) m_EUniverse ) << 56 ) + ((uint64) m_EAccountType << 52 ) + m_unAccountID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_unAccountID = 0;
|
||||
m_EAccountType = k_EAccountTypeAnonGameServer;
|
||||
m_EUniverse = eUniverse;
|
||||
m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonUserLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_unAccountID = 0;
|
||||
m_EAccountType = k_EAccountTypeAnonUser;
|
||||
m_EUniverse = eUniverse;
|
||||
m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous game server login that will be filled in?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BBlankAnonAccount() const
|
||||
{
|
||||
return m_unAccountID == 0 && BAnonAccount() && m_unAccountInstance == 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a game server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BGameServerAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeGameServer || m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a content server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BContentServerAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeContentServer;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a clan account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BClanAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeClan;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a chat account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BChatAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeChat;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an individual user account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BIndividualAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeIndividual;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous account?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BAnonAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeAnonUser || m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
|
||||
// simple accessors
|
||||
void SetAccountID( uint32 unAccountID ) { m_unAccountID = unAccountID; }
|
||||
uint32 GetAccountID() const { return m_unAccountID; }
|
||||
uint32 GetUnAccountInstance() const { return m_unAccountInstance; }
|
||||
EAccountType GetEAccountType() const { return ( EAccountType ) m_EAccountType; }
|
||||
EUniverse GetEUniverse() const { return m_EUniverse; }
|
||||
void SetEUniverse( EUniverse eUniverse ) { m_EUniverse = eUniverse; }
|
||||
bool IsValid() const { return ( m_EAccountType != k_EAccountTypeInvalid && m_EUniverse != k_EUniverseInvalid ); }
|
||||
|
||||
// this set of functions is hidden, will be moved out of class
|
||||
explicit CSteamID( const char *pchSteamID, EUniverse eDefaultUniverse = k_EUniverseInvalid );
|
||||
char * Render() const; // renders this steam ID to string
|
||||
static char * Render( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string
|
||||
|
||||
void SetFromString( const char *pchSteamID, EUniverse eDefaultUniverse );
|
||||
bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse );
|
||||
|
||||
bool operator==( const CSteamID &val ) const
|
||||
{
|
||||
return ( ( val.m_unAccountID == m_unAccountID ) && ( val.m_unAccountInstance == m_unAccountInstance )
|
||||
&& ( val.m_EAccountType == m_EAccountType ) && ( val.m_EUniverse == m_EUniverse ) );
|
||||
}
|
||||
|
||||
bool operator!=( const CSteamID &val ) const { return !operator==( val ); }
|
||||
bool operator<( const CSteamID &val ) const { return ConvertToUint64() < val.ConvertToUint64(); }
|
||||
bool operator>( const CSteamID &val ) const { return ConvertToUint64() > val.ConvertToUint64(); }
|
||||
|
||||
// DEBUG function
|
||||
bool BValidExternalSteamID() const;
|
||||
|
||||
private:
|
||||
// These are defined here to prevent accidental implicit conversion of a u32AccountID to a CSteamID.
|
||||
// If you get a compiler error about an ambiguous constructor/function then it may be because you're
|
||||
// passing a 32-bit int to a function that takes a CSteamID. You should explicitly create the SteamID
|
||||
// using the correct Universe and account Type/Instance values.
|
||||
CSteamID( uint32 );
|
||||
CSteamID( int32 );
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4201) // nameless union is nonstandard
|
||||
// 64 bits total
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
#endif
|
||||
uint32 m_unAccountID : 32; // unique account identifier
|
||||
unsigned int m_unAccountInstance : 20; // dynamic instance ID (used for multiseat type accounts only)
|
||||
unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference
|
||||
EUniverse m_EUniverse : 8; // universe this account belongs to
|
||||
#ifdef _WIN32
|
||||
};
|
||||
|
||||
uint64 m_unAll64Bits;
|
||||
};
|
||||
#pragma warning(pop) // no more anonymous unions until next time
|
||||
#endif
|
||||
};
|
||||
|
||||
const int k_unSteamAccountIDMask = 0xFFFFFFFF;
|
||||
const int k_unSteamAccountInstanceMask = 0x000FFFFF;
|
||||
|
||||
|
||||
// Special flags for Chat accounts - they go in the top 8 bits
|
||||
// of the steam ID's "instance", leaving 12 for the actual instances
|
||||
enum EChatSteamIDInstanceFlags
|
||||
{
|
||||
k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags
|
||||
|
||||
k_EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) >> 1, // top bit
|
||||
k_EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 2, // next one down, etc
|
||||
|
||||
// Max of 8 flags
|
||||
};
|
||||
|
||||
|
||||
// generic invalid CSteamID
|
||||
const CSteamID k_steamIDNil;
|
||||
|
||||
// This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol
|
||||
// to provide its steamID
|
||||
const CSteamID k_steamIDOutofDateGS( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
// This steamID comes from a user game connection to an sv_lan GS
|
||||
const CSteamID k_steamIDLanModeGS( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid );
|
||||
// This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized
|
||||
// its steam3 component and started logging on.
|
||||
const CSteamID k_steamIDNotInitYetGS( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
|
||||
|
||||
#ifdef STEAM
|
||||
// Returns the matching chat steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance
|
||||
CSteamID ChatIDFromSteamID( CSteamID &steamID );
|
||||
// Returns the matching clan steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance
|
||||
CSteamID ClanIDFromSteamID( CSteamID &steamID );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ChatIDFromClanID( CSteamID &steamIDClan );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ClanIDFromChatID( CSteamID &steamIDChat );
|
||||
|
||||
#endif // _STEAM
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: encapsulates an appID/modID pair
|
||||
//-----------------------------------------------------------------------------
|
||||
class CGameID
|
||||
{
|
||||
public:
|
||||
|
||||
CGameID()
|
||||
{
|
||||
m_gameID.m_nType = k_EGameIDTypeApp;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nModID = 0;
|
||||
}
|
||||
|
||||
explicit CGameID( uint64 ulGameID )
|
||||
{
|
||||
m_ulGameID = ulGameID;
|
||||
}
|
||||
|
||||
explicit CGameID( int32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
explicit CGameID( uint32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
CGameID( uint32 nAppID, uint32 nModID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nModID = nModID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
}
|
||||
|
||||
// Hidden functions used only by Steam
|
||||
explicit CGameID( const char *pchGameID );
|
||||
char *Render() const; // render this Game ID to string
|
||||
static char *Render( uint64 ulGameID ); // static method to render a uint64 representation of a Game ID to a string
|
||||
|
||||
// must include checksum_crc.h first to get this functionality
|
||||
#if defined( CHECKSUM_CRC_H )
|
||||
CGameID( uint32 nAppID, const char *pchModPath )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
|
||||
char rgchModDir[MAX_PATH];
|
||||
Q_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) );
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, rgchModDir, Q_strlen( rgchModDir ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
CGameID( const char *pchExePath, const char *pchAppName )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeShortcut;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, pchExePath, Q_strlen( pchExePath ) );
|
||||
CRC32_ProcessBuffer( &crc32, pchAppName, Q_strlen( pchAppName ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#if defined( VSTFILEID_H )
|
||||
|
||||
CGameID( VstFileID vstFileID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeP2P;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
const char *pchFileId = vstFileID.Render();
|
||||
CRC32_ProcessBuffer( &crc32, pchFileId, Q_strlen( pchFileId ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#endif /* VSTFILEID_H */
|
||||
|
||||
#endif /* CHECKSUM_CRC_H */
|
||||
|
||||
|
||||
uint64 ToUint64() const
|
||||
{
|
||||
return m_ulGameID;
|
||||
}
|
||||
|
||||
uint64 *GetUint64Ptr()
|
||||
{
|
||||
return &m_ulGameID;
|
||||
}
|
||||
|
||||
bool IsMod() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeGameMod );
|
||||
}
|
||||
|
||||
bool IsShortcut() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeShortcut );
|
||||
}
|
||||
|
||||
bool IsP2PFile() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeP2P );
|
||||
}
|
||||
|
||||
bool IsSteamApp() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeApp );
|
||||
}
|
||||
|
||||
uint32 ModID() const
|
||||
{
|
||||
return m_gameID.m_nModID;
|
||||
}
|
||||
|
||||
uint32 AppID() const
|
||||
{
|
||||
return m_gameID.m_nAppID;
|
||||
}
|
||||
|
||||
bool operator == ( const CGameID &rhs ) const
|
||||
{
|
||||
return m_ulGameID == rhs.m_ulGameID;
|
||||
}
|
||||
|
||||
bool operator != ( const CGameID &rhs ) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
bool operator < ( const CGameID &rhs ) const
|
||||
{
|
||||
return ( m_ulGameID < rhs.m_ulGameID );
|
||||
}
|
||||
|
||||
bool IsValid() const
|
||||
{
|
||||
// each type has it's own invalid fixed point:
|
||||
switch( m_gameID.m_nType )
|
||||
{
|
||||
case k_EGameIDTypeApp:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid;
|
||||
break;
|
||||
case k_EGameIDTypeGameMod:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
case k_EGameIDTypeShortcut:
|
||||
return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
case k_EGameIDTypeP2P:
|
||||
return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
default:
|
||||
#if defined(Assert)
|
||||
Assert(false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
enum EGameIDType
|
||||
{
|
||||
k_EGameIDTypeApp = 0,
|
||||
k_EGameIDTypeGameMod = 1,
|
||||
k_EGameIDTypeShortcut = 2,
|
||||
k_EGameIDTypeP2P = 3,
|
||||
};
|
||||
|
||||
struct GameID_t
|
||||
{
|
||||
unsigned int m_nAppID : 24;
|
||||
unsigned int m_nType : 8;
|
||||
unsigned int m_nModID : 32;
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
uint64 m_ulGameID;
|
||||
GameID_t m_gameID;
|
||||
};
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
const int k_cchGameExtraInfoMax = 64;
|
||||
|
||||
|
||||
// Max number of credit cards stored for one account
|
||||
const int k_nMaxNumCardsPerAccount = 1;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constants used for query ports.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define QUERY_PORT_NOT_INITIALIZED 0xFFFF // We haven't asked the GS for this query port's actual value yet.
|
||||
#define QUERY_PORT_ERROR 0xFFFE // We were unable to get the query port for this server.
|
||||
|
||||
#endif // STEAMCLIENTPUBLIC_H
|
||||
87
res/steamworks/101/headers/steamtypes.h
Normal file
87
res/steamworks/101/headers/steamtypes.h
Normal file
@@ -0,0 +1,87 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMTYPES_H
|
||||
#define STEAMTYPES_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Steam-specific types. Defined here so this header file can be included in other code bases.
|
||||
#ifndef WCHARTYPES_H
|
||||
typedef unsigned char uint8;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(_WIN64)
|
||||
#define X64BITS
|
||||
#endif
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef signed char int8;
|
||||
|
||||
#if defined( _WIN32 )
|
||||
|
||||
typedef __int16 int16;
|
||||
typedef unsigned __int16 uint16;
|
||||
typedef __int32 int32;
|
||||
typedef unsigned __int32 uint32;
|
||||
typedef __int64 int64;
|
||||
typedef unsigned __int64 uint64;
|
||||
|
||||
#ifdef X64BITS
|
||||
typedef __int64 intp; // intp is an integer that can accomodate a pointer
|
||||
typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *)
|
||||
#else
|
||||
typedef __int32 intp;
|
||||
typedef unsigned __int32 uintp;
|
||||
#endif
|
||||
|
||||
#else // _WIN32
|
||||
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
#ifdef X64BITS
|
||||
typedef long long intp;
|
||||
typedef unsigned long long uintp;
|
||||
#else
|
||||
typedef int intp;
|
||||
typedef unsigned int uintp;
|
||||
#endif
|
||||
|
||||
#endif // else _WIN32
|
||||
|
||||
const int k_cubDigestSize = 20; // CryptoPP::SHA::DIGESTSIZE
|
||||
const int k_cubSaltSize = 8;
|
||||
|
||||
typedef uint8 SHADigest_t[ k_cubDigestSize ];
|
||||
typedef uint8 Salt_t[ k_cubSaltSize ];
|
||||
|
||||
typedef uint64 GID_t; // globally unique identifier
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 PackageId_t;
|
||||
const PackageId_t k_uPackageIdInvalid = 0xFFFFFFFF;
|
||||
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 AppId_t;
|
||||
const AppId_t k_uAppIdInvalid = 0x0;
|
||||
|
||||
// RTime32
|
||||
// We use this 32 bit time representing real world time.
|
||||
// It offers 1 second resolution beginning on January 1, 1970 (Unix time)
|
||||
typedef uint32 RTime32;
|
||||
|
||||
typedef uint32 CellID_t;
|
||||
|
||||
#endif // STEAMTYPES_H
|
||||
32
res/steamworks/102/headers/isteamapps.h
Normal file
32
res/steamworks/102/headers/isteamapps.h
Normal file
@@ -0,0 +1,32 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to app data in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMAPPS_H
|
||||
#define ISTEAMAPPS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to app data
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamApps
|
||||
{
|
||||
public:
|
||||
virtual bool BIsSubscribed() = 0;
|
||||
virtual bool BIsLowViolence() = 0;
|
||||
virtual bool BIsCybercafe() = 0;
|
||||
virtual bool BIsVACBanned() = 0;
|
||||
virtual const char *GetCurrentGameLanguage() = 0;
|
||||
virtual const char *GetAvailableGameLanguages() = 0;
|
||||
|
||||
// only use this member if you need to check ownership of another game related to yours, a demo for example
|
||||
virtual bool BIsSubscribedApp( AppId_t appID ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION002"
|
||||
|
||||
#endif // ISTEAMAPPS_H
|
||||
149
res/steamworks/102/headers/isteamclient.h
Normal file
149
res/steamworks/102/headers/isteamclient.h
Normal file
@@ -0,0 +1,149 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: Main interface for loading and accessing Steamworks API's from the
|
||||
// Steam client.
|
||||
// For most uses, this code is wrapped inside of SteamAPI_Init()
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMCLIENT_H
|
||||
#define ISTEAMCLIENT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a communication pipe to the Steam client
|
||||
typedef int32 HSteamPipe;
|
||||
// handle to single instance of a steam user
|
||||
typedef int32 HSteamUser;
|
||||
// function prototype
|
||||
#if defined( POSIX ) && !defined( _CYGWIN )
|
||||
#define __cdecl
|
||||
#endif
|
||||
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
|
||||
|
||||
// interface predec
|
||||
class ISteamUser;
|
||||
class ISteamGameServer;
|
||||
class ISteamFriends;
|
||||
class ISteamUtils;
|
||||
class ISteamMatchmaking;
|
||||
class ISteamContentServer;
|
||||
class ISteamMasterServerUpdater;
|
||||
class ISteamMatchmakingServers;
|
||||
class ISteamUserStats;
|
||||
class ISteamApps;
|
||||
class ISteamNetworking;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Interface to creating a new steam instance, or to
|
||||
// connect to an existing steam instance, whether it's in a
|
||||
// different process or is local.
|
||||
//
|
||||
// For most scenarios this is all handled automatically via SteamAPI_Init().
|
||||
// You'll only need to use these interfaces if you have a more complex versioning scheme,
|
||||
// where you want to get different versions of the same interface in different dll's in your project.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamClient
|
||||
{
|
||||
public:
|
||||
// Creates a communication pipe to the Steam client
|
||||
virtual HSteamPipe CreateSteamPipe() = 0;
|
||||
|
||||
// Releases a previously created communications pipe
|
||||
virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// connects to an existing global user, failing if none exists
|
||||
// used by the game to coordinate with the steamUI
|
||||
virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// used by game servers, create a steam user that won't be shared with anyone else
|
||||
virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe ) = 0;
|
||||
|
||||
// removes an allocated user
|
||||
virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0;
|
||||
|
||||
// retrieves the ISteamUser interface associated with the handle
|
||||
virtual ISteamUser *GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// retrieves the ISteamGameServer interface associated with the handle
|
||||
virtual ISteamGameServer *GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// set the local IP and Port to bind to
|
||||
// this must be set before CreateLocalUser()
|
||||
virtual void SetLocalIPBinding( uint32 unIP, uint16 usPort ) = 0;
|
||||
|
||||
// returns the ISteamFriends interface
|
||||
virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamUtils interface
|
||||
virtual ISteamUtils *GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmaking interface
|
||||
virtual ISteamMatchmaking *GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamContentServer interface
|
||||
virtual ISteamContentServer *GetISteamContentServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMasterServerUpdater interface
|
||||
virtual ISteamMasterServerUpdater *GetISteamMasterServerUpdater( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmakingServers interface
|
||||
virtual ISteamMatchmakingServers *GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the a generic interface
|
||||
virtual void *GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// this needs to be called every frame to process matchmaking results
|
||||
// redundant if you're already calling SteamAPI_RunCallbacks()
|
||||
virtual void RunFrame() = 0;
|
||||
|
||||
// returns the number of IPC calls made since the last time this function was called
|
||||
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
||||
// Every IPC call is at minimum a thread context switch if not a process one so you want to rate
|
||||
// control how often you do them.
|
||||
virtual uint32 GetIPCCallCount() = 0;
|
||||
|
||||
// returns the ISteamUserStats interface
|
||||
virtual ISteamUserStats *GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns apps interface
|
||||
virtual ISteamApps *GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// networking
|
||||
virtual ISteamNetworking *GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// API warning handling
|
||||
// 'int' is the severity; 0 for msg, 1 for warning
|
||||
// 'const char *' is the text of the message
|
||||
// callbacks will occur directly after the API function is called that generated the warning or message
|
||||
virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient007"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Base values for callback identifiers, each callback must
|
||||
// have a unique ID.
|
||||
//-----------------------------------------------------------------------------
|
||||
enum { k_iSteamUserCallbacks = 100 };
|
||||
enum { k_iSteamGameServerCallbacks = 200 };
|
||||
enum { k_iSteamFriendsCallbacks = 300 };
|
||||
enum { k_iSteamBillingCallbacks = 400 };
|
||||
enum { k_iSteamMatchmakingCallbacks = 500 };
|
||||
enum { k_iSteamContentServerCallbacks = 600 };
|
||||
enum { k_iSteamUtilsCallbacks = 700 };
|
||||
enum { k_iClientFriendsCallbacks = 800 };
|
||||
enum { k_iClientUserCallbacks = 900 };
|
||||
enum { k_iSteamAppsCallbacks = 1000 };
|
||||
enum { k_iSteamUserStatsCallbacks = 1100 };
|
||||
enum { k_iSteamNetworkingCallbacks = 1200 };
|
||||
enum { k_iClientRemoteStorageCallbacks = 1300 };
|
||||
enum { k_iSteamUserItemsCallbacks = 1400 };
|
||||
enum { k_iSteamGameServerItemsCallbacks = 1500 };
|
||||
enum { k_iClientUtilsCallbacks = 1600 };
|
||||
|
||||
|
||||
#endif // ISTEAMCLIENT_H
|
||||
212
res/steamworks/102/headers/isteamfriends.h
Normal file
212
res/steamworks/102/headers/isteamfriends.h
Normal file
@@ -0,0 +1,212 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to both friends list data and general information about users
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMFRIENDS_H
|
||||
#define ISTEAMFRIENDS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: set of relationships to other users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EFriendRelationship
|
||||
{
|
||||
k_EFriendRelationshipNone = 0,
|
||||
k_EFriendRelationshipBlocked = 1,
|
||||
k_EFriendRelationshipRequestRecipient = 2,
|
||||
k_EFriendRelationshipFriend = 3,
|
||||
k_EFriendRelationshipRequestInitiator = 4,
|
||||
k_EFriendRelationshipIgnored = 5,
|
||||
k_EFriendRelationshipIgnoredFriend = 6,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: list of states a friend can be in
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EPersonaState
|
||||
{
|
||||
k_EPersonaStateOffline = 0, // friend is not currently logged on
|
||||
k_EPersonaStateOnline = 1, // friend is logged on
|
||||
k_EPersonaStateBusy = 2, // user is on, but busy
|
||||
k_EPersonaStateAway = 3, // auto-away feature
|
||||
k_EPersonaStateSnooze = 4, // auto-away for a long time
|
||||
k_EPersonaStateMax,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: flags for enumerating friends list, or quickly checking a the relationship between users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EFriendFlags
|
||||
{
|
||||
k_EFriendFlagNone = 0x00,
|
||||
k_EFriendFlagBlocked = 0x01,
|
||||
k_EFriendFlagFriendshipRequested = 0x02,
|
||||
k_EFriendFlagImmediate = 0x04, // "regular" friend
|
||||
k_EFriendFlagClanMember = 0x08,
|
||||
k_EFriendFlagOnGameServer = 0x10,
|
||||
// k_EFriendFlagHasPlayedWith = 0x20, // not currently used
|
||||
// k_EFriendFlagFriendOfFriend = 0x40, // not currently used
|
||||
k_EFriendFlagRequestingFriendship = 0x80,
|
||||
k_EFriendFlagRequestingInfo = 0x100,
|
||||
k_EFriendFlagIgnored = 0x200,
|
||||
k_EFriendFlagIgnoredFriend = 0x400,
|
||||
k_EFriendFlagAll = 0xFFFF,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: avatar sizes, used in ISteamFriends::GetFriendAvatar()
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EAvatarSize
|
||||
{
|
||||
k_EAvatarSize32x32 = 0,
|
||||
k_EAvatarSize64x64 = 1,
|
||||
};
|
||||
|
||||
|
||||
// maximum number of characters in a users name
|
||||
enum { k_cchPersonaNameMax = 128 };
|
||||
|
||||
// size limit on chat room or member metadata
|
||||
const uint32 k_cubChatMetadataMax = 8192;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to accessing information about individual users,
|
||||
// that can be a friend, in a group, on a game server or in a lobby with the local user
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamFriends
|
||||
{
|
||||
public:
|
||||
// returns the local players name - guaranteed to not be NULL.
|
||||
// this is the same name as on the users community profile page
|
||||
// this is stored in UTF-8 format
|
||||
// like all the other interface functions that return a char *, it's important that this pointer is not saved
|
||||
// off; it will eventually be free'd or re-allocated
|
||||
virtual const char *GetPersonaName() = 0;
|
||||
|
||||
// sets the player name, stores it on the server and publishes the changes to all friends who are online
|
||||
virtual void SetPersonaName( const char *pchPersonaName ) = 0;
|
||||
|
||||
// gets the status of the current user
|
||||
virtual EPersonaState GetPersonaState() = 0;
|
||||
|
||||
// friend iteration
|
||||
// takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria
|
||||
// then GetFriendByIndex() can then be used to return the id's of each of those users
|
||||
virtual int GetFriendCount( int iFriendFlags ) = 0;
|
||||
|
||||
// returns the steamID of a user
|
||||
// iFriend is a index of range [0, GetFriendCount())
|
||||
// iFriendsFlags must be the same value as used in GetFriendCount()
|
||||
// the returned CSteamID can then be used by all the functions below to access details about the user
|
||||
virtual CSteamID GetFriendByIndex( int iFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// returns a relationship to a user
|
||||
virtual EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the current status of the specified user
|
||||
// this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user
|
||||
virtual EPersonaState GetFriendPersonaState( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the name another user - guaranteed to not be NULL.
|
||||
// same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user
|
||||
// note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously
|
||||
//
|
||||
virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// gets the avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetFriendAvatar( CSteamID steamIDFriend, int eAvatarSize ) = 0;
|
||||
// returns true if the friend is actually in a game
|
||||
virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, uint64 *pulGameID, uint32 *punGameIP, uint16 *pusGamePort, uint16 *pusQueryPort ) = 0;
|
||||
// accesses old friends names - returns an empty string when their are no more items in the history
|
||||
virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0;
|
||||
|
||||
// returns true if the specified user meets any of the criteria specified in iFriendFlags
|
||||
// iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values
|
||||
virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// clan (group) iteration and access functions
|
||||
virtual int GetClanCount() = 0;
|
||||
virtual CSteamID GetClanByIndex( int iClan ) = 0;
|
||||
virtual const char *GetClanName( CSteamID steamIDClan ) = 0;
|
||||
|
||||
// iterators for getting users in a chat room, lobby, game server or clan
|
||||
// note that large clans that cannot be iterated by the local user
|
||||
// steamIDSource can be the steamID of a group, game server, lobby or chat room
|
||||
virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0;
|
||||
virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0;
|
||||
|
||||
// returns true if the local user can see that steamIDUser is a member or in steamIDSource
|
||||
virtual bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) = 0;
|
||||
|
||||
// User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI)
|
||||
virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0;
|
||||
|
||||
// activates the game overlay, with an optional dialog to open ("Friends", "Community", "Players", "Settings")
|
||||
virtual void ActivateGameOverlay( const char *pchDialog ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends004"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a friends' status changes
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PersonaStateChange_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamID; // steamID of the friend who changed
|
||||
int m_nChangeFlags; // what's changed
|
||||
};
|
||||
|
||||
|
||||
// used in PersonaStateChange_t::m_nChangeFlags to describe what's changed about a user
|
||||
// these flags describe what the client has learned has changed recently, so on startup you'll see a name, avatar & relationship change for every friend
|
||||
enum EPersonaChange
|
||||
{
|
||||
k_EPersonaChangeName = 0x001,
|
||||
k_EPersonaChangeStatus = 0x002,
|
||||
k_EPersonaChangeComeOnline = 0x004,
|
||||
k_EPersonaChangeGoneOffline = 0x008,
|
||||
k_EPersonaChangeGamePlayed = 0x010,
|
||||
k_EPersonaChangeGameServer = 0x020,
|
||||
k_EPersonaChangeAvatar = 0x040,
|
||||
k_EPersonaChangeJoinedSource= 0x080,
|
||||
k_EPersonaChangeLeftSource = 0x100,
|
||||
k_EPersonaChangeRelationshipChanged = 0x200,
|
||||
k_EPersonaChangeNameFirstSet = 0x400,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: posted when game overlay activates or deactivates
|
||||
// the game can use this to be pause or resume single player games
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameOverlayActivated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 31 };
|
||||
uint8 m_bActive; // true if it's just been activated, false otherwise
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the user tries to join a different game server from their friends list
|
||||
// game client should attempt to connect to specified server when this is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameServerChangeRequested_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 32 };
|
||||
char m_rgchServer[64]; // server address ("127.0.0.1:27015", "tf2.valvesoftware.com")
|
||||
char m_rgchPassword[64]; // server password, if any
|
||||
};
|
||||
|
||||
#endif // ISTEAMFRIENDS_H
|
||||
161
res/steamworks/102/headers/isteamgameserver.h
Normal file
161
res/steamworks/102/headers/isteamgameserver.h
Normal file
@@ -0,0 +1,161 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMGAMESERVER_H
|
||||
#define ISTEAMGAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for authenticating users via Steam to play on a game server
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamGameServer
|
||||
{
|
||||
public:
|
||||
// connection functions
|
||||
virtual void LogOn() = 0;
|
||||
virtual void LogOff() = 0;
|
||||
|
||||
// status functions
|
||||
virtual bool BLoggedOn() = 0;
|
||||
virtual bool BSecure() = 0;
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Handles receiving a new connection from a Steam user. This call will ask the Steam
|
||||
// servers to validate the users identity, app ownership, and VAC status. If the Steam servers
|
||||
// are off-line, then it will validate the cached ticket itself which will validate app ownership
|
||||
// and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection()
|
||||
// and must then be sent up to the game server for authentication.
|
||||
//
|
||||
// Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL
|
||||
// If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication
|
||||
// for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)
|
||||
virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0;
|
||||
|
||||
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||
//
|
||||
// Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect()
|
||||
// when this user leaves the server just like you would for a real user.
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection() = 0;
|
||||
|
||||
// Should be called whenever a user leaves our game server, this lets Steam internally
|
||||
// track which users are currently on which servers for the purposes of preventing a single
|
||||
// account being logged into multiple servers, showing who is currently on a server, etc.
|
||||
virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// Update the data to be displayed in the server browser and matchmaking interfaces for a user
|
||||
// currently connected to the server. For regular users you must call this after you receive a
|
||||
// GSUserValidationSuccess callback.
|
||||
//
|
||||
// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
|
||||
virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
|
||||
|
||||
// You shouldn't need to call this as it is called internally by SteamGameServer_Init() and can only be called once.
|
||||
//
|
||||
// To update the data in this call which may change during the servers lifetime see UpdateServerStatus() below.
|
||||
//
|
||||
// Input: nGameAppID - The Steam assigned AppID for the game
|
||||
// unServerFlags - Any applicable combination of flags (see k_unServerFlag____ constants below)
|
||||
// unGameIP - The IP Address the server is listening for client connections on (might be INADDR_ANY)
|
||||
// unGamePort - The port which the server is listening for client connections on
|
||||
// unSpectatorPort - the port on which spectators can join to observe the server, 0 if spectating is not supported
|
||||
// usQueryPort - The port which the ISteamMasterServerUpdater API should use in order to listen for matchmaking requests
|
||||
// pchGameDir - A unique string identifier for your game
|
||||
// pchVersion - The current version of the server as a string like 1.0.0.0
|
||||
// bLanMode - Is this a LAN only server?
|
||||
//
|
||||
// bugbug jmccaskey - figure out how to remove this from the API and only expose via SteamGameServer_Init... or make this actually used,
|
||||
// and stop calling it in SteamGameServer_Init()?
|
||||
virtual bool BSetServerType( uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort,
|
||||
uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode ) = 0;
|
||||
|
||||
// Updates server status values which shows up in the server browser and matchmaking APIs
|
||||
virtual void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers,
|
||||
const char *pchServerName, const char *pSpectatorServerName,
|
||||
const char *pchMapName ) = 0;
|
||||
|
||||
// This can be called if spectator goes away or comes back (passing 0 means there is no spectator server now).
|
||||
virtual void UpdateSpectatorPort( uint16 unSpectatorPort ) = 0;
|
||||
|
||||
// Sets a string defining the "gametype" for this server, this is optional, but if it is set
|
||||
// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||
virtual void SetGameType( const char *pchGameType ) = 0;
|
||||
|
||||
// Ask if a user has a specific achievement for this game, will get a callback on reply
|
||||
virtual bool BGetUserAchievementStatus( CSteamID steamID, const char *pchAchievementName ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer005"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unServerFlagNone = 0x00;
|
||||
const uint32 k_unServerFlagActive = 0x01; // server has users playing
|
||||
const uint32 k_unServerFlagSecure = 0x02; // server wants to be secure
|
||||
const uint32 k_unServerFlagDedicated = 0x04; // server is dedicated
|
||||
const uint32 k_unServerFlagLinux = 0x08; // linux build
|
||||
const uint32 k_unServerFlagPassworded = 0x10; // password protected
|
||||
const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and
|
||||
// won't enforce authentication of users that connect to the server.
|
||||
// Useful when you run a server where the clients may not
|
||||
// be connected to the internet but you want them to play (i.e LANs)
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
// client has been approved to connect to this game server
|
||||
struct GSClientApprove_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 1 };
|
||||
CSteamID m_SteamID;
|
||||
};
|
||||
|
||||
|
||||
// client has been denied to connection to this game server
|
||||
struct GSClientDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 2 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
char m_rgchOptionalText[128];
|
||||
};
|
||||
|
||||
|
||||
// request the game server should kick the user
|
||||
struct GSClientKick_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 3 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
};
|
||||
|
||||
// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks,
|
||||
// do not reuse them here.
|
||||
|
||||
|
||||
// client achievement info
|
||||
struct GSClientAchievementStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 6 };
|
||||
uint64 m_SteamID;
|
||||
char m_pchAchievement[128];
|
||||
bool m_bUnlocked;
|
||||
};
|
||||
|
||||
// received when the game server requests to be displayed as secure (VAC protected)
|
||||
// m_bSecure is true if the game server should display itself as secure to users, false otherwise
|
||||
struct GSPolicyResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 15 };
|
||||
uint8 m_bSecure;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // ISTEAMGAMESERVER_H
|
||||
103
res/steamworks/102/headers/isteammasterserverupdater.h
Normal file
103
res/steamworks/102/headers/isteammasterserverupdater.h
Normal file
@@ -0,0 +1,103 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for retrieving list of game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMASTERSERVERUPDATER_H
|
||||
#define ISTEAMMASTERSERVERUPDATER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Game engines use this to tell the Steam master servers
|
||||
// about their games so their games can show up in the server browser.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMasterServerUpdater
|
||||
{
|
||||
public:
|
||||
|
||||
// Call this as often as you like to tell the master server updater whether or not
|
||||
// you want it to be active (default: off).
|
||||
virtual void SetActive( bool bActive ) = 0;
|
||||
|
||||
// You usually don't need to modify this.
|
||||
// Pass -1 to use the default value for iHeartbeatInterval.
|
||||
// Some mods change this.
|
||||
virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0;
|
||||
|
||||
|
||||
// These are in GameSocketShare mode, where instead of ISteamMasterServerUpdater creating its own
|
||||
// socket to talk to the master server on, it lets the game use its socket to forward messages
|
||||
// back and forth. This prevents us from requiring server ops to open up yet another port
|
||||
// in their firewalls.
|
||||
//
|
||||
// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001
|
||||
|
||||
// These are used when you've elected to multiplex the game server's UDP socket
|
||||
// rather than having the master server updater use its own sockets.
|
||||
//
|
||||
// Source games use this to simplify the job of the server admins, so they
|
||||
// don't have to open up more ports on their firewalls.
|
||||
|
||||
// Call this when a packet that starts with 0xFFFFFFFF comes in. That means
|
||||
// it's for us.
|
||||
virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0;
|
||||
|
||||
// AFTER calling HandleIncomingPacket for any packets that came in that frame, call this.
|
||||
// This gets a packet that the master server updater needs to send out on UDP.
|
||||
// It returns the length of the packet it wants to send, or 0 if there are no more packets to send.
|
||||
// Call this each frame until it returns 0.
|
||||
virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0;
|
||||
|
||||
|
||||
// Functions to set various fields that are used to respond to queries.
|
||||
|
||||
// Call this to set basic data that is passed to the server browser.
|
||||
virtual void SetBasicServerData(
|
||||
unsigned short nProtocolVersion,
|
||||
bool bDedicatedServer,
|
||||
const char *pRegionName,
|
||||
const char *pProductName,
|
||||
unsigned short nMaxReportedClients,
|
||||
bool bPasswordProtected,
|
||||
const char *pGameDescription ) = 0;
|
||||
|
||||
// Call this to clear the whole list of key/values that are sent in rules queries.
|
||||
virtual void ClearAllKeyValues() = 0;
|
||||
|
||||
// Call this to add/update a key/value pair.
|
||||
virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
|
||||
// You can call this upon shutdown to clear out data stored for this game server and
|
||||
// to tell the master servers that this server is going away.
|
||||
virtual void NotifyShutdown() = 0;
|
||||
|
||||
// Returns true if the master server has requested a restart.
|
||||
// Only returns true once per request.
|
||||
virtual bool WasRestartRequested() = 0;
|
||||
|
||||
// Force it to request a heartbeat from the master servers.
|
||||
virtual void ForceHeartbeat() = 0;
|
||||
|
||||
// Manually edit and query the master server list.
|
||||
// It will provide name resolution and use the default master server port if none is provided.
|
||||
virtual bool AddMasterServer( const char *pServerAddress ) = 0;
|
||||
virtual bool RemoveMasterServer( const char *pServerAddress ) = 0;
|
||||
|
||||
virtual int GetNumMasterServers() = 0;
|
||||
|
||||
// Returns the # of bytes written to pOut.
|
||||
virtual int GetMasterServerAddress( int iServer, char *pOut, int outBufferSize ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMMASTERSERVERUPDATER_INTERFACE_VERSION "SteamMasterServerUpdater001"
|
||||
|
||||
#endif // ISTEAMMASTERSERVERUPDATER_H
|
||||
553
res/steamworks/102/headers/isteammatchmaking.h
Normal file
553
res/steamworks/102/headers/isteammatchmaking.h
Normal file
@@ -0,0 +1,553 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing game server/client match making
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMATCHMAKING
|
||||
#define ISTEAMMATCHMAKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
#include "matchmakingtypes.h"
|
||||
#include "isteamclient.h"
|
||||
#include "isteamfriends.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to favorites
|
||||
// and to operate on game lobbies.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmaking
|
||||
{
|
||||
public:
|
||||
// game server favorites storage
|
||||
// saves basic details about a multiplayer game server locally
|
||||
|
||||
// returns the number of favorites servers the user has stored
|
||||
virtual int GetFavoriteGameCount() = 0;
|
||||
|
||||
// returns the details of the game server
|
||||
// iGame is of range [0,GetFavoriteGameCount())
|
||||
// *pnIP, *pnConnPort are filled in the with IP:port of the game server
|
||||
// *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections
|
||||
// *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added
|
||||
virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0;
|
||||
|
||||
// adds the game server to the local list; updates the time played of the server if it already exists in the list
|
||||
virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0;
|
||||
|
||||
// removes the game server from the local storage; returns true if one was removed
|
||||
virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0;
|
||||
|
||||
///////
|
||||
// Game lobby functions
|
||||
|
||||
// Get a list of relevant lobbies
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyMatchList_t callback, with the number of servers requested
|
||||
// if the user is not currently connected to Steam (i.e. SteamUser()->BLoggedOn() returns false) then
|
||||
// a LobbyMatchList_t callback will be posted immediately with no servers
|
||||
virtual void RequestLobbyList() = 0;
|
||||
|
||||
// filters for lobbies
|
||||
// this needs to be called before RequestLobbyList() to take effect
|
||||
// these are cleared on each call to RequestLobbyList()
|
||||
virtual void AddRequestLobbyListFilter( const char *pchKeyToMatch, const char *pchValueToMatch ) = 0;
|
||||
// numerical comparison - 0 is equal, -1 is the lobby value is less than nValueToMatch, 1 is the lobby value is greater than nValueToMatch
|
||||
virtual void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueToMatch, int nComparisonType /* 0 is equal, -1 is less than, 1 is greater than */ ) = 0;
|
||||
// sets RequestLobbyList() to only returns lobbies which aren't yet full - needs SetLobbyMemberLimit() called on the lobby to set an initial limit
|
||||
virtual void AddRequestLobbyListSlotsAvailableFilter() = 0;
|
||||
|
||||
// returns the CSteamID of a lobby, as retrieved by a RequestLobbyList call
|
||||
// should only be called after a LobbyMatchList_t callback is received
|
||||
// iLobby is of the range [0, LobbyMatchList_t::m_nLobbiesMatching)
|
||||
// the returned CSteamID::IsValid() will be false if iLobby is out of range
|
||||
virtual CSteamID GetLobbyByIndex( int iLobby ) = 0;
|
||||
|
||||
// Create a lobby on the Steam servers.
|
||||
// If bPrivate is true, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID
|
||||
// of the lobby will need to be communicated via game channels or via InviteUserToLobby()
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyCreated_t callback when the lobby has been created;
|
||||
// local user will the join the lobby, resulting in an additional LobbyEnter_t callback being sent
|
||||
// operations on the chat room can only proceed once the LobbyEnter_t has been received
|
||||
virtual void CreateLobby( bool bPrivate ) = 0;
|
||||
|
||||
// Joins an existing lobby
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyEnter_t callback when the lobby has been joined
|
||||
// users already in the lobby will receive LobbyChatUpdate_t callback after this user has successfully joined
|
||||
virtual void JoinLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Leave a lobby; this will take effect immediately on the client side
|
||||
// other users in the lobby will be notified by a LobbyChatUpdate_t callback
|
||||
virtual void LeaveLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Invite another user to the lobby
|
||||
// the target user will receive a LobbyInvite_t callback
|
||||
// will return true if the invite is successfully sent, whether or not the target responds
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0;
|
||||
|
||||
// Lobby iteration, for viewing details of users in a lobby
|
||||
// only accessible if the lobby user is a member of the specified lobby
|
||||
// persona information for other lobby members (name, avatar, etc.) will be asynchronously received
|
||||
// and accessible via ISteamFriends interface
|
||||
|
||||
// returns the number of users in the specified lobby
|
||||
virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0;
|
||||
// returns the CSteamID of a user in the lobby
|
||||
// iMember is of range [0,GetNumLobbyMembers())
|
||||
virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0;
|
||||
|
||||
// Get data associated with this lobby
|
||||
// takes a simple key, and returns the string associated with it
|
||||
// "" will be returned if no value is set, or if steamIDLobby is invalid
|
||||
virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0;
|
||||
// Sets a key/value pair in the lobby metadata
|
||||
// each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data
|
||||
// this can be used to set lobby names, map, etc.
|
||||
// to reset a key, just set it to ""
|
||||
// other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback
|
||||
virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// As above, but gets per-user data for someone in this lobby
|
||||
virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0;
|
||||
// Sets per-user metadata (for the local user implicitly)
|
||||
virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// Broadcasts a chat message to the all the users in the lobby
|
||||
// users in the lobby (including the local user) will receive a LobbyChatMsg_t callback
|
||||
// returns true if the message is successfully sent
|
||||
// pvMsgBody can be binary or text data, up to 4k
|
||||
// if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator
|
||||
virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0;
|
||||
// Get a chat message as specified in a LobbyChatMsg_t callback
|
||||
// iChatID is the LobbyChatMsg_t::m_iChatID value in the callback
|
||||
// *pSteamIDUser is filled in with the CSteamID of the member
|
||||
// *pvData is filled in with the message itself
|
||||
// return value is the number of bytes written into the buffer
|
||||
virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0;
|
||||
|
||||
// Fetch metadata for a lobby you're not necessarily in right now
|
||||
// this will send down all the metadata associated with a lobby
|
||||
// this is an asynchronous call
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// sets the game server associated with the lobby
|
||||
// usually at this point, the users will leave the lobby and join the specified game server
|
||||
// either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect
|
||||
virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0;
|
||||
// returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist
|
||||
virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, CSteamID *psteamIDGameServer ) = 0;
|
||||
|
||||
// set the limit on the # of users who can join the lobby
|
||||
virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0;
|
||||
// returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined
|
||||
virtual int GetLobbyMemberLimit( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// asks the Steam servers for a list of lobbies that friends are in
|
||||
// returns results by posting one RequestFriendsLobbiesResponse_t callback per friend/lobby pair
|
||||
// if no friends are in lobbies, RequestFriendsLobbiesResponse_t will be posted but with 0 results
|
||||
// filters don't apply to lobbies (currently)
|
||||
virtual bool RequestFriendsLobbies() = 0;
|
||||
};
|
||||
#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking004"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callback interfaces for server list functions (see ISteamMatchmakingServers below)
|
||||
//
|
||||
// The idea here is that your game code implements objects that implement these
|
||||
// interfaces to receive callback notifications after calling asynchronous functions
|
||||
// inside the ISteamMatchmakingServers() interface below.
|
||||
//
|
||||
// This is different than normal Steam callback handling due to the potentially
|
||||
// large size of server lists.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after a server list refresh
|
||||
// or an individual server update.
|
||||
//
|
||||
// Since you get these callbacks after requesting full list refreshes you will
|
||||
// usually implement this interface inside an object like CServerBrowser. If that
|
||||
// object is getting destructed you should use ISteamMatchMakingServers()->CancelQuery()
|
||||
// to cancel any in-progress queries so you don't get a callback into the destructed
|
||||
// object and crash.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServerListResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded ok with updated data
|
||||
virtual void ServerResponded( int iServer ) = 0;
|
||||
|
||||
// Server has failed to respond
|
||||
virtual void ServerFailedToRespond( int iServer ) = 0;
|
||||
|
||||
// A list refresh you had initiated is now 100% completed
|
||||
virtual void RefreshComplete( EMatchMakingServerResponse response ) = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after pinging an individual server
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PingServer() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPingResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded successfully and has updated data
|
||||
virtual void ServerResponded( gameserveritem_t &server ) = 0;
|
||||
|
||||
// Server failed to respond to the ping request
|
||||
virtual void ServerFailedToRespond() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting details on
|
||||
// who is playing on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPlayersResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a new player on the server -- you'll get this callback once per player
|
||||
// on the server which you have requested player data on.
|
||||
virtual void AddPlayerToList( const char *pchName, int nScore, float flTimePlayed ) = 0;
|
||||
|
||||
// The server failed to respond to the request for player details
|
||||
virtual void PlayersFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the player details request
|
||||
// (ie, you won't get anymore AddPlayerToList callbacks)
|
||||
virtual void PlayersRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting rules
|
||||
// details on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->ServerRules() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingRulesResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a rule on the server -- you'll get one of these per rule defined on
|
||||
// the server you are querying
|
||||
virtual void RulesResponded( const char *pchRule, const char *pchValue ) = 0;
|
||||
|
||||
// The server failed to respond to the request for rule details
|
||||
virtual void RulesFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the rule details request
|
||||
// (ie, you won't get anymore RulesResponded callbacks)
|
||||
virtual void RulesRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Typedef for handle type you will receive when querying details on an individual server.
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef int HServerQuery;
|
||||
const int HSERVERQUERY_INVALID = 0xffffffff;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to game lists and details
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServers
|
||||
{
|
||||
public:
|
||||
// Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values.
|
||||
virtual void RequestInternetServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFriendsServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFavoritesServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestHistoryServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestSpectatorServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
/* the filters that are available in the ppchFilters params are:
|
||||
|
||||
"map" - map the server is running, as set in the dedicated server api
|
||||
"dedicated" - reports bDedicated from the API
|
||||
"secure" - VAC-enabled
|
||||
"full" - not full
|
||||
"empty" - not empty
|
||||
"noplayers" - is empty
|
||||
"proxy" - a relay server
|
||||
|
||||
*/
|
||||
|
||||
// Get details on a given server in the list, you can get the valid range of index
|
||||
// values by calling GetServerCount(). You will also receive index values in
|
||||
// ISteamMatchmakingServerListResponse::ServerResponded() callbacks
|
||||
virtual gameserveritem_t *GetServerDetails( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
// Cancel an request which is operation on the given list type. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above list request calls. Not doing so may result in a crash when a callback
|
||||
// occurs on the destructed object.
|
||||
virtual void CancelQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Ping every server in your list again but don't update the list of servers
|
||||
virtual void RefreshQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Returns true if the list is currently refreshing its server list
|
||||
virtual bool IsRefreshing( EMatchMakingType eType ) = 0;
|
||||
|
||||
// How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1
|
||||
virtual int GetServerCount( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Refresh a single server inside of a query (rather than all the servers )
|
||||
virtual void RefreshServer( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Queries to individual servers directly via IP/Port
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Request updated ping time and other details from a single server
|
||||
virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of players currently playing on a server
|
||||
virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of rules that the server is running (See ISteamMasterServerUpdater->SetKeyValue() to set the rules server side)
|
||||
virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above calls to avoid crashing when callbacks occur.
|
||||
virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0;
|
||||
};
|
||||
#define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "SteamMatchMakingServers001"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unFavoriteFlagNone = 0x00;
|
||||
const uint32 k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list
|
||||
const uint32 k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Used in ChatInfo messages - fields specific to a chat member - must fit in a uint32
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatMemberStateChange
|
||||
{
|
||||
// Specific to joining / leaving the chatroom
|
||||
k_EChatMemberStateChangeEntered = 0x01, // This user has joined or is joining the chat room
|
||||
k_EChatMemberStateChangeLeft = 0x02, // This user has left or is leaving the chat room
|
||||
k_EChatMemberStateChangeDisconnected = 0x04, // User disconnected without leaving the chat first
|
||||
k_EChatMemberStateChangeKicked = 0x08, // User kicked
|
||||
k_EChatMemberStateChangeBanned = 0x10, // User kicked and banned
|
||||
|
||||
k_EChatMemberInfoVoiceSpeaking = 0x20, // User started talking (using speaker slot)
|
||||
k_EChatMemberInfoVoiceDoneSpeaking = 0x40, // User relinquished speaker slot
|
||||
};
|
||||
|
||||
// returns true of the flags indicate that a user has been removed from the chat
|
||||
#define BChatMemberStateChangeRemoved( rgfChatMemberStateChangeFlags ) ( rgfChatMemberStateChangeFlags & ( k_EChatMemberStateChangeDisconnected | k_EChatMemberStateChangeLeft | k_EChatMemberStateChangeKicked | k_EChatMemberStateChangeBanned ) )
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: a server was added/removed from the favorites list, you should refresh now
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FavoritesListChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 2 };
|
||||
uint32 m_nIP; // an IP of 0 means reload the whole list, any other value means just one server
|
||||
uint32 m_nQueryPort;
|
||||
uint32 m_nConnPort;
|
||||
uint32 m_nAppID;
|
||||
uint32 m_nFlags;
|
||||
bool m_bAdd; // true if this is adding the entry, otherwise it is a remove
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Someone has invited you to join a Lobby
|
||||
// normally you don't need to do anything with this, since
|
||||
// the Steam UI will also display a '<user> has invited you to the lobby, join?' dialog
|
||||
// if the user outside a game chooses to join, your game will be launched with the parameter "+connect_lobby <64-bit lobby id>"
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyInvite_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 3 };
|
||||
|
||||
uint64 m_ulSteamIDUser; // Steam ID of the person making the invite
|
||||
uint64 m_ulSteamIDLobby; // Steam ID of the Lobby
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent on entering a Lobby
|
||||
// m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success,
|
||||
// or a higher value on failure (see enum EChatRoomEnterResponse)
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyEnter_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // SteamID of the Lobby you have entered
|
||||
uint32 m_rgfChatPermissions; // Permissions of the current user
|
||||
bool m_bLocked; // If true, then only invited users may join
|
||||
uint32 m_EChatRoomEnterResponse; // EChatRoomEnterResponse
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby metadata has changed
|
||||
// if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details
|
||||
// if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyDataUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 5 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // steamID of the Lobby
|
||||
uint64 m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby chat room state has changed
|
||||
// this is usually sent when a user has joined or left the lobby
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 6 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // Lobby ID
|
||||
uint64 m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient
|
||||
uint64 m_ulSteamIDMakingChange; // Chat member who made the change (different from SteamIDUserChange if kicking, muting, etc.)
|
||||
// for example, if one user kicks another from the lobby, this will be set to the id of the user who initiated the kick
|
||||
uint32 m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A chat message for this lobby has been sent
|
||||
// use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatMsg_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 7 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby id this is in
|
||||
uint64 m_ulSteamIDUser; // steamID of the user who has sent this message
|
||||
uint8 m_eChatEntryType; // type of message
|
||||
uint32 m_iChatID; // index of the chat entry to lookup
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A game created a game for all the members of the lobby to join,
|
||||
// as triggered by a SetLobbyGameServer()
|
||||
// it's up to the individual clients to take action on this; the usual
|
||||
// game behavior is to leave the lobby and connect to the specified game server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyGameCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 9 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby we were in
|
||||
uint64 m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members
|
||||
uint32 m_unIP; // IP & Port of the game server (if any)
|
||||
uint16 m_usPort;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Number of matching lobbies found
|
||||
// iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyMatchList_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 10 };
|
||||
uint32 m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when the lobby is being forcefully closed
|
||||
// lobby details functions will no longer be updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyClosing_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 11 };
|
||||
uint64 m_ulSteamIDLobby; // Lobby
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when the local user has been kicked from the lobby
|
||||
// lobby details functions will no longer be updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyKicked_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 12 };
|
||||
uint64 m_ulSteamIDLobby; // Lobby
|
||||
uint64 m_ulSteamIDAdmin; // User who kicked you
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Result of our request to create a Lobby
|
||||
// m_eResult == k_EResultOK on success
|
||||
// at this point, the local user may not have finishing joining this lobby;
|
||||
// game code should wait until the subsequent LobbyEnter_t callback is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 };
|
||||
EResult m_eResult; // Result
|
||||
uint64 m_ulSteamIDLobby; // chat room, zero if failed
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Response to a RequestFriendsLobbies() call
|
||||
// One of these callbacks will be received per friend who is in a lobby
|
||||
// if no friends are in a lobby, then one of these will be called with 0 values
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RequestFriendsLobbiesResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 };
|
||||
|
||||
uint64 m_ulSteamIDFriend; // friend who is in a lobby; 0 if no friends in lobbies are found
|
||||
uint64 m_ulSteamIDLobby; // lobby that the friend is in; 0 if no friends in lobbies are found
|
||||
|
||||
int m_cResultIndex; // result #, [1, m_cResultsTotal] if any are found; 0 if no friends in lobbies are found
|
||||
int m_cResultsTotal; // total number of results; 0 if no friends in lobbies are found
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // ISTEAMMATCHMAKING
|
||||
134
res/steamworks/102/headers/isteamnetworking.h
Normal file
134
res/steamworks/102/headers/isteamnetworking.h
Normal file
@@ -0,0 +1,134 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing network connections between game clients & servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMNETWORKING
|
||||
#define ISTEAMNETWORKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a socket
|
||||
typedef uint32 SNetSocket_t;
|
||||
typedef uint32 SNetListenSocket_t;
|
||||
|
||||
|
||||
// connection progress indicators
|
||||
enum ESNetSocketState
|
||||
{
|
||||
k_ESNetSocketStateInvalid = 0,
|
||||
|
||||
// communication is valid
|
||||
k_ESNetSocketStateConnected = 1,
|
||||
|
||||
// states while establishing a connection
|
||||
k_ESNetSocketStateInitiated = 10, // the connection state machine has started
|
||||
|
||||
// p2p connections
|
||||
k_ESNetSocketStateLocalCandidatesFound = 11, // we've found our local IP info
|
||||
k_ESNetSocketStateReceivedRemoteCandidates = 12,// we've received information from the remote machine, via the Steam back-end, about their IP info
|
||||
|
||||
// direct connections
|
||||
k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server
|
||||
|
||||
// failure states
|
||||
k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end
|
||||
k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown
|
||||
k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection
|
||||
k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us
|
||||
k_ESNetSocketStateConnectionBroken = 25, // connection has been broken; either the other end has disappeared or our local network connection has broke
|
||||
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for making connections and sending data between clients,
|
||||
// traversing NAT's where possible
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamNetworking
|
||||
{
|
||||
public:
|
||||
// creates a socket and listens others to connect
|
||||
// will trigger a SocketStatusCallback_t callback on another client connecting
|
||||
// nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports
|
||||
// this can usually just be 0 unless you want multiple sets of connections
|
||||
// unIP is the local IP address to bind to
|
||||
// pass in 0 if you just want the default local IP
|
||||
// unPort is the port to use
|
||||
// pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only
|
||||
virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort ) = 0;
|
||||
|
||||
// creates a socket and begin connection to a remote destination
|
||||
// can connect via a known steamID (client or game server), or directly to an IP
|
||||
// on success will trigger a SocketStatusCallback_t callback
|
||||
// on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState
|
||||
virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec ) = 0;
|
||||
virtual SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec ) = 0;
|
||||
|
||||
// disconnects the connection to the socket, if any, and invalidates the handle
|
||||
// any unread data on the socket will be thrown away
|
||||
// if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect
|
||||
virtual bool DestroySocket( SNetSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
// destroying a listen socket will automatically kill all the regular sockets generated from it
|
||||
virtual bool DestroyListenSocket( SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
|
||||
// sending data
|
||||
// must be a handle to a connected socket
|
||||
// data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets
|
||||
// use the reliable flag with caution; although the resend rate is pretty aggressive,
|
||||
// it can still cause stalls in receiving data (like TCP)
|
||||
virtual bool SendDataOnSocket( SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable ) = 0;
|
||||
|
||||
// receiving data
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// checks for data from any socket that has been connected off this listen socket
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool IsDataAvailable( SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// retrieves data from any socket that has been connected off this listen socket
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// returns information about the specified socket, filling out the contents of the pointers
|
||||
virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote ) = 0;
|
||||
|
||||
// returns which local port the listen socket is bound to
|
||||
// *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only
|
||||
virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort ) = 0;
|
||||
|
||||
};
|
||||
#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking001"
|
||||
|
||||
|
||||
// callback notification - status of a socket has changed
|
||||
struct SocketStatusCallback_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 };
|
||||
SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host
|
||||
SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection
|
||||
CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one
|
||||
int m_eSNetSocketState; // socket state, ESNetSocketState
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMNETWORKING
|
||||
167
res/steamworks/102/headers/isteamuser.h
Normal file
167
res/steamworks/102/headers/isteamuser.h
Normal file
@@ -0,0 +1,167 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSER_H
|
||||
#define ISTEAMUSER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// structure that contains client callback data
|
||||
// see callbacks documentation for more details
|
||||
struct CallbackMsg_t
|
||||
{
|
||||
HSteamUser m_hSteamUser;
|
||||
int m_iCallback;
|
||||
uint8 *m_pubParam;
|
||||
int m_cubParam;
|
||||
};
|
||||
|
||||
// reference to a steam call, to filter results by
|
||||
typedef int32 HSteamCall;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing and manipulating a steam account
|
||||
// associated with one client instance
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUser
|
||||
{
|
||||
public:
|
||||
// returns the HSteamUser this interface represents
|
||||
// this is only used internally by the API, and by a few select interfaces that support multi-user
|
||||
virtual HSteamUser GetHSteamUser() = 0;
|
||||
|
||||
// returns true if the Steam client current has a live connection to the Steam servers.
|
||||
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
|
||||
// The Steam client will automatically be trying to recreate the connection as often as possible.
|
||||
virtual bool BLoggedOn() = 0;
|
||||
|
||||
// returns the CSteamID of the account currently logged into the Steam client
|
||||
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Multiplayer Authentication functions
|
||||
|
||||
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
|
||||
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
|
||||
//
|
||||
// Parameters:
|
||||
// void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.
|
||||
// int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
|
||||
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
|
||||
// CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )
|
||||
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
|
||||
// bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)
|
||||
//
|
||||
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
|
||||
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
|
||||
virtual int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
|
||||
|
||||
// notify of disconnect
|
||||
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
|
||||
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
|
||||
|
||||
// Legacy functions
|
||||
|
||||
// used by only a few games to track usage events
|
||||
virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
|
||||
|
||||
// get the local storage folder for current Steam account to write application data, e.g. save games, configs etc.
|
||||
// this will usually be something like "C:\Progam Files\Steam\userdata\<SteamID>\<AppID>\local"
|
||||
virtual bool GetUserDataFolder( char *pchBuffer, int cubBuffer ) = 0;
|
||||
|
||||
// Starts voice recording. Once started, use GetCompressedVoice() to get the data
|
||||
virtual void StartVoiceRecording( ) = 0;
|
||||
|
||||
// Stops voice recording. Because people often release push-to-talk keys early, the system will keep recording for
|
||||
// a little bit after this function is called. GetCompressedVoice() should continue to be called until it returns
|
||||
// k_eVoiceResultNotRecording
|
||||
virtual void StopVoiceRecording( ) = 0;
|
||||
|
||||
// Gets the latest voice data. It should be called as often as possible once recording has started.
|
||||
// nBytesWritten is set to the number of bytes written to pDestBuffer.
|
||||
virtual EVoiceResult GetCompressedVoice( void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten ) = 0;
|
||||
|
||||
// Decompresses a chunk of data produced by GetCompressedVoice(). nBytesWritten is set to the
|
||||
// number of bytes written to pDestBuffer. The output format of the data is 16-bit signed at
|
||||
// 11025 samples per second.
|
||||
virtual EVoiceResult DecompressVoice( void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser011"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connections to the Steam back-end has been established
|
||||
// this means the Steam client now has a working connection to the Steam servers
|
||||
// usually this will have occurred before the game has launched, and should
|
||||
// only be seen if the user has dropped connection due to a networking issue
|
||||
// or a Steam server update
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersConnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 1 };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connection attempt has failed
|
||||
// this will occur periodically if the Steam client is not connected,
|
||||
// and has failed in it's retry to establish a connection
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServerConnectFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 2 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called if the client has lost connection to the Steam servers
|
||||
// real-time services will be disabled until a matching SteamServersConnected_t has been posted
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersDisconnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 3 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server,
|
||||
// which it may be in the process of or already connected to.
|
||||
// The game client should immediately disconnect upon receiving this message.
|
||||
// This can usually occur if the user doesn't have rights to play on the game server.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ClientGameServerDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 13 };
|
||||
|
||||
uint32 m_uAppID;
|
||||
uint32 m_unGameServerIP;
|
||||
uint16 m_usGameServerPort;
|
||||
uint16 m_bSecure;
|
||||
uint32 m_uReason;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks)
|
||||
// When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect.
|
||||
// This usually occurs in the rare event the Steam client has some kind of fatal error.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct CallbackPipeFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 17 };
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
98
res/steamworks/102/headers/isteamuserstats.h
Normal file
98
res/steamworks/102/headers/isteamuserstats.h
Normal file
@@ -0,0 +1,98 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSERSTATS_H
|
||||
#define ISTEAMUSERSTATS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// size limit on stat or achievement name
|
||||
const uint32 k_cchStatNameMax = 128;
|
||||
|
||||
class ISteamUserStats
|
||||
{
|
||||
public:
|
||||
|
||||
// Ask the server to send down this user's data and achievements for nGameID
|
||||
virtual bool RequestCurrentStats( ) = 0;
|
||||
|
||||
// Data accessors
|
||||
virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetStat( const char *pchName, float *pData ) = 0;
|
||||
|
||||
// Set / update data
|
||||
virtual bool SetStat( const char *pchName, int32 nData ) = 0;
|
||||
virtual bool SetStat( const char *pchName, float fData ) = 0;
|
||||
virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||
|
||||
// Achievement flag accessors
|
||||
virtual bool GetAchievement( const char *pchName, bool *pbAchieved ) = 0;
|
||||
virtual bool SetAchievement( const char *pchName ) = 0;
|
||||
virtual bool ClearAchievement( const char *pchName ) = 0;
|
||||
|
||||
// Store the current data on the server, will get a callback when set
|
||||
// And one callback for every new achievement
|
||||
virtual bool StoreStats( ) = 0;
|
||||
|
||||
// Achievement / GroupAchievement metadata
|
||||
|
||||
// Gets the icon of the achievement, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetAchievementIcon( const char *pchName ) = 0;
|
||||
// Get general attributes (display name / text, etc) for an Achievement
|
||||
virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0;
|
||||
|
||||
// Achievement progress - triggers an AchievementProgress callback, that is all.
|
||||
// Calling this w/ N out of N progress will NOT set the achievement, the game must still do that.
|
||||
virtual bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint32 nMaxProgress ) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION003"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the latests stats and achievements have been received
|
||||
// from the server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsReceived_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // Success / error fetching the stats
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the user stats for a game
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // success / error
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the achievements for a game, or an
|
||||
// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress
|
||||
// are zero, that means the achievement has been fully unlocked.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserAchievementStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 };
|
||||
|
||||
uint64 m_nGameID; // Game this is for
|
||||
bool m_bGroupAchievement; // if this is a "group" achievement
|
||||
char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement
|
||||
uint32 m_nCurProgress; // current progress towards the achievement
|
||||
uint32 m_nMaxProgress; // "out of" this many
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
81
res/steamworks/102/headers/isteamutils.h
Normal file
81
res/steamworks/102/headers/isteamutils.h
Normal file
@@ -0,0 +1,81 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to utility functions in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUTILS_H
|
||||
#define ISTEAMUTILS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to user independent utility functions
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUtils
|
||||
{
|
||||
public:
|
||||
// return the number of seconds since the user
|
||||
virtual uint32 GetSecondsSinceAppActive() = 0;
|
||||
virtual uint32 GetSecondsSinceComputerActive() = 0;
|
||||
|
||||
// the universe this client is connecting to
|
||||
virtual EUniverse GetConnectedUniverse() = 0;
|
||||
|
||||
// Steam server time - in PST, number of seconds since January 1, 1970 (i.e unix time)
|
||||
virtual uint32 GetServerRealTime() = 0;
|
||||
|
||||
// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
|
||||
// e.g "US" or "UK".
|
||||
virtual const char *GetIPCountry() = 0;
|
||||
|
||||
// returns true if the image exists, and valid sizes were filled out
|
||||
virtual bool GetImageSize( int iImage, uint32 *pnWidth, uint32 *pnHeight ) = 0;
|
||||
|
||||
// returns true if the image exists, and the buffer was successfully filled out
|
||||
// results are returned in RGBA format
|
||||
// the destination buffer size should be 4 * height * width * sizeof(char)
|
||||
virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0;
|
||||
|
||||
// returns the IP of the reporting server for valve - currently only used in Source engine games
|
||||
virtual bool GetCSERIPPort( uint32 *unIP, uint16 *usPort ) = 0;
|
||||
|
||||
// return the amount of battery power left in the current system in % [0..100], 255 for being on AC power
|
||||
virtual uint8 GetCurrentBatteryPower() = 0;
|
||||
|
||||
// returns the appID of the current process
|
||||
virtual uint32 GetAppID() = 0;
|
||||
|
||||
// Sets the position where the overlay instance for the currently calling game should show notifications.
|
||||
// This position is per-game and if this function is called from outside of a game context it will do nothing.
|
||||
virtual void SetOverlayNotificationPosition( ENotificationPosition eNotificationPosition ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils002"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The country of the user changed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct IPCountry_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 1 };
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LowBatteryPower_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 2 };
|
||||
uint8 m_nMinutesBatteryLeft;
|
||||
};
|
||||
|
||||
#endif // ISTEAMUTILS_H
|
||||
239
res/steamworks/102/headers/matchmakingtypes.h
Normal file
239
res/steamworks/102/headers/matchmakingtypes.h
Normal file
@@ -0,0 +1,239 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef MATCHMAKINGTYPES_H
|
||||
#define MATCHMAKINGTYPES_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef POSIX
|
||||
#define _snprintf snprintf
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
struct MatchMakingKeyValuePair_t
|
||||
{
|
||||
MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; }
|
||||
MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue )
|
||||
{
|
||||
strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only!
|
||||
strncpy( m_szValue, pchValue, sizeof(m_szValue) );
|
||||
}
|
||||
char m_szKey[ 256 ];
|
||||
char m_szValue[ 256 ];
|
||||
};
|
||||
|
||||
|
||||
enum EMatchMakingServerResponse
|
||||
{
|
||||
eServerResponded = 0,
|
||||
eServerFailedToRespond,
|
||||
eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match
|
||||
};
|
||||
|
||||
enum EMatchMakingType
|
||||
{
|
||||
eInternetServer = 0,
|
||||
eLANServer,
|
||||
eFriendsServer,
|
||||
eFavoritesServer,
|
||||
eHistoryServer,
|
||||
eSpectatorServer,
|
||||
eInvalidServer
|
||||
};
|
||||
|
||||
|
||||
// servernetadr_t is all the addressing info the serverbrowser needs to know about a game server,
|
||||
// namely: its IP, its connection port, and its query port.
|
||||
class servernetadr_t
|
||||
{
|
||||
public:
|
||||
|
||||
void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort );
|
||||
#ifdef NETADR_H
|
||||
void Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort );
|
||||
netadr_t& GetIPAndQueryPort();
|
||||
#endif
|
||||
|
||||
// Access the query port.
|
||||
uint16 GetQueryPort() const;
|
||||
void SetQueryPort( uint16 usPort );
|
||||
|
||||
// Access the connection port.
|
||||
uint16 GetConnectionPort() const;
|
||||
void SetConnectionPort( uint16 usPort );
|
||||
|
||||
// Access the IP
|
||||
uint32 GetIP() const;
|
||||
void SetIP( uint32 );
|
||||
|
||||
// This gets the 'a.b.c.d:port' string with the connection port (instead of the query port).
|
||||
const char *GetConnectionAddressString() const;
|
||||
const char *GetQueryAddressString() const;
|
||||
|
||||
// Comparison operators and functions.
|
||||
bool operator<(const servernetadr_t &netadr) const;
|
||||
void operator=( const servernetadr_t &that )
|
||||
{
|
||||
m_usConnectionPort = that.m_usConnectionPort;
|
||||
m_usQueryPort = that.m_usQueryPort;
|
||||
m_unIP = that.m_unIP;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
const char *ToString( uint32 unIP, uint16 usPort ) const;
|
||||
uint16 m_usConnectionPort; // (in HOST byte order)
|
||||
uint16 m_usQueryPort;
|
||||
uint32 m_unIP;
|
||||
};
|
||||
|
||||
|
||||
inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
m_unIP = ip;
|
||||
m_usQueryPort = usQueryPort;
|
||||
m_usConnectionPort = usConnectionPort;
|
||||
}
|
||||
|
||||
#ifdef NETADR_H
|
||||
inline void servernetadr_t::Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
Init( ipAndQueryPort.GetIP(), ipAndQueryPort.GetPort(), usConnectionPort );
|
||||
}
|
||||
|
||||
inline netadr_t& servernetadr_t::GetIPAndQueryPort()
|
||||
{
|
||||
static netadr_t netAdr;
|
||||
netAdr.SetIP( m_unIP );
|
||||
netAdr.SetPort( m_usQueryPort );
|
||||
return netAdr;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline uint16 servernetadr_t::GetQueryPort() const
|
||||
{
|
||||
return m_usQueryPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetQueryPort( uint16 usPort )
|
||||
{
|
||||
m_usQueryPort = usPort;
|
||||
}
|
||||
|
||||
inline uint16 servernetadr_t::GetConnectionPort() const
|
||||
{
|
||||
return m_usConnectionPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetConnectionPort( uint16 usPort )
|
||||
{
|
||||
m_usConnectionPort = usPort;
|
||||
}
|
||||
|
||||
inline uint32 servernetadr_t::GetIP() const
|
||||
{
|
||||
return m_unIP;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetIP( uint32 unIP )
|
||||
{
|
||||
m_unIP = unIP;
|
||||
}
|
||||
|
||||
inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const
|
||||
{
|
||||
static char s[4][64];
|
||||
static int nBuf = 0;
|
||||
unsigned char *ipByte = (unsigned char *)&unIP;
|
||||
_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
|
||||
const char *pchRet = s[nBuf];
|
||||
++nBuf;
|
||||
nBuf %= ( (sizeof(s)/sizeof(s[0])) );
|
||||
return pchRet;
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetConnectionAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usConnectionPort );
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetQueryAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usQueryPort );
|
||||
}
|
||||
|
||||
inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const
|
||||
{
|
||||
return ( m_unIP < netadr.m_unIP ) || ( m_unIP == netadr.m_unIP && m_usQueryPort < netadr.m_usQueryPort );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Data describing a single server
|
||||
//-----------------------------------------------------------------------------
|
||||
class gameserveritem_t
|
||||
{
|
||||
public:
|
||||
gameserveritem_t();
|
||||
|
||||
const char* GetName() const;
|
||||
void SetName( const char *pName );
|
||||
|
||||
public:
|
||||
servernetadr_t m_NetAdr; // IP/Query Port/Connection Port for this server
|
||||
int m_nPing; // current ping time in milliseconds
|
||||
bool m_bHadSuccessfulResponse; // server has responded successfully in the past
|
||||
bool m_bDoNotRefresh; // server is marked as not responding and should no longer be refreshed
|
||||
char m_szGameDir[32]; // current game directory
|
||||
char m_szMap[32]; // current map
|
||||
char m_szGameDescription[64]; // game description
|
||||
int m_nAppID; // Steam App ID of this server
|
||||
int m_nPlayers; // current number of players on the server
|
||||
int m_nMaxPlayers; // Maximum players that can join this server
|
||||
int m_nBotPlayers; // Number of bots (i.e simulated players) on this server
|
||||
bool m_bPassword; // true if this server needs a password to join
|
||||
bool m_bSecure; // Is this server protected by VAC
|
||||
uint32 m_ulTimeLastPlayed; // time (in unix time) when this server was last played on (for favorite/history servers)
|
||||
int m_nServerVersion; // server version as reported to Steam
|
||||
|
||||
private:
|
||||
char m_szServerName[64]; // Game server name
|
||||
|
||||
// For data added after SteamMatchMaking001 add it here
|
||||
public:
|
||||
char m_szGameTags[128]; // the tags this server exposes
|
||||
};
|
||||
|
||||
|
||||
inline gameserveritem_t::gameserveritem_t()
|
||||
{
|
||||
m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0;
|
||||
m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false;
|
||||
m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0;
|
||||
m_szGameTags[0] = 0;
|
||||
}
|
||||
|
||||
inline const char* gameserveritem_t::GetName() const
|
||||
{
|
||||
// Use the IP address as the name if nothing is set yet.
|
||||
if ( m_szServerName[0] == 0 )
|
||||
return m_NetAdr.GetConnectionAddressString();
|
||||
else
|
||||
return m_szServerName;
|
||||
}
|
||||
|
||||
inline void gameserveritem_t::SetName( const char *pName )
|
||||
{
|
||||
strncpy( m_szServerName, pName, sizeof( m_szServerName ) );
|
||||
}
|
||||
|
||||
|
||||
#endif // MATCHMAKINGTYPES_H
|
||||
318
res/steamworks/102/headers/steam_api.h
Normal file
318
res/steamworks/102/headers/steam_api.h
Normal file
@@ -0,0 +1,318 @@
|
||||
//====== Copyright 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_API_H
|
||||
#define STEAM_API_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "isteamuser.h"
|
||||
#include "isteamfriends.h"
|
||||
#include "isteamutils.h"
|
||||
#include "isteammatchmaking.h"
|
||||
#include "isteamuserstats.h"
|
||||
#include "isteamapps.h"
|
||||
#include "isteamnetworking.h"
|
||||
|
||||
// Steam API export macro
|
||||
#if defined( _WIN32 ) && !defined( _X360 )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __declspec( dllexport )
|
||||
#elif defined( STEAM_API_NODLL )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C" __declspec( dllimport )
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#elif defined( GNUC )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#else // !WIN32
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// Steam API setup & shutdown
|
||||
//
|
||||
// These functions manage loading, initializing and shutdown of the steamclient.dll
|
||||
//
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// S_API void SteamAPI_Init(); (see below)
|
||||
S_API void SteamAPI_Shutdown();
|
||||
|
||||
// crash dump recording functions
|
||||
S_API void SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID );
|
||||
S_API void SteamAPI_SetMiniDumpComment( const char *pchMsg );
|
||||
|
||||
// interface pointers, configured by SteamAPI_Init()
|
||||
S_API ISteamClient *SteamClient();
|
||||
|
||||
|
||||
//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES is usually not necessary, but it provides safety against releasing
|
||||
// new steam_api.dll's without recompiling/rereleasing modules that use it.
|
||||
//
|
||||
// If you use VERSION_SAFE_STEAM_API_INTERFACES, then you should call SteamAPI_InitSafe(). Also, to get the
|
||||
// Steam interfaces, you must create and Init() a CSteamAPIContext (below) and use the interfaces in there.
|
||||
//
|
||||
// If you don't use VERSION_SAFE_STEAM_API_INTERFACES, then you can use SteamAPI_Init() and the SteamXXXX()
|
||||
// functions below to get at the Steam interfaces.
|
||||
//
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamAPI_InitSafe();
|
||||
#else
|
||||
S_API bool SteamAPI_Init();
|
||||
|
||||
S_API ISteamUser *SteamUser();
|
||||
S_API ISteamFriends *SteamFriends();
|
||||
S_API ISteamUtils *SteamUtils();
|
||||
S_API ISteamMatchmaking *SteamMatchmaking();
|
||||
S_API ISteamUserStats *SteamUserStats();
|
||||
S_API ISteamApps *SteamApps();
|
||||
S_API ISteamNetworking *SteamNetworking();
|
||||
S_API ISteamMatchmakingServers *SteamMatchmakingServers();
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steam callback helper functions
|
||||
//
|
||||
// The following classes/macros are used to be able to easily multiplex callbacks
|
||||
// from the Steam API into various objects in the app in a thread-safe manner
|
||||
//
|
||||
// These functors are triggered via the SteamAPI_RunCallbacks() function, mapping the callback
|
||||
// to as many functions/objects as are registered to it
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API void SteamAPI_RunCallbacks();
|
||||
|
||||
|
||||
|
||||
// functions used by the utility CCallback objects to receive callbacks
|
||||
S_API void SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback );
|
||||
S_API void SteamAPI_UnregisterCallback( class CCallbackBase *pCallback );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: base for callbacks,
|
||||
// used only by CCallback, shouldn't be used directly
|
||||
//-----------------------------------------------------------------------------
|
||||
class CCallbackBase
|
||||
{
|
||||
public:
|
||||
CCallbackBase() { m_nCallbackFlags = 0; }
|
||||
// don't add a virtual destructor because we export this binary interface across dll's
|
||||
virtual void Run( void *pvParam ) = 0;
|
||||
|
||||
protected:
|
||||
enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 };
|
||||
uint8 m_nCallbackFlags;
|
||||
private:
|
||||
int m_iCallback;
|
||||
friend class CCallbackMgr;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: maps a steam callback to a class member function
|
||||
// template params: T = local class, P = parameter struct
|
||||
//-----------------------------------------------------------------------------
|
||||
template< class T, class P, bool bGameServer >
|
||||
class CCallback : private CCallbackBase
|
||||
{
|
||||
public:
|
||||
typedef void (T::*func_t)( P* );
|
||||
|
||||
// If you can't support constructing a callback with the correct parameters
|
||||
// then uncomment the empty constructor below and manually call
|
||||
// ::Register() for your object
|
||||
// Or, just call the regular constructor with (NULL, NULL)
|
||||
// CCallback() {}
|
||||
|
||||
// constructor for initializing this object in owner's constructor
|
||||
CCallback( T *pObj, func_t func ) : m_pObj( pObj ), m_Func( func )
|
||||
{
|
||||
if ( pObj && func )
|
||||
Register( pObj, func );
|
||||
}
|
||||
|
||||
~CCallback()
|
||||
{
|
||||
Unregister();
|
||||
}
|
||||
|
||||
// manual registration of the callback
|
||||
void Register( T *pObj, func_t func )
|
||||
{
|
||||
if ( m_nCallbackFlags & k_ECallbackFlagsRegistered )
|
||||
Unregister();
|
||||
|
||||
if ( bGameServer )
|
||||
{
|
||||
m_nCallbackFlags |= k_ECallbackFlagsGameServer;
|
||||
}
|
||||
m_pObj = pObj;
|
||||
m_Func = func;
|
||||
SteamAPI_RegisterCallback( this, P::k_iCallback );
|
||||
}
|
||||
|
||||
void Unregister()
|
||||
{
|
||||
SteamAPI_UnregisterCallback( this );
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
|
||||
T *m_pObj;
|
||||
func_t m_Func;
|
||||
};
|
||||
|
||||
|
||||
// utility macro for declaring the function and callback object together
|
||||
#define STEAM_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, false > var; void func( param *pParam )
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
// disable this warning; this pattern need for steam callback registration
|
||||
#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// pumps out all the steam messages, calling the register callback
|
||||
S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks );
|
||||
|
||||
// register the callback funcs to use to interact with the steam dll
|
||||
S_API void Steam_RegisterInterfaceFuncs( void *hModule );
|
||||
|
||||
// returns the HSteamUser of the last user to dispatch a callback
|
||||
S_API HSteamUser Steam_GetHSteamUserCurrent();
|
||||
|
||||
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name
|
||||
S_API const char *SteamAPI_GetSteamInstallPath();
|
||||
|
||||
// returns the pipe we are communicating to Steam with
|
||||
S_API HSteamPipe SteamAPI_GetHSteamPipe();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamAPI_GetHSteamUser();
|
||||
|
||||
class CSteamAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamUser* SteamUser() { return m_pSteamUser; }
|
||||
ISteamFriends* SteamFriends() { return m_pSteamFriends; }
|
||||
ISteamUtils* SteamUtils() { return m_pSteamUtils; }
|
||||
ISteamMatchmaking* SteamMatchmaking() { return m_pSteamMatchmaking; }
|
||||
ISteamUserStats* SteamUserStats() { return m_pSteamUserStats; }
|
||||
ISteamApps* SteamApps() { return m_pSteamApps; }
|
||||
ISteamMatchmakingServers* SteamMatchmakingServers() { return m_pSteamMatchmakingServers; }
|
||||
ISteamNetworking* SteamNetworking() { return m_pSteamNetworking; }
|
||||
|
||||
private:
|
||||
ISteamUser *m_pSteamUser;
|
||||
ISteamFriends *m_pSteamFriends;
|
||||
ISteamUtils *m_pSteamUtils;
|
||||
ISteamMatchmaking *m_pSteamMatchmaking;
|
||||
ISteamUserStats *m_pSteamUserStats;
|
||||
ISteamApps *m_pSteamApps;
|
||||
ISteamMatchmakingServers *m_pSteamMatchmakingServers;
|
||||
ISteamNetworking *m_pSteamNetworking;
|
||||
};
|
||||
|
||||
inline CSteamAPIContext::CSteamAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamAPIContext::Clear()
|
||||
{
|
||||
m_pSteamUser = NULL;
|
||||
m_pSteamFriends = NULL;
|
||||
m_pSteamUtils = NULL;
|
||||
m_pSteamMatchmaking = NULL;
|
||||
m_pSteamUserStats = NULL;
|
||||
m_pSteamApps = NULL;
|
||||
m_pSteamMatchmakingServers = NULL;
|
||||
m_pSteamNetworking = NULL;
|
||||
}
|
||||
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamAPIContext::Init()
|
||||
{
|
||||
if ( !SteamClient() )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamAPI_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe();
|
||||
|
||||
m_pSteamUser = SteamClient()->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUser )
|
||||
return false;
|
||||
|
||||
m_pSteamFriends = SteamClient()->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamFriends )
|
||||
return false;
|
||||
|
||||
m_pSteamUtils = SteamClient()->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmaking = SteamClient()->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmaking )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmakingServers = SteamClient()->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmakingServers )
|
||||
return false;
|
||||
|
||||
m_pSteamUserStats = SteamClient()->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUserStats )
|
||||
return false;
|
||||
|
||||
m_pSteamApps = SteamClient()->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamApps )
|
||||
return false;
|
||||
|
||||
m_pSteamNetworking = SteamClient()->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamNetworking )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
#endif // STEAM_API_H
|
||||
134
res/steamworks/102/headers/steam_gameserver.h
Normal file
134
res/steamworks/102/headers/steam_gameserver.h
Normal file
@@ -0,0 +1,134 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_GAMESERVER_H
|
||||
#define STEAM_GAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api.h"
|
||||
#include "isteamgameserver.h"
|
||||
#include "isteammasterserverupdater.h"
|
||||
|
||||
enum EServerMode
|
||||
{
|
||||
eServerModeInvalid = 0, // DO NOT USE
|
||||
eServerModeNoAuthentication = 1, // Don't authenticate user logins and don't list on the server list
|
||||
eServerModeAuthentication = 2, // Authenticate users, list on the server list, don't run VAC on clients that connect
|
||||
eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients
|
||||
};
|
||||
|
||||
// Note: if you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it will use "GameSocketShare" mode,
|
||||
// which means that the game is responsible for sending and receiving UDP packets for the master
|
||||
// server updater. See references to GameSocketShare in isteammasterserverupdater.h.
|
||||
//
|
||||
// Pass 0 for usGamePort or usSpectatorPort if you're not using that. Then, the master server updater will report
|
||||
// what's running based on that.
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamGameServer_InitSafe( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString );
|
||||
#else
|
||||
S_API bool SteamGameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString );
|
||||
|
||||
S_API ISteamGameServer *SteamGameServer();
|
||||
S_API ISteamUtils *SteamGameServerUtils();
|
||||
S_API ISteamMasterServerUpdater *SteamMasterServerUpdater();
|
||||
S_API ISteamNetworking *SteamGameServerNetworking();
|
||||
#endif
|
||||
|
||||
S_API void SteamGameServer_Shutdown();
|
||||
S_API void SteamGameServer_RunCallbacks();
|
||||
|
||||
S_API bool SteamGameServer_BSecure();
|
||||
S_API uint64 SteamGameServer_GetSteamID();
|
||||
|
||||
#define STEAM_GAMESERVER_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, true > var; void func( param *pParam )
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
S_API HSteamPipe SteamGameServer_GetHSteamPipe();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamGameServer_GetHSteamUser();
|
||||
|
||||
class CSteamGameServerAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamGameServerAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamGameServer *SteamGameServer() { return m_pSteamGameServer; }
|
||||
ISteamUtils *SteamGameServerUtils() { return m_pSteamGameServerUtils; }
|
||||
ISteamMasterServerUpdater *SteamMasterServerUpdater() { return m_pSteamMasterServerUpdater; }
|
||||
ISteamNetworking *SteamGameServerNetworking() { return m_pSteamGameServerNetworking; }
|
||||
|
||||
private:
|
||||
ISteamGameServer *m_pSteamGameServer;
|
||||
ISteamUtils *m_pSteamGameServerUtils;
|
||||
ISteamMasterServerUpdater *m_pSteamMasterServerUpdater;
|
||||
ISteamNetworking *m_pSteamGameServerNetworking;
|
||||
};
|
||||
|
||||
inline CSteamGameServerAPIContext::CSteamGameServerAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamGameServerAPIContext::Clear()
|
||||
{
|
||||
m_pSteamGameServer = NULL;
|
||||
m_pSteamGameServerUtils = NULL;
|
||||
m_pSteamMasterServerUpdater = NULL;
|
||||
m_pSteamGameServerNetworking = NULL;
|
||||
}
|
||||
|
||||
S_API ISteamClient *g_pSteamClientGameServer;
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamGameServerAPIContext::Init()
|
||||
{
|
||||
if ( !g_pSteamClientGameServer )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamGameServer_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe();
|
||||
|
||||
m_pSteamGameServer = g_pSteamClientGameServer->GetISteamGameServer( hSteamUser, hSteamPipe, STEAMGAMESERVER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServer )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerUtils = g_pSteamClientGameServer->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMasterServerUpdater = g_pSteamClientGameServer->GetISteamMasterServerUpdater( hSteamUser, hSteamPipe, STEAMMASTERSERVERUPDATER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMasterServerUpdater )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerNetworking = g_pSteamClientGameServer->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerNetworking )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
|
||||
#endif // STEAM_GAMESERVER_H
|
||||
860
res/steamworks/102/headers/steamclientpublic.h
Normal file
860
res/steamworks/102/headers/steamclientpublic.h
Normal file
@@ -0,0 +1,860 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMCLIENTPUBLIC_H
|
||||
#define STEAMCLIENTPUBLIC_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
//lint -save -e1931 -e1927 -e1924 -e613 -e726
|
||||
|
||||
// This header file defines the interface between the calling application and the code that
|
||||
// knows how to communicate with the connection manager (CM) from the Steam service
|
||||
|
||||
// This header file is intended to be portable; ideally this 1 header file plus a lib or dll
|
||||
// is all you need to integrate the client library into some other tree. So please avoid
|
||||
// including or requiring other header files if possible. This header should only describe the
|
||||
// interface layer, no need to include anything about the implementation.
|
||||
|
||||
#include "steamtypes.h"
|
||||
|
||||
|
||||
// General result codes
|
||||
enum EResult
|
||||
{
|
||||
k_EResultOK = 1, // success
|
||||
k_EResultFail = 2, // generic failure
|
||||
k_EResultNoConnection = 3, // no/failed network connection
|
||||
// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed
|
||||
k_EResultInvalidPassword = 5, // password/ticket is invalid
|
||||
k_EResultLoggedInElsewhere = 6, // same user logged in elsewhere
|
||||
k_EResultInvalidProtocolVer = 7, // protocol version is incorrect
|
||||
k_EResultInvalidParam = 8, // a parameter is incorrect
|
||||
k_EResultFileNotFound = 9, // file was not found
|
||||
k_EResultBusy = 10, // called method busy - action not taken
|
||||
k_EResultInvalidState = 11, // called object was in an invalid state
|
||||
k_EResultInvalidName = 12, // name is invalid
|
||||
k_EResultInvalidEmail = 13, // email is invalid
|
||||
k_EResultDuplicateName = 14, // name is not unique
|
||||
k_EResultAccessDenied = 15, // access is denied
|
||||
k_EResultTimeout = 16, // operation timed out
|
||||
k_EResultBanned = 17, // VAC2 banned
|
||||
k_EResultAccountNotFound = 18, // account not found
|
||||
k_EResultInvalidSteamID = 19, // steamID is invalid
|
||||
k_EResultServiceUnavailable = 20, // The requested service is currently unavailable
|
||||
k_EResultNotLoggedOn = 21, // The user is not logged on
|
||||
k_EResultPending = 22, // Request is pending (may be in process, or waiting on third party)
|
||||
k_EResultEncryptionFailure = 23, // Encryption or Decryption failed
|
||||
k_EResultInsufficientPrivilege = 24, // Insufficient privilege
|
||||
k_EResultLimitExceeded = 25, // Too much of a good thing
|
||||
k_EResultRevoked = 26, // Access has been revoked (used for revoked guest passes)
|
||||
k_EResultExpired = 27, // License/Guest pass the user is trying to access is expired
|
||||
k_EResultAlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again
|
||||
k_EResultDuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time
|
||||
k_EResultAlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user
|
||||
k_EResultIPNotFound = 31, // IP address not found
|
||||
k_EResultPersistFailed = 32, // failed to write change to the data store
|
||||
k_EResultLockingFailed = 33, // failed to acquire access lock for this operation
|
||||
k_EResultLogonSessionReplaced = 34,
|
||||
k_EResultConnectFailed = 35,
|
||||
k_EResultHandshakeFailed = 36,
|
||||
k_EResultIOFailure = 37,
|
||||
k_EResultRemoteDisconnect = 38,
|
||||
k_EResultShoppingCartNotFound = 39, // failed to find the shopping cart requested
|
||||
k_EResultBlocked = 40, // a user didn't allow it
|
||||
k_EResultIgnored = 41, // target is ignoring sender
|
||||
k_EResultNoMatch = 42, // nothing matching the request found
|
||||
};
|
||||
|
||||
// Error codes for use with the voice functions
|
||||
enum EVoiceResult
|
||||
{
|
||||
k_EVoiceResultOK = 0,
|
||||
k_EVoiceResultNotInitialized = 1,
|
||||
k_EVoiceResultNotRecording = 2,
|
||||
k_EVoiceResultNoData = 3,
|
||||
k_EVoiceResultBufferTooSmall = 4,
|
||||
k_EVoiceResultDataCorrupted = 5,
|
||||
};
|
||||
|
||||
// Result codes to GSHandleClientDeny/Kick
|
||||
typedef enum
|
||||
{
|
||||
k_EDenyInvalid = 0,
|
||||
k_EDenyInvalidVersion = 1,
|
||||
k_EDenyGeneric = 2,
|
||||
k_EDenyNotLoggedOn = 3,
|
||||
k_EDenyNoLicense = 4,
|
||||
k_EDenyCheater = 5,
|
||||
k_EDenyLoggedInElseWhere = 6,
|
||||
k_EDenyUnknownText = 7,
|
||||
k_EDenyIncompatibleAnticheat = 8,
|
||||
k_EDenyMemoryCorruption = 9,
|
||||
k_EDenyIncompatibleSoftware = 10,
|
||||
k_EDenySteamConnectionLost = 11,
|
||||
k_EDenySteamConnectionError = 12,
|
||||
k_EDenySteamResponseTimedOut = 13,
|
||||
k_EDenySteamValidationStalled = 14,
|
||||
k_EDenySteamOwnerLeftGuestUser = 15,
|
||||
} EDenyReason;
|
||||
|
||||
// Steam universes. Each universe is a self-contained Steam instance.
|
||||
enum EUniverse
|
||||
{
|
||||
k_EUniverseInvalid = 0,
|
||||
k_EUniversePublic = 1,
|
||||
k_EUniverseBeta = 2,
|
||||
k_EUniverseInternal = 3,
|
||||
k_EUniverseDev = 4,
|
||||
k_EUniverseRC = 5,
|
||||
k_EUniverseMax
|
||||
};
|
||||
|
||||
// Steam account types
|
||||
enum EAccountType
|
||||
{
|
||||
k_EAccountTypeInvalid = 0,
|
||||
k_EAccountTypeIndividual = 1, // single user account
|
||||
k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account
|
||||
k_EAccountTypeGameServer = 3, // game server account
|
||||
k_EAccountTypeAnonGameServer = 4, // anonymous game server account
|
||||
k_EAccountTypePending = 5, // pending
|
||||
k_EAccountTypeContentServer = 6, // content server
|
||||
k_EAccountTypeClan = 7,
|
||||
k_EAccountTypeChat = 8,
|
||||
k_EAccountTypeP2PSuperSeeder = 9, // a fake steamid used by superpeers to seed content to users of Steam P2P stuff
|
||||
k_EAccountTypeAnonUser = 10,
|
||||
|
||||
// Max of 16 items in this field
|
||||
k_EAccountTypeMax
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// types of user game stats fields
|
||||
// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ESteamUserStatType
|
||||
{
|
||||
k_ESteamUserStatTypeINVALID = 0,
|
||||
k_ESteamUserStatTypeINT = 1,
|
||||
k_ESteamUserStatTypeFLOAT = 2,
|
||||
// Read as FLOAT, set with count / session length
|
||||
k_ESteamUserStatTypeAVGRATE = 3,
|
||||
k_ESteamUserStatTypeACHIEVEMENTS = 4,
|
||||
k_ESteamUserStatTypeGROUPACHIEVEMENTS = 5,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Entry Types (previously was only friend-to-friend message types)
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatEntryType
|
||||
{
|
||||
k_EChatEntryTypeChatMsg = 1, // Normal text message from another user
|
||||
k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat)
|
||||
k_EChatEntryTypeInviteGame = 3, // Invite from other user into that users current game
|
||||
k_EChatEntryTypeEmote = 4, // text emote message
|
||||
k_EChatEntryTypeLobbyGameStart = 5, // lobby game is starting
|
||||
// Above are previous FriendMsgType entries, now merged into more generic chat entry types
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Room Enter Responses
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatRoomEnterResponse
|
||||
{
|
||||
k_EChatRoomEnterResponseSuccess = 1, // Success
|
||||
k_EChatRoomEnterResponseDoesntExist = 2, // Chat doesn't exist (probably closed)
|
||||
k_EChatRoomEnterResponseNotAllowed = 3, // General Denied - You don't have the permissions needed to join the chat
|
||||
k_EChatRoomEnterResponseFull = 4, // Chat room has reached its maximum size
|
||||
k_EChatRoomEnterResponseError = 5, // Unexpected Error
|
||||
k_EChatRoomEnterResponseBanned = 6, // You are banned from this chat room and may not join
|
||||
};
|
||||
|
||||
|
||||
typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath );
|
||||
typedef bool (*PFNLegacyKeyInstalled)();
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Persistent item constants
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef int32 HNewItemRequest; // Handle to an item generation request
|
||||
const int k_cchCreateItemLen = 64; // Maximum string length in item create APIs
|
||||
const uint64 INVALID_ITEM_ID = (uint64)-1;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Persistent item quality (rarity)
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EItemQuality
|
||||
{
|
||||
// If k_EItemQuality_Any is used in an item request a random quality will be chosen
|
||||
k_EItemQuality_Any = -1,
|
||||
k_EItemQuality_Normal = 0,
|
||||
k_EItemQuality_Common = 1,
|
||||
k_EItemQuality_Rare = 2,
|
||||
k_EItemQuality_Unique = 3,
|
||||
|
||||
//Must be last
|
||||
k_EItemQuality_Count = 4,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Result codes for SendNewItemReqeust
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EItemRequestResult
|
||||
{
|
||||
k_EItemRequestResultOK = 0, // Request succeeded
|
||||
k_EItemRequestResultDenied = 1, // Request denied
|
||||
k_EItemRequestResultServerError = 2, // Request failed due to a temporary server error
|
||||
k_EItemRequestResultTimeout = 3, // Request timed out
|
||||
k_EItemRequestResultInvalid = 4, // Request was corrupt
|
||||
k_EItemRequestResultNoMatch = 5, // No item definition matched the request
|
||||
k_EItemRequestResultUnknownError = 6, // Request failed with an unknown error
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Valid operators for BAddNewItemCriteria
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EItemCriteriaOperator
|
||||
{
|
||||
k_EOperator_String_EQ = 0, // Field is string equal to value
|
||||
k_EOperator_Not = 1, // Logical not
|
||||
k_EOperator_String_Not_EQ = 1, // Field is not string equal to value
|
||||
k_EOperator_Float_EQ = 2, // Field as a float is equal to value
|
||||
k_EOperator_Float_Not_EQ = 3, // Field as a float is not equal to value
|
||||
k_EOperator_Float_LT = 4, // Field as a float is less than value
|
||||
k_EOperator_Float_Not_LT = 5, // Field as a float is not less than value
|
||||
k_EOperator_Float_LTE = 6, // Field as a float is less than or equal value
|
||||
k_EOperator_Float_Not_LTE = 7, // Field as a float is not less than or equal value
|
||||
k_EOperator_Float_GT = 8, // Field as a float is greater than value
|
||||
k_EOperator_Float_Not_GT = 9, // Field as a float is not greater than value
|
||||
k_EOperator_Float_GTE = 10, // Field as a float is greater than or equal value
|
||||
k_EOperator_Float_Not_GTE = 11, // Field as a float is not greater than or equal value
|
||||
k_EOperator_Subkey_Contains = 12, // Field contains value as a subkey
|
||||
k_EOperator_Subkey_Not_Contains = 13, // Field does not contain value as a subkey
|
||||
|
||||
// Must be last
|
||||
k_EItemCriteriaOperator_Count = 14,
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Possible positions to tell the overlay to show notifications in
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ENotificationPosition
|
||||
{
|
||||
k_EPositionTopLeft = 0,
|
||||
k_EPositionTopRight = 1,
|
||||
k_EPositionBottomLeft = 2,
|
||||
k_EPositionBottomRight = 3,
|
||||
};
|
||||
|
||||
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
// Steam ID structure (64 bits total)
|
||||
class CSteamID
|
||||
{
|
||||
public:
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID()
|
||||
{
|
||||
m_unAccountID = 0;
|
||||
m_EAccountType = k_EAccountTypeInvalid;
|
||||
m_EUniverse = k_EUniverseInvalid;
|
||||
m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
Set( unAccountID, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// unAccountInstance - instance
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
#if defined(_SERVER) && defined(Assert)
|
||||
Assert( ! ( ( k_EAccountTypeIndividual == eAccountType ) && ( 1 != unAccountInstance ) ) ); // enforce that for individual accounts, instance is always 1
|
||||
#endif // _SERVER
|
||||
InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
// Note: Will not accept a uint32 or int32 as input, as that is a probable mistake.
|
||||
// See the stubbed out overloads in the private: section for more info.
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint64 ulSteamID )
|
||||
{
|
||||
SetFromUint64( ulSteamID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void Set( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_unAccountID = unAccountID;
|
||||
m_EUniverse = eUniverse;
|
||||
m_EAccountType = eAccountType;
|
||||
m_unAccountInstance = 1;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void InstancedSet( uint32 unAccountID, uint32 unInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_unAccountID = unAccountID;
|
||||
m_EUniverse = eUniverse;
|
||||
m_EAccountType = eAccountType;
|
||||
m_unAccountInstance = unInstance;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 52 bit parts and universe/type
|
||||
// Input : ulIdentifier - 52 bits of goodness
|
||||
//-----------------------------------------------------------------------------
|
||||
void FullSet( uint64 ulIdentifier, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_unAccountID = ( ulIdentifier & 0xFFFFFFFF ); // account ID is low 32 bits
|
||||
m_unAccountInstance = ( ( ulIdentifier >> 32 ) & 0xFFFFF ); // account instance is next 20 bits
|
||||
m_EUniverse = eUniverse;
|
||||
m_EAccountType = eAccountType;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 64-bit representation
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromUint64( uint64 ulSteamID )
|
||||
{
|
||||
m_unAccountID = ( ulSteamID & 0xFFFFFFFF ); // account ID is low 32 bits
|
||||
m_unAccountInstance = ( ( ulSteamID >> 32 ) & 0xFFFFF ); // account instance is next 20 bits
|
||||
|
||||
m_EAccountType = ( EAccountType ) ( ( ulSteamID >> 52 ) & 0xF ); // type is next 4 bits
|
||||
m_EUniverse = ( EUniverse ) ( ( ulSteamID >> 56 ) & 0xFF ); // universe is next 8 bits
|
||||
}
|
||||
|
||||
|
||||
#if defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to convert
|
||||
// eUniverse - universe this ID belongs to
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromSteam2( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse )
|
||||
{
|
||||
m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 +
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits;
|
||||
m_EUniverse = eUniverse; // set the universe
|
||||
m_EAccountType = k_EAccountTypeIndividual; // Steam 2 accounts always map to account type of individual
|
||||
m_unAccountInstance = 1; // individual accounts always have an account instance ID of 1
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fills out a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to write to
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConvertToSteam2( TSteamGlobalUserID *pTSteamGlobalUserID ) const
|
||||
{
|
||||
// only individual accounts have any meaning in Steam 2, only they can be mapped
|
||||
// Assert( m_EAccountType == k_EAccountTypeIndividual );
|
||||
|
||||
pTSteamGlobalUserID->m_SteamInstanceID = 0;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits = m_unAccountID % 2;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits = m_unAccountID / 2;
|
||||
}
|
||||
#endif // defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts steam ID to its 64-bit representation
|
||||
// Output : 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 ConvertToUint64() const
|
||||
{
|
||||
return (uint64) ( ( ( (uint64) m_EUniverse ) << 56 ) + ( ( (uint64) m_EAccountType ) << 52 ) +
|
||||
( ( (uint64) m_unAccountInstance ) << 32 ) + m_unAccountID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts the static parts of a steam ID to a 64-bit representation.
|
||||
// For multiseat accounts, all instances of that account will have the
|
||||
// same static account key, so they can be grouped together by the static
|
||||
// account key.
|
||||
// Output : 64-bit static account key
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 GetStaticAccountKey() const
|
||||
{
|
||||
// note we do NOT include the account instance (which is a dynamic property) in the static account key
|
||||
return (uint64) ( ( ( (uint64) m_EUniverse ) << 56 ) + ((uint64) m_EAccountType << 52 ) + m_unAccountID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_unAccountID = 0;
|
||||
m_EAccountType = k_EAccountTypeAnonGameServer;
|
||||
m_EUniverse = eUniverse;
|
||||
m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonUserLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_unAccountID = 0;
|
||||
m_EAccountType = k_EAccountTypeAnonUser;
|
||||
m_EUniverse = eUniverse;
|
||||
m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous game server login that will be filled in?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BBlankAnonAccount() const
|
||||
{
|
||||
return m_unAccountID == 0 && BAnonAccount() && m_unAccountInstance == 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a game server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BGameServerAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeGameServer || m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a content server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BContentServerAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeContentServer;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a clan account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BClanAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeClan;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a chat account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BChatAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeChat;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an individual user account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BIndividualAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeIndividual;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous account?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BAnonAccount() const
|
||||
{
|
||||
return m_EAccountType == k_EAccountTypeAnonUser || m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
|
||||
// simple accessors
|
||||
void SetAccountID( uint32 unAccountID ) { m_unAccountID = unAccountID; }
|
||||
uint32 GetAccountID() const { return m_unAccountID; }
|
||||
uint32 GetUnAccountInstance() const { return m_unAccountInstance; }
|
||||
EAccountType GetEAccountType() const { return ( EAccountType ) m_EAccountType; }
|
||||
EUniverse GetEUniverse() const { return m_EUniverse; }
|
||||
void SetEUniverse( EUniverse eUniverse ) { m_EUniverse = eUniverse; }
|
||||
bool IsValid() const { return ( m_EAccountType != k_EAccountTypeInvalid && m_EUniverse != k_EUniverseInvalid ); }
|
||||
|
||||
// this set of functions is hidden, will be moved out of class
|
||||
explicit CSteamID( const char *pchSteamID, EUniverse eDefaultUniverse = k_EUniverseInvalid );
|
||||
char * Render() const; // renders this steam ID to string
|
||||
static char * Render( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string
|
||||
|
||||
void SetFromString( const char *pchSteamID, EUniverse eDefaultUniverse );
|
||||
bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse );
|
||||
|
||||
bool operator==( const CSteamID &val ) const
|
||||
{
|
||||
return ( ( val.m_unAccountID == m_unAccountID ) && ( val.m_unAccountInstance == m_unAccountInstance )
|
||||
&& ( val.m_EAccountType == m_EAccountType ) && ( val.m_EUniverse == m_EUniverse ) );
|
||||
}
|
||||
|
||||
bool operator!=( const CSteamID &val ) const { return !operator==( val ); }
|
||||
bool operator<( const CSteamID &val ) const { return ConvertToUint64() < val.ConvertToUint64(); }
|
||||
bool operator>( const CSteamID &val ) const { return ConvertToUint64() > val.ConvertToUint64(); }
|
||||
|
||||
// DEBUG function
|
||||
bool BValidExternalSteamID() const;
|
||||
|
||||
private:
|
||||
// These are defined here to prevent accidental implicit conversion of a u32AccountID to a CSteamID.
|
||||
// If you get a compiler error about an ambiguous constructor/function then it may be because you're
|
||||
// passing a 32-bit int to a function that takes a CSteamID. You should explicitly create the SteamID
|
||||
// using the correct Universe and account Type/Instance values.
|
||||
CSteamID( uint32 );
|
||||
CSteamID( int32 );
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4201) // nameless union is nonstandard
|
||||
// 64 bits total
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
#endif
|
||||
uint32 m_unAccountID : 32; // unique account identifier
|
||||
unsigned int m_unAccountInstance : 20; // dynamic instance ID (used for multiseat type accounts only)
|
||||
unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference
|
||||
EUniverse m_EUniverse : 8; // universe this account belongs to
|
||||
#ifdef _WIN32
|
||||
};
|
||||
|
||||
uint64 m_unAll64Bits;
|
||||
};
|
||||
#pragma warning(pop) // no more anonymous unions until next time
|
||||
#endif
|
||||
};
|
||||
|
||||
const int k_unSteamAccountIDMask = 0xFFFFFFFF;
|
||||
const int k_unSteamAccountInstanceMask = 0x000FFFFF;
|
||||
|
||||
|
||||
// Special flags for Chat accounts - they go in the top 8 bits
|
||||
// of the steam ID's "instance", leaving 12 for the actual instances
|
||||
enum EChatSteamIDInstanceFlags
|
||||
{
|
||||
k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags
|
||||
|
||||
k_EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) >> 1, // top bit
|
||||
k_EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 2, // next one down, etc
|
||||
|
||||
// Max of 8 flags
|
||||
};
|
||||
|
||||
|
||||
// generic invalid CSteamID
|
||||
const CSteamID k_steamIDNil;
|
||||
|
||||
// This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol
|
||||
// to provide its steamID
|
||||
const CSteamID k_steamIDOutofDateGS( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
// This steamID comes from a user game connection to an sv_lan GS
|
||||
const CSteamID k_steamIDLanModeGS( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid );
|
||||
// This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized
|
||||
// its steam3 component and started logging on.
|
||||
const CSteamID k_steamIDNotInitYetGS( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
// This steamID can come from a user game connection to a GS that isn't using the steam authentication system but still
|
||||
// wants to support the "Join Game" option in the friends list
|
||||
const CSteamID k_steamIDNonSteamGS( 2, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
|
||||
|
||||
#ifdef STEAM
|
||||
// Returns the matching chat steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance
|
||||
CSteamID ChatIDFromSteamID( CSteamID &steamID );
|
||||
// Returns the matching clan steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance
|
||||
CSteamID ClanIDFromSteamID( CSteamID &steamID );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ChatIDFromClanID( CSteamID &steamIDClan );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ClanIDFromChatID( CSteamID &steamIDChat );
|
||||
|
||||
#endif // _STEAM
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: encapsulates an appID/modID pair
|
||||
//-----------------------------------------------------------------------------
|
||||
class CGameID
|
||||
{
|
||||
public:
|
||||
|
||||
CGameID()
|
||||
{
|
||||
m_gameID.m_nType = k_EGameIDTypeApp;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nModID = 0;
|
||||
}
|
||||
|
||||
explicit CGameID( uint64 ulGameID )
|
||||
{
|
||||
m_ulGameID = ulGameID;
|
||||
}
|
||||
|
||||
explicit CGameID( int32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
explicit CGameID( uint32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
CGameID( uint32 nAppID, uint32 nModID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nModID = nModID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
}
|
||||
|
||||
// Hidden functions used only by Steam
|
||||
explicit CGameID( const char *pchGameID );
|
||||
char *Render() const; // render this Game ID to string
|
||||
static char *Render( uint64 ulGameID ); // static method to render a uint64 representation of a Game ID to a string
|
||||
|
||||
// must include checksum_crc.h first to get this functionality
|
||||
#if defined( CHECKSUM_CRC_H )
|
||||
CGameID( uint32 nAppID, const char *pchModPath )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
|
||||
char rgchModDir[MAX_PATH];
|
||||
Q_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) );
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, rgchModDir, Q_strlen( rgchModDir ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
CGameID( const char *pchExePath, const char *pchAppName )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeShortcut;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, pchExePath, Q_strlen( pchExePath ) );
|
||||
CRC32_ProcessBuffer( &crc32, pchAppName, Q_strlen( pchAppName ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#if defined( VSTFILEID_H )
|
||||
|
||||
CGameID( VstFileID vstFileID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeP2P;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
const char *pchFileId = vstFileID.Render();
|
||||
CRC32_ProcessBuffer( &crc32, pchFileId, Q_strlen( pchFileId ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#endif /* VSTFILEID_H */
|
||||
|
||||
#endif /* CHECKSUM_CRC_H */
|
||||
|
||||
|
||||
uint64 ToUint64() const
|
||||
{
|
||||
return m_ulGameID;
|
||||
}
|
||||
|
||||
uint64 *GetUint64Ptr()
|
||||
{
|
||||
return &m_ulGameID;
|
||||
}
|
||||
|
||||
bool IsMod() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeGameMod );
|
||||
}
|
||||
|
||||
bool IsShortcut() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeShortcut );
|
||||
}
|
||||
|
||||
bool IsP2PFile() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeP2P );
|
||||
}
|
||||
|
||||
bool IsSteamApp() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeApp );
|
||||
}
|
||||
|
||||
uint32 ModID() const
|
||||
{
|
||||
return m_gameID.m_nModID;
|
||||
}
|
||||
|
||||
uint32 AppID() const
|
||||
{
|
||||
return m_gameID.m_nAppID;
|
||||
}
|
||||
|
||||
bool operator == ( const CGameID &rhs ) const
|
||||
{
|
||||
return m_ulGameID == rhs.m_ulGameID;
|
||||
}
|
||||
|
||||
bool operator != ( const CGameID &rhs ) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
bool operator < ( const CGameID &rhs ) const
|
||||
{
|
||||
return ( m_ulGameID < rhs.m_ulGameID );
|
||||
}
|
||||
|
||||
bool IsValid() const
|
||||
{
|
||||
// each type has it's own invalid fixed point:
|
||||
switch( m_gameID.m_nType )
|
||||
{
|
||||
case k_EGameIDTypeApp:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid;
|
||||
break;
|
||||
case k_EGameIDTypeGameMod:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
case k_EGameIDTypeShortcut:
|
||||
return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
case k_EGameIDTypeP2P:
|
||||
return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
default:
|
||||
#if defined(Assert)
|
||||
Assert(false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
enum EGameIDType
|
||||
{
|
||||
k_EGameIDTypeApp = 0,
|
||||
k_EGameIDTypeGameMod = 1,
|
||||
k_EGameIDTypeShortcut = 2,
|
||||
k_EGameIDTypeP2P = 3,
|
||||
};
|
||||
|
||||
struct GameID_t
|
||||
{
|
||||
unsigned int m_nAppID : 24;
|
||||
unsigned int m_nType : 8;
|
||||
unsigned int m_nModID : 32;
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
uint64 m_ulGameID;
|
||||
GameID_t m_gameID;
|
||||
};
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
const int k_cchGameExtraInfoMax = 64;
|
||||
|
||||
|
||||
// Max number of credit cards stored for one account
|
||||
const int k_nMaxNumCardsPerAccount = 1;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constants used for query ports.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define QUERY_PORT_NOT_INITIALIZED 0xFFFF // We haven't asked the GS for this query port's actual value yet.
|
||||
#define QUERY_PORT_ERROR 0xFFFE // We were unable to get the query port for this server.
|
||||
|
||||
#endif // STEAMCLIENTPUBLIC_H
|
||||
84
res/steamworks/102/headers/steamtypes.h
Normal file
84
res/steamworks/102/headers/steamtypes.h
Normal file
@@ -0,0 +1,84 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMTYPES_H
|
||||
#define STEAMTYPES_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Steam-specific types. Defined here so this header file can be included in other code bases.
|
||||
#ifndef WCHARTYPES_H
|
||||
typedef unsigned char uint8;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(_WIN64)
|
||||
#define X64BITS
|
||||
#endif
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef signed char int8;
|
||||
|
||||
#if defined( _WIN32 )
|
||||
|
||||
typedef __int16 int16;
|
||||
typedef unsigned __int16 uint16;
|
||||
typedef __int32 int32;
|
||||
typedef unsigned __int32 uint32;
|
||||
typedef __int64 int64;
|
||||
typedef unsigned __int64 uint64;
|
||||
|
||||
#ifdef X64BITS
|
||||
typedef __int64 intp; // intp is an integer that can accomodate a pointer
|
||||
typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *)
|
||||
#else
|
||||
typedef __int32 intp;
|
||||
typedef unsigned __int32 uintp;
|
||||
#endif
|
||||
|
||||
#else // _WIN32
|
||||
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
#ifdef X64BITS
|
||||
typedef long long intp;
|
||||
typedef unsigned long long uintp;
|
||||
#else
|
||||
typedef int intp;
|
||||
typedef unsigned int uintp;
|
||||
#endif
|
||||
|
||||
#endif // else _WIN32
|
||||
|
||||
const int k_cubSaltSize = 8;
|
||||
typedef uint8 Salt_t[ k_cubSaltSize ];
|
||||
|
||||
typedef uint64 GID_t; // globally unique identifier
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 PackageId_t;
|
||||
const PackageId_t k_uPackageIdInvalid = 0xFFFFFFFF;
|
||||
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 AppId_t;
|
||||
const AppId_t k_uAppIdInvalid = 0x0;
|
||||
|
||||
// RTime32
|
||||
// We use this 32 bit time representing real world time.
|
||||
// It offers 1 second resolution beginning on January 1, 1970 (Unix time)
|
||||
typedef uint32 RTime32;
|
||||
|
||||
typedef uint32 CellID_t;
|
||||
|
||||
#endif // STEAMTYPES_H
|
||||
32
res/steamworks/103/headers/isteamapps.h
Normal file
32
res/steamworks/103/headers/isteamapps.h
Normal file
@@ -0,0 +1,32 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to app data in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMAPPS_H
|
||||
#define ISTEAMAPPS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to app data
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamApps
|
||||
{
|
||||
public:
|
||||
virtual bool BIsSubscribed() = 0;
|
||||
virtual bool BIsLowViolence() = 0;
|
||||
virtual bool BIsCybercafe() = 0;
|
||||
virtual bool BIsVACBanned() = 0;
|
||||
virtual const char *GetCurrentGameLanguage() = 0;
|
||||
virtual const char *GetAvailableGameLanguages() = 0;
|
||||
|
||||
// only use this member if you need to check ownership of another game related to yours, a demo for example
|
||||
virtual bool BIsSubscribedApp( AppId_t appID ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION002"
|
||||
|
||||
#endif // ISTEAMAPPS_H
|
||||
154
res/steamworks/103/headers/isteamclient.h
Normal file
154
res/steamworks/103/headers/isteamclient.h
Normal file
@@ -0,0 +1,154 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: Main interface for loading and accessing Steamworks API's from the
|
||||
// Steam client.
|
||||
// For most uses, this code is wrapped inside of SteamAPI_Init()
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMCLIENT_H
|
||||
#define ISTEAMCLIENT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a communication pipe to the Steam client
|
||||
typedef int32 HSteamPipe;
|
||||
// handle to single instance of a steam user
|
||||
typedef int32 HSteamUser;
|
||||
// function prototype
|
||||
#if defined( POSIX ) && !defined( _CYGWIN )
|
||||
#define __cdecl
|
||||
#endif
|
||||
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
|
||||
|
||||
// interface predec
|
||||
class ISteamUser;
|
||||
class ISteamGameServer;
|
||||
class ISteamFriends;
|
||||
class ISteamUtils;
|
||||
class ISteamMatchmaking;
|
||||
class ISteamContentServer;
|
||||
class ISteamMasterServerUpdater;
|
||||
class ISteamMatchmakingServers;
|
||||
class ISteamUserStats;
|
||||
class ISteamApps;
|
||||
class ISteamNetworking;
|
||||
class ISteamRemoteStorage;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Interface to creating a new steam instance, or to
|
||||
// connect to an existing steam instance, whether it's in a
|
||||
// different process or is local.
|
||||
//
|
||||
// For most scenarios this is all handled automatically via SteamAPI_Init().
|
||||
// You'll only need to use these interfaces if you have a more complex versioning scheme,
|
||||
// where you want to get different versions of the same interface in different dll's in your project.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamClient
|
||||
{
|
||||
public:
|
||||
// Creates a communication pipe to the Steam client
|
||||
virtual HSteamPipe CreateSteamPipe() = 0;
|
||||
|
||||
// Releases a previously created communications pipe
|
||||
virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// connects to an existing global user, failing if none exists
|
||||
// used by the game to coordinate with the steamUI
|
||||
virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// used by game servers, create a steam user that won't be shared with anyone else
|
||||
virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe ) = 0;
|
||||
|
||||
// removes an allocated user
|
||||
virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0;
|
||||
|
||||
// retrieves the ISteamUser interface associated with the handle
|
||||
virtual ISteamUser *GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// retrieves the ISteamGameServer interface associated with the handle
|
||||
virtual ISteamGameServer *GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// set the local IP and Port to bind to
|
||||
// this must be set before CreateLocalUser()
|
||||
virtual void SetLocalIPBinding( uint32 unIP, uint16 usPort ) = 0;
|
||||
|
||||
// returns the ISteamFriends interface
|
||||
virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamUtils interface
|
||||
virtual ISteamUtils *GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmaking interface
|
||||
virtual ISteamMatchmaking *GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamContentServer interface
|
||||
virtual ISteamContentServer *GetISteamContentServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMasterServerUpdater interface
|
||||
virtual ISteamMasterServerUpdater *GetISteamMasterServerUpdater( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmakingServers interface
|
||||
virtual ISteamMatchmakingServers *GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the a generic interface
|
||||
virtual void *GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// this needs to be called every frame to process matchmaking results
|
||||
// redundant if you're already calling SteamAPI_RunCallbacks()
|
||||
virtual void RunFrame() = 0;
|
||||
|
||||
// returns the number of IPC calls made since the last time this function was called
|
||||
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
||||
// Every IPC call is at minimum a thread context switch if not a process one so you want to rate
|
||||
// control how often you do them.
|
||||
virtual uint32 GetIPCCallCount() = 0;
|
||||
|
||||
// returns the ISteamUserStats interface
|
||||
virtual ISteamUserStats *GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns apps interface
|
||||
virtual ISteamApps *GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// networking
|
||||
virtual ISteamNetworking *GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// API warning handling
|
||||
// 'int' is the severity; 0 for msg, 1 for warning
|
||||
// 'const char *' is the text of the message
|
||||
// callbacks will occur directly after the API function is called that generated the warning or message
|
||||
virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
|
||||
|
||||
// remote storage
|
||||
virtual ISteamRemoteStorage *GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
};
|
||||
|
||||
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient007"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Base values for callback identifiers, each callback must
|
||||
// have a unique ID.
|
||||
//-----------------------------------------------------------------------------
|
||||
enum { k_iSteamUserCallbacks = 100 };
|
||||
enum { k_iSteamGameServerCallbacks = 200 };
|
||||
enum { k_iSteamFriendsCallbacks = 300 };
|
||||
enum { k_iSteamBillingCallbacks = 400 };
|
||||
enum { k_iSteamMatchmakingCallbacks = 500 };
|
||||
enum { k_iSteamContentServerCallbacks = 600 };
|
||||
enum { k_iSteamUtilsCallbacks = 700 };
|
||||
enum { k_iClientFriendsCallbacks = 800 };
|
||||
enum { k_iClientUserCallbacks = 900 };
|
||||
enum { k_iSteamAppsCallbacks = 1000 };
|
||||
enum { k_iSteamUserStatsCallbacks = 1100 };
|
||||
enum { k_iSteamNetworkingCallbacks = 1200 };
|
||||
enum { k_iClientRemoteStorageCallbacks = 1300 };
|
||||
enum { k_iSteamUserItemsCallbacks = 1400 };
|
||||
enum { k_iSteamGameServerItemsCallbacks = 1500 };
|
||||
enum { k_iClientUtilsCallbacks = 1600 };
|
||||
|
||||
|
||||
#endif // ISTEAMCLIENT_H
|
||||
247
res/steamworks/103/headers/isteamfriends.h
Normal file
247
res/steamworks/103/headers/isteamfriends.h
Normal file
@@ -0,0 +1,247 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to both friends list data and general information about users
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMFRIENDS_H
|
||||
#define ISTEAMFRIENDS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: set of relationships to other users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EFriendRelationship
|
||||
{
|
||||
k_EFriendRelationshipNone = 0,
|
||||
k_EFriendRelationshipBlocked = 1,
|
||||
k_EFriendRelationshipRequestRecipient = 2,
|
||||
k_EFriendRelationshipFriend = 3,
|
||||
k_EFriendRelationshipRequestInitiator = 4,
|
||||
k_EFriendRelationshipIgnored = 5,
|
||||
k_EFriendRelationshipIgnoredFriend = 6,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: list of states a friend can be in
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EPersonaState
|
||||
{
|
||||
k_EPersonaStateOffline = 0, // friend is not currently logged on
|
||||
k_EPersonaStateOnline = 1, // friend is logged on
|
||||
k_EPersonaStateBusy = 2, // user is on, but busy
|
||||
k_EPersonaStateAway = 3, // auto-away feature
|
||||
k_EPersonaStateSnooze = 4, // auto-away for a long time
|
||||
k_EPersonaStateMax,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: flags for enumerating friends list, or quickly checking a the relationship between users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EFriendFlags
|
||||
{
|
||||
k_EFriendFlagNone = 0x00,
|
||||
k_EFriendFlagBlocked = 0x01,
|
||||
k_EFriendFlagFriendshipRequested = 0x02,
|
||||
k_EFriendFlagImmediate = 0x04, // "regular" friend
|
||||
k_EFriendFlagClanMember = 0x08,
|
||||
k_EFriendFlagOnGameServer = 0x10,
|
||||
// k_EFriendFlagHasPlayedWith = 0x20, // not currently used
|
||||
// k_EFriendFlagFriendOfFriend = 0x40, // not currently used
|
||||
k_EFriendFlagRequestingFriendship = 0x80,
|
||||
k_EFriendFlagRequestingInfo = 0x100,
|
||||
k_EFriendFlagIgnored = 0x200,
|
||||
k_EFriendFlagIgnoredFriend = 0x400,
|
||||
k_EFriendFlagAll = 0xFFFF,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: avatar sizes, used in ISteamFriends::GetFriendAvatar()
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EAvatarSize
|
||||
{
|
||||
k_EAvatarSize32x32 = 0,
|
||||
k_EAvatarSize64x64 = 1,
|
||||
};
|
||||
|
||||
|
||||
// friend game played information
|
||||
struct FriendGameInfo_t
|
||||
{
|
||||
CGameID m_gameID;
|
||||
uint32 m_unGameIP;
|
||||
uint16 m_usGamePort;
|
||||
uint16 m_usQueryPort;
|
||||
CSteamID m_steamIDLobby;
|
||||
};
|
||||
|
||||
|
||||
// maximum number of characters in a users name
|
||||
enum { k_cchPersonaNameMax = 128 };
|
||||
|
||||
// size limit on chat room or member metadata
|
||||
const uint32 k_cubChatMetadataMax = 8192;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to accessing information about individual users,
|
||||
// that can be a friend, in a group, on a game server or in a lobby with the local user
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamFriends
|
||||
{
|
||||
public:
|
||||
// returns the local players name - guaranteed to not be NULL.
|
||||
// this is the same name as on the users community profile page
|
||||
// this is stored in UTF-8 format
|
||||
// like all the other interface functions that return a char *, it's important that this pointer is not saved
|
||||
// off; it will eventually be free'd or re-allocated
|
||||
virtual const char *GetPersonaName() = 0;
|
||||
|
||||
// sets the player name, stores it on the server and publishes the changes to all friends who are online
|
||||
virtual void SetPersonaName( const char *pchPersonaName ) = 0;
|
||||
|
||||
// gets the status of the current user
|
||||
virtual EPersonaState GetPersonaState() = 0;
|
||||
|
||||
// friend iteration
|
||||
// takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria
|
||||
// then GetFriendByIndex() can then be used to return the id's of each of those users
|
||||
virtual int GetFriendCount( int iFriendFlags ) = 0;
|
||||
|
||||
// returns the steamID of a user
|
||||
// iFriend is a index of range [0, GetFriendCount())
|
||||
// iFriendsFlags must be the same value as used in GetFriendCount()
|
||||
// the returned CSteamID can then be used by all the functions below to access details about the user
|
||||
virtual CSteamID GetFriendByIndex( int iFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// returns a relationship to a user
|
||||
virtual EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the current status of the specified user
|
||||
// this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user
|
||||
virtual EPersonaState GetFriendPersonaState( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the name another user - guaranteed to not be NULL.
|
||||
// same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user
|
||||
// note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously
|
||||
//
|
||||
virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// gets the avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetFriendAvatar( CSteamID steamIDFriend, int eAvatarSize ) = 0;
|
||||
// returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details
|
||||
virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, FriendGameInfo_t *pFriendGameInfo ) = 0;
|
||||
// accesses old friends names - returns an empty string when their are no more items in the history
|
||||
virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0;
|
||||
|
||||
// returns true if the specified user meets any of the criteria specified in iFriendFlags
|
||||
// iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values
|
||||
virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// clan (group) iteration and access functions
|
||||
virtual int GetClanCount() = 0;
|
||||
virtual CSteamID GetClanByIndex( int iClan ) = 0;
|
||||
virtual const char *GetClanName( CSteamID steamIDClan ) = 0;
|
||||
|
||||
// iterators for getting users in a chat room, lobby, game server or clan
|
||||
// note that large clans that cannot be iterated by the local user
|
||||
// steamIDSource can be the steamID of a group, game server, lobby or chat room
|
||||
virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0;
|
||||
virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0;
|
||||
|
||||
// returns true if the local user can see that steamIDUser is a member or in steamIDSource
|
||||
virtual bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) = 0;
|
||||
|
||||
// User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI)
|
||||
virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0;
|
||||
|
||||
// activates the game overlay, with an optional dialog to open
|
||||
// valid options are "Friends", "Community", "Players", "Settings", "LobbyInvite", "OfficialGameGroup"
|
||||
virtual void ActivateGameOverlay( const char *pchDialog ) = 0;
|
||||
|
||||
// activates game overlay to a specific place
|
||||
// valid options are
|
||||
// "steamid" - opens the overlay web browser to the specified user or groups profile
|
||||
// "chat" - opens a chat window to the specified user, or joins the group chat
|
||||
virtual void ActivateGameOverlayToUser( const char *pchDialog, CSteamID steamID ) = 0;
|
||||
|
||||
// activates game overlay web browser directly to the specified URL
|
||||
// full address with protocol type is required, e.g. http://www.steamgames.com/
|
||||
virtual void ActivateGameOverlayToWebPage( const char *pchURL ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends005"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a friends' status changes
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PersonaStateChange_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamID; // steamID of the friend who changed
|
||||
int m_nChangeFlags; // what's changed
|
||||
};
|
||||
|
||||
|
||||
// used in PersonaStateChange_t::m_nChangeFlags to describe what's changed about a user
|
||||
// these flags describe what the client has learned has changed recently, so on startup you'll see a name, avatar & relationship change for every friend
|
||||
enum EPersonaChange
|
||||
{
|
||||
k_EPersonaChangeName = 0x001,
|
||||
k_EPersonaChangeStatus = 0x002,
|
||||
k_EPersonaChangeComeOnline = 0x004,
|
||||
k_EPersonaChangeGoneOffline = 0x008,
|
||||
k_EPersonaChangeGamePlayed = 0x010,
|
||||
k_EPersonaChangeGameServer = 0x020,
|
||||
k_EPersonaChangeAvatar = 0x040,
|
||||
k_EPersonaChangeJoinedSource= 0x080,
|
||||
k_EPersonaChangeLeftSource = 0x100,
|
||||
k_EPersonaChangeRelationshipChanged = 0x200,
|
||||
k_EPersonaChangeNameFirstSet = 0x400,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: posted when game overlay activates or deactivates
|
||||
// the game can use this to be pause or resume single player games
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameOverlayActivated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 31 };
|
||||
uint8 m_bActive; // true if it's just been activated, false otherwise
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the user tries to join a different game server from their friends list
|
||||
// game client should attempt to connect to specified server when this is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameServerChangeRequested_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 32 };
|
||||
char m_rgchServer[64]; // server address ("127.0.0.1:27015", "tf2.valvesoftware.com")
|
||||
char m_rgchPassword[64]; // server password, if any
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the user tries to join a lobby from their friends list
|
||||
// game client should attempt to connect to specified lobby when this is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameLobbyJoinRequested_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 33 };
|
||||
CSteamID m_steamIDLobby;
|
||||
CSteamID m_steamIDFriend; // the friend they did the join via (will be invalid if not directly via a friend)
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMFRIENDS_H
|
||||
192
res/steamworks/103/headers/isteamgameserver.h
Normal file
192
res/steamworks/103/headers/isteamgameserver.h
Normal file
@@ -0,0 +1,192 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMGAMESERVER_H
|
||||
#define ISTEAMGAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for authenticating users via Steam to play on a game server
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamGameServer
|
||||
{
|
||||
public:
|
||||
// connection functions
|
||||
virtual void LogOn() = 0;
|
||||
virtual void LogOff() = 0;
|
||||
|
||||
// status functions
|
||||
virtual bool BLoggedOn() = 0;
|
||||
virtual bool BSecure() = 0;
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Handles receiving a new connection from a Steam user. This call will ask the Steam
|
||||
// servers to validate the users identity, app ownership, and VAC status. If the Steam servers
|
||||
// are off-line, then it will validate the cached ticket itself which will validate app ownership
|
||||
// and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection()
|
||||
// and must then be sent up to the game server for authentication.
|
||||
//
|
||||
// Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL
|
||||
// If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication
|
||||
// for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)
|
||||
virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0;
|
||||
|
||||
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||
//
|
||||
// Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect()
|
||||
// when this user leaves the server just like you would for a real user.
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection() = 0;
|
||||
|
||||
// Should be called whenever a user leaves our game server, this lets Steam internally
|
||||
// track which users are currently on which servers for the purposes of preventing a single
|
||||
// account being logged into multiple servers, showing who is currently on a server, etc.
|
||||
virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// Update the data to be displayed in the server browser and matchmaking interfaces for a user
|
||||
// currently connected to the server. For regular users you must call this after you receive a
|
||||
// GSUserValidationSuccess callback.
|
||||
//
|
||||
// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
|
||||
virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
|
||||
|
||||
// You shouldn't need to call this as it is called internally by SteamGameServer_Init() and can only be called once.
|
||||
//
|
||||
// To update the data in this call which may change during the servers lifetime see UpdateServerStatus() below.
|
||||
//
|
||||
// Input: nGameAppID - The Steam assigned AppID for the game
|
||||
// unServerFlags - Any applicable combination of flags (see k_unServerFlag____ constants below)
|
||||
// unGameIP - The IP Address the server is listening for client connections on (might be INADDR_ANY)
|
||||
// unGamePort - The port which the server is listening for client connections on
|
||||
// unSpectatorPort - the port on which spectators can join to observe the server, 0 if spectating is not supported
|
||||
// usQueryPort - The port which the ISteamMasterServerUpdater API should use in order to listen for matchmaking requests
|
||||
// pchGameDir - A unique string identifier for your game
|
||||
// pchVersion - The current version of the server as a string like 1.0.0.0
|
||||
// bLanMode - Is this a LAN only server?
|
||||
//
|
||||
// bugbug jmccaskey - figure out how to remove this from the API and only expose via SteamGameServer_Init... or make this actually used,
|
||||
// and stop calling it in SteamGameServer_Init()?
|
||||
virtual bool BSetServerType( uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort,
|
||||
uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode ) = 0;
|
||||
|
||||
// Updates server status values which shows up in the server browser and matchmaking APIs
|
||||
virtual void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers,
|
||||
const char *pchServerName, const char *pSpectatorServerName,
|
||||
const char *pchMapName ) = 0;
|
||||
|
||||
// This can be called if spectator goes away or comes back (passing 0 means there is no spectator server now).
|
||||
virtual void UpdateSpectatorPort( uint16 unSpectatorPort ) = 0;
|
||||
|
||||
// Sets a string defining the "gametype" for this server, this is optional, but if it is set
|
||||
// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||
virtual void SetGameType( const char *pchGameType ) = 0;
|
||||
|
||||
// Ask if a user has a specific achievement for this game, will get a callback on reply
|
||||
virtual bool BGetUserAchievementStatus( CSteamID steamID, const char *pchAchievementName ) = 0;
|
||||
|
||||
// Ask for the gameplay stats for the server. Results returned in a callback
|
||||
virtual void GetGameplayStats( ) = 0;
|
||||
|
||||
// Ask if a user in in the specified group, results returns async by GSUserGroupStatus_t
|
||||
// returns false if we're not connected to the steam servers and thus cannot ask
|
||||
virtual bool RequestUserGroupStatus( CSteamID steamIDUser, CSteamID steamIDGroup ) = 0;
|
||||
|
||||
// Returns the public IP of the server according to Steam, useful when the server is
|
||||
// behind NAT and you want to advertise its IP in a lobby for other clients to directly
|
||||
// connect to
|
||||
virtual uint32 GetPublicIP() = 0;
|
||||
};
|
||||
|
||||
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer008"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unServerFlagNone = 0x00;
|
||||
const uint32 k_unServerFlagActive = 0x01; // server has users playing
|
||||
const uint32 k_unServerFlagSecure = 0x02; // server wants to be secure
|
||||
const uint32 k_unServerFlagDedicated = 0x04; // server is dedicated
|
||||
const uint32 k_unServerFlagLinux = 0x08; // linux build
|
||||
const uint32 k_unServerFlagPassworded = 0x10; // password protected
|
||||
const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and
|
||||
// won't enforce authentication of users that connect to the server.
|
||||
// Useful when you run a server where the clients may not
|
||||
// be connected to the internet but you want them to play (i.e LANs)
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
// client has been approved to connect to this game server
|
||||
struct GSClientApprove_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 1 };
|
||||
CSteamID m_SteamID;
|
||||
};
|
||||
|
||||
|
||||
// client has been denied to connection to this game server
|
||||
struct GSClientDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 2 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
char m_rgchOptionalText[128];
|
||||
};
|
||||
|
||||
|
||||
// request the game server should kick the user
|
||||
struct GSClientKick_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 3 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
};
|
||||
|
||||
// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks,
|
||||
// do not reuse them here.
|
||||
|
||||
|
||||
// client achievement info
|
||||
struct GSClientAchievementStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 6 };
|
||||
uint64 m_SteamID;
|
||||
char m_pchAchievement[128];
|
||||
bool m_bUnlocked;
|
||||
};
|
||||
|
||||
// received when the game server requests to be displayed as secure (VAC protected)
|
||||
// m_bSecure is true if the game server should display itself as secure to users, false otherwise
|
||||
struct GSPolicyResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 15 };
|
||||
uint8 m_bSecure;
|
||||
};
|
||||
|
||||
// GS gameplay stats info
|
||||
struct GSGameplayStats_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 7 };
|
||||
EResult m_eResult; // Result of the call
|
||||
int32 m_nRank; // Overall rank of the server (0-based)
|
||||
uint32 m_unTotalConnects; // Total number of clients who have ever connected to the server
|
||||
uint32 m_unTotalMinutesPlayed; // Total number of minutes ever played on the server
|
||||
};
|
||||
|
||||
// send as a reply to RequestUserGroupStatus()
|
||||
struct GSClientGroupStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 8 };
|
||||
CSteamID m_SteamIDUser;
|
||||
CSteamID m_SteamIDGroup;
|
||||
bool m_bMember;
|
||||
bool m_bOfficer;
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMGAMESERVER_H
|
||||
103
res/steamworks/103/headers/isteammasterserverupdater.h
Normal file
103
res/steamworks/103/headers/isteammasterserverupdater.h
Normal file
@@ -0,0 +1,103 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for retrieving list of game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMASTERSERVERUPDATER_H
|
||||
#define ISTEAMMASTERSERVERUPDATER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Game engines use this to tell the Steam master servers
|
||||
// about their games so their games can show up in the server browser.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMasterServerUpdater
|
||||
{
|
||||
public:
|
||||
|
||||
// Call this as often as you like to tell the master server updater whether or not
|
||||
// you want it to be active (default: off).
|
||||
virtual void SetActive( bool bActive ) = 0;
|
||||
|
||||
// You usually don't need to modify this.
|
||||
// Pass -1 to use the default value for iHeartbeatInterval.
|
||||
// Some mods change this.
|
||||
virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0;
|
||||
|
||||
|
||||
// These are in GameSocketShare mode, where instead of ISteamMasterServerUpdater creating its own
|
||||
// socket to talk to the master server on, it lets the game use its socket to forward messages
|
||||
// back and forth. This prevents us from requiring server ops to open up yet another port
|
||||
// in their firewalls.
|
||||
//
|
||||
// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001
|
||||
|
||||
// These are used when you've elected to multiplex the game server's UDP socket
|
||||
// rather than having the master server updater use its own sockets.
|
||||
//
|
||||
// Source games use this to simplify the job of the server admins, so they
|
||||
// don't have to open up more ports on their firewalls.
|
||||
|
||||
// Call this when a packet that starts with 0xFFFFFFFF comes in. That means
|
||||
// it's for us.
|
||||
virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0;
|
||||
|
||||
// AFTER calling HandleIncomingPacket for any packets that came in that frame, call this.
|
||||
// This gets a packet that the master server updater needs to send out on UDP.
|
||||
// It returns the length of the packet it wants to send, or 0 if there are no more packets to send.
|
||||
// Call this each frame until it returns 0.
|
||||
virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0;
|
||||
|
||||
|
||||
// Functions to set various fields that are used to respond to queries.
|
||||
|
||||
// Call this to set basic data that is passed to the server browser.
|
||||
virtual void SetBasicServerData(
|
||||
unsigned short nProtocolVersion,
|
||||
bool bDedicatedServer,
|
||||
const char *pRegionName,
|
||||
const char *pProductName,
|
||||
unsigned short nMaxReportedClients,
|
||||
bool bPasswordProtected,
|
||||
const char *pGameDescription ) = 0;
|
||||
|
||||
// Call this to clear the whole list of key/values that are sent in rules queries.
|
||||
virtual void ClearAllKeyValues() = 0;
|
||||
|
||||
// Call this to add/update a key/value pair.
|
||||
virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
|
||||
// You can call this upon shutdown to clear out data stored for this game server and
|
||||
// to tell the master servers that this server is going away.
|
||||
virtual void NotifyShutdown() = 0;
|
||||
|
||||
// Returns true if the master server has requested a restart.
|
||||
// Only returns true once per request.
|
||||
virtual bool WasRestartRequested() = 0;
|
||||
|
||||
// Force it to request a heartbeat from the master servers.
|
||||
virtual void ForceHeartbeat() = 0;
|
||||
|
||||
// Manually edit and query the master server list.
|
||||
// It will provide name resolution and use the default master server port if none is provided.
|
||||
virtual bool AddMasterServer( const char *pServerAddress ) = 0;
|
||||
virtual bool RemoveMasterServer( const char *pServerAddress ) = 0;
|
||||
|
||||
virtual int GetNumMasterServers() = 0;
|
||||
|
||||
// Returns the # of bytes written to pOut.
|
||||
virtual int GetMasterServerAddress( int iServer, char *pOut, int outBufferSize ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMMASTERSERVERUPDATER_INTERFACE_VERSION "SteamMasterServerUpdater001"
|
||||
|
||||
#endif // ISTEAMMASTERSERVERUPDATER_H
|
||||
584
res/steamworks/103/headers/isteammatchmaking.h
Normal file
584
res/steamworks/103/headers/isteammatchmaking.h
Normal file
@@ -0,0 +1,584 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing game server/client match making
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMATCHMAKING
|
||||
#define ISTEAMMATCHMAKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
#include "matchmakingtypes.h"
|
||||
#include "isteamclient.h"
|
||||
#include "isteamfriends.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to favorites
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ELobbyType
|
||||
{
|
||||
k_ELobbyTypeFriendsOnly = 1, // shows for friends or invitees, but not in lobby list
|
||||
k_ELobbyTypePublic = 2, // visible for friends and in lobby list
|
||||
};
|
||||
|
||||
enum ELobbyComparison
|
||||
{
|
||||
k_ELobbyComparisonEqualToOrLessThan = -2,
|
||||
k_ELobbyComparisonLessThan = -1,
|
||||
k_ELobbyComparisonEqual = 0,
|
||||
k_ELobbyComparisonGreaterThan = 1,
|
||||
k_ELobbyComparisonEqualToOrGreaterThan = 2,
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to favorites
|
||||
// and to operate on game lobbies.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmaking
|
||||
{
|
||||
public:
|
||||
// game server favorites storage
|
||||
// saves basic details about a multiplayer game server locally
|
||||
|
||||
// returns the number of favorites servers the user has stored
|
||||
virtual int GetFavoriteGameCount() = 0;
|
||||
|
||||
// returns the details of the game server
|
||||
// iGame is of range [0,GetFavoriteGameCount())
|
||||
// *pnIP, *pnConnPort are filled in the with IP:port of the game server
|
||||
// *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections
|
||||
// *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added
|
||||
virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0;
|
||||
|
||||
// adds the game server to the local list; updates the time played of the server if it already exists in the list
|
||||
virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0;
|
||||
|
||||
// removes the game server from the local storage; returns true if one was removed
|
||||
virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0;
|
||||
|
||||
///////
|
||||
// Game lobby functions
|
||||
|
||||
// Get a list of relevant lobbies
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyMatchList_t callback & call result, with the number of lobbies found
|
||||
// this will never return lobbies that are full
|
||||
// to add more filter, the filter calls below need to be call before each and every RequestLobbyList() call
|
||||
// use the CCallResult<> object in steam_api.h to match the SteamAPICall_t call result to a function in an object, e.g.
|
||||
/*
|
||||
class CMyLobbyListManager
|
||||
{
|
||||
CCallResult<CMyLobbyListManager, LobbyMatchList_t> m_CallResultLobbyMatchList;
|
||||
void FindLobbies()
|
||||
{
|
||||
// SteamMatchmaking()->AddRequestLobbyListFilter*() functions would be called here, before RequestLobbyList()
|
||||
SteamAPICall_t hSteamAPICall = SteamMatchmaking()->RequestLobbyList();
|
||||
m_CallResultLobbyMatchList.Set( hSteamAPICall, this, &CMyLobbyListManager::OnLobbyMatchList );
|
||||
}
|
||||
|
||||
void OnLobbyMatchList( LobbyMatchList_t *pLobbyMatchList, bool bIOFailure )
|
||||
{
|
||||
// lobby list has be retrieved from Steam back-end, use results
|
||||
}
|
||||
}
|
||||
*/
|
||||
//
|
||||
virtual SteamAPICall_t RequestLobbyList() = 0;
|
||||
// filters for lobbies
|
||||
// this needs to be called before RequestLobbyList() to take effect
|
||||
// these are cleared on each call to RequestLobbyList()
|
||||
virtual void AddRequestLobbyListFilter( const char *pchKeyToMatch, const char *pchValueToMatch ) = 0;
|
||||
// numerical comparison
|
||||
virtual void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueToMatch, int nComparisonType ) = 0;
|
||||
// returns results closest to the specified value. Multiple near filters can be added, with early filters taking precedence
|
||||
virtual void AddRequestLobbyListNearValueFilter( const char *pchKeyToMatch, int nValueToBeCloseTo ) = 0;
|
||||
|
||||
// returns the CSteamID of a lobby, as retrieved by a RequestLobbyList call
|
||||
// should only be called after a LobbyMatchList_t callback is received
|
||||
// iLobby is of the range [0, LobbyMatchList_t::m_nLobbiesMatching)
|
||||
// the returned CSteamID::IsValid() will be false if iLobby is out of range
|
||||
virtual CSteamID GetLobbyByIndex( int iLobby ) = 0;
|
||||
|
||||
// Create a lobby on the Steam servers.
|
||||
// If private, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID
|
||||
// of the lobby will need to be communicated via game channels or via InviteUserToLobby()
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyCreated_t callback and call result; lobby is joined & ready to use at this pointer
|
||||
// a LobbyEnter_t callback will also be received (since the local user is joining their own lobby)
|
||||
virtual SteamAPICall_t CreateLobby( ELobbyType eLobbyType ) = 0;
|
||||
|
||||
// Joins an existing lobby
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyEnter_t callback & call result, check m_EChatRoomEnterResponse to see if was successful
|
||||
// lobby metadata is available to use immediately on this call completing
|
||||
virtual SteamAPICall_t JoinLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Leave a lobby; this will take effect immediately on the client side
|
||||
// other users in the lobby will be notified by a LobbyChatUpdate_t callback
|
||||
virtual void LeaveLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Invite another user to the lobby
|
||||
// the target user will receive a LobbyInvite_t callback
|
||||
// will return true if the invite is successfully sent, whether or not the target responds
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0;
|
||||
|
||||
// Lobby iteration, for viewing details of users in a lobby
|
||||
// only accessible if the lobby user is a member of the specified lobby
|
||||
// persona information for other lobby members (name, avatar, etc.) will be asynchronously received
|
||||
// and accessible via ISteamFriends interface
|
||||
|
||||
// returns the number of users in the specified lobby
|
||||
virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0;
|
||||
// returns the CSteamID of a user in the lobby
|
||||
// iMember is of range [0,GetNumLobbyMembers())
|
||||
virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0;
|
||||
|
||||
// Get data associated with this lobby
|
||||
// takes a simple key, and returns the string associated with it
|
||||
// "" will be returned if no value is set, or if steamIDLobby is invalid
|
||||
virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0;
|
||||
// Sets a key/value pair in the lobby metadata
|
||||
// each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data
|
||||
// this can be used to set lobby names, map, etc.
|
||||
// to reset a key, just set it to ""
|
||||
// other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback
|
||||
virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// As above, but gets per-user data for someone in this lobby
|
||||
virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0;
|
||||
// Sets per-user metadata (for the local user implicitly)
|
||||
virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// Broadcasts a chat message to the all the users in the lobby
|
||||
// users in the lobby (including the local user) will receive a LobbyChatMsg_t callback
|
||||
// returns true if the message is successfully sent
|
||||
// pvMsgBody can be binary or text data, up to 4k
|
||||
// if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator
|
||||
virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0;
|
||||
// Get a chat message as specified in a LobbyChatMsg_t callback
|
||||
// iChatID is the LobbyChatMsg_t::m_iChatID value in the callback
|
||||
// *pSteamIDUser is filled in with the CSteamID of the member
|
||||
// *pvData is filled in with the message itself
|
||||
// return value is the number of bytes written into the buffer
|
||||
virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0;
|
||||
|
||||
// Refreshes metadata for a lobby you're not necessarily in right now
|
||||
// you never do this for lobbies you're a member of, only if your
|
||||
// this will send down all the metadata associated with a lobby
|
||||
// this is an asynchronous call
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
// restart are returned by a LobbyDataUpdate_t callback
|
||||
virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// sets the game server associated with the lobby
|
||||
// usually at this point, the users will join the specified game server
|
||||
// either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect
|
||||
virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0;
|
||||
// returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist
|
||||
virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, CSteamID *psteamIDGameServer ) = 0;
|
||||
|
||||
// set the limit on the # of users who can join the lobby
|
||||
virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0;
|
||||
// returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined
|
||||
virtual int GetLobbyMemberLimit( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// updates which type of lobby it is
|
||||
// only lobbies that are k_ELobbyTypePublic will be returned by RequestLobbyList() calls
|
||||
virtual bool SetLobbyType( CSteamID steamIDLobby, ELobbyType eLobbyType ) = 0;
|
||||
|
||||
// returns the current lobby owner
|
||||
// you must be a member of the lobby to access this
|
||||
// there always one lobby owner - if the current owner leaves, another user will become the owner
|
||||
// it is possible (bur rare) to join a lobby just as the owner is leaving, thus entering a lobby with self as the owner
|
||||
virtual CSteamID GetLobbyOwner( CSteamID steamIDLobby ) = 0;
|
||||
};
|
||||
#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking006"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callback interfaces for server list functions (see ISteamMatchmakingServers below)
|
||||
//
|
||||
// The idea here is that your game code implements objects that implement these
|
||||
// interfaces to receive callback notifications after calling asynchronous functions
|
||||
// inside the ISteamMatchmakingServers() interface below.
|
||||
//
|
||||
// This is different than normal Steam callback handling due to the potentially
|
||||
// large size of server lists.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after a server list refresh
|
||||
// or an individual server update.
|
||||
//
|
||||
// Since you get these callbacks after requesting full list refreshes you will
|
||||
// usually implement this interface inside an object like CServerBrowser. If that
|
||||
// object is getting destructed you should use ISteamMatchMakingServers()->CancelQuery()
|
||||
// to cancel any in-progress queries so you don't get a callback into the destructed
|
||||
// object and crash.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServerListResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded ok with updated data
|
||||
virtual void ServerResponded( int iServer ) = 0;
|
||||
|
||||
// Server has failed to respond
|
||||
virtual void ServerFailedToRespond( int iServer ) = 0;
|
||||
|
||||
// A list refresh you had initiated is now 100% completed
|
||||
virtual void RefreshComplete( EMatchMakingServerResponse response ) = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after pinging an individual server
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PingServer() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPingResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded successfully and has updated data
|
||||
virtual void ServerResponded( gameserveritem_t &server ) = 0;
|
||||
|
||||
// Server failed to respond to the ping request
|
||||
virtual void ServerFailedToRespond() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting details on
|
||||
// who is playing on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPlayersResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a new player on the server -- you'll get this callback once per player
|
||||
// on the server which you have requested player data on.
|
||||
virtual void AddPlayerToList( const char *pchName, int nScore, float flTimePlayed ) = 0;
|
||||
|
||||
// The server failed to respond to the request for player details
|
||||
virtual void PlayersFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the player details request
|
||||
// (ie, you won't get anymore AddPlayerToList callbacks)
|
||||
virtual void PlayersRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting rules
|
||||
// details on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->ServerRules() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingRulesResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a rule on the server -- you'll get one of these per rule defined on
|
||||
// the server you are querying
|
||||
virtual void RulesResponded( const char *pchRule, const char *pchValue ) = 0;
|
||||
|
||||
// The server failed to respond to the request for rule details
|
||||
virtual void RulesFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the rule details request
|
||||
// (ie, you won't get anymore RulesResponded callbacks)
|
||||
virtual void RulesRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Typedef for handle type you will receive when querying details on an individual server.
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef int HServerQuery;
|
||||
const int HSERVERQUERY_INVALID = 0xffffffff;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to game lists and details
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServers
|
||||
{
|
||||
public:
|
||||
// Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values.
|
||||
virtual void RequestInternetServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFriendsServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFavoritesServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestHistoryServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestSpectatorServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
/* the filters that are available in the ppchFilters params are:
|
||||
|
||||
"map" - map the server is running, as set in the dedicated server api
|
||||
"dedicated" - reports bDedicated from the API
|
||||
"secure" - VAC-enabled
|
||||
"full" - not full
|
||||
"empty" - not empty
|
||||
"noplayers" - is empty
|
||||
"proxy" - a relay server
|
||||
|
||||
*/
|
||||
|
||||
// Get details on a given server in the list, you can get the valid range of index
|
||||
// values by calling GetServerCount(). You will also receive index values in
|
||||
// ISteamMatchmakingServerListResponse::ServerResponded() callbacks
|
||||
virtual gameserveritem_t *GetServerDetails( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
// Cancel an request which is operation on the given list type. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above list request calls. Not doing so may result in a crash when a callback
|
||||
// occurs on the destructed object.
|
||||
virtual void CancelQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Ping every server in your list again but don't update the list of servers
|
||||
virtual void RefreshQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Returns true if the list is currently refreshing its server list
|
||||
virtual bool IsRefreshing( EMatchMakingType eType ) = 0;
|
||||
|
||||
// How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1
|
||||
virtual int GetServerCount( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Refresh a single server inside of a query (rather than all the servers )
|
||||
virtual void RefreshServer( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Queries to individual servers directly via IP/Port
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Request updated ping time and other details from a single server
|
||||
virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of players currently playing on a server
|
||||
virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of rules that the server is running (See ISteamMasterServerUpdater->SetKeyValue() to set the rules server side)
|
||||
virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above calls to avoid crashing when callbacks occur.
|
||||
virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0;
|
||||
};
|
||||
#define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "SteamMatchMakingServers001"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unFavoriteFlagNone = 0x00;
|
||||
const uint32 k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list
|
||||
const uint32 k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Used in ChatInfo messages - fields specific to a chat member - must fit in a uint32
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatMemberStateChange
|
||||
{
|
||||
// Specific to joining / leaving the chatroom
|
||||
k_EChatMemberStateChangeEntered = 0x0001, // This user has joined or is joining the chat room
|
||||
k_EChatMemberStateChangeLeft = 0x0002, // This user has left or is leaving the chat room
|
||||
k_EChatMemberStateChangeDisconnected = 0x0004, // User disconnected without leaving the chat first
|
||||
k_EChatMemberStateChangeKicked = 0x0008, // User kicked
|
||||
k_EChatMemberStateChangeBanned = 0x0010, // User kicked and banned
|
||||
};
|
||||
|
||||
// returns true of the flags indicate that a user has been removed from the chat
|
||||
#define BChatMemberStateChangeRemoved( rgfChatMemberStateChangeFlags ) ( rgfChatMemberStateChangeFlags & ( k_EChatMemberStateChangeDisconnected | k_EChatMemberStateChangeLeft | k_EChatMemberStateChangeKicked | k_EChatMemberStateChangeBanned ) )
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: a server was added/removed from the favorites list, you should refresh now
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FavoritesListChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 2 };
|
||||
uint32 m_nIP; // an IP of 0 means reload the whole list, any other value means just one server
|
||||
uint32 m_nQueryPort;
|
||||
uint32 m_nConnPort;
|
||||
uint32 m_nAppID;
|
||||
uint32 m_nFlags;
|
||||
bool m_bAdd; // true if this is adding the entry, otherwise it is a remove
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Someone has invited you to join a Lobby
|
||||
// normally you don't need to do anything with this, since
|
||||
// the Steam UI will also display a '<user> has invited you to the lobby, join?' dialog
|
||||
// if the user outside a game chooses to join, your game will be launched with the parameter "+connect_lobby <64-bit lobby id>"
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyInvite_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 3 };
|
||||
|
||||
uint64 m_ulSteamIDUser; // Steam ID of the person making the invite
|
||||
uint64 m_ulSteamIDLobby; // Steam ID of the Lobby
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent on entering a lobby, or on failing to enter
|
||||
// m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success,
|
||||
// or a higher value on failure (see enum EChatRoomEnterResponse)
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyEnter_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // SteamID of the Lobby you have entered
|
||||
uint32 m_rgfChatPermissions; // Permissions of the current user
|
||||
bool m_bLocked; // If true, then only invited users may join
|
||||
uint32 m_EChatRoomEnterResponse; // EChatRoomEnterResponse
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby metadata has changed
|
||||
// if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details
|
||||
// if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyDataUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 5 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // steamID of the Lobby
|
||||
uint64 m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby chat room state has changed
|
||||
// this is usually sent when a user has joined or left the lobby
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 6 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // Lobby ID
|
||||
uint64 m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient
|
||||
uint64 m_ulSteamIDMakingChange; // Chat member who made the change (different from SteamIDUserChange if kicking, muting, etc.)
|
||||
// for example, if one user kicks another from the lobby, this will be set to the id of the user who initiated the kick
|
||||
uint32 m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A chat message for this lobby has been sent
|
||||
// use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatMsg_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 7 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby id this is in
|
||||
uint64 m_ulSteamIDUser; // steamID of the user who has sent this message
|
||||
uint8 m_eChatEntryType; // type of message
|
||||
uint32 m_iChatID; // index of the chat entry to lookup
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A game created a game for all the members of the lobby to join,
|
||||
// as triggered by a SetLobbyGameServer()
|
||||
// it's up to the individual clients to take action on this; the usual
|
||||
// game behavior is to leave the lobby and connect to the specified game server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyGameCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 9 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby we were in
|
||||
uint64 m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members
|
||||
uint32 m_unIP; // IP & Port of the game server (if any)
|
||||
uint16 m_usPort;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Number of matching lobbies found
|
||||
// iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyMatchList_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 10 };
|
||||
uint32 m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when the lobby is being forcefully closed
|
||||
// lobby details functions will no longer be updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyClosing_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 11 };
|
||||
uint64 m_ulSteamIDLobby; // Lobby
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when the local user has been kicked from the lobby
|
||||
// lobby details functions will no longer be updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyKicked_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 12 };
|
||||
uint64 m_ulSteamIDLobby; // Lobby
|
||||
uint64 m_ulSteamIDAdmin; // User who kicked you
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Result of our request to create a Lobby
|
||||
// m_eResult == k_EResultOK on success
|
||||
// at this point, the local user may not have finishing joining this lobby;
|
||||
// game code should wait until the subsequent LobbyEnter_t callback is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 };
|
||||
|
||||
EResult m_eResult; // k_EResultOK - the lobby was successfully created
|
||||
// k_EResultNoConnection - your Steam client doesn't have a connection to the back-end
|
||||
// k_EResultTimeout - you the message to the Steam servers, but it didn't respond
|
||||
// k_EResultFail - the server responded, but with an unknown internal error
|
||||
// k_EResultAccessDenied - your game isn't set to allow lobbies, or your client does haven't rights to play the game
|
||||
// k_EResultLimitExceeded - your game client has created too many lobbies
|
||||
|
||||
uint64 m_ulSteamIDLobby; // chat room, zero if failed
|
||||
};
|
||||
|
||||
|
||||
// used by now obsolete RequestFriendsLobbiesResponse_t
|
||||
// enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 };
|
||||
|
||||
|
||||
|
||||
#endif // ISTEAMMATCHMAKING
|
||||
147
res/steamworks/103/headers/isteamnetworking.h
Normal file
147
res/steamworks/103/headers/isteamnetworking.h
Normal file
@@ -0,0 +1,147 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing network connections between game clients & servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMNETWORKING
|
||||
#define ISTEAMNETWORKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a socket
|
||||
typedef uint32 SNetSocket_t;
|
||||
typedef uint32 SNetListenSocket_t;
|
||||
|
||||
|
||||
// connection progress indicators
|
||||
enum ESNetSocketState
|
||||
{
|
||||
k_ESNetSocketStateInvalid = 0,
|
||||
|
||||
// communication is valid
|
||||
k_ESNetSocketStateConnected = 1,
|
||||
|
||||
// states while establishing a connection
|
||||
k_ESNetSocketStateInitiated = 10, // the connection state machine has started
|
||||
|
||||
// p2p connections
|
||||
k_ESNetSocketStateLocalCandidatesFound = 11, // we've found our local IP info
|
||||
k_ESNetSocketStateReceivedRemoteCandidates = 12,// we've received information from the remote machine, via the Steam back-end, about their IP info
|
||||
|
||||
// direct connections
|
||||
k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server
|
||||
|
||||
// failure states
|
||||
k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end
|
||||
k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown
|
||||
k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection
|
||||
k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us
|
||||
k_ESNetSocketStateConnectionBroken = 25, // connection has been broken; either the other end has disappeared or our local network connection has broke
|
||||
|
||||
};
|
||||
|
||||
// describes how the socket is currently connected
|
||||
enum ESNetSocketConnectionType
|
||||
{
|
||||
k_ESNetSocketConnectionTypeNotConnected = 0,
|
||||
k_ESNetSocketConnectionTypeUDP = 1,
|
||||
k_ESNetSocketConnectionTypeUDPRelay = 2,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for making connections and sending data between clients,
|
||||
// traversing NAT's where possible
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamNetworking
|
||||
{
|
||||
public:
|
||||
// creates a socket and listens others to connect
|
||||
// will trigger a SocketStatusCallback_t callback on another client connecting
|
||||
// nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports
|
||||
// this can usually just be 0 unless you want multiple sets of connections
|
||||
// unIP is the local IP address to bind to
|
||||
// pass in 0 if you just want the default local IP
|
||||
// unPort is the port to use
|
||||
// pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only
|
||||
virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay ) = 0;
|
||||
|
||||
// creates a socket and begin connection to a remote destination
|
||||
// can connect via a known steamID (client or game server), or directly to an IP
|
||||
// on success will trigger a SocketStatusCallback_t callback
|
||||
// on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState
|
||||
virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay ) = 0;
|
||||
virtual SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec ) = 0;
|
||||
|
||||
// disconnects the connection to the socket, if any, and invalidates the handle
|
||||
// any unread data on the socket will be thrown away
|
||||
// if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect
|
||||
virtual bool DestroySocket( SNetSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
// destroying a listen socket will automatically kill all the regular sockets generated from it
|
||||
virtual bool DestroyListenSocket( SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
|
||||
// sending data
|
||||
// must be a handle to a connected socket
|
||||
// data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets
|
||||
// use the reliable flag with caution; although the resend rate is pretty aggressive,
|
||||
// it can still cause stalls in receiving data (like TCP)
|
||||
virtual bool SendDataOnSocket( SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable ) = 0;
|
||||
|
||||
// receiving data
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// checks for data from any socket that has been connected off this listen socket
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool IsDataAvailable( SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// retrieves data from any socket that has been connected off this listen socket
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// returns information about the specified socket, filling out the contents of the pointers
|
||||
virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote ) = 0;
|
||||
|
||||
// returns which local port the listen socket is bound to
|
||||
// *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only
|
||||
virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort ) = 0;
|
||||
|
||||
// returns true to describe how the socket ended up connecting
|
||||
virtual ESNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket ) = 0;
|
||||
|
||||
// max packet size, in bytes
|
||||
virtual int GetMaxPacketSize( SNetSocket_t hSocket ) = 0;
|
||||
};
|
||||
#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking002"
|
||||
|
||||
|
||||
// callback notification - status of a socket has changed
|
||||
struct SocketStatusCallback_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 };
|
||||
SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host
|
||||
SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection
|
||||
CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one
|
||||
int m_eSNetSocketState; // socket state, ESNetSocketState
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMNETWORKING
|
||||
45
res/steamworks/103/headers/isteamremotestorage.h
Normal file
45
res/steamworks/103/headers/isteamremotestorage.h
Normal file
@@ -0,0 +1,45 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: public interface to user remote file storage in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMREMOTESTORAGE_H
|
||||
#define ISTEAMREMOTESTORAGE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing, reading and writing files stored remotely
|
||||
// and cached locally
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamRemoteStorage
|
||||
{
|
||||
public:
|
||||
// NOTE
|
||||
//
|
||||
// Filenames are case-insensitive, and will be converted to lowercase automatically.
|
||||
// So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then
|
||||
// iterate the files, the filename returned will be "foo.bar".
|
||||
//
|
||||
|
||||
// file operations
|
||||
virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0;
|
||||
virtual int32 GetFileSize( const char *pchFile ) = 0;
|
||||
virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0;
|
||||
virtual bool FileExists( const char *pchFile ) = 0;
|
||||
|
||||
// iteration
|
||||
virtual int32 GetFileCount() = 0;
|
||||
virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0;
|
||||
|
||||
// quota management
|
||||
virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION002"
|
||||
|
||||
#endif // ISTEAMREMOTESTORAGE_H
|
||||
172
res/steamworks/103/headers/isteamuser.h
Normal file
172
res/steamworks/103/headers/isteamuser.h
Normal file
@@ -0,0 +1,172 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSER_H
|
||||
#define ISTEAMUSER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// structure that contains client callback data
|
||||
// see callbacks documentation for more details
|
||||
struct CallbackMsg_t
|
||||
{
|
||||
HSteamUser m_hSteamUser;
|
||||
int m_iCallback;
|
||||
uint8 *m_pubParam;
|
||||
int m_cubParam;
|
||||
};
|
||||
|
||||
// reference to a steam call, to filter results by
|
||||
typedef int32 HSteamCall;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing and manipulating a steam account
|
||||
// associated with one client instance
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUser
|
||||
{
|
||||
public:
|
||||
// returns the HSteamUser this interface represents
|
||||
// this is only used internally by the API, and by a few select interfaces that support multi-user
|
||||
virtual HSteamUser GetHSteamUser() = 0;
|
||||
|
||||
// returns true if the Steam client current has a live connection to the Steam servers.
|
||||
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
|
||||
// The Steam client will automatically be trying to recreate the connection as often as possible.
|
||||
virtual bool BLoggedOn() = 0;
|
||||
|
||||
// returns the CSteamID of the account currently logged into the Steam client
|
||||
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Multiplayer Authentication functions
|
||||
|
||||
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
|
||||
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
|
||||
//
|
||||
// Parameters:
|
||||
// void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.
|
||||
// int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
|
||||
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
|
||||
// CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )
|
||||
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
|
||||
// bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)
|
||||
//
|
||||
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
|
||||
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
|
||||
virtual int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
|
||||
|
||||
// notify of disconnect
|
||||
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
|
||||
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
|
||||
|
||||
// Legacy functions
|
||||
|
||||
// used by only a few games to track usage events
|
||||
virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
|
||||
|
||||
// get the local storage folder for current Steam account to write application data, e.g. save games, configs etc.
|
||||
// this will usually be something like "C:\Progam Files\Steam\userdata\<SteamID>\<AppID>\local"
|
||||
virtual bool GetUserDataFolder( char *pchBuffer, int cubBuffer ) = 0;
|
||||
|
||||
// Starts voice recording. Once started, use GetCompressedVoice() to get the data
|
||||
virtual void StartVoiceRecording( ) = 0;
|
||||
|
||||
// Stops voice recording. Because people often release push-to-talk keys early, the system will keep recording for
|
||||
// a little bit after this function is called. GetCompressedVoice() should continue to be called until it returns
|
||||
// k_eVoiceResultNotRecording
|
||||
virtual void StopVoiceRecording( ) = 0;
|
||||
|
||||
// Gets the latest voice data. It should be called as often as possible once recording has started.
|
||||
// nBytesWritten is set to the number of bytes written to pDestBuffer.
|
||||
virtual EVoiceResult GetCompressedVoice( void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten ) = 0;
|
||||
|
||||
// Decompresses a chunk of data produced by GetCompressedVoice(). nBytesWritten is set to the
|
||||
// number of bytes written to pDestBuffer. The output format of the data is 16-bit signed at
|
||||
// 11025 samples per second.
|
||||
virtual EVoiceResult DecompressVoice( void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser011"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connections to the Steam back-end has been established
|
||||
// this means the Steam client now has a working connection to the Steam servers
|
||||
// usually this will have occurred before the game has launched, and should
|
||||
// only be seen if the user has dropped connection due to a networking issue
|
||||
// or a Steam server update
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersConnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 1 };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connection attempt has failed
|
||||
// this will occur periodically if the Steam client is not connected,
|
||||
// and has failed in it's retry to establish a connection
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServerConnectFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 2 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called if the client has lost connection to the Steam servers
|
||||
// real-time services will be disabled until a matching SteamServersConnected_t has been posted
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersDisconnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 3 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server,
|
||||
// which it may be in the process of or already connected to.
|
||||
// The game client should immediately disconnect upon receiving this message.
|
||||
// This can usually occur if the user doesn't have rights to play on the game server.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ClientGameServerDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 13 };
|
||||
|
||||
uint32 m_uAppID;
|
||||
uint32 m_unGameServerIP;
|
||||
uint16 m_usGameServerPort;
|
||||
uint16 m_bSecure;
|
||||
uint32 m_uReason;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks)
|
||||
// When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect.
|
||||
// This usually occurs in the rare event the Steam client has some kind of fatal error.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct IPCFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 17 };
|
||||
enum EFailureType
|
||||
{
|
||||
k_EFailureFlushedCallbackQueue,
|
||||
k_EFailurePipeFail,
|
||||
};
|
||||
uint8 m_eFailureType;
|
||||
};
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
111
res/steamworks/103/headers/isteamuserstats.h
Normal file
111
res/steamworks/103/headers/isteamuserstats.h
Normal file
@@ -0,0 +1,111 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSERSTATS_H
|
||||
#define ISTEAMUSERSTATS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// size limit on stat or achievement name
|
||||
const uint32 k_cchStatNameMax = 128;
|
||||
|
||||
class ISteamUserStats
|
||||
{
|
||||
public:
|
||||
// Ask the server to send down this user's data and achievements for this game
|
||||
virtual bool RequestCurrentStats() = 0;
|
||||
|
||||
// Data accessors
|
||||
virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetStat( const char *pchName, float *pData ) = 0;
|
||||
|
||||
// Set / update data
|
||||
virtual bool SetStat( const char *pchName, int32 nData ) = 0;
|
||||
virtual bool SetStat( const char *pchName, float fData ) = 0;
|
||||
virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||
|
||||
// Achievement flag accessors
|
||||
virtual bool GetAchievement( const char *pchName, bool *pbAchieved ) = 0;
|
||||
virtual bool SetAchievement( const char *pchName ) = 0;
|
||||
virtual bool ClearAchievement( const char *pchName ) = 0;
|
||||
|
||||
// Store the current data on the server, will get a callback when set
|
||||
// And one callback for every new achievement
|
||||
virtual bool StoreStats() = 0;
|
||||
|
||||
// Achievement / GroupAchievement metadata
|
||||
|
||||
// Gets the icon of the achievement, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetAchievementIcon( const char *pchName ) = 0;
|
||||
// Get general attributes (display name / text, etc) for an Achievement
|
||||
virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0;
|
||||
|
||||
// Achievement progress - triggers an AchievementProgress callback, that is all.
|
||||
// Calling this w/ N out of N progress will NOT set the achievement, the game must still do that.
|
||||
virtual bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint32 nMaxProgress ) = 0;
|
||||
|
||||
// Friends stats & achievements
|
||||
|
||||
// downloads stats for the user
|
||||
// returns a UserStatsReceived_t received when completed
|
||||
// if the other user has no stats, UserStatsReceived_t.m_eResult will be set to k_EResultFail
|
||||
// these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data
|
||||
virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// requests stat information for a user, usable after a successful call to RequestUserStats()
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
|
||||
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION004"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the latests stats and achievements have been received
|
||||
// from the server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsReceived_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // Success / error fetching the stats
|
||||
CSteamID m_steamIDUser; // The user for whom the stats are retrieved for
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the user stats for a game
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // success / error
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the achievements for a game, or an
|
||||
// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress
|
||||
// are zero, that means the achievement has been fully unlocked.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserAchievementStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 };
|
||||
|
||||
uint64 m_nGameID; // Game this is for
|
||||
bool m_bGroupAchievement; // if this is a "group" achievement
|
||||
char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement
|
||||
uint32 m_nCurProgress; // current progress towards the achievement
|
||||
uint32 m_nMaxProgress; // "out of" this many
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
114
res/steamworks/103/headers/isteamutils.h
Normal file
114
res/steamworks/103/headers/isteamutils.h
Normal file
@@ -0,0 +1,114 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to utility functions in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUTILS_H
|
||||
#define ISTEAMUTILS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
|
||||
// Steam API call failure results
|
||||
enum ESteamAPICallFailure
|
||||
{
|
||||
k_ESteamAPICallFailureNone = -1, // no failure
|
||||
k_ESteamAPICallFailureSteamGone = 0, // the local Steam process has gone away
|
||||
k_ESteamAPICallFailureNetworkFailure = 1, // the network connection to Steam has been broken, or was already broken
|
||||
// SteamServersDisconnected_t callback will be sent around the same time
|
||||
// SteamServersConnected_t will be sent when the client is able to talk to the Steam servers again
|
||||
k_ESteamAPICallFailureInvalidHandle = 2, // the SteamAPICall_t handle passed in no longer exists
|
||||
k_ESteamAPICallFailureMismatchedCallback = 3,// GetAPICallResult() was called with the wrong callback type for this API call
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to user independent utility functions
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUtils
|
||||
{
|
||||
public:
|
||||
// return the number of seconds since the user
|
||||
virtual uint32 GetSecondsSinceAppActive() = 0;
|
||||
virtual uint32 GetSecondsSinceComputerActive() = 0;
|
||||
|
||||
// the universe this client is connecting to
|
||||
virtual EUniverse GetConnectedUniverse() = 0;
|
||||
|
||||
// Steam server time - in PST, number of seconds since January 1, 1970 (i.e unix time)
|
||||
virtual uint32 GetServerRealTime() = 0;
|
||||
|
||||
// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
|
||||
// e.g "US" or "UK".
|
||||
virtual const char *GetIPCountry() = 0;
|
||||
|
||||
// returns true if the image exists, and valid sizes were filled out
|
||||
virtual bool GetImageSize( int iImage, uint32 *pnWidth, uint32 *pnHeight ) = 0;
|
||||
|
||||
// returns true if the image exists, and the buffer was successfully filled out
|
||||
// results are returned in RGBA format
|
||||
// the destination buffer size should be 4 * height * width * sizeof(char)
|
||||
virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0;
|
||||
|
||||
// returns the IP of the reporting server for valve - currently only used in Source engine games
|
||||
virtual bool GetCSERIPPort( uint32 *unIP, uint16 *usPort ) = 0;
|
||||
|
||||
// return the amount of battery power left in the current system in % [0..100], 255 for being on AC power
|
||||
virtual uint8 GetCurrentBatteryPower() = 0;
|
||||
|
||||
// returns the appID of the current process
|
||||
virtual uint32 GetAppID() = 0;
|
||||
|
||||
// Sets the position where the overlay instance for the currently calling game should show notifications.
|
||||
// This position is per-game and if this function is called from outside of a game context it will do nothing.
|
||||
virtual void SetOverlayNotificationPosition( ENotificationPosition eNotificationPosition ) = 0;
|
||||
|
||||
// API asynchronous call results
|
||||
// can be used directly, but more commonly used via the callback dispatch API (see steam_api.h)
|
||||
virtual bool IsAPICallCompleted( SteamAPICall_t hSteamAPICall, bool *pbFailed ) = 0;
|
||||
virtual ESteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICall ) = 0;
|
||||
virtual bool GetAPICallResult( SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils002"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The country of the user changed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct IPCountry_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 1 };
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LowBatteryPower_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 2 };
|
||||
uint8 m_nMinutesBatteryLeft;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a SteamAsyncCall_t has completed (or failed)
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamAPICallCompleted_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 3 };
|
||||
SteamAPICall_t m_hAsyncCall;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // ISTEAMUTILS_H
|
||||
241
res/steamworks/103/headers/matchmakingtypes.h
Normal file
241
res/steamworks/103/headers/matchmakingtypes.h
Normal file
@@ -0,0 +1,241 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef MATCHMAKINGTYPES_H
|
||||
#define MATCHMAKINGTYPES_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef POSIX
|
||||
#ifndef _snprintf
|
||||
#define _snprintf snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
struct MatchMakingKeyValuePair_t
|
||||
{
|
||||
MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; }
|
||||
MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue )
|
||||
{
|
||||
strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only!
|
||||
strncpy( m_szValue, pchValue, sizeof(m_szValue) );
|
||||
}
|
||||
char m_szKey[ 256 ];
|
||||
char m_szValue[ 256 ];
|
||||
};
|
||||
|
||||
|
||||
enum EMatchMakingServerResponse
|
||||
{
|
||||
eServerResponded = 0,
|
||||
eServerFailedToRespond,
|
||||
eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match
|
||||
};
|
||||
|
||||
enum EMatchMakingType
|
||||
{
|
||||
eInternetServer = 0,
|
||||
eLANServer,
|
||||
eFriendsServer,
|
||||
eFavoritesServer,
|
||||
eHistoryServer,
|
||||
eSpectatorServer,
|
||||
eInvalidServer
|
||||
};
|
||||
|
||||
|
||||
// servernetadr_t is all the addressing info the serverbrowser needs to know about a game server,
|
||||
// namely: its IP, its connection port, and its query port.
|
||||
class servernetadr_t
|
||||
{
|
||||
public:
|
||||
|
||||
void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort );
|
||||
#ifdef NETADR_H
|
||||
void Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort );
|
||||
netadr_t& GetIPAndQueryPort();
|
||||
#endif
|
||||
|
||||
// Access the query port.
|
||||
uint16 GetQueryPort() const;
|
||||
void SetQueryPort( uint16 usPort );
|
||||
|
||||
// Access the connection port.
|
||||
uint16 GetConnectionPort() const;
|
||||
void SetConnectionPort( uint16 usPort );
|
||||
|
||||
// Access the IP
|
||||
uint32 GetIP() const;
|
||||
void SetIP( uint32 );
|
||||
|
||||
// This gets the 'a.b.c.d:port' string with the connection port (instead of the query port).
|
||||
const char *GetConnectionAddressString() const;
|
||||
const char *GetQueryAddressString() const;
|
||||
|
||||
// Comparison operators and functions.
|
||||
bool operator<(const servernetadr_t &netadr) const;
|
||||
void operator=( const servernetadr_t &that )
|
||||
{
|
||||
m_usConnectionPort = that.m_usConnectionPort;
|
||||
m_usQueryPort = that.m_usQueryPort;
|
||||
m_unIP = that.m_unIP;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
const char *ToString( uint32 unIP, uint16 usPort ) const;
|
||||
uint16 m_usConnectionPort; // (in HOST byte order)
|
||||
uint16 m_usQueryPort;
|
||||
uint32 m_unIP;
|
||||
};
|
||||
|
||||
|
||||
inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
m_unIP = ip;
|
||||
m_usQueryPort = usQueryPort;
|
||||
m_usConnectionPort = usConnectionPort;
|
||||
}
|
||||
|
||||
#ifdef NETADR_H
|
||||
inline void servernetadr_t::Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
Init( ipAndQueryPort.GetIP(), ipAndQueryPort.GetPort(), usConnectionPort );
|
||||
}
|
||||
|
||||
inline netadr_t& servernetadr_t::GetIPAndQueryPort()
|
||||
{
|
||||
static netadr_t netAdr;
|
||||
netAdr.SetIP( m_unIP );
|
||||
netAdr.SetPort( m_usQueryPort );
|
||||
return netAdr;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline uint16 servernetadr_t::GetQueryPort() const
|
||||
{
|
||||
return m_usQueryPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetQueryPort( uint16 usPort )
|
||||
{
|
||||
m_usQueryPort = usPort;
|
||||
}
|
||||
|
||||
inline uint16 servernetadr_t::GetConnectionPort() const
|
||||
{
|
||||
return m_usConnectionPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetConnectionPort( uint16 usPort )
|
||||
{
|
||||
m_usConnectionPort = usPort;
|
||||
}
|
||||
|
||||
inline uint32 servernetadr_t::GetIP() const
|
||||
{
|
||||
return m_unIP;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetIP( uint32 unIP )
|
||||
{
|
||||
m_unIP = unIP;
|
||||
}
|
||||
|
||||
inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const
|
||||
{
|
||||
static char s[4][64];
|
||||
static int nBuf = 0;
|
||||
unsigned char *ipByte = (unsigned char *)&unIP;
|
||||
_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
|
||||
const char *pchRet = s[nBuf];
|
||||
++nBuf;
|
||||
nBuf %= ( (sizeof(s)/sizeof(s[0])) );
|
||||
return pchRet;
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetConnectionAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usConnectionPort );
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetQueryAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usQueryPort );
|
||||
}
|
||||
|
||||
inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const
|
||||
{
|
||||
return ( m_unIP < netadr.m_unIP ) || ( m_unIP == netadr.m_unIP && m_usQueryPort < netadr.m_usQueryPort );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Data describing a single server
|
||||
//-----------------------------------------------------------------------------
|
||||
class gameserveritem_t
|
||||
{
|
||||
public:
|
||||
gameserveritem_t();
|
||||
|
||||
const char* GetName() const;
|
||||
void SetName( const char *pName );
|
||||
|
||||
public:
|
||||
servernetadr_t m_NetAdr; // IP/Query Port/Connection Port for this server
|
||||
int m_nPing; // current ping time in milliseconds
|
||||
bool m_bHadSuccessfulResponse; // server has responded successfully in the past
|
||||
bool m_bDoNotRefresh; // server is marked as not responding and should no longer be refreshed
|
||||
char m_szGameDir[32]; // current game directory
|
||||
char m_szMap[32]; // current map
|
||||
char m_szGameDescription[64]; // game description
|
||||
int m_nAppID; // Steam App ID of this server
|
||||
int m_nPlayers; // current number of players on the server
|
||||
int m_nMaxPlayers; // Maximum players that can join this server
|
||||
int m_nBotPlayers; // Number of bots (i.e simulated players) on this server
|
||||
bool m_bPassword; // true if this server needs a password to join
|
||||
bool m_bSecure; // Is this server protected by VAC
|
||||
uint32 m_ulTimeLastPlayed; // time (in unix time) when this server was last played on (for favorite/history servers)
|
||||
int m_nServerVersion; // server version as reported to Steam
|
||||
|
||||
private:
|
||||
char m_szServerName[64]; // Game server name
|
||||
|
||||
// For data added after SteamMatchMaking001 add it here
|
||||
public:
|
||||
char m_szGameTags[128]; // the tags this server exposes
|
||||
};
|
||||
|
||||
|
||||
inline gameserveritem_t::gameserveritem_t()
|
||||
{
|
||||
m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0;
|
||||
m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false;
|
||||
m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0;
|
||||
m_szGameTags[0] = 0;
|
||||
}
|
||||
|
||||
inline const char* gameserveritem_t::GetName() const
|
||||
{
|
||||
// Use the IP address as the name if nothing is set yet.
|
||||
if ( m_szServerName[0] == 0 )
|
||||
return m_NetAdr.GetConnectionAddressString();
|
||||
else
|
||||
return m_szServerName;
|
||||
}
|
||||
|
||||
inline void gameserveritem_t::SetName( const char *pName )
|
||||
{
|
||||
strncpy( m_szServerName, pName, sizeof( m_szServerName ) );
|
||||
}
|
||||
|
||||
|
||||
#endif // MATCHMAKINGTYPES_H
|
||||
414
res/steamworks/103/headers/steam_api.h
Normal file
414
res/steamworks/103/headers/steam_api.h
Normal file
@@ -0,0 +1,414 @@
|
||||
//====== Copyright 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_API_H
|
||||
#define STEAM_API_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "isteamuser.h"
|
||||
#include "isteamfriends.h"
|
||||
#include "isteamutils.h"
|
||||
#include "isteammatchmaking.h"
|
||||
#include "isteamuserstats.h"
|
||||
#include "isteamapps.h"
|
||||
#include "isteamnetworking.h"
|
||||
#include "isteamremotestorage.h"
|
||||
|
||||
// Steam API export macro
|
||||
#if defined( _WIN32 ) && !defined( _X360 )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __declspec( dllexport )
|
||||
#elif defined( STEAM_API_NODLL )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C" __declspec( dllimport )
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#elif defined( GNUC )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#else // !WIN32
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// Steam API setup & shutdown
|
||||
//
|
||||
// These functions manage loading, initializing and shutdown of the steamclient.dll
|
||||
//
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// S_API void SteamAPI_Init(); (see below)
|
||||
S_API void SteamAPI_Shutdown();
|
||||
|
||||
// crash dump recording functions
|
||||
S_API void SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID );
|
||||
S_API void SteamAPI_SetMiniDumpComment( const char *pchMsg );
|
||||
|
||||
// interface pointers, configured by SteamAPI_Init()
|
||||
S_API ISteamClient *SteamClient();
|
||||
|
||||
|
||||
//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES is usually not necessary, but it provides safety against releasing
|
||||
// new steam_api.dll's without recompiling/rereleasing modules that use it.
|
||||
//
|
||||
// If you use VERSION_SAFE_STEAM_API_INTERFACES, then you should call SteamAPI_InitSafe(). Also, to get the
|
||||
// Steam interfaces, you must create and Init() a CSteamAPIContext (below) and use the interfaces in there.
|
||||
//
|
||||
// If you don't use VERSION_SAFE_STEAM_API_INTERFACES, then you can use SteamAPI_Init() and the SteamXXXX()
|
||||
// functions below to get at the Steam interfaces.
|
||||
//
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamAPI_InitSafe();
|
||||
#else
|
||||
S_API bool SteamAPI_Init();
|
||||
|
||||
S_API ISteamUser *SteamUser();
|
||||
S_API ISteamFriends *SteamFriends();
|
||||
S_API ISteamUtils *SteamUtils();
|
||||
S_API ISteamMatchmaking *SteamMatchmaking();
|
||||
S_API ISteamUserStats *SteamUserStats();
|
||||
S_API ISteamApps *SteamApps();
|
||||
S_API ISteamNetworking *SteamNetworking();
|
||||
S_API ISteamMatchmakingServers *SteamMatchmakingServers();
|
||||
S_API ISteamRemoteStorage *SteamRemoteStorage();
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steam callback helper functions
|
||||
//
|
||||
// The following classes/macros are used to be able to easily multiplex callbacks
|
||||
// from the Steam API into various objects in the app in a thread-safe manner
|
||||
//
|
||||
// These functors are triggered via the SteamAPI_RunCallbacks() function, mapping the callback
|
||||
// to as many functions/objects as are registered to it
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API void SteamAPI_RunCallbacks();
|
||||
|
||||
|
||||
|
||||
// functions used by the utility CCallback objects to receive callbacks
|
||||
S_API void SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback );
|
||||
S_API void SteamAPI_UnregisterCallback( class CCallbackBase *pCallback );
|
||||
// functions used by the utility CCallResult objects to receive async call results
|
||||
S_API void SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
|
||||
S_API void SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: base for callbacks,
|
||||
// used only by CCallback, shouldn't be used directly
|
||||
//-----------------------------------------------------------------------------
|
||||
class CCallbackBase
|
||||
{
|
||||
public:
|
||||
CCallbackBase() { m_nCallbackFlags = 0; m_iCallback = 0; }
|
||||
// don't add a virtual destructor because we export this binary interface across dll's
|
||||
virtual void Run( void *pvParam ) = 0;
|
||||
virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) = 0;
|
||||
int GetICallback() { return m_iCallback; }
|
||||
virtual int GetCallbackSizeBytes() = 0;
|
||||
|
||||
protected:
|
||||
enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 };
|
||||
uint8 m_nCallbackFlags;
|
||||
int m_iCallback;
|
||||
friend class CCallbackMgr;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: maps a steam async call result to a class member function
|
||||
// template params: T = local class, P = parameter struct
|
||||
//-----------------------------------------------------------------------------
|
||||
template< class T, class P >
|
||||
class CCallResult : private CCallbackBase
|
||||
{
|
||||
public:
|
||||
typedef void (T::*func_t)( P*, bool );
|
||||
|
||||
CCallResult()
|
||||
{
|
||||
m_hAPICall = 0;
|
||||
m_pObj = NULL;
|
||||
m_Func = NULL;
|
||||
m_iCallback = P::k_iCallback;
|
||||
}
|
||||
|
||||
void Set( SteamAPICall_t hAPICall, T *p, func_t func )
|
||||
{
|
||||
if ( m_hAPICall )
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
|
||||
m_hAPICall = hAPICall;
|
||||
m_pObj = p;
|
||||
m_Func = func;
|
||||
|
||||
if ( hAPICall )
|
||||
SteamAPI_RegisterCallResult( this, hAPICall );
|
||||
}
|
||||
|
||||
bool IsActive()
|
||||
{
|
||||
return ( m_hAPICall != 0 );
|
||||
}
|
||||
|
||||
void Cancel()
|
||||
{
|
||||
m_hAPICall = 0;
|
||||
}
|
||||
|
||||
~CCallResult()
|
||||
{
|
||||
if ( m_hAPICall )
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam, false );
|
||||
m_hAPICall = 0;
|
||||
}
|
||||
void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall )
|
||||
{
|
||||
if ( hSteamAPICall == m_hAPICall )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam, bIOFailure );
|
||||
m_hAPICall = 0;
|
||||
}
|
||||
}
|
||||
int GetCallbackSizeBytes()
|
||||
{
|
||||
return sizeof( P );
|
||||
}
|
||||
|
||||
SteamAPICall_t m_hAPICall;
|
||||
T *m_pObj;
|
||||
func_t m_Func;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: maps a steam callback to a class member function
|
||||
// template params: T = local class, P = parameter struct
|
||||
//-----------------------------------------------------------------------------
|
||||
template< class T, class P, bool bGameServer >
|
||||
class CCallback : private CCallbackBase
|
||||
{
|
||||
public:
|
||||
typedef void (T::*func_t)( P* );
|
||||
|
||||
// If you can't support constructing a callback with the correct parameters
|
||||
// then uncomment the empty constructor below and manually call
|
||||
// ::Register() for your object
|
||||
// Or, just call the regular constructor with (NULL, NULL)
|
||||
// CCallback() {}
|
||||
|
||||
// constructor for initializing this object in owner's constructor
|
||||
CCallback( T *pObj, func_t func ) : m_pObj( pObj ), m_Func( func )
|
||||
{
|
||||
if ( pObj && func )
|
||||
Register( pObj, func );
|
||||
}
|
||||
|
||||
~CCallback()
|
||||
{
|
||||
Unregister();
|
||||
}
|
||||
|
||||
// manual registration of the callback
|
||||
void Register( T *pObj, func_t func )
|
||||
{
|
||||
if ( m_nCallbackFlags & k_ECallbackFlagsRegistered )
|
||||
Unregister();
|
||||
|
||||
if ( bGameServer )
|
||||
{
|
||||
m_nCallbackFlags |= k_ECallbackFlagsGameServer;
|
||||
}
|
||||
m_pObj = pObj;
|
||||
m_Func = func;
|
||||
SteamAPI_RegisterCallback( this, P::k_iCallback );
|
||||
}
|
||||
|
||||
void Unregister()
|
||||
{
|
||||
SteamAPI_UnregisterCallback( this );
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
virtual void Run( void *pvParam, bool, SteamAPICall_t )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
int GetCallbackSizeBytes()
|
||||
{
|
||||
return sizeof( P );
|
||||
}
|
||||
|
||||
T *m_pObj;
|
||||
func_t m_Func;
|
||||
};
|
||||
|
||||
|
||||
// utility macro for declaring the function and callback object together
|
||||
#define STEAM_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, false > var; void func( param *pParam )
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
// disable this warning; this pattern need for steam callback registration
|
||||
#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// pumps out all the steam messages, calling the register callback
|
||||
S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks );
|
||||
|
||||
// register the callback funcs to use to interact with the steam dll
|
||||
S_API void Steam_RegisterInterfaceFuncs( void *hModule );
|
||||
|
||||
// returns the HSteamUser of the last user to dispatch a callback
|
||||
S_API HSteamUser Steam_GetHSteamUserCurrent();
|
||||
|
||||
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name
|
||||
S_API const char *SteamAPI_GetSteamInstallPath();
|
||||
|
||||
// returns the pipe we are communicating to Steam with
|
||||
S_API HSteamPipe SteamAPI_GetHSteamPipe();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamAPI_GetHSteamUser();
|
||||
|
||||
class CSteamAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamUser* SteamUser() { return m_pSteamUser; }
|
||||
ISteamFriends* SteamFriends() { return m_pSteamFriends; }
|
||||
ISteamUtils* SteamUtils() { return m_pSteamUtils; }
|
||||
ISteamMatchmaking* SteamMatchmaking() { return m_pSteamMatchmaking; }
|
||||
ISteamUserStats* SteamUserStats() { return m_pSteamUserStats; }
|
||||
ISteamApps* SteamApps() { return m_pSteamApps; }
|
||||
ISteamMatchmakingServers* SteamMatchmakingServers() { return m_pSteamMatchmakingServers; }
|
||||
ISteamNetworking* SteamNetworking() { return m_pSteamNetworking; }
|
||||
ISteamRemoteStorage* SteamRemoteStorage() { return m_pSteamRemoteStorage; }
|
||||
|
||||
private:
|
||||
ISteamUser *m_pSteamUser;
|
||||
ISteamFriends *m_pSteamFriends;
|
||||
ISteamUtils *m_pSteamUtils;
|
||||
ISteamMatchmaking *m_pSteamMatchmaking;
|
||||
ISteamUserStats *m_pSteamUserStats;
|
||||
ISteamApps *m_pSteamApps;
|
||||
ISteamMatchmakingServers *m_pSteamMatchmakingServers;
|
||||
ISteamNetworking *m_pSteamNetworking;
|
||||
ISteamRemoteStorage *m_pSteamRemoteStorage;
|
||||
};
|
||||
|
||||
inline CSteamAPIContext::CSteamAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamAPIContext::Clear()
|
||||
{
|
||||
m_pSteamUser = NULL;
|
||||
m_pSteamFriends = NULL;
|
||||
m_pSteamUtils = NULL;
|
||||
m_pSteamMatchmaking = NULL;
|
||||
m_pSteamUserStats = NULL;
|
||||
m_pSteamApps = NULL;
|
||||
m_pSteamMatchmakingServers = NULL;
|
||||
m_pSteamNetworking = NULL;
|
||||
m_pSteamRemoteStorage = NULL;
|
||||
}
|
||||
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamAPIContext::Init()
|
||||
{
|
||||
if ( !SteamClient() )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamAPI_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe();
|
||||
|
||||
m_pSteamUser = SteamClient()->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUser )
|
||||
return false;
|
||||
|
||||
m_pSteamFriends = SteamClient()->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamFriends )
|
||||
return false;
|
||||
|
||||
m_pSteamUtils = SteamClient()->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmaking = SteamClient()->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmaking )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmakingServers = SteamClient()->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmakingServers )
|
||||
return false;
|
||||
|
||||
m_pSteamUserStats = SteamClient()->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUserStats )
|
||||
return false;
|
||||
|
||||
m_pSteamApps = SteamClient()->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamApps )
|
||||
return false;
|
||||
|
||||
m_pSteamNetworking = SteamClient()->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamNetworking )
|
||||
return false;
|
||||
|
||||
m_pSteamRemoteStorage = SteamClient()->GetISteamRemoteStorage( hSteamUser, hSteamPipe, STEAMREMOTESTORAGE_INTERFACE_VERSION );
|
||||
if ( !m_pSteamRemoteStorage )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
#endif // STEAM_API_H
|
||||
134
res/steamworks/103/headers/steam_gameserver.h
Normal file
134
res/steamworks/103/headers/steam_gameserver.h
Normal file
@@ -0,0 +1,134 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_GAMESERVER_H
|
||||
#define STEAM_GAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api.h"
|
||||
#include "isteamgameserver.h"
|
||||
#include "isteammasterserverupdater.h"
|
||||
|
||||
enum EServerMode
|
||||
{
|
||||
eServerModeInvalid = 0, // DO NOT USE
|
||||
eServerModeNoAuthentication = 1, // Don't authenticate user logins and don't list on the server list
|
||||
eServerModeAuthentication = 2, // Authenticate users, list on the server list, don't run VAC on clients that connect
|
||||
eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients
|
||||
};
|
||||
|
||||
// Note: if you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it will use "GameSocketShare" mode,
|
||||
// which means that the game is responsible for sending and receiving UDP packets for the master
|
||||
// server updater. See references to GameSocketShare in isteammasterserverupdater.h.
|
||||
//
|
||||
// Pass 0 for usGamePort or usSpectatorPort if you're not using that. Then, the master server updater will report
|
||||
// what's running based on that.
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamGameServer_InitSafe( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString );
|
||||
#else
|
||||
S_API bool SteamGameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString );
|
||||
|
||||
S_API ISteamGameServer *SteamGameServer();
|
||||
S_API ISteamUtils *SteamGameServerUtils();
|
||||
S_API ISteamMasterServerUpdater *SteamMasterServerUpdater();
|
||||
S_API ISteamNetworking *SteamGameServerNetworking();
|
||||
#endif
|
||||
|
||||
S_API void SteamGameServer_Shutdown();
|
||||
S_API void SteamGameServer_RunCallbacks();
|
||||
|
||||
S_API bool SteamGameServer_BSecure();
|
||||
S_API uint64 SteamGameServer_GetSteamID();
|
||||
|
||||
#define STEAM_GAMESERVER_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, true > var; void func( param *pParam )
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
S_API HSteamPipe SteamGameServer_GetHSteamPipe();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamGameServer_GetHSteamUser();
|
||||
|
||||
class CSteamGameServerAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamGameServerAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamGameServer *SteamGameServer() { return m_pSteamGameServer; }
|
||||
ISteamUtils *SteamGameServerUtils() { return m_pSteamGameServerUtils; }
|
||||
ISteamMasterServerUpdater *SteamMasterServerUpdater() { return m_pSteamMasterServerUpdater; }
|
||||
ISteamNetworking *SteamGameServerNetworking() { return m_pSteamGameServerNetworking; }
|
||||
|
||||
private:
|
||||
ISteamGameServer *m_pSteamGameServer;
|
||||
ISteamUtils *m_pSteamGameServerUtils;
|
||||
ISteamMasterServerUpdater *m_pSteamMasterServerUpdater;
|
||||
ISteamNetworking *m_pSteamGameServerNetworking;
|
||||
};
|
||||
|
||||
inline CSteamGameServerAPIContext::CSteamGameServerAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamGameServerAPIContext::Clear()
|
||||
{
|
||||
m_pSteamGameServer = NULL;
|
||||
m_pSteamGameServerUtils = NULL;
|
||||
m_pSteamMasterServerUpdater = NULL;
|
||||
m_pSteamGameServerNetworking = NULL;
|
||||
}
|
||||
|
||||
S_API ISteamClient *g_pSteamClientGameServer;
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamGameServerAPIContext::Init()
|
||||
{
|
||||
if ( !g_pSteamClientGameServer )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamGameServer_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe();
|
||||
|
||||
m_pSteamGameServer = g_pSteamClientGameServer->GetISteamGameServer( hSteamUser, hSteamPipe, STEAMGAMESERVER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServer )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerUtils = g_pSteamClientGameServer->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMasterServerUpdater = g_pSteamClientGameServer->GetISteamMasterServerUpdater( hSteamUser, hSteamPipe, STEAMMASTERSERVERUPDATER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMasterServerUpdater )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerNetworking = g_pSteamClientGameServer->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerNetworking )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
|
||||
#endif // STEAM_GAMESERVER_H
|
||||
802
res/steamworks/103/headers/steamclientpublic.h
Normal file
802
res/steamworks/103/headers/steamclientpublic.h
Normal file
@@ -0,0 +1,802 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMCLIENTPUBLIC_H
|
||||
#define STEAMCLIENTPUBLIC_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
//lint -save -e1931 -e1927 -e1924 -e613 -e726
|
||||
|
||||
// This header file defines the interface between the calling application and the code that
|
||||
// knows how to communicate with the connection manager (CM) from the Steam service
|
||||
|
||||
// This header file is intended to be portable; ideally this 1 header file plus a lib or dll
|
||||
// is all you need to integrate the client library into some other tree. So please avoid
|
||||
// including or requiring other header files if possible. This header should only describe the
|
||||
// interface layer, no need to include anything about the implementation.
|
||||
|
||||
#include "steamtypes.h"
|
||||
|
||||
|
||||
// General result codes
|
||||
enum EResult
|
||||
{
|
||||
k_EResultOK = 1, // success
|
||||
k_EResultFail = 2, // generic failure
|
||||
k_EResultNoConnection = 3, // no/failed network connection
|
||||
// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed
|
||||
k_EResultInvalidPassword = 5, // password/ticket is invalid
|
||||
k_EResultLoggedInElsewhere = 6, // same user logged in elsewhere
|
||||
k_EResultInvalidProtocolVer = 7, // protocol version is incorrect
|
||||
k_EResultInvalidParam = 8, // a parameter is incorrect
|
||||
k_EResultFileNotFound = 9, // file was not found
|
||||
k_EResultBusy = 10, // called method busy - action not taken
|
||||
k_EResultInvalidState = 11, // called object was in an invalid state
|
||||
k_EResultInvalidName = 12, // name is invalid
|
||||
k_EResultInvalidEmail = 13, // email is invalid
|
||||
k_EResultDuplicateName = 14, // name is not unique
|
||||
k_EResultAccessDenied = 15, // access is denied
|
||||
k_EResultTimeout = 16, // operation timed out
|
||||
k_EResultBanned = 17, // VAC2 banned
|
||||
k_EResultAccountNotFound = 18, // account not found
|
||||
k_EResultInvalidSteamID = 19, // steamID is invalid
|
||||
k_EResultServiceUnavailable = 20, // The requested service is currently unavailable
|
||||
k_EResultNotLoggedOn = 21, // The user is not logged on
|
||||
k_EResultPending = 22, // Request is pending (may be in process, or waiting on third party)
|
||||
k_EResultEncryptionFailure = 23, // Encryption or Decryption failed
|
||||
k_EResultInsufficientPrivilege = 24, // Insufficient privilege
|
||||
k_EResultLimitExceeded = 25, // Too much of a good thing
|
||||
k_EResultRevoked = 26, // Access has been revoked (used for revoked guest passes)
|
||||
k_EResultExpired = 27, // License/Guest pass the user is trying to access is expired
|
||||
k_EResultAlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again
|
||||
k_EResultDuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time
|
||||
k_EResultAlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user
|
||||
k_EResultIPNotFound = 31, // IP address not found
|
||||
k_EResultPersistFailed = 32, // failed to write change to the data store
|
||||
k_EResultLockingFailed = 33, // failed to acquire access lock for this operation
|
||||
k_EResultLogonSessionReplaced = 34,
|
||||
k_EResultConnectFailed = 35,
|
||||
k_EResultHandshakeFailed = 36,
|
||||
k_EResultIOFailure = 37,
|
||||
k_EResultRemoteDisconnect = 38,
|
||||
k_EResultShoppingCartNotFound = 39, // failed to find the shopping cart requested
|
||||
k_EResultBlocked = 40, // a user didn't allow it
|
||||
k_EResultIgnored = 41, // target is ignoring sender
|
||||
k_EResultNoMatch = 42, // nothing matching the request found
|
||||
k_EResultAccountDisabled = 43,
|
||||
};
|
||||
|
||||
// Error codes for use with the voice functions
|
||||
enum EVoiceResult
|
||||
{
|
||||
k_EVoiceResultOK = 0,
|
||||
k_EVoiceResultNotInitialized = 1,
|
||||
k_EVoiceResultNotRecording = 2,
|
||||
k_EVoiceResultNoData = 3,
|
||||
k_EVoiceResultBufferTooSmall = 4,
|
||||
k_EVoiceResultDataCorrupted = 5,
|
||||
};
|
||||
|
||||
// Result codes to GSHandleClientDeny/Kick
|
||||
typedef enum
|
||||
{
|
||||
k_EDenyInvalid = 0,
|
||||
k_EDenyInvalidVersion = 1,
|
||||
k_EDenyGeneric = 2,
|
||||
k_EDenyNotLoggedOn = 3,
|
||||
k_EDenyNoLicense = 4,
|
||||
k_EDenyCheater = 5,
|
||||
k_EDenyLoggedInElseWhere = 6,
|
||||
k_EDenyUnknownText = 7,
|
||||
k_EDenyIncompatibleAnticheat = 8,
|
||||
k_EDenyMemoryCorruption = 9,
|
||||
k_EDenyIncompatibleSoftware = 10,
|
||||
k_EDenySteamConnectionLost = 11,
|
||||
k_EDenySteamConnectionError = 12,
|
||||
k_EDenySteamResponseTimedOut = 13,
|
||||
k_EDenySteamValidationStalled = 14,
|
||||
k_EDenySteamOwnerLeftGuestUser = 15,
|
||||
} EDenyReason;
|
||||
|
||||
// Steam universes. Each universe is a self-contained Steam instance.
|
||||
enum EUniverse
|
||||
{
|
||||
k_EUniverseInvalid = 0,
|
||||
k_EUniversePublic = 1,
|
||||
k_EUniverseBeta = 2,
|
||||
k_EUniverseInternal = 3,
|
||||
k_EUniverseDev = 4,
|
||||
k_EUniverseRC = 5,
|
||||
k_EUniverseMax
|
||||
};
|
||||
|
||||
// Steam account types
|
||||
enum EAccountType
|
||||
{
|
||||
k_EAccountTypeInvalid = 0,
|
||||
k_EAccountTypeIndividual = 1, // single user account
|
||||
k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account
|
||||
k_EAccountTypeGameServer = 3, // game server account
|
||||
k_EAccountTypeAnonGameServer = 4, // anonymous game server account
|
||||
k_EAccountTypePending = 5, // pending
|
||||
k_EAccountTypeContentServer = 6, // content server
|
||||
k_EAccountTypeClan = 7,
|
||||
k_EAccountTypeChat = 8,
|
||||
k_EAccountTypeP2PSuperSeeder = 9, // a fake steamid used by superpeers to seed content to users of Steam P2P stuff
|
||||
k_EAccountTypeAnonUser = 10,
|
||||
|
||||
// Max of 16 items in this field
|
||||
k_EAccountTypeMax
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// types of user game stats fields
|
||||
// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ESteamUserStatType
|
||||
{
|
||||
k_ESteamUserStatTypeINVALID = 0,
|
||||
k_ESteamUserStatTypeINT = 1,
|
||||
k_ESteamUserStatTypeFLOAT = 2,
|
||||
// Read as FLOAT, set with count / session length
|
||||
k_ESteamUserStatTypeAVGRATE = 3,
|
||||
k_ESteamUserStatTypeACHIEVEMENTS = 4,
|
||||
k_ESteamUserStatTypeGROUPACHIEVEMENTS = 5,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Entry Types (previously was only friend-to-friend message types)
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatEntryType
|
||||
{
|
||||
k_EChatEntryTypeChatMsg = 1, // Normal text message from another user
|
||||
k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat)
|
||||
k_EChatEntryTypeInviteGame = 3, // Invite from other user into that users current game
|
||||
k_EChatEntryTypeEmote = 4, // text emote message
|
||||
k_EChatEntryTypeLobbyGameStart = 5, // lobby game is starting
|
||||
// Above are previous FriendMsgType entries, now merged into more generic chat entry types
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Room Enter Responses
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatRoomEnterResponse
|
||||
{
|
||||
k_EChatRoomEnterResponseSuccess = 1, // Success
|
||||
k_EChatRoomEnterResponseDoesntExist = 2, // Chat doesn't exist (probably closed)
|
||||
k_EChatRoomEnterResponseNotAllowed = 3, // General Denied - You don't have the permissions needed to join the chat
|
||||
k_EChatRoomEnterResponseFull = 4, // Chat room has reached its maximum size
|
||||
k_EChatRoomEnterResponseError = 5, // Unexpected Error
|
||||
k_EChatRoomEnterResponseBanned = 6, // You are banned from this chat room and may not join
|
||||
};
|
||||
|
||||
|
||||
typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath );
|
||||
typedef bool (*PFNLegacyKeyInstalled)();
|
||||
|
||||
const int k_unSteamAccountIDMask = 0xFFFFFFFF;
|
||||
const int k_unSteamAccountInstanceMask = 0x000FFFFF;
|
||||
|
||||
// Special flags for Chat accounts - they go in the top 8 bits
|
||||
// of the steam ID's "instance", leaving 12 for the actual instances
|
||||
enum EChatSteamIDInstanceFlags
|
||||
{
|
||||
k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags
|
||||
|
||||
k_EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) >> 1, // top bit
|
||||
k_EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 2, // next one down, etc
|
||||
|
||||
// Max of 8 flags
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Possible positions to tell the overlay to show notifications in
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ENotificationPosition
|
||||
{
|
||||
k_EPositionTopLeft = 0,
|
||||
k_EPositionTopRight = 1,
|
||||
k_EPositionBottomLeft = 2,
|
||||
k_EPositionBottomRight = 3,
|
||||
};
|
||||
|
||||
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
// Steam ID structure (64 bits total)
|
||||
class CSteamID
|
||||
{
|
||||
public:
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID()
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = 0;
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeInvalid;
|
||||
m_steamid.m_comp.m_EUniverse = k_EUniverseInvalid;
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
Set( unAccountID, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// unAccountInstance - instance
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
#if defined(_SERVER) && defined(Assert)
|
||||
Assert( ! ( ( k_EAccountTypeIndividual == eAccountType ) && ( 1 != unAccountInstance ) ) ); // enforce that for individual accounts, instance is always 1
|
||||
#endif // _SERVER
|
||||
InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
// Note: Will not accept a uint32 or int32 as input, as that is a probable mistake.
|
||||
// See the stubbed out overloads in the private: section for more info.
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint64 ulSteamID )
|
||||
{
|
||||
SetFromUint64( ulSteamID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void Set( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = unAccountID;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_EAccountType = eAccountType;
|
||||
|
||||
if ( eAccountType == k_EAccountTypeClan )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountInstance = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void InstancedSet( uint32 unAccountID, uint32 unInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = unAccountID;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_EAccountType = eAccountType;
|
||||
m_steamid.m_comp.m_unAccountInstance = unInstance;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 52 bit parts and universe/type
|
||||
// Input : ulIdentifier - 52 bits of goodness
|
||||
//-----------------------------------------------------------------------------
|
||||
void FullSet( uint64 ulIdentifier, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = ( ulIdentifier & 0xFFFFFFFF ); // account ID is low 32 bits
|
||||
m_steamid.m_comp.m_unAccountInstance = ( ( ulIdentifier >> 32 ) & 0xFFFFF ); // account instance is next 20 bits
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_EAccountType = eAccountType;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 64-bit representation
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromUint64( uint64 ulSteamID )
|
||||
{
|
||||
m_steamid.m_unAll64Bits = ulSteamID;
|
||||
}
|
||||
|
||||
|
||||
#if defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to convert
|
||||
// eUniverse - universe this ID belongs to
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromSteam2( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 +
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse; // set the universe
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeIndividual; // Steam 2 accounts always map to account type of individual
|
||||
m_steamid.m_comp.m_unAccountInstance = 1; // individual accounts always have an account instance ID of 1
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fills out a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to write to
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConvertToSteam2( TSteamGlobalUserID *pTSteamGlobalUserID ) const
|
||||
{
|
||||
// only individual accounts have any meaning in Steam 2, only they can be mapped
|
||||
// Assert( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual );
|
||||
|
||||
pTSteamGlobalUserID->m_SteamInstanceID = 0;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits = m_steamid.m_comp.m_unAccountID % 2;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits = m_steamid.m_comp.m_unAccountID / 2;
|
||||
}
|
||||
#endif // defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts steam ID to its 64-bit representation
|
||||
// Output : 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 ConvertToUint64() const
|
||||
{
|
||||
return m_steamid.m_unAll64Bits;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts the static parts of a steam ID to a 64-bit representation.
|
||||
// For multiseat accounts, all instances of that account will have the
|
||||
// same static account key, so they can be grouped together by the static
|
||||
// account key.
|
||||
// Output : 64-bit static account key
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 GetStaticAccountKey() const
|
||||
{
|
||||
// note we do NOT include the account instance (which is a dynamic property) in the static account key
|
||||
return (uint64) ( ( ( (uint64) m_steamid.m_comp.m_EUniverse ) << 56 ) + ((uint64) m_steamid.m_comp.m_EAccountType << 52 ) + m_steamid.m_comp.m_unAccountID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = 0;
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonGameServer;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonUserLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = 0;
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonUser;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous game server login that will be filled in?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BBlankAnonAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_unAccountID == 0 && BAnonAccount() && m_steamid.m_comp.m_unAccountInstance == 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a game server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BGameServerAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a content server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BContentServerAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeContentServer;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a clan account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BClanAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a chat account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BChatAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a chat account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool IsLobby() const
|
||||
{
|
||||
return ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat )
|
||||
&& ( m_steamid.m_comp.m_unAccountInstance & k_EChatInstanceFlagLobby );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an individual user account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BIndividualAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous account?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BAnonAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous user account? ( used to create an account or reset a password )
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BAnonUserAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser;
|
||||
}
|
||||
|
||||
|
||||
// simple accessors
|
||||
void SetAccountID( uint32 unAccountID ) { m_steamid.m_comp.m_unAccountID = unAccountID; }
|
||||
uint32 GetAccountID() const { return m_steamid.m_comp.m_unAccountID; }
|
||||
uint32 GetUnAccountInstance() const { return m_steamid.m_comp.m_unAccountInstance; }
|
||||
EAccountType GetEAccountType() const { return ( EAccountType ) m_steamid.m_comp.m_EAccountType; }
|
||||
EUniverse GetEUniverse() const { return m_steamid.m_comp.m_EUniverse; }
|
||||
void SetEUniverse( EUniverse eUniverse ) { m_steamid.m_comp.m_EUniverse = eUniverse; }
|
||||
bool IsValid() const { return ( m_steamid.m_comp.m_EAccountType != k_EAccountTypeInvalid && m_steamid.m_comp.m_EUniverse != k_EUniverseInvalid ); }
|
||||
|
||||
// this set of functions is hidden, will be moved out of class
|
||||
explicit CSteamID( const char *pchSteamID, EUniverse eDefaultUniverse = k_EUniverseInvalid );
|
||||
const char * Render() const; // renders this steam ID to string
|
||||
static const char * Render( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string
|
||||
|
||||
void SetFromString( const char *pchSteamID, EUniverse eDefaultUniverse );
|
||||
bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse );
|
||||
|
||||
inline bool operator==( const CSteamID &val ) const { return m_steamid.m_unAll64Bits == val.m_steamid.m_unAll64Bits; }
|
||||
inline bool operator!=( const CSteamID &val ) const { return !operator==( val ); }
|
||||
inline bool operator<( const CSteamID &val ) const { return m_steamid.m_unAll64Bits < val.m_steamid.m_unAll64Bits; }
|
||||
inline bool operator>( const CSteamID &val ) const { return m_steamid.m_unAll64Bits > val.m_steamid.m_unAll64Bits; }
|
||||
|
||||
// DEBUG function
|
||||
bool BValidExternalSteamID() const;
|
||||
|
||||
private:
|
||||
// These are defined here to prevent accidental implicit conversion of a u32AccountID to a CSteamID.
|
||||
// If you get a compiler error about an ambiguous constructor/function then it may be because you're
|
||||
// passing a 32-bit int to a function that takes a CSteamID. You should explicitly create the SteamID
|
||||
// using the correct Universe and account Type/Instance values.
|
||||
CSteamID( uint32 );
|
||||
CSteamID( int32 );
|
||||
|
||||
// 64 bits total
|
||||
union SteamID_t
|
||||
{
|
||||
struct SteamIDComponent_t
|
||||
{
|
||||
uint32 m_unAccountID : 32; // unique account identifier
|
||||
unsigned int m_unAccountInstance : 20; // dynamic instance ID (used for multiseat type accounts only)
|
||||
unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference
|
||||
EUniverse m_EUniverse : 8; // universe this account belongs to
|
||||
} m_comp;
|
||||
|
||||
uint64 m_unAll64Bits;
|
||||
} m_steamid;
|
||||
};
|
||||
|
||||
// generic invalid CSteamID
|
||||
const CSteamID k_steamIDNil;
|
||||
|
||||
// This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol
|
||||
// to provide its steamID
|
||||
const CSteamID k_steamIDOutofDateGS( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
// This steamID comes from a user game connection to an sv_lan GS
|
||||
const CSteamID k_steamIDLanModeGS( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid );
|
||||
// This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized
|
||||
// its steam3 component and started logging on.
|
||||
const CSteamID k_steamIDNotInitYetGS( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
// This steamID can come from a user game connection to a GS that isn't using the steam authentication system but still
|
||||
// wants to support the "Join Game" option in the friends list
|
||||
const CSteamID k_steamIDNonSteamGS( 2, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
|
||||
|
||||
#ifdef STEAM
|
||||
// Returns the matching chat steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance
|
||||
CSteamID ChatIDFromSteamID( const CSteamID &steamID );
|
||||
// Returns the matching clan steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance
|
||||
CSteamID ClanIDFromSteamID( const CSteamID &steamID );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ChatIDFromClanID( const CSteamID &steamIDClan );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ClanIDFromChatID( const CSteamID &steamIDChat );
|
||||
|
||||
#endif // _STEAM
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: encapsulates an appID/modID pair
|
||||
//-----------------------------------------------------------------------------
|
||||
class CGameID
|
||||
{
|
||||
public:
|
||||
|
||||
CGameID()
|
||||
{
|
||||
m_gameID.m_nType = k_EGameIDTypeApp;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nModID = 0;
|
||||
}
|
||||
|
||||
explicit CGameID( uint64 ulGameID )
|
||||
{
|
||||
m_ulGameID = ulGameID;
|
||||
}
|
||||
|
||||
explicit CGameID( int32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
explicit CGameID( uint32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
CGameID( uint32 nAppID, uint32 nModID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nModID = nModID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
}
|
||||
|
||||
// Hidden functions used only by Steam
|
||||
explicit CGameID( const char *pchGameID );
|
||||
const char *Render() const; // render this Game ID to string
|
||||
static const char *Render( uint64 ulGameID ); // static method to render a uint64 representation of a Game ID to a string
|
||||
|
||||
// must include checksum_crc.h first to get this functionality
|
||||
#if defined( CHECKSUM_CRC_H )
|
||||
CGameID( uint32 nAppID, const char *pchModPath )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
|
||||
char rgchModDir[MAX_PATH];
|
||||
Q_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) );
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, rgchModDir, Q_strlen( rgchModDir ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
CGameID( const char *pchExePath, const char *pchAppName )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeShortcut;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, pchExePath, Q_strlen( pchExePath ) );
|
||||
CRC32_ProcessBuffer( &crc32, pchAppName, Q_strlen( pchAppName ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#if defined( VSTFILEID_H )
|
||||
|
||||
CGameID( VstFileID vstFileID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeP2P;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
const char *pchFileId = vstFileID.Render();
|
||||
CRC32_ProcessBuffer( &crc32, pchFileId, Q_strlen( pchFileId ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#endif /* VSTFILEID_H */
|
||||
|
||||
#endif /* CHECKSUM_CRC_H */
|
||||
|
||||
|
||||
uint64 ToUint64() const
|
||||
{
|
||||
return m_ulGameID;
|
||||
}
|
||||
|
||||
uint64 *GetUint64Ptr()
|
||||
{
|
||||
return &m_ulGameID;
|
||||
}
|
||||
|
||||
bool IsMod() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeGameMod );
|
||||
}
|
||||
|
||||
bool IsShortcut() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeShortcut );
|
||||
}
|
||||
|
||||
bool IsP2PFile() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeP2P );
|
||||
}
|
||||
|
||||
bool IsSteamApp() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeApp );
|
||||
}
|
||||
|
||||
uint32 ModID() const
|
||||
{
|
||||
return m_gameID.m_nModID;
|
||||
}
|
||||
|
||||
uint32 AppID() const
|
||||
{
|
||||
return m_gameID.m_nAppID;
|
||||
}
|
||||
|
||||
bool operator == ( const CGameID &rhs ) const
|
||||
{
|
||||
return m_ulGameID == rhs.m_ulGameID;
|
||||
}
|
||||
|
||||
bool operator != ( const CGameID &rhs ) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
bool operator < ( const CGameID &rhs ) const
|
||||
{
|
||||
return ( m_ulGameID < rhs.m_ulGameID );
|
||||
}
|
||||
|
||||
bool IsValid() const
|
||||
{
|
||||
// each type has it's own invalid fixed point:
|
||||
switch( m_gameID.m_nType )
|
||||
{
|
||||
case k_EGameIDTypeApp:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid;
|
||||
break;
|
||||
case k_EGameIDTypeGameMod:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
case k_EGameIDTypeShortcut:
|
||||
return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
case k_EGameIDTypeP2P:
|
||||
return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
default:
|
||||
#if defined(Assert)
|
||||
Assert(false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
enum EGameIDType
|
||||
{
|
||||
k_EGameIDTypeApp = 0,
|
||||
k_EGameIDTypeGameMod = 1,
|
||||
k_EGameIDTypeShortcut = 2,
|
||||
k_EGameIDTypeP2P = 3,
|
||||
};
|
||||
|
||||
struct GameID_t
|
||||
{
|
||||
unsigned int m_nAppID : 24;
|
||||
unsigned int m_nType : 8;
|
||||
unsigned int m_nModID : 32;
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
uint64 m_ulGameID;
|
||||
GameID_t m_gameID;
|
||||
};
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
const int k_cchGameExtraInfoMax = 64;
|
||||
|
||||
|
||||
// Max number of credit cards stored for one account
|
||||
const int k_nMaxNumCardsPerAccount = 1;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constants used for query ports.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define QUERY_PORT_NOT_INITIALIZED 0xFFFF // We haven't asked the GS for this query port's actual value yet.
|
||||
#define QUERY_PORT_ERROR 0xFFFE // We were unable to get the query port for this server.
|
||||
|
||||
#endif // STEAMCLIENTPUBLIC_H
|
||||
90
res/steamworks/103/headers/steamtypes.h
Normal file
90
res/steamworks/103/headers/steamtypes.h
Normal file
@@ -0,0 +1,90 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMTYPES_H
|
||||
#define STEAMTYPES_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Steam-specific types. Defined here so this header file can be included in other code bases.
|
||||
#ifndef WCHARTYPES_H
|
||||
typedef unsigned char uint8;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(_WIN64)
|
||||
#define X64BITS
|
||||
#endif
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef signed char int8;
|
||||
|
||||
#if defined( _WIN32 )
|
||||
|
||||
typedef __int16 int16;
|
||||
typedef unsigned __int16 uint16;
|
||||
typedef __int32 int32;
|
||||
typedef unsigned __int32 uint32;
|
||||
typedef __int64 int64;
|
||||
typedef unsigned __int64 uint64;
|
||||
|
||||
#ifdef X64BITS
|
||||
typedef __int64 intp; // intp is an integer that can accomodate a pointer
|
||||
typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *)
|
||||
#else
|
||||
typedef __int32 intp;
|
||||
typedef unsigned __int32 uintp;
|
||||
#endif
|
||||
|
||||
#else // _WIN32
|
||||
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
#ifdef X64BITS
|
||||
typedef long long intp;
|
||||
typedef unsigned long long uintp;
|
||||
#else
|
||||
typedef int intp;
|
||||
typedef unsigned int uintp;
|
||||
#endif
|
||||
|
||||
#endif // else _WIN32
|
||||
|
||||
const int k_cubSaltSize = 8;
|
||||
typedef uint8 Salt_t[ k_cubSaltSize ];
|
||||
|
||||
typedef uint64 GID_t; // globally unique identifier
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 PackageId_t;
|
||||
const PackageId_t k_uPackageIdInvalid = 0xFFFFFFFF;
|
||||
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 AppId_t;
|
||||
const AppId_t k_uAppIdInvalid = 0x0;
|
||||
|
||||
// RTime32
|
||||
// We use this 32 bit time representing real world time.
|
||||
// It offers 1 second resolution beginning on January 1, 1970 (Unix time)
|
||||
typedef uint32 RTime32;
|
||||
|
||||
typedef uint32 CellID_t;
|
||||
|
||||
// handle to a Steam API call
|
||||
typedef uint64 SteamAPICall_t;
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // STEAMTYPES_H
|
||||
45
res/steamworks/104/headers/isteamapps.h
Normal file
45
res/steamworks/104/headers/isteamapps.h
Normal file
@@ -0,0 +1,45 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to app data in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMAPPS_H
|
||||
#define ISTEAMAPPS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to app data
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamApps
|
||||
{
|
||||
public:
|
||||
virtual bool BIsSubscribed() = 0;
|
||||
virtual bool BIsLowViolence() = 0;
|
||||
virtual bool BIsCybercafe() = 0;
|
||||
virtual bool BIsVACBanned() = 0;
|
||||
virtual const char *GetCurrentGameLanguage() = 0;
|
||||
virtual const char *GetAvailableGameLanguages() = 0;
|
||||
|
||||
// only use this member if you need to check ownership of another game related to yours, a demo for example
|
||||
virtual bool BIsSubscribedApp( AppId_t appID ) = 0;
|
||||
|
||||
// Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed
|
||||
virtual bool BIsDlcInstalled( AppId_t appID ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION003"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: posted after the user gains ownership of DLC & that DLC is installed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct DlcInstalled_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamAppsCallbacks + 5 };
|
||||
AppId_t m_nAppID; // AppID of the DLC
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMAPPS_H
|
||||
151
res/steamworks/104/headers/isteamclient.h
Normal file
151
res/steamworks/104/headers/isteamclient.h
Normal file
@@ -0,0 +1,151 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: Main interface for loading and accessing Steamworks API's from the
|
||||
// Steam client.
|
||||
// For most uses, this code is wrapped inside of SteamAPI_Init()
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMCLIENT_H
|
||||
#define ISTEAMCLIENT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a communication pipe to the Steam client
|
||||
typedef int32 HSteamPipe;
|
||||
// handle to single instance of a steam user
|
||||
typedef int32 HSteamUser;
|
||||
// function prototype
|
||||
#if defined( POSIX ) && !defined( _CYGWIN )
|
||||
#define __cdecl
|
||||
#endif
|
||||
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
|
||||
|
||||
// interface predec
|
||||
class ISteamUser;
|
||||
class ISteamGameServer;
|
||||
class ISteamFriends;
|
||||
class ISteamUtils;
|
||||
class ISteamMatchmaking;
|
||||
class ISteamContentServer;
|
||||
class ISteamMasterServerUpdater;
|
||||
class ISteamMatchmakingServers;
|
||||
class ISteamUserStats;
|
||||
class ISteamApps;
|
||||
class ISteamNetworking;
|
||||
class ISteamRemoteStorage;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Interface to creating a new steam instance, or to
|
||||
// connect to an existing steam instance, whether it's in a
|
||||
// different process or is local.
|
||||
//
|
||||
// For most scenarios this is all handled automatically via SteamAPI_Init().
|
||||
// You'll only need to use these interfaces if you have a more complex versioning scheme,
|
||||
// where you want to get different versions of the same interface in different dll's in your project.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamClient
|
||||
{
|
||||
public:
|
||||
// Creates a communication pipe to the Steam client
|
||||
virtual HSteamPipe CreateSteamPipe() = 0;
|
||||
|
||||
// Releases a previously created communications pipe
|
||||
virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// connects to an existing global user, failing if none exists
|
||||
// used by the game to coordinate with the steamUI
|
||||
virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// used by game servers, create a steam user that won't be shared with anyone else
|
||||
virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe, EAccountType eAccountType ) = 0;
|
||||
|
||||
// removes an allocated user
|
||||
virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0;
|
||||
|
||||
// retrieves the ISteamUser interface associated with the handle
|
||||
virtual ISteamUser *GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// retrieves the ISteamGameServer interface associated with the handle
|
||||
virtual ISteamGameServer *GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// set the local IP and Port to bind to
|
||||
// this must be set before CreateLocalUser()
|
||||
virtual void SetLocalIPBinding( uint32 unIP, uint16 usPort ) = 0;
|
||||
|
||||
// returns the ISteamFriends interface
|
||||
virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamUtils interface
|
||||
virtual ISteamUtils *GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmaking interface
|
||||
virtual ISteamMatchmaking *GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMasterServerUpdater interface
|
||||
virtual ISteamMasterServerUpdater *GetISteamMasterServerUpdater( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmakingServers interface
|
||||
virtual ISteamMatchmakingServers *GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the a generic interface
|
||||
virtual void *GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamUserStats interface
|
||||
virtual ISteamUserStats *GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns apps interface
|
||||
virtual ISteamApps *GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// networking
|
||||
virtual ISteamNetworking *GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// remote storage
|
||||
virtual ISteamRemoteStorage *GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// this needs to be called every frame to process matchmaking results
|
||||
// redundant if you're already calling SteamAPI_RunCallbacks()
|
||||
virtual void RunFrame() = 0;
|
||||
|
||||
// returns the number of IPC calls made since the last time this function was called
|
||||
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
||||
// Every IPC call is at minimum a thread context switch if not a process one so you want to rate
|
||||
// control how often you do them.
|
||||
virtual uint32 GetIPCCallCount() = 0;
|
||||
|
||||
// API warning handling
|
||||
// 'int' is the severity; 0 for msg, 1 for warning
|
||||
// 'const char *' is the text of the message
|
||||
// callbacks will occur directly after the API function is called that generated the warning or message
|
||||
virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
|
||||
|
||||
};
|
||||
|
||||
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient008"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Base values for callback identifiers, each callback must
|
||||
// have a unique ID.
|
||||
//-----------------------------------------------------------------------------
|
||||
enum { k_iSteamUserCallbacks = 100 };
|
||||
enum { k_iSteamGameServerCallbacks = 200 };
|
||||
enum { k_iSteamFriendsCallbacks = 300 };
|
||||
enum { k_iSteamBillingCallbacks = 400 };
|
||||
enum { k_iSteamMatchmakingCallbacks = 500 };
|
||||
enum { k_iSteamContentServerCallbacks = 600 };
|
||||
enum { k_iSteamUtilsCallbacks = 700 };
|
||||
enum { k_iClientFriendsCallbacks = 800 };
|
||||
enum { k_iClientUserCallbacks = 900 };
|
||||
enum { k_iSteamAppsCallbacks = 1000 };
|
||||
enum { k_iSteamUserStatsCallbacks = 1100 };
|
||||
enum { k_iSteamNetworkingCallbacks = 1200 };
|
||||
enum { k_iClientRemoteStorageCallbacks = 1300 };
|
||||
enum { k_iSteamUserItemsCallbacks = 1400 };
|
||||
enum { k_iSteamGameServerItemsCallbacks = 1500 };
|
||||
enum { k_iClientUtilsCallbacks = 1600 };
|
||||
|
||||
|
||||
#endif // ISTEAMCLIENT_H
|
||||
250
res/steamworks/104/headers/isteamfriends.h
Normal file
250
res/steamworks/104/headers/isteamfriends.h
Normal file
@@ -0,0 +1,250 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to both friends list data and general information about users
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMFRIENDS_H
|
||||
#define ISTEAMFRIENDS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: set of relationships to other users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EFriendRelationship
|
||||
{
|
||||
k_EFriendRelationshipNone = 0,
|
||||
k_EFriendRelationshipBlocked = 1,
|
||||
k_EFriendRelationshipRequestRecipient = 2,
|
||||
k_EFriendRelationshipFriend = 3,
|
||||
k_EFriendRelationshipRequestInitiator = 4,
|
||||
k_EFriendRelationshipIgnored = 5,
|
||||
k_EFriendRelationshipIgnoredFriend = 6,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: list of states a friend can be in
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EPersonaState
|
||||
{
|
||||
k_EPersonaStateOffline = 0, // friend is not currently logged on
|
||||
k_EPersonaStateOnline = 1, // friend is logged on
|
||||
k_EPersonaStateBusy = 2, // user is on, but busy
|
||||
k_EPersonaStateAway = 3, // auto-away feature
|
||||
k_EPersonaStateSnooze = 4, // auto-away for a long time
|
||||
k_EPersonaStateMax,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: flags for enumerating friends list, or quickly checking a the relationship between users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EFriendFlags
|
||||
{
|
||||
k_EFriendFlagNone = 0x00,
|
||||
k_EFriendFlagBlocked = 0x01,
|
||||
k_EFriendFlagFriendshipRequested = 0x02,
|
||||
k_EFriendFlagImmediate = 0x04, // "regular" friend
|
||||
k_EFriendFlagClanMember = 0x08,
|
||||
k_EFriendFlagOnGameServer = 0x10,
|
||||
// k_EFriendFlagHasPlayedWith = 0x20, // not currently used
|
||||
// k_EFriendFlagFriendOfFriend = 0x40, // not currently used
|
||||
k_EFriendFlagRequestingFriendship = 0x80,
|
||||
k_EFriendFlagRequestingInfo = 0x100,
|
||||
k_EFriendFlagIgnored = 0x200,
|
||||
k_EFriendFlagIgnoredFriend = 0x400,
|
||||
k_EFriendFlagAll = 0xFFFF,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: avatar sizes, used in ISteamFriends::GetFriendAvatar()
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EAvatarSize
|
||||
{
|
||||
k_EAvatarSize32x32 = 0,
|
||||
k_EAvatarSize64x64 = 1,
|
||||
};
|
||||
|
||||
|
||||
// friend game played information
|
||||
struct FriendGameInfo_t
|
||||
{
|
||||
CGameID m_gameID;
|
||||
uint32 m_unGameIP;
|
||||
uint16 m_usGamePort;
|
||||
uint16 m_usQueryPort;
|
||||
CSteamID m_steamIDLobby;
|
||||
};
|
||||
|
||||
|
||||
// maximum number of characters in a users name
|
||||
enum { k_cchPersonaNameMax = 128 };
|
||||
|
||||
// size limit on chat room or member metadata
|
||||
const uint32 k_cubChatMetadataMax = 8192;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to accessing information about individual users,
|
||||
// that can be a friend, in a group, on a game server or in a lobby with the local user
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamFriends
|
||||
{
|
||||
public:
|
||||
// returns the local players name - guaranteed to not be NULL.
|
||||
// this is the same name as on the users community profile page
|
||||
// this is stored in UTF-8 format
|
||||
// like all the other interface functions that return a char *, it's important that this pointer is not saved
|
||||
// off; it will eventually be free'd or re-allocated
|
||||
virtual const char *GetPersonaName() = 0;
|
||||
|
||||
// sets the player name, stores it on the server and publishes the changes to all friends who are online
|
||||
virtual void SetPersonaName( const char *pchPersonaName ) = 0;
|
||||
|
||||
// gets the status of the current user
|
||||
virtual EPersonaState GetPersonaState() = 0;
|
||||
|
||||
// friend iteration
|
||||
// takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria
|
||||
// then GetFriendByIndex() can then be used to return the id's of each of those users
|
||||
virtual int GetFriendCount( int iFriendFlags ) = 0;
|
||||
|
||||
// returns the steamID of a user
|
||||
// iFriend is a index of range [0, GetFriendCount())
|
||||
// iFriendsFlags must be the same value as used in GetFriendCount()
|
||||
// the returned CSteamID can then be used by all the functions below to access details about the user
|
||||
virtual CSteamID GetFriendByIndex( int iFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// returns a relationship to a user
|
||||
virtual EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the current status of the specified user
|
||||
// this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user
|
||||
virtual EPersonaState GetFriendPersonaState( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the name another user - guaranteed to not be NULL.
|
||||
// same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user
|
||||
// note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously
|
||||
//
|
||||
virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// gets the avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetFriendAvatar( CSteamID steamIDFriend, int eAvatarSize ) = 0;
|
||||
// returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details
|
||||
virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, FriendGameInfo_t *pFriendGameInfo ) = 0;
|
||||
// accesses old friends names - returns an empty string when their are no more items in the history
|
||||
virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0;
|
||||
|
||||
// returns true if the specified user meets any of the criteria specified in iFriendFlags
|
||||
// iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values
|
||||
virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// clan (group) iteration and access functions
|
||||
virtual int GetClanCount() = 0;
|
||||
virtual CSteamID GetClanByIndex( int iClan ) = 0;
|
||||
virtual const char *GetClanName( CSteamID steamIDClan ) = 0;
|
||||
|
||||
// iterators for getting users in a chat room, lobby, game server or clan
|
||||
// note that large clans that cannot be iterated by the local user
|
||||
// steamIDSource can be the steamID of a group, game server, lobby or chat room
|
||||
virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0;
|
||||
virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0;
|
||||
|
||||
// returns true if the local user can see that steamIDUser is a member or in steamIDSource
|
||||
virtual bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) = 0;
|
||||
|
||||
// User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI)
|
||||
virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0;
|
||||
|
||||
// activates the game overlay, with an optional dialog to open
|
||||
// valid options are "Friends", "Community", "Players", "Settings", "LobbyInvite", "OfficialGameGroup"
|
||||
virtual void ActivateGameOverlay( const char *pchDialog ) = 0;
|
||||
|
||||
// activates game overlay to a specific place
|
||||
// valid options are
|
||||
// "steamid" - opens the overlay web browser to the specified user or groups profile
|
||||
// "chat" - opens a chat window to the specified user, or joins the group chat
|
||||
virtual void ActivateGameOverlayToUser( const char *pchDialog, CSteamID steamID ) = 0;
|
||||
|
||||
// activates game overlay web browser directly to the specified URL
|
||||
// full address with protocol type is required, e.g. http://www.steamgames.com/
|
||||
virtual void ActivateGameOverlayToWebPage( const char *pchURL ) = 0;
|
||||
|
||||
// activates game overlay to store page for app
|
||||
virtual void ActivateGameOverlayToStore( AppId_t nAppID ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends005"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a friends' status changes
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PersonaStateChange_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamID; // steamID of the friend who changed
|
||||
int m_nChangeFlags; // what's changed
|
||||
};
|
||||
|
||||
|
||||
// used in PersonaStateChange_t::m_nChangeFlags to describe what's changed about a user
|
||||
// these flags describe what the client has learned has changed recently, so on startup you'll see a name, avatar & relationship change for every friend
|
||||
enum EPersonaChange
|
||||
{
|
||||
k_EPersonaChangeName = 0x001,
|
||||
k_EPersonaChangeStatus = 0x002,
|
||||
k_EPersonaChangeComeOnline = 0x004,
|
||||
k_EPersonaChangeGoneOffline = 0x008,
|
||||
k_EPersonaChangeGamePlayed = 0x010,
|
||||
k_EPersonaChangeGameServer = 0x020,
|
||||
k_EPersonaChangeAvatar = 0x040,
|
||||
k_EPersonaChangeJoinedSource= 0x080,
|
||||
k_EPersonaChangeLeftSource = 0x100,
|
||||
k_EPersonaChangeRelationshipChanged = 0x200,
|
||||
k_EPersonaChangeNameFirstSet = 0x400,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: posted when game overlay activates or deactivates
|
||||
// the game can use this to be pause or resume single player games
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameOverlayActivated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 31 };
|
||||
uint8 m_bActive; // true if it's just been activated, false otherwise
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the user tries to join a different game server from their friends list
|
||||
// game client should attempt to connect to specified server when this is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameServerChangeRequested_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 32 };
|
||||
char m_rgchServer[64]; // server address ("127.0.0.1:27015", "tf2.valvesoftware.com")
|
||||
char m_rgchPassword[64]; // server password, if any
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the user tries to join a lobby from their friends list
|
||||
// game client should attempt to connect to specified lobby when this is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameLobbyJoinRequested_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 33 };
|
||||
CSteamID m_steamIDLobby;
|
||||
CSteamID m_steamIDFriend; // the friend they did the join via (will be invalid if not directly via a friend)
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMFRIENDS_H
|
||||
193
res/steamworks/104/headers/isteamgameserver.h
Normal file
193
res/steamworks/104/headers/isteamgameserver.h
Normal file
@@ -0,0 +1,193 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMGAMESERVER_H
|
||||
#define ISTEAMGAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for authenticating users via Steam to play on a game server
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamGameServer
|
||||
{
|
||||
public:
|
||||
// connection functions
|
||||
virtual void LogOn() = 0;
|
||||
virtual void LogOff() = 0;
|
||||
|
||||
// status functions
|
||||
virtual bool BLoggedOn() = 0;
|
||||
virtual bool BSecure() = 0;
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Handles receiving a new connection from a Steam user. This call will ask the Steam
|
||||
// servers to validate the users identity, app ownership, and VAC status. If the Steam servers
|
||||
// are off-line, then it will validate the cached ticket itself which will validate app ownership
|
||||
// and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection()
|
||||
// and must then be sent up to the game server for authentication.
|
||||
//
|
||||
// Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL
|
||||
// If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication
|
||||
// for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)
|
||||
virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0;
|
||||
|
||||
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||
//
|
||||
// Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect()
|
||||
// when this user leaves the server just like you would for a real user.
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection() = 0;
|
||||
|
||||
// Should be called whenever a user leaves our game server, this lets Steam internally
|
||||
// track which users are currently on which servers for the purposes of preventing a single
|
||||
// account being logged into multiple servers, showing who is currently on a server, etc.
|
||||
virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// Update the data to be displayed in the server browser and matchmaking interfaces for a user
|
||||
// currently connected to the server. For regular users you must call this after you receive a
|
||||
// GSUserValidationSuccess callback.
|
||||
//
|
||||
// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
|
||||
virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
|
||||
|
||||
// You shouldn't need to call this as it is called internally by SteamGameServer_Init() and can only be called once.
|
||||
//
|
||||
// To update the data in this call which may change during the servers lifetime see UpdateServerStatus() below.
|
||||
//
|
||||
// Input: nGameAppID - The Steam assigned AppID for the game
|
||||
// unServerFlags - Any applicable combination of flags (see k_unServerFlag____ constants below)
|
||||
// unGameIP - The IP Address the server is listening for client connections on (might be INADDR_ANY)
|
||||
// unGamePort - The port which the server is listening for client connections on
|
||||
// unSpectatorPort - the port on which spectators can join to observe the server, 0 if spectating is not supported
|
||||
// usQueryPort - The port which the ISteamMasterServerUpdater API should use in order to listen for matchmaking requests
|
||||
// pchGameDir - A unique string identifier for your game
|
||||
// pchVersion - The current version of the server as a string like 1.0.0.0
|
||||
// bLanMode - Is this a LAN only server?
|
||||
//
|
||||
// bugbug jmccaskey - figure out how to remove this from the API and only expose via SteamGameServer_Init... or make this actually used,
|
||||
// and stop calling it in SteamGameServer_Init()?
|
||||
virtual bool BSetServerType( uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort,
|
||||
uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode ) = 0;
|
||||
|
||||
// Updates server status values which shows up in the server browser and matchmaking APIs
|
||||
virtual void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers,
|
||||
const char *pchServerName, const char *pSpectatorServerName,
|
||||
const char *pchMapName ) = 0;
|
||||
|
||||
// This can be called if spectator goes away or comes back (passing 0 means there is no spectator server now).
|
||||
virtual void UpdateSpectatorPort( uint16 unSpectatorPort ) = 0;
|
||||
|
||||
// Sets a string defining the "gametype" for this server, this is optional, but if it is set
|
||||
// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||
virtual void SetGameType( const char *pchGameType ) = 0;
|
||||
|
||||
// Ask if a user has a specific achievement for this game, will get a callback on reply
|
||||
virtual bool BGetUserAchievementStatus( CSteamID steamID, const char *pchAchievementName ) = 0;
|
||||
|
||||
// Ask for the gameplay stats for the server. Results returned in a callback
|
||||
virtual void GetGameplayStats( ) = 0;
|
||||
|
||||
// Ask if a user in in the specified group, results returns async by GSUserGroupStatus_t
|
||||
// returns false if we're not connected to the steam servers and thus cannot ask
|
||||
virtual bool RequestUserGroupStatus( CSteamID steamIDUser, CSteamID steamIDGroup ) = 0;
|
||||
|
||||
// Returns the public IP of the server according to Steam, useful when the server is
|
||||
// behind NAT and you want to advertise its IP in a lobby for other clients to directly
|
||||
// connect to
|
||||
virtual uint32 GetPublicIP() = 0;
|
||||
|
||||
};
|
||||
|
||||
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer008"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unServerFlagNone = 0x00;
|
||||
const uint32 k_unServerFlagActive = 0x01; // server has users playing
|
||||
const uint32 k_unServerFlagSecure = 0x02; // server wants to be secure
|
||||
const uint32 k_unServerFlagDedicated = 0x04; // server is dedicated
|
||||
const uint32 k_unServerFlagLinux = 0x08; // linux build
|
||||
const uint32 k_unServerFlagPassworded = 0x10; // password protected
|
||||
const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and
|
||||
// won't enforce authentication of users that connect to the server.
|
||||
// Useful when you run a server where the clients may not
|
||||
// be connected to the internet but you want them to play (i.e LANs)
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
// client has been approved to connect to this game server
|
||||
struct GSClientApprove_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 1 };
|
||||
CSteamID m_SteamID;
|
||||
};
|
||||
|
||||
|
||||
// client has been denied to connection to this game server
|
||||
struct GSClientDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 2 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
char m_rgchOptionalText[128];
|
||||
};
|
||||
|
||||
|
||||
// request the game server should kick the user
|
||||
struct GSClientKick_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 3 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
};
|
||||
|
||||
// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks,
|
||||
// do not reuse them here.
|
||||
|
||||
|
||||
// client achievement info
|
||||
struct GSClientAchievementStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 6 };
|
||||
uint64 m_SteamID;
|
||||
char m_pchAchievement[128];
|
||||
bool m_bUnlocked;
|
||||
};
|
||||
|
||||
// received when the game server requests to be displayed as secure (VAC protected)
|
||||
// m_bSecure is true if the game server should display itself as secure to users, false otherwise
|
||||
struct GSPolicyResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 15 };
|
||||
uint8 m_bSecure;
|
||||
};
|
||||
|
||||
// GS gameplay stats info
|
||||
struct GSGameplayStats_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 7 };
|
||||
EResult m_eResult; // Result of the call
|
||||
int32 m_nRank; // Overall rank of the server (0-based)
|
||||
uint32 m_unTotalConnects; // Total number of clients who have ever connected to the server
|
||||
uint32 m_unTotalMinutesPlayed; // Total number of minutes ever played on the server
|
||||
};
|
||||
|
||||
// send as a reply to RequestUserGroupStatus()
|
||||
struct GSClientGroupStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 8 };
|
||||
CSteamID m_SteamIDUser;
|
||||
CSteamID m_SteamIDGroup;
|
||||
bool m_bMember;
|
||||
bool m_bOfficer;
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMGAMESERVER_H
|
||||
103
res/steamworks/104/headers/isteammasterserverupdater.h
Normal file
103
res/steamworks/104/headers/isteammasterserverupdater.h
Normal file
@@ -0,0 +1,103 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for retrieving list of game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMASTERSERVERUPDATER_H
|
||||
#define ISTEAMMASTERSERVERUPDATER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Game engines use this to tell the Steam master servers
|
||||
// about their games so their games can show up in the server browser.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMasterServerUpdater
|
||||
{
|
||||
public:
|
||||
|
||||
// Call this as often as you like to tell the master server updater whether or not
|
||||
// you want it to be active (default: off).
|
||||
virtual void SetActive( bool bActive ) = 0;
|
||||
|
||||
// You usually don't need to modify this.
|
||||
// Pass -1 to use the default value for iHeartbeatInterval.
|
||||
// Some mods change this.
|
||||
virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0;
|
||||
|
||||
|
||||
// These are in GameSocketShare mode, where instead of ISteamMasterServerUpdater creating its own
|
||||
// socket to talk to the master server on, it lets the game use its socket to forward messages
|
||||
// back and forth. This prevents us from requiring server ops to open up yet another port
|
||||
// in their firewalls.
|
||||
//
|
||||
// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001
|
||||
|
||||
// These are used when you've elected to multiplex the game server's UDP socket
|
||||
// rather than having the master server updater use its own sockets.
|
||||
//
|
||||
// Source games use this to simplify the job of the server admins, so they
|
||||
// don't have to open up more ports on their firewalls.
|
||||
|
||||
// Call this when a packet that starts with 0xFFFFFFFF comes in. That means
|
||||
// it's for us.
|
||||
virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0;
|
||||
|
||||
// AFTER calling HandleIncomingPacket for any packets that came in that frame, call this.
|
||||
// This gets a packet that the master server updater needs to send out on UDP.
|
||||
// It returns the length of the packet it wants to send, or 0 if there are no more packets to send.
|
||||
// Call this each frame until it returns 0.
|
||||
virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0;
|
||||
|
||||
|
||||
// Functions to set various fields that are used to respond to queries.
|
||||
|
||||
// Call this to set basic data that is passed to the server browser.
|
||||
virtual void SetBasicServerData(
|
||||
unsigned short nProtocolVersion,
|
||||
bool bDedicatedServer,
|
||||
const char *pRegionName,
|
||||
const char *pProductName,
|
||||
unsigned short nMaxReportedClients,
|
||||
bool bPasswordProtected,
|
||||
const char *pGameDescription ) = 0;
|
||||
|
||||
// Call this to clear the whole list of key/values that are sent in rules queries.
|
||||
virtual void ClearAllKeyValues() = 0;
|
||||
|
||||
// Call this to add/update a key/value pair.
|
||||
virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
|
||||
// You can call this upon shutdown to clear out data stored for this game server and
|
||||
// to tell the master servers that this server is going away.
|
||||
virtual void NotifyShutdown() = 0;
|
||||
|
||||
// Returns true if the master server has requested a restart.
|
||||
// Only returns true once per request.
|
||||
virtual bool WasRestartRequested() = 0;
|
||||
|
||||
// Force it to request a heartbeat from the master servers.
|
||||
virtual void ForceHeartbeat() = 0;
|
||||
|
||||
// Manually edit and query the master server list.
|
||||
// It will provide name resolution and use the default master server port if none is provided.
|
||||
virtual bool AddMasterServer( const char *pServerAddress ) = 0;
|
||||
virtual bool RemoveMasterServer( const char *pServerAddress ) = 0;
|
||||
|
||||
virtual int GetNumMasterServers() = 0;
|
||||
|
||||
// Returns the # of bytes written to pOut.
|
||||
virtual int GetMasterServerAddress( int iServer, char *pOut, int outBufferSize ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMMASTERSERVERUPDATER_INTERFACE_VERSION "SteamMasterServerUpdater001"
|
||||
|
||||
#endif // ISTEAMMASTERSERVERUPDATER_H
|
||||
584
res/steamworks/104/headers/isteammatchmaking.h
Normal file
584
res/steamworks/104/headers/isteammatchmaking.h
Normal file
@@ -0,0 +1,584 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing game server/client match making
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMATCHMAKING
|
||||
#define ISTEAMMATCHMAKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
#include "matchmakingtypes.h"
|
||||
#include "isteamclient.h"
|
||||
#include "isteamfriends.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to favorites
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ELobbyType
|
||||
{
|
||||
k_ELobbyTypeFriendsOnly = 1, // shows for friends or invitees, but not in lobby list
|
||||
k_ELobbyTypePublic = 2, // visible for friends and in lobby list
|
||||
};
|
||||
|
||||
enum ELobbyComparison
|
||||
{
|
||||
k_ELobbyComparisonEqualToOrLessThan = -2,
|
||||
k_ELobbyComparisonLessThan = -1,
|
||||
k_ELobbyComparisonEqual = 0,
|
||||
k_ELobbyComparisonGreaterThan = 1,
|
||||
k_ELobbyComparisonEqualToOrGreaterThan = 2,
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to favorites
|
||||
// and to operate on game lobbies.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmaking
|
||||
{
|
||||
public:
|
||||
// game server favorites storage
|
||||
// saves basic details about a multiplayer game server locally
|
||||
|
||||
// returns the number of favorites servers the user has stored
|
||||
virtual int GetFavoriteGameCount() = 0;
|
||||
|
||||
// returns the details of the game server
|
||||
// iGame is of range [0,GetFavoriteGameCount())
|
||||
// *pnIP, *pnConnPort are filled in the with IP:port of the game server
|
||||
// *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections
|
||||
// *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added
|
||||
virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0;
|
||||
|
||||
// adds the game server to the local list; updates the time played of the server if it already exists in the list
|
||||
virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0;
|
||||
|
||||
// removes the game server from the local storage; returns true if one was removed
|
||||
virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0;
|
||||
|
||||
///////
|
||||
// Game lobby functions
|
||||
|
||||
// Get a list of relevant lobbies
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyMatchList_t callback & call result, with the number of lobbies found
|
||||
// this will never return lobbies that are full
|
||||
// to add more filter, the filter calls below need to be call before each and every RequestLobbyList() call
|
||||
// use the CCallResult<> object in steam_api.h to match the SteamAPICall_t call result to a function in an object, e.g.
|
||||
/*
|
||||
class CMyLobbyListManager
|
||||
{
|
||||
CCallResult<CMyLobbyListManager, LobbyMatchList_t> m_CallResultLobbyMatchList;
|
||||
void FindLobbies()
|
||||
{
|
||||
// SteamMatchmaking()->AddRequestLobbyListFilter*() functions would be called here, before RequestLobbyList()
|
||||
SteamAPICall_t hSteamAPICall = SteamMatchmaking()->RequestLobbyList();
|
||||
m_CallResultLobbyMatchList.Set( hSteamAPICall, this, &CMyLobbyListManager::OnLobbyMatchList );
|
||||
}
|
||||
|
||||
void OnLobbyMatchList( LobbyMatchList_t *pLobbyMatchList, bool bIOFailure )
|
||||
{
|
||||
// lobby list has be retrieved from Steam back-end, use results
|
||||
}
|
||||
}
|
||||
*/
|
||||
//
|
||||
virtual SteamAPICall_t RequestLobbyList() = 0;
|
||||
// filters for lobbies
|
||||
// this needs to be called before RequestLobbyList() to take effect
|
||||
// these are cleared on each call to RequestLobbyList()
|
||||
virtual void AddRequestLobbyListFilter( const char *pchKeyToMatch, const char *pchValueToMatch ) = 0;
|
||||
// numerical comparison
|
||||
virtual void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueToMatch, int nComparisonType ) = 0;
|
||||
// returns results closest to the specified value. Multiple near filters can be added, with early filters taking precedence
|
||||
virtual void AddRequestLobbyListNearValueFilter( const char *pchKeyToMatch, int nValueToBeCloseTo ) = 0;
|
||||
|
||||
// returns the CSteamID of a lobby, as retrieved by a RequestLobbyList call
|
||||
// should only be called after a LobbyMatchList_t callback is received
|
||||
// iLobby is of the range [0, LobbyMatchList_t::m_nLobbiesMatching)
|
||||
// the returned CSteamID::IsValid() will be false if iLobby is out of range
|
||||
virtual CSteamID GetLobbyByIndex( int iLobby ) = 0;
|
||||
|
||||
// Create a lobby on the Steam servers.
|
||||
// If private, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID
|
||||
// of the lobby will need to be communicated via game channels or via InviteUserToLobby()
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyCreated_t callback and call result; lobby is joined & ready to use at this pointer
|
||||
// a LobbyEnter_t callback will also be received (since the local user is joining their own lobby)
|
||||
virtual SteamAPICall_t CreateLobby( ELobbyType eLobbyType ) = 0;
|
||||
|
||||
// Joins an existing lobby
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyEnter_t callback & call result, check m_EChatRoomEnterResponse to see if was successful
|
||||
// lobby metadata is available to use immediately on this call completing
|
||||
virtual SteamAPICall_t JoinLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Leave a lobby; this will take effect immediately on the client side
|
||||
// other users in the lobby will be notified by a LobbyChatUpdate_t callback
|
||||
virtual void LeaveLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Invite another user to the lobby
|
||||
// the target user will receive a LobbyInvite_t callback
|
||||
// will return true if the invite is successfully sent, whether or not the target responds
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0;
|
||||
|
||||
// Lobby iteration, for viewing details of users in a lobby
|
||||
// only accessible if the lobby user is a member of the specified lobby
|
||||
// persona information for other lobby members (name, avatar, etc.) will be asynchronously received
|
||||
// and accessible via ISteamFriends interface
|
||||
|
||||
// returns the number of users in the specified lobby
|
||||
virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0;
|
||||
// returns the CSteamID of a user in the lobby
|
||||
// iMember is of range [0,GetNumLobbyMembers())
|
||||
virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0;
|
||||
|
||||
// Get data associated with this lobby
|
||||
// takes a simple key, and returns the string associated with it
|
||||
// "" will be returned if no value is set, or if steamIDLobby is invalid
|
||||
virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0;
|
||||
// Sets a key/value pair in the lobby metadata
|
||||
// each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data
|
||||
// this can be used to set lobby names, map, etc.
|
||||
// to reset a key, just set it to ""
|
||||
// other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback
|
||||
virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// As above, but gets per-user data for someone in this lobby
|
||||
virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0;
|
||||
// Sets per-user metadata (for the local user implicitly)
|
||||
virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// Broadcasts a chat message to the all the users in the lobby
|
||||
// users in the lobby (including the local user) will receive a LobbyChatMsg_t callback
|
||||
// returns true if the message is successfully sent
|
||||
// pvMsgBody can be binary or text data, up to 4k
|
||||
// if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator
|
||||
virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0;
|
||||
// Get a chat message as specified in a LobbyChatMsg_t callback
|
||||
// iChatID is the LobbyChatMsg_t::m_iChatID value in the callback
|
||||
// *pSteamIDUser is filled in with the CSteamID of the member
|
||||
// *pvData is filled in with the message itself
|
||||
// return value is the number of bytes written into the buffer
|
||||
virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0;
|
||||
|
||||
// Refreshes metadata for a lobby you're not necessarily in right now
|
||||
// you never do this for lobbies you're a member of, only if your
|
||||
// this will send down all the metadata associated with a lobby
|
||||
// this is an asynchronous call
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
// restart are returned by a LobbyDataUpdate_t callback
|
||||
virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// sets the game server associated with the lobby
|
||||
// usually at this point, the users will join the specified game server
|
||||
// either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect
|
||||
virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0;
|
||||
// returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist
|
||||
virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, CSteamID *psteamIDGameServer ) = 0;
|
||||
|
||||
// set the limit on the # of users who can join the lobby
|
||||
virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0;
|
||||
// returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined
|
||||
virtual int GetLobbyMemberLimit( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// updates which type of lobby it is
|
||||
// only lobbies that are k_ELobbyTypePublic will be returned by RequestLobbyList() calls
|
||||
virtual bool SetLobbyType( CSteamID steamIDLobby, ELobbyType eLobbyType ) = 0;
|
||||
|
||||
// returns the current lobby owner
|
||||
// you must be a member of the lobby to access this
|
||||
// there always one lobby owner - if the current owner leaves, another user will become the owner
|
||||
// it is possible (bur rare) to join a lobby just as the owner is leaving, thus entering a lobby with self as the owner
|
||||
virtual CSteamID GetLobbyOwner( CSteamID steamIDLobby ) = 0;
|
||||
};
|
||||
#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking006"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callback interfaces for server list functions (see ISteamMatchmakingServers below)
|
||||
//
|
||||
// The idea here is that your game code implements objects that implement these
|
||||
// interfaces to receive callback notifications after calling asynchronous functions
|
||||
// inside the ISteamMatchmakingServers() interface below.
|
||||
//
|
||||
// This is different than normal Steam callback handling due to the potentially
|
||||
// large size of server lists.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after a server list refresh
|
||||
// or an individual server update.
|
||||
//
|
||||
// Since you get these callbacks after requesting full list refreshes you will
|
||||
// usually implement this interface inside an object like CServerBrowser. If that
|
||||
// object is getting destructed you should use ISteamMatchMakingServers()->CancelQuery()
|
||||
// to cancel any in-progress queries so you don't get a callback into the destructed
|
||||
// object and crash.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServerListResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded ok with updated data
|
||||
virtual void ServerResponded( int iServer ) = 0;
|
||||
|
||||
// Server has failed to respond
|
||||
virtual void ServerFailedToRespond( int iServer ) = 0;
|
||||
|
||||
// A list refresh you had initiated is now 100% completed
|
||||
virtual void RefreshComplete( EMatchMakingServerResponse response ) = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after pinging an individual server
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PingServer() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPingResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded successfully and has updated data
|
||||
virtual void ServerResponded( gameserveritem_t &server ) = 0;
|
||||
|
||||
// Server failed to respond to the ping request
|
||||
virtual void ServerFailedToRespond() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting details on
|
||||
// who is playing on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPlayersResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a new player on the server -- you'll get this callback once per player
|
||||
// on the server which you have requested player data on.
|
||||
virtual void AddPlayerToList( const char *pchName, int nScore, float flTimePlayed ) = 0;
|
||||
|
||||
// The server failed to respond to the request for player details
|
||||
virtual void PlayersFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the player details request
|
||||
// (ie, you won't get anymore AddPlayerToList callbacks)
|
||||
virtual void PlayersRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting rules
|
||||
// details on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->ServerRules() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingRulesResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a rule on the server -- you'll get one of these per rule defined on
|
||||
// the server you are querying
|
||||
virtual void RulesResponded( const char *pchRule, const char *pchValue ) = 0;
|
||||
|
||||
// The server failed to respond to the request for rule details
|
||||
virtual void RulesFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the rule details request
|
||||
// (ie, you won't get anymore RulesResponded callbacks)
|
||||
virtual void RulesRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Typedef for handle type you will receive when querying details on an individual server.
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef int HServerQuery;
|
||||
const int HSERVERQUERY_INVALID = 0xffffffff;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to game lists and details
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServers
|
||||
{
|
||||
public:
|
||||
// Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values.
|
||||
virtual void RequestInternetServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFriendsServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFavoritesServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestHistoryServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestSpectatorServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
/* the filters that are available in the ppchFilters params are:
|
||||
|
||||
"map" - map the server is running, as set in the dedicated server api
|
||||
"dedicated" - reports bDedicated from the API
|
||||
"secure" - VAC-enabled
|
||||
"full" - not full
|
||||
"empty" - not empty
|
||||
"noplayers" - is empty
|
||||
"proxy" - a relay server
|
||||
|
||||
*/
|
||||
|
||||
// Get details on a given server in the list, you can get the valid range of index
|
||||
// values by calling GetServerCount(). You will also receive index values in
|
||||
// ISteamMatchmakingServerListResponse::ServerResponded() callbacks
|
||||
virtual gameserveritem_t *GetServerDetails( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
// Cancel an request which is operation on the given list type. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above list request calls. Not doing so may result in a crash when a callback
|
||||
// occurs on the destructed object.
|
||||
virtual void CancelQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Ping every server in your list again but don't update the list of servers
|
||||
virtual void RefreshQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Returns true if the list is currently refreshing its server list
|
||||
virtual bool IsRefreshing( EMatchMakingType eType ) = 0;
|
||||
|
||||
// How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1
|
||||
virtual int GetServerCount( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Refresh a single server inside of a query (rather than all the servers )
|
||||
virtual void RefreshServer( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Queries to individual servers directly via IP/Port
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Request updated ping time and other details from a single server
|
||||
virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of players currently playing on a server
|
||||
virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of rules that the server is running (See ISteamMasterServerUpdater->SetKeyValue() to set the rules server side)
|
||||
virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above calls to avoid crashing when callbacks occur.
|
||||
virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0;
|
||||
};
|
||||
#define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "SteamMatchMakingServers001"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unFavoriteFlagNone = 0x00;
|
||||
const uint32 k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list
|
||||
const uint32 k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Used in ChatInfo messages - fields specific to a chat member - must fit in a uint32
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatMemberStateChange
|
||||
{
|
||||
// Specific to joining / leaving the chatroom
|
||||
k_EChatMemberStateChangeEntered = 0x0001, // This user has joined or is joining the chat room
|
||||
k_EChatMemberStateChangeLeft = 0x0002, // This user has left or is leaving the chat room
|
||||
k_EChatMemberStateChangeDisconnected = 0x0004, // User disconnected without leaving the chat first
|
||||
k_EChatMemberStateChangeKicked = 0x0008, // User kicked
|
||||
k_EChatMemberStateChangeBanned = 0x0010, // User kicked and banned
|
||||
};
|
||||
|
||||
// returns true of the flags indicate that a user has been removed from the chat
|
||||
#define BChatMemberStateChangeRemoved( rgfChatMemberStateChangeFlags ) ( rgfChatMemberStateChangeFlags & ( k_EChatMemberStateChangeDisconnected | k_EChatMemberStateChangeLeft | k_EChatMemberStateChangeKicked | k_EChatMemberStateChangeBanned ) )
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: a server was added/removed from the favorites list, you should refresh now
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FavoritesListChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 2 };
|
||||
uint32 m_nIP; // an IP of 0 means reload the whole list, any other value means just one server
|
||||
uint32 m_nQueryPort;
|
||||
uint32 m_nConnPort;
|
||||
uint32 m_nAppID;
|
||||
uint32 m_nFlags;
|
||||
bool m_bAdd; // true if this is adding the entry, otherwise it is a remove
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Someone has invited you to join a Lobby
|
||||
// normally you don't need to do anything with this, since
|
||||
// the Steam UI will also display a '<user> has invited you to the lobby, join?' dialog
|
||||
// if the user outside a game chooses to join, your game will be launched with the parameter "+connect_lobby <64-bit lobby id>"
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyInvite_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 3 };
|
||||
|
||||
uint64 m_ulSteamIDUser; // Steam ID of the person making the invite
|
||||
uint64 m_ulSteamIDLobby; // Steam ID of the Lobby
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent on entering a lobby, or on failing to enter
|
||||
// m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success,
|
||||
// or a higher value on failure (see enum EChatRoomEnterResponse)
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyEnter_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // SteamID of the Lobby you have entered
|
||||
uint32 m_rgfChatPermissions; // Permissions of the current user
|
||||
bool m_bLocked; // If true, then only invited users may join
|
||||
uint32 m_EChatRoomEnterResponse; // EChatRoomEnterResponse
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby metadata has changed
|
||||
// if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details
|
||||
// if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyDataUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 5 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // steamID of the Lobby
|
||||
uint64 m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby chat room state has changed
|
||||
// this is usually sent when a user has joined or left the lobby
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 6 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // Lobby ID
|
||||
uint64 m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient
|
||||
uint64 m_ulSteamIDMakingChange; // Chat member who made the change (different from SteamIDUserChange if kicking, muting, etc.)
|
||||
// for example, if one user kicks another from the lobby, this will be set to the id of the user who initiated the kick
|
||||
uint32 m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A chat message for this lobby has been sent
|
||||
// use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatMsg_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 7 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby id this is in
|
||||
uint64 m_ulSteamIDUser; // steamID of the user who has sent this message
|
||||
uint8 m_eChatEntryType; // type of message
|
||||
uint32 m_iChatID; // index of the chat entry to lookup
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A game created a game for all the members of the lobby to join,
|
||||
// as triggered by a SetLobbyGameServer()
|
||||
// it's up to the individual clients to take action on this; the usual
|
||||
// game behavior is to leave the lobby and connect to the specified game server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyGameCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 9 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby we were in
|
||||
uint64 m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members
|
||||
uint32 m_unIP; // IP & Port of the game server (if any)
|
||||
uint16 m_usPort;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Number of matching lobbies found
|
||||
// iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyMatchList_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 10 };
|
||||
uint32 m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when the lobby is being forcefully closed
|
||||
// lobby details functions will no longer be updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyClosing_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 11 };
|
||||
uint64 m_ulSteamIDLobby; // Lobby
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when the local user has been kicked from the lobby
|
||||
// lobby details functions will no longer be updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyKicked_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 12 };
|
||||
uint64 m_ulSteamIDLobby; // Lobby
|
||||
uint64 m_ulSteamIDAdmin; // User who kicked you
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Result of our request to create a Lobby
|
||||
// m_eResult == k_EResultOK on success
|
||||
// at this point, the local user may not have finishing joining this lobby;
|
||||
// game code should wait until the subsequent LobbyEnter_t callback is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 };
|
||||
|
||||
EResult m_eResult; // k_EResultOK - the lobby was successfully created
|
||||
// k_EResultNoConnection - your Steam client doesn't have a connection to the back-end
|
||||
// k_EResultTimeout - you the message to the Steam servers, but it didn't respond
|
||||
// k_EResultFail - the server responded, but with an unknown internal error
|
||||
// k_EResultAccessDenied - your game isn't set to allow lobbies, or your client does haven't rights to play the game
|
||||
// k_EResultLimitExceeded - your game client has created too many lobbies
|
||||
|
||||
uint64 m_ulSteamIDLobby; // chat room, zero if failed
|
||||
};
|
||||
|
||||
|
||||
// used by now obsolete RequestFriendsLobbiesResponse_t
|
||||
// enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 };
|
||||
|
||||
|
||||
|
||||
#endif // ISTEAMMATCHMAKING
|
||||
147
res/steamworks/104/headers/isteamnetworking.h
Normal file
147
res/steamworks/104/headers/isteamnetworking.h
Normal file
@@ -0,0 +1,147 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing network connections between game clients & servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMNETWORKING
|
||||
#define ISTEAMNETWORKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a socket
|
||||
typedef uint32 SNetSocket_t;
|
||||
typedef uint32 SNetListenSocket_t;
|
||||
|
||||
|
||||
// connection progress indicators
|
||||
enum ESNetSocketState
|
||||
{
|
||||
k_ESNetSocketStateInvalid = 0,
|
||||
|
||||
// communication is valid
|
||||
k_ESNetSocketStateConnected = 1,
|
||||
|
||||
// states while establishing a connection
|
||||
k_ESNetSocketStateInitiated = 10, // the connection state machine has started
|
||||
|
||||
// p2p connections
|
||||
k_ESNetSocketStateLocalCandidatesFound = 11, // we've found our local IP info
|
||||
k_ESNetSocketStateReceivedRemoteCandidates = 12,// we've received information from the remote machine, via the Steam back-end, about their IP info
|
||||
|
||||
// direct connections
|
||||
k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server
|
||||
|
||||
// failure states
|
||||
k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end
|
||||
k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown
|
||||
k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection
|
||||
k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us
|
||||
k_ESNetSocketStateConnectionBroken = 25, // connection has been broken; either the other end has disappeared or our local network connection has broke
|
||||
|
||||
};
|
||||
|
||||
// describes how the socket is currently connected
|
||||
enum ESNetSocketConnectionType
|
||||
{
|
||||
k_ESNetSocketConnectionTypeNotConnected = 0,
|
||||
k_ESNetSocketConnectionTypeUDP = 1,
|
||||
k_ESNetSocketConnectionTypeUDPRelay = 2,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for making connections and sending data between clients,
|
||||
// traversing NAT's where possible
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamNetworking
|
||||
{
|
||||
public:
|
||||
// creates a socket and listens others to connect
|
||||
// will trigger a SocketStatusCallback_t callback on another client connecting
|
||||
// nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports
|
||||
// this can usually just be 0 unless you want multiple sets of connections
|
||||
// unIP is the local IP address to bind to
|
||||
// pass in 0 if you just want the default local IP
|
||||
// unPort is the port to use
|
||||
// pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only
|
||||
virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay ) = 0;
|
||||
|
||||
// creates a socket and begin connection to a remote destination
|
||||
// can connect via a known steamID (client or game server), or directly to an IP
|
||||
// on success will trigger a SocketStatusCallback_t callback
|
||||
// on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState
|
||||
virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay ) = 0;
|
||||
virtual SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec ) = 0;
|
||||
|
||||
// disconnects the connection to the socket, if any, and invalidates the handle
|
||||
// any unread data on the socket will be thrown away
|
||||
// if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect
|
||||
virtual bool DestroySocket( SNetSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
// destroying a listen socket will automatically kill all the regular sockets generated from it
|
||||
virtual bool DestroyListenSocket( SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
|
||||
// sending data
|
||||
// must be a handle to a connected socket
|
||||
// data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets
|
||||
// use the reliable flag with caution; although the resend rate is pretty aggressive,
|
||||
// it can still cause stalls in receiving data (like TCP)
|
||||
virtual bool SendDataOnSocket( SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable ) = 0;
|
||||
|
||||
// receiving data
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// checks for data from any socket that has been connected off this listen socket
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool IsDataAvailable( SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// retrieves data from any socket that has been connected off this listen socket
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// returns information about the specified socket, filling out the contents of the pointers
|
||||
virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote ) = 0;
|
||||
|
||||
// returns which local port the listen socket is bound to
|
||||
// *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only
|
||||
virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort ) = 0;
|
||||
|
||||
// returns true to describe how the socket ended up connecting
|
||||
virtual ESNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket ) = 0;
|
||||
|
||||
// max packet size, in bytes
|
||||
virtual int GetMaxPacketSize( SNetSocket_t hSocket ) = 0;
|
||||
};
|
||||
#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking002"
|
||||
|
||||
|
||||
// callback notification - status of a socket has changed
|
||||
struct SocketStatusCallback_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 };
|
||||
SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host
|
||||
SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection
|
||||
CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one
|
||||
int m_eSNetSocketState; // socket state, ESNetSocketState
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMNETWORKING
|
||||
45
res/steamworks/104/headers/isteamremotestorage.h
Normal file
45
res/steamworks/104/headers/isteamremotestorage.h
Normal file
@@ -0,0 +1,45 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: public interface to user remote file storage in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMREMOTESTORAGE_H
|
||||
#define ISTEAMREMOTESTORAGE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing, reading and writing files stored remotely
|
||||
// and cached locally
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamRemoteStorage
|
||||
{
|
||||
public:
|
||||
// NOTE
|
||||
//
|
||||
// Filenames are case-insensitive, and will be converted to lowercase automatically.
|
||||
// So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then
|
||||
// iterate the files, the filename returned will be "foo.bar".
|
||||
//
|
||||
|
||||
// file operations
|
||||
virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0;
|
||||
virtual int32 GetFileSize( const char *pchFile ) = 0;
|
||||
virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0;
|
||||
virtual bool FileExists( const char *pchFile ) = 0;
|
||||
|
||||
// iteration
|
||||
virtual int32 GetFileCount() = 0;
|
||||
virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0;
|
||||
|
||||
// quota management
|
||||
virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION002"
|
||||
|
||||
#endif // ISTEAMREMOTESTORAGE_H
|
||||
199
res/steamworks/104/headers/isteamuser.h
Normal file
199
res/steamworks/104/headers/isteamuser.h
Normal file
@@ -0,0 +1,199 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSER_H
|
||||
#define ISTEAMUSER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// structure that contains client callback data
|
||||
// see callbacks documentation for more details
|
||||
struct CallbackMsg_t
|
||||
{
|
||||
HSteamUser m_hSteamUser;
|
||||
int m_iCallback;
|
||||
uint8 *m_pubParam;
|
||||
int m_cubParam;
|
||||
};
|
||||
|
||||
// reference to a steam call, to filter results by
|
||||
typedef int32 HSteamCall;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing and manipulating a steam account
|
||||
// associated with one client instance
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUser
|
||||
{
|
||||
public:
|
||||
// returns the HSteamUser this interface represents
|
||||
// this is only used internally by the API, and by a few select interfaces that support multi-user
|
||||
virtual HSteamUser GetHSteamUser() = 0;
|
||||
|
||||
// returns true if the Steam client current has a live connection to the Steam servers.
|
||||
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
|
||||
// The Steam client will automatically be trying to recreate the connection as often as possible.
|
||||
virtual bool BLoggedOn() = 0;
|
||||
|
||||
// returns the CSteamID of the account currently logged into the Steam client
|
||||
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Multiplayer Authentication functions
|
||||
|
||||
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
|
||||
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
|
||||
//
|
||||
// Parameters:
|
||||
// void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.
|
||||
// int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
|
||||
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
|
||||
// CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )
|
||||
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
|
||||
// bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)
|
||||
//
|
||||
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
|
||||
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
|
||||
virtual int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
|
||||
|
||||
// notify of disconnect
|
||||
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
|
||||
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
|
||||
|
||||
// Legacy functions
|
||||
|
||||
// used by only a few games to track usage events
|
||||
virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
|
||||
|
||||
// get the local storage folder for current Steam account to write application data, e.g. save games, configs etc.
|
||||
// this will usually be something like "C:\Progam Files\Steam\userdata\<SteamID>\<AppID>\local"
|
||||
virtual bool GetUserDataFolder( char *pchBuffer, int cubBuffer ) = 0;
|
||||
|
||||
// Starts voice recording. Once started, use GetCompressedVoice() to get the data
|
||||
virtual void StartVoiceRecording( ) = 0;
|
||||
|
||||
// Stops voice recording. Because people often release push-to-talk keys early, the system will keep recording for
|
||||
// a little bit after this function is called. GetCompressedVoice() should continue to be called until it returns
|
||||
// k_eVoiceResultNotRecording
|
||||
virtual void StopVoiceRecording( ) = 0;
|
||||
|
||||
// Gets the latest voice data. It should be called as often as possible once recording has started.
|
||||
// nBytesWritten is set to the number of bytes written to pDestBuffer.
|
||||
virtual EVoiceResult GetCompressedVoice( void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten ) = 0;
|
||||
|
||||
// Decompresses a chunk of data produced by GetCompressedVoice(). nBytesWritten is set to the
|
||||
// number of bytes written to pDestBuffer. The output format of the data is 16-bit signed at
|
||||
// 11025 samples per second.
|
||||
virtual EVoiceResult DecompressVoice( void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten ) = 0;
|
||||
|
||||
// Retrieve ticket to be sent to the entity who wishes to authenticate you.
|
||||
// pcbTicket retrieves the length of the actual ticket.
|
||||
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
|
||||
|
||||
// Authenticate ticket from entity steamID to be sure it is valid and isnt reused
|
||||
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
|
||||
virtual EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID ) = 0;
|
||||
|
||||
// Stop tracking started by BeginAuthSession - called when no longer playing game with this entity
|
||||
virtual void EndAuthSession( CSteamID steamID ) = 0;
|
||||
|
||||
// Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to
|
||||
virtual void CancelAuthTicket( HAuthTicket hAuthTicket ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser012"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connections to the Steam back-end has been established
|
||||
// this means the Steam client now has a working connection to the Steam servers
|
||||
// usually this will have occurred before the game has launched, and should
|
||||
// only be seen if the user has dropped connection due to a networking issue
|
||||
// or a Steam server update
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersConnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 1 };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connection attempt has failed
|
||||
// this will occur periodically if the Steam client is not connected,
|
||||
// and has failed in it's retry to establish a connection
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServerConnectFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 2 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called if the client has lost connection to the Steam servers
|
||||
// real-time services will be disabled until a matching SteamServersConnected_t has been posted
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersDisconnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 3 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server,
|
||||
// which it may be in the process of or already connected to.
|
||||
// The game client should immediately disconnect upon receiving this message.
|
||||
// This can usually occur if the user doesn't have rights to play on the game server.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ClientGameServerDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 13 };
|
||||
|
||||
uint32 m_uAppID;
|
||||
uint32 m_unGameServerIP;
|
||||
uint16 m_usGameServerPort;
|
||||
uint16 m_bSecure;
|
||||
uint32 m_uReason;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks)
|
||||
// When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect.
|
||||
// This usually occurs in the rare event the Steam client has some kind of fatal error.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct IPCFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 17 };
|
||||
enum EFailureType
|
||||
{
|
||||
k_EFailureFlushedCallbackQueue,
|
||||
k_EFailurePipeFail,
|
||||
};
|
||||
uint8 m_eFailureType;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for BeginAuthSession
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ValidateAuthTicketResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 43 };
|
||||
CSteamID m_SteamID;
|
||||
EAuthSessionResponse m_eAuthSessionResponse;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
260
res/steamworks/104/headers/isteamuserstats.h
Normal file
260
res/steamworks/104/headers/isteamuserstats.h
Normal file
@@ -0,0 +1,260 @@
|
||||
//====== Copyright <20> 1996-2009, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to stats, achievements, and leaderboards
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSERSTATS_H
|
||||
#define ISTEAMUSERSTATS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// size limit on stat or achievement name (UTF-8 encoded)
|
||||
enum { k_cchStatNameMax = 128 };
|
||||
|
||||
// maximum number of bytes for a leaderboard name (UTF-8 encoded)
|
||||
enum { k_cchLeaderboardNameMax = 128 };
|
||||
|
||||
// maximum number of details int32's storable for a single leaderboard entry
|
||||
enum { k_cLeaderboardDetailsMax = 64 };
|
||||
|
||||
// handle to a single leaderboard
|
||||
typedef uint64 SteamLeaderboard_t;
|
||||
|
||||
// handle to a set of downloaded entries in a leaderboard
|
||||
typedef uint64 SteamLeaderboardEntries_t;
|
||||
|
||||
// type of data request, when downloading leaderboard entries
|
||||
enum ELeaderboardDataRequest
|
||||
{
|
||||
k_ELeaderboardDataRequestGlobal = 0,
|
||||
k_ELeaderboardDataRequestGlobalAroundUser = 1,
|
||||
k_ELeaderboardDataRequestFriends = 2,
|
||||
};
|
||||
|
||||
// the sort order of a leaderboard
|
||||
enum ELeaderboardSortMethod
|
||||
{
|
||||
k_ELeaderboardSortMethodNone = 0,
|
||||
k_ELeaderboardSortMethodAscending = 1, // top-score is lowest number
|
||||
k_ELeaderboardSortMethodDescending = 2, // top-score is highest number
|
||||
};
|
||||
|
||||
// the display type (used by the Steam Community web site) for a leaderboard
|
||||
enum ELeaderboardDisplayType
|
||||
{
|
||||
k_ELeaderboardDisplayTypeNone = 0,
|
||||
k_ELeaderboardDisplayTypeNumeric = 1, // simple numerical score
|
||||
k_ELeaderboardDisplayTypeTimeSeconds = 2, // the score represents a time, in seconds
|
||||
k_ELeaderboardDisplayTypeTimeMilliSeconds = 3, // the score represents a time, in milliseconds
|
||||
};
|
||||
|
||||
// a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry()
|
||||
struct LeaderboardEntry_t
|
||||
{
|
||||
CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info
|
||||
int32 m_nGlobalRank; // [1..N], where N is the number of users with an entry in the leaderboard
|
||||
int32 m_nScore; // score as set in the leaderboard
|
||||
int32 m_cDetails; // number of int32 details available for this entry
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing stats, achievements, and leaderboard information
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUserStats
|
||||
{
|
||||
public:
|
||||
// Ask the server to send down this user's data and achievements for this game
|
||||
virtual bool RequestCurrentStats() = 0;
|
||||
|
||||
// Data accessors
|
||||
virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetStat( const char *pchName, float *pData ) = 0;
|
||||
|
||||
// Set / update data
|
||||
virtual bool SetStat( const char *pchName, int32 nData ) = 0;
|
||||
virtual bool SetStat( const char *pchName, float fData ) = 0;
|
||||
virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||
|
||||
// Achievement flag accessors
|
||||
virtual bool GetAchievement( const char *pchName, bool *pbAchieved ) = 0;
|
||||
virtual bool SetAchievement( const char *pchName ) = 0;
|
||||
virtual bool ClearAchievement( const char *pchName ) = 0;
|
||||
|
||||
// Store the current data on the server, will get a callback when set
|
||||
// And one callback for every new achievement
|
||||
virtual bool StoreStats() = 0;
|
||||
|
||||
// Achievement / GroupAchievement metadata
|
||||
|
||||
// Gets the icon of the achievement, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetAchievementIcon( const char *pchName ) = 0;
|
||||
// Get general attributes (display name / text, etc) for an Achievement
|
||||
virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0;
|
||||
|
||||
// Achievement progress - triggers an AchievementProgress callback, that is all.
|
||||
// Calling this w/ N out of N progress will NOT set the achievement, the game must still do that.
|
||||
virtual bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint32 nMaxProgress ) = 0;
|
||||
|
||||
// Friends stats & achievements
|
||||
|
||||
// downloads stats for the user
|
||||
// returns a UserStatsReceived_t received when completed
|
||||
// if the other user has no stats, UserStatsReceived_t.m_eResult will be set to k_EResultFail
|
||||
// these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data
|
||||
virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// requests stat information for a user, usable after a successful call to RequestUserStats()
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
|
||||
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
|
||||
|
||||
// Reset stats
|
||||
virtual bool ResetAllStats( bool bAchievementsToo ) = 0;
|
||||
|
||||
// Leaderboard functions
|
||||
|
||||
// asks the Steam back-end for a leaderboard by name, and will create it if it's not yet
|
||||
// This call is asynchronous, with the result returned in LeaderboardFindResult_t
|
||||
virtual SteamAPICall_t FindOrCreateLeaderboard( const char *pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ) = 0;
|
||||
|
||||
// as above, but won't create the leaderboard if it's not found
|
||||
// This call is asynchronous, with the result returned in LeaderboardFindResult_t
|
||||
virtual SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName ) = 0;
|
||||
|
||||
// returns the name of a leaderboard
|
||||
virtual const char *GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// returns the total number of entries in a leaderboard, as of the last request
|
||||
virtual int GetLeaderboardEntryCount( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// returns the sort method of the leaderboard
|
||||
virtual ELeaderboardSortMethod GetLeaderboardSortMethod( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// returns the display type of the leaderboard
|
||||
virtual ELeaderboardDisplayType GetLeaderboardDisplayType( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// Asks the Steam back-end for a set of rows in the leaderboard.
|
||||
// This call is asynchronous, with the result returned in LeaderboardScoresDownloaded_t
|
||||
// LeaderboardScoresDownloaded_t will contain a handle to pull the results from GetDownloadedLeaderboardEntries() (below)
|
||||
// You can ask for more entries than exist, and it will return as many as do exist.
|
||||
// k_ELeaderboardDataRequestGlobal requests rows in the leaderboard from the full table, with nRangeStart & nRangeEnd in the range [1, TotalEntries]
|
||||
// k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user, nRangeStart being negate
|
||||
// e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after
|
||||
// k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user
|
||||
virtual SteamAPICall_t DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) = 0;
|
||||
|
||||
// Returns data about a single leaderboard entry
|
||||
// use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries
|
||||
// e.g.
|
||||
// void OnLeaderboardScoresDownloaded( LeaderboardScoresDownloaded_t *pLeaderboardScoresDownloaded )
|
||||
// {
|
||||
// for ( int index = 0; index < pLeaderboardScoresDownloaded->m_cEntryCount; index++ )
|
||||
// {
|
||||
// LeaderboardEntry_t leaderboardEntry;
|
||||
// int32 details[3]; // we know this is how many we've stored previously
|
||||
// GetDownloadedLeaderboardEntry( pLeaderboardScoresDownloaded->m_hSteamLeaderboardEntries, index, &leaderboardEntry, details, 3 );
|
||||
// assert( leaderboardEntry.m_cDetails == 3 );
|
||||
// ...
|
||||
// }
|
||||
// once you've accessed all the entries, the data will be free'd, and the SteamLeaderboardEntries_t handle will become invalid
|
||||
virtual bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, LeaderboardEntry_t *pLeaderboardEntry, int32 *pDetails, int cDetailsMax ) = 0;
|
||||
|
||||
// Uploads a user score to the Steam back-end.
|
||||
// This call is asynchronous, with the result returned in LeaderboardScoreUploaded_t
|
||||
// If the score passed in is no better than the existing score this user has in the leaderboard, then the leaderboard will not be updated.
|
||||
// Details are extra game-defined information regarding how the user got that score
|
||||
// pScoreDetails points to an array of int32's, cScoreDetailsCount is the number of int32's in the list
|
||||
virtual SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, int32 nScore, int32 *pScoreDetails, int cScoreDetailsCount ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION005"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the latests stats and achievements have been received
|
||||
// from the server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsReceived_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // Success / error fetching the stats
|
||||
CSteamID m_steamIDUser; // The user for whom the stats are retrieved for
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the user stats for a game
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // success / error
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the achievements for a game, or an
|
||||
// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress
|
||||
// are zero, that means the achievement has been fully unlocked.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserAchievementStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 };
|
||||
|
||||
uint64 m_nGameID; // Game this is for
|
||||
bool m_bGroupAchievement; // if this is a "group" achievement
|
||||
char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement
|
||||
uint32 m_nCurProgress; // current progress towards the achievement
|
||||
uint32 m_nMaxProgress; // "out of" this many
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: call result for finding a leaderboard, returned as a result of FindOrCreateLeaderboard() or FindLeaderboard()
|
||||
// use CCallResult<> to map this async result to a member function
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LeaderboardFindResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 4 };
|
||||
SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard serarched for, 0 if no leaderboard found
|
||||
uint8 m_bLeaderboardFound; // 0 if no leaderboard found
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: call result indicating scores for a leaderboard have been downloaded and are ready to be retrieved, returned as a result of DownloadLeaderboardEntries()
|
||||
// use CCallResult<> to map this async result to a member function
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LeaderboardScoresDownloaded_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 5 };
|
||||
SteamLeaderboard_t m_hSteamLeaderboard;
|
||||
SteamLeaderboardEntries_t m_hSteamLeaderboardEntries; // the handle to pass into GetDownloadedLeaderboardEntries()
|
||||
int m_cEntryCount; // the number of entries downloaded
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: call result indicating scores has been uploaded, returned as a result of UploadLeaderboardScore()
|
||||
// use CCallResult<> to map this async result to a member function
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LeaderboardScoreUploaded_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 6 };
|
||||
uint8 m_bSuccess; // 1 if the call was successful
|
||||
SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was
|
||||
int32 m_nScore; // the score that was attempted to set
|
||||
uint8 m_bScoreChanged; // true if the score in the leaderboard change, false if the existing score was better
|
||||
int m_nGlobalRankNew; // the new global rank of the user in this leaderboard
|
||||
int m_nGlobalRankPrevious; // the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
146
res/steamworks/104/headers/isteamutils.h
Normal file
146
res/steamworks/104/headers/isteamutils.h
Normal file
@@ -0,0 +1,146 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to utility functions in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUTILS_H
|
||||
#define ISTEAMUTILS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
|
||||
// Steam API call failure results
|
||||
enum ESteamAPICallFailure
|
||||
{
|
||||
k_ESteamAPICallFailureNone = -1, // no failure
|
||||
k_ESteamAPICallFailureSteamGone = 0, // the local Steam process has gone away
|
||||
k_ESteamAPICallFailureNetworkFailure = 1, // the network connection to Steam has been broken, or was already broken
|
||||
// SteamServersDisconnected_t callback will be sent around the same time
|
||||
// SteamServersConnected_t will be sent when the client is able to talk to the Steam servers again
|
||||
k_ESteamAPICallFailureInvalidHandle = 2, // the SteamAPICall_t handle passed in no longer exists
|
||||
k_ESteamAPICallFailureMismatchedCallback = 3,// GetAPICallResult() was called with the wrong callback type for this API call
|
||||
};
|
||||
|
||||
// function prototype for warning message hook
|
||||
#if defined( POSIX ) && !defined( _CYGWIN )
|
||||
#define __cdecl
|
||||
#endif
|
||||
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to user independent utility functions
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUtils
|
||||
{
|
||||
public:
|
||||
// return the number of seconds since the user
|
||||
virtual uint32 GetSecondsSinceAppActive() = 0;
|
||||
virtual uint32 GetSecondsSinceComputerActive() = 0;
|
||||
|
||||
// the universe this client is connecting to
|
||||
virtual EUniverse GetConnectedUniverse() = 0;
|
||||
|
||||
// Steam server time - in PST, number of seconds since January 1, 1970 (i.e unix time)
|
||||
virtual uint32 GetServerRealTime() = 0;
|
||||
|
||||
// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
|
||||
// e.g "US" or "UK".
|
||||
virtual const char *GetIPCountry() = 0;
|
||||
|
||||
// returns true if the image exists, and valid sizes were filled out
|
||||
virtual bool GetImageSize( int iImage, uint32 *pnWidth, uint32 *pnHeight ) = 0;
|
||||
|
||||
// returns true if the image exists, and the buffer was successfully filled out
|
||||
// results are returned in RGBA format
|
||||
// the destination buffer size should be 4 * height * width * sizeof(char)
|
||||
virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0;
|
||||
|
||||
// returns the IP of the reporting server for valve - currently only used in Source engine games
|
||||
virtual bool GetCSERIPPort( uint32 *unIP, uint16 *usPort ) = 0;
|
||||
|
||||
// return the amount of battery power left in the current system in % [0..100], 255 for being on AC power
|
||||
virtual uint8 GetCurrentBatteryPower() = 0;
|
||||
|
||||
// returns the appID of the current process
|
||||
virtual uint32 GetAppID() = 0;
|
||||
|
||||
// Sets the position where the overlay instance for the currently calling game should show notifications.
|
||||
// This position is per-game and if this function is called from outside of a game context it will do nothing.
|
||||
virtual void SetOverlayNotificationPosition( ENotificationPosition eNotificationPosition ) = 0;
|
||||
|
||||
// API asynchronous call results
|
||||
// can be used directly, but more commonly used via the callback dispatch API (see steam_api.h)
|
||||
virtual bool IsAPICallCompleted( SteamAPICall_t hSteamAPICall, bool *pbFailed ) = 0;
|
||||
virtual ESteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICall ) = 0;
|
||||
virtual bool GetAPICallResult( SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed ) = 0;
|
||||
|
||||
// this needs to be called every frame to process matchmaking results
|
||||
// redundant if you're already calling SteamAPI_RunCallbacks()
|
||||
virtual void RunFrame() = 0;
|
||||
|
||||
// returns the number of IPC calls made since the last time this function was called
|
||||
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
||||
// Every IPC call is at minimum a thread context switch if not a process one so you want to rate
|
||||
// control how often you do them.
|
||||
virtual uint32 GetIPCCallCount() = 0;
|
||||
|
||||
// API warning handling
|
||||
// 'int' is the severity; 0 for msg, 1 for warning
|
||||
// 'const char *' is the text of the message
|
||||
// callbacks will occur directly after the API function is called that generated the warning or message
|
||||
virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
|
||||
|
||||
// Returns true if the overlay is running & the user can access it. The overlay process could take a few seconds to
|
||||
// start & hook the game process, so this function will initially return false while the overlay is loading.
|
||||
virtual bool IsOverlayEnabled() = 0;
|
||||
};
|
||||
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils004"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The country of the user changed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct IPCountry_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 1 };
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LowBatteryPower_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 2 };
|
||||
uint8 m_nMinutesBatteryLeft;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a SteamAsyncCall_t has completed (or failed)
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamAPICallCompleted_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 3 };
|
||||
SteamAPICall_t m_hAsyncCall;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// called when Steam wants to shutdown
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamShutdown_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 4 };
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMUTILS_H
|
||||
241
res/steamworks/104/headers/matchmakingtypes.h
Normal file
241
res/steamworks/104/headers/matchmakingtypes.h
Normal file
@@ -0,0 +1,241 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef MATCHMAKINGTYPES_H
|
||||
#define MATCHMAKINGTYPES_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef POSIX
|
||||
#ifndef _snprintf
|
||||
#define _snprintf snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
struct MatchMakingKeyValuePair_t
|
||||
{
|
||||
MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; }
|
||||
MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue )
|
||||
{
|
||||
strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only!
|
||||
strncpy( m_szValue, pchValue, sizeof(m_szValue) );
|
||||
}
|
||||
char m_szKey[ 256 ];
|
||||
char m_szValue[ 256 ];
|
||||
};
|
||||
|
||||
|
||||
enum EMatchMakingServerResponse
|
||||
{
|
||||
eServerResponded = 0,
|
||||
eServerFailedToRespond,
|
||||
eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match
|
||||
};
|
||||
|
||||
enum EMatchMakingType
|
||||
{
|
||||
eInternetServer = 0,
|
||||
eLANServer,
|
||||
eFriendsServer,
|
||||
eFavoritesServer,
|
||||
eHistoryServer,
|
||||
eSpectatorServer,
|
||||
eInvalidServer
|
||||
};
|
||||
|
||||
|
||||
// servernetadr_t is all the addressing info the serverbrowser needs to know about a game server,
|
||||
// namely: its IP, its connection port, and its query port.
|
||||
class servernetadr_t
|
||||
{
|
||||
public:
|
||||
|
||||
void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort );
|
||||
#ifdef NETADR_H
|
||||
void Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort );
|
||||
netadr_t& GetIPAndQueryPort();
|
||||
#endif
|
||||
|
||||
// Access the query port.
|
||||
uint16 GetQueryPort() const;
|
||||
void SetQueryPort( uint16 usPort );
|
||||
|
||||
// Access the connection port.
|
||||
uint16 GetConnectionPort() const;
|
||||
void SetConnectionPort( uint16 usPort );
|
||||
|
||||
// Access the IP
|
||||
uint32 GetIP() const;
|
||||
void SetIP( uint32 );
|
||||
|
||||
// This gets the 'a.b.c.d:port' string with the connection port (instead of the query port).
|
||||
const char *GetConnectionAddressString() const;
|
||||
const char *GetQueryAddressString() const;
|
||||
|
||||
// Comparison operators and functions.
|
||||
bool operator<(const servernetadr_t &netadr) const;
|
||||
void operator=( const servernetadr_t &that )
|
||||
{
|
||||
m_usConnectionPort = that.m_usConnectionPort;
|
||||
m_usQueryPort = that.m_usQueryPort;
|
||||
m_unIP = that.m_unIP;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
const char *ToString( uint32 unIP, uint16 usPort ) const;
|
||||
uint16 m_usConnectionPort; // (in HOST byte order)
|
||||
uint16 m_usQueryPort;
|
||||
uint32 m_unIP;
|
||||
};
|
||||
|
||||
|
||||
inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
m_unIP = ip;
|
||||
m_usQueryPort = usQueryPort;
|
||||
m_usConnectionPort = usConnectionPort;
|
||||
}
|
||||
|
||||
#ifdef NETADR_H
|
||||
inline void servernetadr_t::Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
Init( ipAndQueryPort.GetIP(), ipAndQueryPort.GetPort(), usConnectionPort );
|
||||
}
|
||||
|
||||
inline netadr_t& servernetadr_t::GetIPAndQueryPort()
|
||||
{
|
||||
static netadr_t netAdr;
|
||||
netAdr.SetIP( m_unIP );
|
||||
netAdr.SetPort( m_usQueryPort );
|
||||
return netAdr;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline uint16 servernetadr_t::GetQueryPort() const
|
||||
{
|
||||
return m_usQueryPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetQueryPort( uint16 usPort )
|
||||
{
|
||||
m_usQueryPort = usPort;
|
||||
}
|
||||
|
||||
inline uint16 servernetadr_t::GetConnectionPort() const
|
||||
{
|
||||
return m_usConnectionPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetConnectionPort( uint16 usPort )
|
||||
{
|
||||
m_usConnectionPort = usPort;
|
||||
}
|
||||
|
||||
inline uint32 servernetadr_t::GetIP() const
|
||||
{
|
||||
return m_unIP;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetIP( uint32 unIP )
|
||||
{
|
||||
m_unIP = unIP;
|
||||
}
|
||||
|
||||
inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const
|
||||
{
|
||||
static char s[4][64];
|
||||
static int nBuf = 0;
|
||||
unsigned char *ipByte = (unsigned char *)&unIP;
|
||||
_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
|
||||
const char *pchRet = s[nBuf];
|
||||
++nBuf;
|
||||
nBuf %= ( (sizeof(s)/sizeof(s[0])) );
|
||||
return pchRet;
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetConnectionAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usConnectionPort );
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetQueryAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usQueryPort );
|
||||
}
|
||||
|
||||
inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const
|
||||
{
|
||||
return ( m_unIP < netadr.m_unIP ) || ( m_unIP == netadr.m_unIP && m_usQueryPort < netadr.m_usQueryPort );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Data describing a single server
|
||||
//-----------------------------------------------------------------------------
|
||||
class gameserveritem_t
|
||||
{
|
||||
public:
|
||||
gameserveritem_t();
|
||||
|
||||
const char* GetName() const;
|
||||
void SetName( const char *pName );
|
||||
|
||||
public:
|
||||
servernetadr_t m_NetAdr; // IP/Query Port/Connection Port for this server
|
||||
int m_nPing; // current ping time in milliseconds
|
||||
bool m_bHadSuccessfulResponse; // server has responded successfully in the past
|
||||
bool m_bDoNotRefresh; // server is marked as not responding and should no longer be refreshed
|
||||
char m_szGameDir[32]; // current game directory
|
||||
char m_szMap[32]; // current map
|
||||
char m_szGameDescription[64]; // game description
|
||||
int m_nAppID; // Steam App ID of this server
|
||||
int m_nPlayers; // current number of players on the server
|
||||
int m_nMaxPlayers; // Maximum players that can join this server
|
||||
int m_nBotPlayers; // Number of bots (i.e simulated players) on this server
|
||||
bool m_bPassword; // true if this server needs a password to join
|
||||
bool m_bSecure; // Is this server protected by VAC
|
||||
uint32 m_ulTimeLastPlayed; // time (in unix time) when this server was last played on (for favorite/history servers)
|
||||
int m_nServerVersion; // server version as reported to Steam
|
||||
|
||||
private:
|
||||
char m_szServerName[64]; // Game server name
|
||||
|
||||
// For data added after SteamMatchMaking001 add it here
|
||||
public:
|
||||
char m_szGameTags[128]; // the tags this server exposes
|
||||
};
|
||||
|
||||
|
||||
inline gameserveritem_t::gameserveritem_t()
|
||||
{
|
||||
m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0;
|
||||
m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false;
|
||||
m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0;
|
||||
m_szGameTags[0] = 0;
|
||||
}
|
||||
|
||||
inline const char* gameserveritem_t::GetName() const
|
||||
{
|
||||
// Use the IP address as the name if nothing is set yet.
|
||||
if ( m_szServerName[0] == 0 )
|
||||
return m_NetAdr.GetConnectionAddressString();
|
||||
else
|
||||
return m_szServerName;
|
||||
}
|
||||
|
||||
inline void gameserveritem_t::SetName( const char *pName )
|
||||
{
|
||||
strncpy( m_szServerName, pName, sizeof( m_szServerName ) );
|
||||
}
|
||||
|
||||
|
||||
#endif // MATCHMAKINGTYPES_H
|
||||
421
res/steamworks/104/headers/steam_api.h
Normal file
421
res/steamworks/104/headers/steam_api.h
Normal file
@@ -0,0 +1,421 @@
|
||||
//====== Copyright 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_API_H
|
||||
#define STEAM_API_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "isteamuser.h"
|
||||
#include "isteamfriends.h"
|
||||
#include "isteamutils.h"
|
||||
#include "isteammatchmaking.h"
|
||||
#include "isteamuserstats.h"
|
||||
#include "isteamapps.h"
|
||||
#include "isteamnetworking.h"
|
||||
#include "isteamremotestorage.h"
|
||||
|
||||
// Steam API export macro
|
||||
#if defined( _WIN32 ) && !defined( _X360 )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __declspec( dllexport )
|
||||
#elif defined( STEAM_API_NODLL )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C" __declspec( dllimport )
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#elif defined( GNUC )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#else // !WIN32
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// Steam API setup & shutdown
|
||||
//
|
||||
// These functions manage loading, initializing and shutdown of the steamclient.dll
|
||||
//
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// S_API void SteamAPI_Init(); (see below)
|
||||
S_API void SteamAPI_Shutdown();
|
||||
|
||||
// crash dump recording functions
|
||||
S_API void SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID );
|
||||
S_API void SteamAPI_SetMiniDumpComment( const char *pchMsg );
|
||||
|
||||
// interface pointers, configured by SteamAPI_Init()
|
||||
S_API ISteamClient *SteamClient();
|
||||
|
||||
|
||||
//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES is usually not necessary, but it provides safety against releasing
|
||||
// new steam_api.dll's without recompiling/rereleasing modules that use it.
|
||||
//
|
||||
// If you use VERSION_SAFE_STEAM_API_INTERFACES, then you should call SteamAPI_InitSafe(). Also, to get the
|
||||
// Steam interfaces, you must create and Init() a CSteamAPIContext (below) and use the interfaces in there.
|
||||
//
|
||||
// If you don't use VERSION_SAFE_STEAM_API_INTERFACES, then you can use SteamAPI_Init() and the SteamXXXX()
|
||||
// functions below to get at the Steam interfaces.
|
||||
//
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamAPI_InitSafe();
|
||||
#else
|
||||
S_API bool SteamAPI_Init();
|
||||
|
||||
S_API ISteamUser *SteamUser();
|
||||
S_API ISteamFriends *SteamFriends();
|
||||
S_API ISteamUtils *SteamUtils();
|
||||
S_API ISteamMatchmaking *SteamMatchmaking();
|
||||
S_API ISteamUserStats *SteamUserStats();
|
||||
S_API ISteamApps *SteamApps();
|
||||
S_API ISteamNetworking *SteamNetworking();
|
||||
S_API ISteamMatchmakingServers *SteamMatchmakingServers();
|
||||
S_API ISteamRemoteStorage *SteamRemoteStorage();
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steam callback helper functions
|
||||
//
|
||||
// The following classes/macros are used to be able to easily multiplex callbacks
|
||||
// from the Steam API into various objects in the app in a thread-safe manner
|
||||
//
|
||||
// These functors are triggered via the SteamAPI_RunCallbacks() function, mapping the callback
|
||||
// to as many functions/objects as are registered to it
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API void SteamAPI_RunCallbacks();
|
||||
|
||||
|
||||
|
||||
// functions used by the utility CCallback objects to receive callbacks
|
||||
S_API void SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback );
|
||||
S_API void SteamAPI_UnregisterCallback( class CCallbackBase *pCallback );
|
||||
// functions used by the utility CCallResult objects to receive async call results
|
||||
S_API void SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
|
||||
S_API void SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: base for callbacks,
|
||||
// used only by CCallback, shouldn't be used directly
|
||||
//-----------------------------------------------------------------------------
|
||||
class CCallbackBase
|
||||
{
|
||||
public:
|
||||
CCallbackBase() { m_nCallbackFlags = 0; m_iCallback = 0; }
|
||||
// don't add a virtual destructor because we export this binary interface across dll's
|
||||
virtual void Run( void *pvParam ) = 0;
|
||||
virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) = 0;
|
||||
int GetICallback() { return m_iCallback; }
|
||||
virtual int GetCallbackSizeBytes() = 0;
|
||||
|
||||
protected:
|
||||
enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 };
|
||||
uint8 m_nCallbackFlags;
|
||||
int m_iCallback;
|
||||
friend class CCallbackMgr;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: maps a steam async call result to a class member function
|
||||
// template params: T = local class, P = parameter struct
|
||||
//-----------------------------------------------------------------------------
|
||||
template< class T, class P >
|
||||
class CCallResult : private CCallbackBase
|
||||
{
|
||||
public:
|
||||
typedef void (T::*func_t)( P*, bool );
|
||||
|
||||
CCallResult()
|
||||
{
|
||||
m_hAPICall = 0;
|
||||
m_pObj = NULL;
|
||||
m_Func = NULL;
|
||||
m_iCallback = P::k_iCallback;
|
||||
}
|
||||
|
||||
void Set( SteamAPICall_t hAPICall, T *p, func_t func )
|
||||
{
|
||||
if ( m_hAPICall )
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
|
||||
m_hAPICall = hAPICall;
|
||||
m_pObj = p;
|
||||
m_Func = func;
|
||||
|
||||
if ( hAPICall )
|
||||
SteamAPI_RegisterCallResult( this, hAPICall );
|
||||
}
|
||||
|
||||
bool IsActive()
|
||||
{
|
||||
return ( m_hAPICall != 0 );
|
||||
}
|
||||
|
||||
void Cancel()
|
||||
{
|
||||
m_hAPICall = 0;
|
||||
}
|
||||
|
||||
~CCallResult()
|
||||
{
|
||||
if ( m_hAPICall )
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
m_hAPICall = 0;
|
||||
(m_pObj->*m_Func)( (P *)pvParam, false );
|
||||
}
|
||||
void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall )
|
||||
{
|
||||
if ( hSteamAPICall == m_hAPICall )
|
||||
{
|
||||
m_hAPICall = 0;
|
||||
(m_pObj->*m_Func)( (P *)pvParam, bIOFailure );
|
||||
}
|
||||
}
|
||||
int GetCallbackSizeBytes()
|
||||
{
|
||||
return sizeof( P );
|
||||
}
|
||||
|
||||
SteamAPICall_t m_hAPICall;
|
||||
T *m_pObj;
|
||||
func_t m_Func;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: maps a steam callback to a class member function
|
||||
// template params: T = local class, P = parameter struct
|
||||
//-----------------------------------------------------------------------------
|
||||
template< class T, class P, bool bGameServer >
|
||||
class CCallback : private CCallbackBase
|
||||
{
|
||||
public:
|
||||
typedef void (T::*func_t)( P* );
|
||||
|
||||
// If you can't support constructing a callback with the correct parameters
|
||||
// then uncomment the empty constructor below and manually call
|
||||
// ::Register() for your object
|
||||
// Or, just call the regular constructor with (NULL, NULL)
|
||||
// CCallback() {}
|
||||
|
||||
// constructor for initializing this object in owner's constructor
|
||||
CCallback( T *pObj, func_t func ) : m_pObj( pObj ), m_Func( func )
|
||||
{
|
||||
if ( pObj && func )
|
||||
Register( pObj, func );
|
||||
}
|
||||
|
||||
~CCallback()
|
||||
{
|
||||
Unregister();
|
||||
}
|
||||
|
||||
// manual registration of the callback
|
||||
void Register( T *pObj, func_t func )
|
||||
{
|
||||
if ( m_nCallbackFlags & k_ECallbackFlagsRegistered )
|
||||
Unregister();
|
||||
|
||||
if ( bGameServer )
|
||||
{
|
||||
m_nCallbackFlags |= k_ECallbackFlagsGameServer;
|
||||
}
|
||||
m_pObj = pObj;
|
||||
m_Func = func;
|
||||
SteamAPI_RegisterCallback( this, P::k_iCallback );
|
||||
}
|
||||
|
||||
void Unregister()
|
||||
{
|
||||
SteamAPI_UnregisterCallback( this );
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
virtual void Run( void *pvParam, bool, SteamAPICall_t )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
int GetCallbackSizeBytes()
|
||||
{
|
||||
return sizeof( P );
|
||||
}
|
||||
|
||||
T *m_pObj;
|
||||
func_t m_Func;
|
||||
};
|
||||
|
||||
|
||||
// utility macro for declaring the function and callback object together
|
||||
#define STEAM_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, false > var; void func( param *pParam )
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
// disable this warning; this pattern need for steam callback registration
|
||||
#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// pumps out all the steam messages, calling the register callback
|
||||
S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks );
|
||||
|
||||
// register the callback funcs to use to interact with the steam dll
|
||||
S_API void Steam_RegisterInterfaceFuncs( void *hModule );
|
||||
|
||||
// returns the HSteamUser of the last user to dispatch a callback
|
||||
S_API HSteamUser Steam_GetHSteamUserCurrent();
|
||||
|
||||
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name
|
||||
S_API const char *SteamAPI_GetSteamInstallPath();
|
||||
|
||||
// returns the pipe we are communicating to Steam with
|
||||
S_API HSteamPipe SteamAPI_GetHSteamPipe();
|
||||
|
||||
// sets whether or not Steam_RunCallbacks() should do a try {} catch (...) {} around calls to issuing callbacks
|
||||
S_API void SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks );
|
||||
|
||||
// backwards compat export, passes through to SteamAPI_ variants
|
||||
S_API HSteamPipe GetHSteamPipe();
|
||||
S_API HSteamUser GetHSteamUser();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamAPI_GetHSteamUser();
|
||||
|
||||
class CSteamAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamUser* SteamUser() { return m_pSteamUser; }
|
||||
ISteamFriends* SteamFriends() { return m_pSteamFriends; }
|
||||
ISteamUtils* SteamUtils() { return m_pSteamUtils; }
|
||||
ISteamMatchmaking* SteamMatchmaking() { return m_pSteamMatchmaking; }
|
||||
ISteamUserStats* SteamUserStats() { return m_pSteamUserStats; }
|
||||
ISteamApps* SteamApps() { return m_pSteamApps; }
|
||||
ISteamMatchmakingServers* SteamMatchmakingServers() { return m_pSteamMatchmakingServers; }
|
||||
ISteamNetworking* SteamNetworking() { return m_pSteamNetworking; }
|
||||
ISteamRemoteStorage* SteamRemoteStorage() { return m_pSteamRemoteStorage; }
|
||||
|
||||
private:
|
||||
ISteamUser *m_pSteamUser;
|
||||
ISteamFriends *m_pSteamFriends;
|
||||
ISteamUtils *m_pSteamUtils;
|
||||
ISteamMatchmaking *m_pSteamMatchmaking;
|
||||
ISteamUserStats *m_pSteamUserStats;
|
||||
ISteamApps *m_pSteamApps;
|
||||
ISteamMatchmakingServers *m_pSteamMatchmakingServers;
|
||||
ISteamNetworking *m_pSteamNetworking;
|
||||
ISteamRemoteStorage *m_pSteamRemoteStorage;
|
||||
};
|
||||
|
||||
inline CSteamAPIContext::CSteamAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamAPIContext::Clear()
|
||||
{
|
||||
m_pSteamUser = NULL;
|
||||
m_pSteamFriends = NULL;
|
||||
m_pSteamUtils = NULL;
|
||||
m_pSteamMatchmaking = NULL;
|
||||
m_pSteamUserStats = NULL;
|
||||
m_pSteamApps = NULL;
|
||||
m_pSteamMatchmakingServers = NULL;
|
||||
m_pSteamNetworking = NULL;
|
||||
m_pSteamRemoteStorage = NULL;
|
||||
}
|
||||
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamAPIContext::Init()
|
||||
{
|
||||
if ( !SteamClient() )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamAPI_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe();
|
||||
|
||||
m_pSteamUser = SteamClient()->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUser )
|
||||
return false;
|
||||
|
||||
m_pSteamFriends = SteamClient()->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamFriends )
|
||||
return false;
|
||||
|
||||
m_pSteamUtils = SteamClient()->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmaking = SteamClient()->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmaking )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmakingServers = SteamClient()->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmakingServers )
|
||||
return false;
|
||||
|
||||
m_pSteamUserStats = SteamClient()->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUserStats )
|
||||
return false;
|
||||
|
||||
m_pSteamApps = SteamClient()->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamApps )
|
||||
return false;
|
||||
|
||||
m_pSteamNetworking = SteamClient()->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamNetworking )
|
||||
return false;
|
||||
|
||||
m_pSteamRemoteStorage = SteamClient()->GetISteamRemoteStorage( hSteamUser, hSteamPipe, STEAMREMOTESTORAGE_INTERFACE_VERSION );
|
||||
if ( !m_pSteamRemoteStorage )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
#endif // STEAM_API_H
|
||||
134
res/steamworks/104/headers/steam_gameserver.h
Normal file
134
res/steamworks/104/headers/steam_gameserver.h
Normal file
@@ -0,0 +1,134 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_GAMESERVER_H
|
||||
#define STEAM_GAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api.h"
|
||||
#include "isteamgameserver.h"
|
||||
#include "isteammasterserverupdater.h"
|
||||
|
||||
enum EServerMode
|
||||
{
|
||||
eServerModeInvalid = 0, // DO NOT USE
|
||||
eServerModeNoAuthentication = 1, // Don't authenticate user logins and don't list on the server list
|
||||
eServerModeAuthentication = 2, // Authenticate users, list on the server list, don't run VAC on clients that connect
|
||||
eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients
|
||||
};
|
||||
|
||||
// Note: if you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it will use "GameSocketShare" mode,
|
||||
// which means that the game is responsible for sending and receiving UDP packets for the master
|
||||
// server updater. See references to GameSocketShare in isteammasterserverupdater.h.
|
||||
//
|
||||
// Pass 0 for usGamePort or usSpectatorPort if you're not using that. Then, the master server updater will report
|
||||
// what's running based on that.
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamGameServer_InitSafe( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString );
|
||||
#else
|
||||
S_API bool SteamGameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString );
|
||||
|
||||
S_API ISteamGameServer *SteamGameServer();
|
||||
S_API ISteamUtils *SteamGameServerUtils();
|
||||
S_API ISteamMasterServerUpdater *SteamMasterServerUpdater();
|
||||
S_API ISteamNetworking *SteamGameServerNetworking();
|
||||
#endif
|
||||
|
||||
S_API void SteamGameServer_Shutdown();
|
||||
S_API void SteamGameServer_RunCallbacks();
|
||||
|
||||
S_API bool SteamGameServer_BSecure();
|
||||
S_API uint64 SteamGameServer_GetSteamID();
|
||||
|
||||
#define STEAM_GAMESERVER_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, true > var; void func( param *pParam )
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
S_API HSteamPipe SteamGameServer_GetHSteamPipe();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamGameServer_GetHSteamUser();
|
||||
|
||||
class CSteamGameServerAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamGameServerAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamGameServer *SteamGameServer() { return m_pSteamGameServer; }
|
||||
ISteamUtils *SteamGameServerUtils() { return m_pSteamGameServerUtils; }
|
||||
ISteamMasterServerUpdater *SteamMasterServerUpdater() { return m_pSteamMasterServerUpdater; }
|
||||
ISteamNetworking *SteamGameServerNetworking() { return m_pSteamGameServerNetworking; }
|
||||
|
||||
private:
|
||||
ISteamGameServer *m_pSteamGameServer;
|
||||
ISteamUtils *m_pSteamGameServerUtils;
|
||||
ISteamMasterServerUpdater *m_pSteamMasterServerUpdater;
|
||||
ISteamNetworking *m_pSteamGameServerNetworking;
|
||||
};
|
||||
|
||||
inline CSteamGameServerAPIContext::CSteamGameServerAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamGameServerAPIContext::Clear()
|
||||
{
|
||||
m_pSteamGameServer = NULL;
|
||||
m_pSteamGameServerUtils = NULL;
|
||||
m_pSteamMasterServerUpdater = NULL;
|
||||
m_pSteamGameServerNetworking = NULL;
|
||||
}
|
||||
|
||||
S_API ISteamClient *g_pSteamClientGameServer;
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamGameServerAPIContext::Init()
|
||||
{
|
||||
if ( !g_pSteamClientGameServer )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamGameServer_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe();
|
||||
|
||||
m_pSteamGameServer = g_pSteamClientGameServer->GetISteamGameServer( hSteamUser, hSteamPipe, STEAMGAMESERVER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServer )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerUtils = g_pSteamClientGameServer->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMasterServerUpdater = g_pSteamClientGameServer->GetISteamMasterServerUpdater( hSteamUser, hSteamPipe, STEAMMASTERSERVERUPDATER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMasterServerUpdater )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerNetworking = g_pSteamClientGameServer->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerNetworking )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
|
||||
#endif // STEAM_GAMESERVER_H
|
||||
856
res/steamworks/104/headers/steamclientpublic.h
Normal file
856
res/steamworks/104/headers/steamclientpublic.h
Normal file
@@ -0,0 +1,856 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMCLIENTPUBLIC_H
|
||||
#define STEAMCLIENTPUBLIC_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
//lint -save -e1931 -e1927 -e1924 -e613 -e726
|
||||
|
||||
// This header file defines the interface between the calling application and the code that
|
||||
// knows how to communicate with the connection manager (CM) from the Steam service
|
||||
|
||||
// This header file is intended to be portable; ideally this 1 header file plus a lib or dll
|
||||
// is all you need to integrate the client library into some other tree. So please avoid
|
||||
// including or requiring other header files if possible. This header should only describe the
|
||||
// interface layer, no need to include anything about the implementation.
|
||||
|
||||
#include "steamtypes.h"
|
||||
|
||||
|
||||
// General result codes
|
||||
enum EResult
|
||||
{
|
||||
k_EResultOK = 1, // success
|
||||
k_EResultFail = 2, // generic failure
|
||||
k_EResultNoConnection = 3, // no/failed network connection
|
||||
// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed
|
||||
k_EResultInvalidPassword = 5, // password/ticket is invalid
|
||||
k_EResultLoggedInElsewhere = 6, // same user logged in elsewhere
|
||||
k_EResultInvalidProtocolVer = 7, // protocol version is incorrect
|
||||
k_EResultInvalidParam = 8, // a parameter is incorrect
|
||||
k_EResultFileNotFound = 9, // file was not found
|
||||
k_EResultBusy = 10, // called method busy - action not taken
|
||||
k_EResultInvalidState = 11, // called object was in an invalid state
|
||||
k_EResultInvalidName = 12, // name is invalid
|
||||
k_EResultInvalidEmail = 13, // email is invalid
|
||||
k_EResultDuplicateName = 14, // name is not unique
|
||||
k_EResultAccessDenied = 15, // access is denied
|
||||
k_EResultTimeout = 16, // operation timed out
|
||||
k_EResultBanned = 17, // VAC2 banned
|
||||
k_EResultAccountNotFound = 18, // account not found
|
||||
k_EResultInvalidSteamID = 19, // steamID is invalid
|
||||
k_EResultServiceUnavailable = 20, // The requested service is currently unavailable
|
||||
k_EResultNotLoggedOn = 21, // The user is not logged on
|
||||
k_EResultPending = 22, // Request is pending (may be in process, or waiting on third party)
|
||||
k_EResultEncryptionFailure = 23, // Encryption or Decryption failed
|
||||
k_EResultInsufficientPrivilege = 24, // Insufficient privilege
|
||||
k_EResultLimitExceeded = 25, // Too much of a good thing
|
||||
k_EResultRevoked = 26, // Access has been revoked (used for revoked guest passes)
|
||||
k_EResultExpired = 27, // License/Guest pass the user is trying to access is expired
|
||||
k_EResultAlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again
|
||||
k_EResultDuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time
|
||||
k_EResultAlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user
|
||||
k_EResultIPNotFound = 31, // IP address not found
|
||||
k_EResultPersistFailed = 32, // failed to write change to the data store
|
||||
k_EResultLockingFailed = 33, // failed to acquire access lock for this operation
|
||||
k_EResultLogonSessionReplaced = 34,
|
||||
k_EResultConnectFailed = 35,
|
||||
k_EResultHandshakeFailed = 36,
|
||||
k_EResultIOFailure = 37,
|
||||
k_EResultRemoteDisconnect = 38,
|
||||
k_EResultShoppingCartNotFound = 39, // failed to find the shopping cart requested
|
||||
k_EResultBlocked = 40, // a user didn't allow it
|
||||
k_EResultIgnored = 41, // target is ignoring sender
|
||||
k_EResultNoMatch = 42, // nothing matching the request found
|
||||
k_EResultAccountDisabled = 43,
|
||||
k_EResultServiceReadOnly = 44, // this service is not accepting content changes right now
|
||||
};
|
||||
|
||||
// Error codes for use with the voice functions
|
||||
enum EVoiceResult
|
||||
{
|
||||
k_EVoiceResultOK = 0,
|
||||
k_EVoiceResultNotInitialized = 1,
|
||||
k_EVoiceResultNotRecording = 2,
|
||||
k_EVoiceResultNoData = 3,
|
||||
k_EVoiceResultBufferTooSmall = 4,
|
||||
k_EVoiceResultDataCorrupted = 5,
|
||||
};
|
||||
|
||||
// Result codes to GSHandleClientDeny/Kick
|
||||
typedef enum
|
||||
{
|
||||
k_EDenyInvalid = 0,
|
||||
k_EDenyInvalidVersion = 1,
|
||||
k_EDenyGeneric = 2,
|
||||
k_EDenyNotLoggedOn = 3,
|
||||
k_EDenyNoLicense = 4,
|
||||
k_EDenyCheater = 5,
|
||||
k_EDenyLoggedInElseWhere = 6,
|
||||
k_EDenyUnknownText = 7,
|
||||
k_EDenyIncompatibleAnticheat = 8,
|
||||
k_EDenyMemoryCorruption = 9,
|
||||
k_EDenyIncompatibleSoftware = 10,
|
||||
k_EDenySteamConnectionLost = 11,
|
||||
k_EDenySteamConnectionError = 12,
|
||||
k_EDenySteamResponseTimedOut = 13,
|
||||
k_EDenySteamValidationStalled = 14,
|
||||
k_EDenySteamOwnerLeftGuestUser = 15,
|
||||
} EDenyReason;
|
||||
|
||||
// return type of GetAuthSessionTicket
|
||||
typedef uint32 HAuthTicket;
|
||||
const HAuthTicket k_HAuthTicketInvalid = 0;
|
||||
|
||||
// results from BeginAuthSession
|
||||
typedef enum
|
||||
{
|
||||
k_EBeginAuthSessionResultOK = 0, // Ticket is valid for this game and this steamID.
|
||||
k_EBeginAuthSessionResultInvalidTicket = 1, // Ticket is not valid.
|
||||
k_EBeginAuthSessionResultDuplicateRequest = 2, // A ticket has already been submitted for this steamID
|
||||
k_EBeginAuthSessionResultInvalidVersion = 3, // Ticket is from an incompatible interface version
|
||||
k_EBeginAuthSessionResultGameMismatch = 4, // Ticket is not for this game
|
||||
k_EBeginAuthSessionResultExpiredTicket = 5, // Ticket has expired
|
||||
} EBeginAuthSessionResult;
|
||||
|
||||
// Callback values for callback ValidateAuthTicketResponse_t which is a response to BeginAuthSession
|
||||
typedef enum
|
||||
{
|
||||
k_EAuthSessionResponseOK = 0, // Steam has verified the user is online, the ticket is valid and ticket has not been reused.
|
||||
k_EAuthSessionResponseUserNotConnectedToSteam = 1, // The user in question is not connected to steam
|
||||
k_EAuthSessionResponseNoLicenseOrExpired = 2, // The license has expired.
|
||||
k_EAuthSessionResponseVACBanned = 3, // The user is VAC banned for this game.
|
||||
k_EAuthSessionResponseLoggedInElseWhere = 4, // The user account has logged in elsewhere and the session containing the game instance has been disconnected.
|
||||
k_EAuthSessionResponseVACCheckTimedOut = 5, // VAC has been unable to perform anti-cheat checks on this user
|
||||
k_EAuthSessionResponseAuthTicketCanceled = 6, // The ticket has been canceled by the issuer
|
||||
k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7, // This ticket has already been used, it is not valid.
|
||||
k_EAuthSessionResponseAuthTicketInvalid = 8, // This ticket is not from a user instance currently connected to steam.
|
||||
} EAuthSessionResponse;
|
||||
|
||||
|
||||
// Steam universes. Each universe is a self-contained Steam instance.
|
||||
enum EUniverse
|
||||
{
|
||||
k_EUniverseInvalid = 0,
|
||||
k_EUniversePublic = 1,
|
||||
k_EUniverseBeta = 2,
|
||||
k_EUniverseInternal = 3,
|
||||
k_EUniverseDev = 4,
|
||||
k_EUniverseRC = 5,
|
||||
k_EUniverseMax
|
||||
};
|
||||
|
||||
// Steam account types
|
||||
enum EAccountType
|
||||
{
|
||||
k_EAccountTypeInvalid = 0,
|
||||
k_EAccountTypeIndividual = 1, // single user account
|
||||
k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account
|
||||
k_EAccountTypeGameServer = 3, // game server account
|
||||
k_EAccountTypeAnonGameServer = 4, // anonymous game server account
|
||||
k_EAccountTypePending = 5, // pending
|
||||
k_EAccountTypeContentServer = 6, // content server
|
||||
k_EAccountTypeClan = 7,
|
||||
k_EAccountTypeChat = 8,
|
||||
k_EAccountTypeP2PSuperSeeder = 9, // a fake steamid used by superpeers to seed content to users of Steam P2P stuff
|
||||
k_EAccountTypeAnonUser = 10,
|
||||
|
||||
// Max of 16 items in this field
|
||||
k_EAccountTypeMax
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// types of user game stats fields
|
||||
// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ESteamUserStatType
|
||||
{
|
||||
k_ESteamUserStatTypeINVALID = 0,
|
||||
k_ESteamUserStatTypeINT = 1,
|
||||
k_ESteamUserStatTypeFLOAT = 2,
|
||||
// Read as FLOAT, set with count / session length
|
||||
k_ESteamUserStatTypeAVGRATE = 3,
|
||||
k_ESteamUserStatTypeACHIEVEMENTS = 4,
|
||||
k_ESteamUserStatTypeGROUPACHIEVEMENTS = 5,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Entry Types (previously was only friend-to-friend message types)
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatEntryType
|
||||
{
|
||||
k_EChatEntryTypeChatMsg = 1, // Normal text message from another user
|
||||
k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat)
|
||||
k_EChatEntryTypeInviteGame = 3, // Invite from other user into that users current game
|
||||
k_EChatEntryTypeEmote = 4, // text emote message
|
||||
k_EChatEntryTypeLobbyGameStart = 5, // lobby game is starting
|
||||
// Above are previous FriendMsgType entries, now merged into more generic chat entry types
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Room Enter Responses
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatRoomEnterResponse
|
||||
{
|
||||
k_EChatRoomEnterResponseSuccess = 1, // Success
|
||||
k_EChatRoomEnterResponseDoesntExist = 2, // Chat doesn't exist (probably closed)
|
||||
k_EChatRoomEnterResponseNotAllowed = 3, // General Denied - You don't have the permissions needed to join the chat
|
||||
k_EChatRoomEnterResponseFull = 4, // Chat room has reached its maximum size
|
||||
k_EChatRoomEnterResponseError = 5, // Unexpected Error
|
||||
k_EChatRoomEnterResponseBanned = 6, // You are banned from this chat room and may not join
|
||||
};
|
||||
|
||||
|
||||
typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath );
|
||||
typedef bool (*PFNLegacyKeyInstalled)();
|
||||
|
||||
const int k_unSteamAccountIDMask = 0xFFFFFFFF;
|
||||
const int k_unSteamAccountInstanceMask = 0x000FFFFF;
|
||||
|
||||
// Special flags for Chat accounts - they go in the top 8 bits
|
||||
// of the steam ID's "instance", leaving 12 for the actual instances
|
||||
enum EChatSteamIDInstanceFlags
|
||||
{
|
||||
k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags
|
||||
|
||||
k_EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) >> 1, // top bit
|
||||
k_EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 2, // next one down, etc
|
||||
|
||||
// Max of 8 flags
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Possible positions to tell the overlay to show notifications in
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ENotificationPosition
|
||||
{
|
||||
k_EPositionTopLeft = 0,
|
||||
k_EPositionTopRight = 1,
|
||||
k_EPositionBottomLeft = 2,
|
||||
k_EPositionBottomRight = 3,
|
||||
};
|
||||
|
||||
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
// Steam ID structure (64 bits total)
|
||||
class CSteamID
|
||||
{
|
||||
public:
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID()
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = 0;
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeInvalid;
|
||||
m_steamid.m_comp.m_EUniverse = k_EUniverseInvalid;
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
Set( unAccountID, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// unAccountInstance - instance
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
#if defined(_SERVER) && defined(Assert)
|
||||
Assert( ! ( ( k_EAccountTypeIndividual == eAccountType ) && ( 1 != unAccountInstance ) ) ); // enforce that for individual accounts, instance is always 1
|
||||
#endif // _SERVER
|
||||
InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
// Note: Will not accept a uint32 or int32 as input, as that is a probable mistake.
|
||||
// See the stubbed out overloads in the private: section for more info.
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint64 ulSteamID )
|
||||
{
|
||||
SetFromUint64( ulSteamID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void Set( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = unAccountID;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_EAccountType = eAccountType;
|
||||
|
||||
if ( eAccountType == k_EAccountTypeClan )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountInstance = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void InstancedSet( uint32 unAccountID, uint32 unInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = unAccountID;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_EAccountType = eAccountType;
|
||||
m_steamid.m_comp.m_unAccountInstance = unInstance;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 52 bit parts and universe/type
|
||||
// Input : ulIdentifier - 52 bits of goodness
|
||||
//-----------------------------------------------------------------------------
|
||||
void FullSet( uint64 ulIdentifier, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = ( ulIdentifier & 0xFFFFFFFF ); // account ID is low 32 bits
|
||||
m_steamid.m_comp.m_unAccountInstance = ( ( ulIdentifier >> 32 ) & 0xFFFFF ); // account instance is next 20 bits
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_EAccountType = eAccountType;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 64-bit representation
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromUint64( uint64 ulSteamID )
|
||||
{
|
||||
m_steamid.m_unAll64Bits = ulSteamID;
|
||||
}
|
||||
|
||||
|
||||
#if defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to convert
|
||||
// eUniverse - universe this ID belongs to
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromSteam2( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 +
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse; // set the universe
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeIndividual; // Steam 2 accounts always map to account type of individual
|
||||
m_steamid.m_comp.m_unAccountInstance = 1; // individual accounts always have an account instance ID of 1
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fills out a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to write to
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConvertToSteam2( TSteamGlobalUserID *pTSteamGlobalUserID ) const
|
||||
{
|
||||
// only individual accounts have any meaning in Steam 2, only they can be mapped
|
||||
// Assert( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual );
|
||||
|
||||
pTSteamGlobalUserID->m_SteamInstanceID = 0;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits = m_steamid.m_comp.m_unAccountID % 2;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits = m_steamid.m_comp.m_unAccountID / 2;
|
||||
}
|
||||
#endif // defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts steam ID to its 64-bit representation
|
||||
// Output : 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 ConvertToUint64() const
|
||||
{
|
||||
return m_steamid.m_unAll64Bits;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts the static parts of a steam ID to a 64-bit representation.
|
||||
// For multiseat accounts, all instances of that account will have the
|
||||
// same static account key, so they can be grouped together by the static
|
||||
// account key.
|
||||
// Output : 64-bit static account key
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 GetStaticAccountKey() const
|
||||
{
|
||||
// note we do NOT include the account instance (which is a dynamic property) in the static account key
|
||||
return (uint64) ( ( ( (uint64) m_steamid.m_comp.m_EUniverse ) << 56 ) + ((uint64) m_steamid.m_comp.m_EAccountType << 52 ) + m_steamid.m_comp.m_unAccountID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = 0;
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonGameServer;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonUserLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = 0;
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonUser;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous game server login that will be filled in?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BBlankAnonAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_unAccountID == 0 && BAnonAccount() && m_steamid.m_comp.m_unAccountInstance == 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a game server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BGameServerAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a content server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BContentServerAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeContentServer;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a clan account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BClanAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a chat account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BChatAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a chat account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool IsLobby() const
|
||||
{
|
||||
return ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat )
|
||||
&& ( m_steamid.m_comp.m_unAccountInstance & k_EChatInstanceFlagLobby );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an individual user account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BIndividualAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous account?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BAnonAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous user account? ( used to create an account or reset a password )
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BAnonUserAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser;
|
||||
}
|
||||
|
||||
|
||||
// simple accessors
|
||||
void SetAccountID( uint32 unAccountID ) { m_steamid.m_comp.m_unAccountID = unAccountID; }
|
||||
uint32 GetAccountID() const { return m_steamid.m_comp.m_unAccountID; }
|
||||
uint32 GetUnAccountInstance() const { return m_steamid.m_comp.m_unAccountInstance; }
|
||||
EAccountType GetEAccountType() const { return ( EAccountType ) m_steamid.m_comp.m_EAccountType; }
|
||||
EUniverse GetEUniverse() const { return m_steamid.m_comp.m_EUniverse; }
|
||||
void SetEUniverse( EUniverse eUniverse ) { m_steamid.m_comp.m_EUniverse = eUniverse; }
|
||||
bool IsValid() const;
|
||||
|
||||
// this set of functions is hidden, will be moved out of class
|
||||
explicit CSteamID( const char *pchSteamID, EUniverse eDefaultUniverse = k_EUniverseInvalid );
|
||||
const char * Render() const; // renders this steam ID to string
|
||||
static const char * Render( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string
|
||||
|
||||
void SetFromString( const char *pchSteamID, EUniverse eDefaultUniverse );
|
||||
bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse );
|
||||
|
||||
inline bool operator==( const CSteamID &val ) const { return m_steamid.m_unAll64Bits == val.m_steamid.m_unAll64Bits; }
|
||||
inline bool operator!=( const CSteamID &val ) const { return !operator==( val ); }
|
||||
inline bool operator<( const CSteamID &val ) const { return m_steamid.m_unAll64Bits < val.m_steamid.m_unAll64Bits; }
|
||||
inline bool operator>( const CSteamID &val ) const { return m_steamid.m_unAll64Bits > val.m_steamid.m_unAll64Bits; }
|
||||
|
||||
// DEBUG function
|
||||
bool BValidExternalSteamID() const;
|
||||
|
||||
private:
|
||||
// These are defined here to prevent accidental implicit conversion of a u32AccountID to a CSteamID.
|
||||
// If you get a compiler error about an ambiguous constructor/function then it may be because you're
|
||||
// passing a 32-bit int to a function that takes a CSteamID. You should explicitly create the SteamID
|
||||
// using the correct Universe and account Type/Instance values.
|
||||
CSteamID( uint32 );
|
||||
CSteamID( int32 );
|
||||
|
||||
// 64 bits total
|
||||
union SteamID_t
|
||||
{
|
||||
struct SteamIDComponent_t
|
||||
{
|
||||
uint32 m_unAccountID : 32; // unique account identifier
|
||||
unsigned int m_unAccountInstance : 20; // dynamic instance ID (used for multiseat type accounts only)
|
||||
unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference
|
||||
EUniverse m_EUniverse : 8; // universe this account belongs to
|
||||
} m_comp;
|
||||
|
||||
uint64 m_unAll64Bits;
|
||||
} m_steamid;
|
||||
};
|
||||
|
||||
inline bool CSteamID::IsValid() const
|
||||
{
|
||||
if ( m_steamid.m_comp.m_EAccountType <= k_EAccountTypeInvalid || m_steamid.m_comp.m_EAccountType >= k_EAccountTypeMax )
|
||||
return false;
|
||||
|
||||
if ( m_steamid.m_comp.m_EUniverse <= k_EUniverseInvalid || m_steamid.m_comp.m_EUniverse >= k_EUniverseMax )
|
||||
return false;
|
||||
|
||||
if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual )
|
||||
{
|
||||
if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != 1 )
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan )
|
||||
{
|
||||
if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != 0 )
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// generic invalid CSteamID
|
||||
const CSteamID k_steamIDNil;
|
||||
|
||||
// This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol
|
||||
// to provide its steamID
|
||||
const CSteamID k_steamIDOutofDateGS( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
// This steamID comes from a user game connection to an sv_lan GS
|
||||
const CSteamID k_steamIDLanModeGS( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid );
|
||||
// This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized
|
||||
// its steam3 component and started logging on.
|
||||
const CSteamID k_steamIDNotInitYetGS( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
// This steamID can come from a user game connection to a GS that isn't using the steam authentication system but still
|
||||
// wants to support the "Join Game" option in the friends list
|
||||
const CSteamID k_steamIDNonSteamGS( 2, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
|
||||
|
||||
#ifdef STEAM
|
||||
// Returns the matching chat steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance
|
||||
CSteamID ChatIDFromSteamID( const CSteamID &steamID );
|
||||
// Returns the matching clan steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance
|
||||
CSteamID ClanIDFromSteamID( const CSteamID &steamID );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ChatIDFromClanID( const CSteamID &steamIDClan );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ClanIDFromChatID( const CSteamID &steamIDChat );
|
||||
|
||||
#endif // _STEAM
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: encapsulates an appID/modID pair
|
||||
//-----------------------------------------------------------------------------
|
||||
class CGameID
|
||||
{
|
||||
public:
|
||||
|
||||
CGameID()
|
||||
{
|
||||
m_gameID.m_nType = k_EGameIDTypeApp;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nModID = 0;
|
||||
}
|
||||
|
||||
explicit CGameID( uint64 ulGameID )
|
||||
{
|
||||
m_ulGameID = ulGameID;
|
||||
}
|
||||
|
||||
explicit CGameID( int32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
explicit CGameID( uint32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
CGameID( uint32 nAppID, uint32 nModID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nModID = nModID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
}
|
||||
|
||||
// Hidden functions used only by Steam
|
||||
explicit CGameID( const char *pchGameID );
|
||||
const char *Render() const; // render this Game ID to string
|
||||
static const char *Render( uint64 ulGameID ); // static method to render a uint64 representation of a Game ID to a string
|
||||
|
||||
// must include checksum_crc.h first to get this functionality
|
||||
#if defined( CHECKSUM_CRC_H )
|
||||
CGameID( uint32 nAppID, const char *pchModPath )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
|
||||
char rgchModDir[MAX_PATH];
|
||||
Q_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) );
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, rgchModDir, Q_strlen( rgchModDir ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
CGameID( const char *pchExePath, const char *pchAppName )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeShortcut;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, pchExePath, Q_strlen( pchExePath ) );
|
||||
CRC32_ProcessBuffer( &crc32, pchAppName, Q_strlen( pchAppName ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#if defined( VSTFILEID_H )
|
||||
|
||||
CGameID( VstFileID vstFileID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeP2P;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
const char *pchFileId = vstFileID.Render();
|
||||
CRC32_ProcessBuffer( &crc32, pchFileId, Q_strlen( pchFileId ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#endif /* VSTFILEID_H */
|
||||
|
||||
#endif /* CHECKSUM_CRC_H */
|
||||
|
||||
|
||||
uint64 ToUint64() const
|
||||
{
|
||||
return m_ulGameID;
|
||||
}
|
||||
|
||||
uint64 *GetUint64Ptr()
|
||||
{
|
||||
return &m_ulGameID;
|
||||
}
|
||||
|
||||
bool IsMod() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeGameMod );
|
||||
}
|
||||
|
||||
bool IsShortcut() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeShortcut );
|
||||
}
|
||||
|
||||
bool IsP2PFile() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeP2P );
|
||||
}
|
||||
|
||||
bool IsSteamApp() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeApp );
|
||||
}
|
||||
|
||||
uint32 ModID() const
|
||||
{
|
||||
return m_gameID.m_nModID;
|
||||
}
|
||||
|
||||
uint32 AppID() const
|
||||
{
|
||||
return m_gameID.m_nAppID;
|
||||
}
|
||||
|
||||
bool operator == ( const CGameID &rhs ) const
|
||||
{
|
||||
return m_ulGameID == rhs.m_ulGameID;
|
||||
}
|
||||
|
||||
bool operator != ( const CGameID &rhs ) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
bool operator < ( const CGameID &rhs ) const
|
||||
{
|
||||
return ( m_ulGameID < rhs.m_ulGameID );
|
||||
}
|
||||
|
||||
bool IsValid() const
|
||||
{
|
||||
// each type has it's own invalid fixed point:
|
||||
switch( m_gameID.m_nType )
|
||||
{
|
||||
case k_EGameIDTypeApp:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid;
|
||||
break;
|
||||
case k_EGameIDTypeGameMod:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
case k_EGameIDTypeShortcut:
|
||||
return (m_gameID.m_nModID & 0x80000000) != 0;
|
||||
break;
|
||||
case k_EGameIDTypeP2P:
|
||||
return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
default:
|
||||
#if defined(Assert)
|
||||
Assert(false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
enum EGameIDType
|
||||
{
|
||||
k_EGameIDTypeApp = 0,
|
||||
k_EGameIDTypeGameMod = 1,
|
||||
k_EGameIDTypeShortcut = 2,
|
||||
k_EGameIDTypeP2P = 3,
|
||||
};
|
||||
|
||||
struct GameID_t
|
||||
{
|
||||
unsigned int m_nAppID : 24;
|
||||
unsigned int m_nType : 8;
|
||||
unsigned int m_nModID : 32;
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
uint64 m_ulGameID;
|
||||
GameID_t m_gameID;
|
||||
};
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
const int k_cchGameExtraInfoMax = 64;
|
||||
|
||||
|
||||
// Max number of credit cards stored for one account
|
||||
const int k_nMaxNumCardsPerAccount = 1;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constants used for query ports.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define QUERY_PORT_NOT_INITIALIZED 0xFFFF // We haven't asked the GS for this query port's actual value yet.
|
||||
#define QUERY_PORT_ERROR 0xFFFE // We were unable to get the query port for this server.
|
||||
|
||||
#endif // STEAMCLIENTPUBLIC_H
|
||||
90
res/steamworks/104/headers/steamtypes.h
Normal file
90
res/steamworks/104/headers/steamtypes.h
Normal file
@@ -0,0 +1,90 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMTYPES_H
|
||||
#define STEAMTYPES_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Steam-specific types. Defined here so this header file can be included in other code bases.
|
||||
#ifndef WCHARTYPES_H
|
||||
typedef unsigned char uint8;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(_WIN64)
|
||||
#define X64BITS
|
||||
#endif
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef signed char int8;
|
||||
|
||||
#if defined( _WIN32 )
|
||||
|
||||
typedef __int16 int16;
|
||||
typedef unsigned __int16 uint16;
|
||||
typedef __int32 int32;
|
||||
typedef unsigned __int32 uint32;
|
||||
typedef __int64 int64;
|
||||
typedef unsigned __int64 uint64;
|
||||
|
||||
#ifdef X64BITS
|
||||
typedef __int64 intp; // intp is an integer that can accomodate a pointer
|
||||
typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *)
|
||||
#else
|
||||
typedef __int32 intp;
|
||||
typedef unsigned __int32 uintp;
|
||||
#endif
|
||||
|
||||
#else // _WIN32
|
||||
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
#ifdef X64BITS
|
||||
typedef long long intp;
|
||||
typedef unsigned long long uintp;
|
||||
#else
|
||||
typedef int intp;
|
||||
typedef unsigned int uintp;
|
||||
#endif
|
||||
|
||||
#endif // else _WIN32
|
||||
|
||||
const int k_cubSaltSize = 8;
|
||||
typedef uint8 Salt_t[ k_cubSaltSize ];
|
||||
|
||||
typedef uint64 GID_t; // globally unique identifier
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 PackageId_t;
|
||||
const PackageId_t k_uPackageIdInvalid = 0xFFFFFFFF;
|
||||
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 AppId_t;
|
||||
const AppId_t k_uAppIdInvalid = 0x0;
|
||||
|
||||
// RTime32
|
||||
// We use this 32 bit time representing real world time.
|
||||
// It offers 1 second resolution beginning on January 1, 1970 (Unix time)
|
||||
typedef uint32 RTime32;
|
||||
|
||||
typedef uint32 CellID_t;
|
||||
|
||||
// handle to a Steam API call
|
||||
typedef uint64 SteamAPICall_t;
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // STEAMTYPES_H
|
||||
45
res/steamworks/105/headers/isteamapps.h
Normal file
45
res/steamworks/105/headers/isteamapps.h
Normal file
@@ -0,0 +1,45 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to app data in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMAPPS_H
|
||||
#define ISTEAMAPPS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to app data
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamApps
|
||||
{
|
||||
public:
|
||||
virtual bool BIsSubscribed() = 0;
|
||||
virtual bool BIsLowViolence() = 0;
|
||||
virtual bool BIsCybercafe() = 0;
|
||||
virtual bool BIsVACBanned() = 0;
|
||||
virtual const char *GetCurrentGameLanguage() = 0;
|
||||
virtual const char *GetAvailableGameLanguages() = 0;
|
||||
|
||||
// only use this member if you need to check ownership of another game related to yours, a demo for example
|
||||
virtual bool BIsSubscribedApp( AppId_t appID ) = 0;
|
||||
|
||||
// Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed
|
||||
virtual bool BIsDlcInstalled( AppId_t appID ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION003"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: posted after the user gains ownership of DLC & that DLC is installed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct DlcInstalled_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamAppsCallbacks + 5 };
|
||||
AppId_t m_nAppID; // AppID of the DLC
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMAPPS_H
|
||||
151
res/steamworks/105/headers/isteamclient.h
Normal file
151
res/steamworks/105/headers/isteamclient.h
Normal file
@@ -0,0 +1,151 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: Main interface for loading and accessing Steamworks API's from the
|
||||
// Steam client.
|
||||
// For most uses, this code is wrapped inside of SteamAPI_Init()
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMCLIENT_H
|
||||
#define ISTEAMCLIENT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a communication pipe to the Steam client
|
||||
typedef int32 HSteamPipe;
|
||||
// handle to single instance of a steam user
|
||||
typedef int32 HSteamUser;
|
||||
// function prototype
|
||||
#if defined( POSIX ) && !defined( _CYGWIN )
|
||||
#define __cdecl
|
||||
#endif
|
||||
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
|
||||
|
||||
// interface predec
|
||||
class ISteamUser;
|
||||
class ISteamGameServer;
|
||||
class ISteamFriends;
|
||||
class ISteamUtils;
|
||||
class ISteamMatchmaking;
|
||||
class ISteamContentServer;
|
||||
class ISteamMasterServerUpdater;
|
||||
class ISteamMatchmakingServers;
|
||||
class ISteamUserStats;
|
||||
class ISteamApps;
|
||||
class ISteamNetworking;
|
||||
class ISteamRemoteStorage;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Interface to creating a new steam instance, or to
|
||||
// connect to an existing steam instance, whether it's in a
|
||||
// different process or is local.
|
||||
//
|
||||
// For most scenarios this is all handled automatically via SteamAPI_Init().
|
||||
// You'll only need to use these interfaces if you have a more complex versioning scheme,
|
||||
// where you want to get different versions of the same interface in different dll's in your project.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamClient
|
||||
{
|
||||
public:
|
||||
// Creates a communication pipe to the Steam client
|
||||
virtual HSteamPipe CreateSteamPipe() = 0;
|
||||
|
||||
// Releases a previously created communications pipe
|
||||
virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// connects to an existing global user, failing if none exists
|
||||
// used by the game to coordinate with the steamUI
|
||||
virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// used by game servers, create a steam user that won't be shared with anyone else
|
||||
virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe, EAccountType eAccountType ) = 0;
|
||||
|
||||
// removes an allocated user
|
||||
virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0;
|
||||
|
||||
// retrieves the ISteamUser interface associated with the handle
|
||||
virtual ISteamUser *GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// retrieves the ISteamGameServer interface associated with the handle
|
||||
virtual ISteamGameServer *GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// set the local IP and Port to bind to
|
||||
// this must be set before CreateLocalUser()
|
||||
virtual void SetLocalIPBinding( uint32 unIP, uint16 usPort ) = 0;
|
||||
|
||||
// returns the ISteamFriends interface
|
||||
virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamUtils interface
|
||||
virtual ISteamUtils *GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmaking interface
|
||||
virtual ISteamMatchmaking *GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMasterServerUpdater interface
|
||||
virtual ISteamMasterServerUpdater *GetISteamMasterServerUpdater( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmakingServers interface
|
||||
virtual ISteamMatchmakingServers *GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the a generic interface
|
||||
virtual void *GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamUserStats interface
|
||||
virtual ISteamUserStats *GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns apps interface
|
||||
virtual ISteamApps *GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// networking
|
||||
virtual ISteamNetworking *GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// remote storage
|
||||
virtual ISteamRemoteStorage *GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// this needs to be called every frame to process matchmaking results
|
||||
// redundant if you're already calling SteamAPI_RunCallbacks()
|
||||
virtual void RunFrame() = 0;
|
||||
|
||||
// returns the number of IPC calls made since the last time this function was called
|
||||
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
||||
// Every IPC call is at minimum a thread context switch if not a process one so you want to rate
|
||||
// control how often you do them.
|
||||
virtual uint32 GetIPCCallCount() = 0;
|
||||
|
||||
// API warning handling
|
||||
// 'int' is the severity; 0 for msg, 1 for warning
|
||||
// 'const char *' is the text of the message
|
||||
// callbacks will occur directly after the API function is called that generated the warning or message
|
||||
virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
|
||||
|
||||
};
|
||||
|
||||
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient008"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Base values for callback identifiers, each callback must
|
||||
// have a unique ID.
|
||||
//-----------------------------------------------------------------------------
|
||||
enum { k_iSteamUserCallbacks = 100 };
|
||||
enum { k_iSteamGameServerCallbacks = 200 };
|
||||
enum { k_iSteamFriendsCallbacks = 300 };
|
||||
enum { k_iSteamBillingCallbacks = 400 };
|
||||
enum { k_iSteamMatchmakingCallbacks = 500 };
|
||||
enum { k_iSteamContentServerCallbacks = 600 };
|
||||
enum { k_iSteamUtilsCallbacks = 700 };
|
||||
enum { k_iClientFriendsCallbacks = 800 };
|
||||
enum { k_iClientUserCallbacks = 900 };
|
||||
enum { k_iSteamAppsCallbacks = 1000 };
|
||||
enum { k_iSteamUserStatsCallbacks = 1100 };
|
||||
enum { k_iSteamNetworkingCallbacks = 1200 };
|
||||
enum { k_iClientRemoteStorageCallbacks = 1300 };
|
||||
enum { k_iSteamUserItemsCallbacks = 1400 };
|
||||
enum { k_iSteamGameServerItemsCallbacks = 1500 };
|
||||
enum { k_iClientUtilsCallbacks = 1600 };
|
||||
|
||||
|
||||
#endif // ISTEAMCLIENT_H
|
||||
251
res/steamworks/105/headers/isteamfriends.h
Normal file
251
res/steamworks/105/headers/isteamfriends.h
Normal file
@@ -0,0 +1,251 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to both friends list data and general information about users
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMFRIENDS_H
|
||||
#define ISTEAMFRIENDS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: set of relationships to other users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EFriendRelationship
|
||||
{
|
||||
k_EFriendRelationshipNone = 0,
|
||||
k_EFriendRelationshipBlocked = 1,
|
||||
k_EFriendRelationshipRequestRecipient = 2,
|
||||
k_EFriendRelationshipFriend = 3,
|
||||
k_EFriendRelationshipRequestInitiator = 4,
|
||||
k_EFriendRelationshipIgnored = 5,
|
||||
k_EFriendRelationshipIgnoredFriend = 6,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: list of states a friend can be in
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EPersonaState
|
||||
{
|
||||
k_EPersonaStateOffline = 0, // friend is not currently logged on
|
||||
k_EPersonaStateOnline = 1, // friend is logged on
|
||||
k_EPersonaStateBusy = 2, // user is on, but busy
|
||||
k_EPersonaStateAway = 3, // auto-away feature
|
||||
k_EPersonaStateSnooze = 4, // auto-away for a long time
|
||||
k_EPersonaStateMax,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: flags for enumerating friends list, or quickly checking a the relationship between users
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EFriendFlags
|
||||
{
|
||||
k_EFriendFlagNone = 0x00,
|
||||
k_EFriendFlagBlocked = 0x01,
|
||||
k_EFriendFlagFriendshipRequested = 0x02,
|
||||
k_EFriendFlagImmediate = 0x04, // "regular" friend
|
||||
k_EFriendFlagClanMember = 0x08,
|
||||
k_EFriendFlagOnGameServer = 0x10,
|
||||
// k_EFriendFlagHasPlayedWith = 0x20, // not currently used
|
||||
// k_EFriendFlagFriendOfFriend = 0x40, // not currently used
|
||||
k_EFriendFlagRequestingFriendship = 0x80,
|
||||
k_EFriendFlagRequestingInfo = 0x100,
|
||||
k_EFriendFlagIgnored = 0x200,
|
||||
k_EFriendFlagIgnoredFriend = 0x400,
|
||||
k_EFriendFlagAll = 0xFFFF,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: avatar sizes, used in ISteamFriends::GetFriendAvatar()
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EAvatarSize
|
||||
{
|
||||
k_EAvatarSize32x32 = 0,
|
||||
k_EAvatarSize64x64 = 1,
|
||||
};
|
||||
|
||||
|
||||
// friend game played information
|
||||
struct FriendGameInfo_t
|
||||
{
|
||||
CGameID m_gameID;
|
||||
uint32 m_unGameIP;
|
||||
uint16 m_usGamePort;
|
||||
uint16 m_usQueryPort;
|
||||
CSteamID m_steamIDLobby;
|
||||
};
|
||||
|
||||
|
||||
// maximum number of characters in a users name
|
||||
enum { k_cchPersonaNameMax = 128 };
|
||||
|
||||
// size limit on chat room or member metadata
|
||||
const uint32 k_cubChatMetadataMax = 8192;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to accessing information about individual users,
|
||||
// that can be a friend, in a group, on a game server or in a lobby with the local user
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamFriends
|
||||
{
|
||||
public:
|
||||
// returns the local players name - guaranteed to not be NULL.
|
||||
// this is the same name as on the users community profile page
|
||||
// this is stored in UTF-8 format
|
||||
// like all the other interface functions that return a char *, it's important that this pointer is not saved
|
||||
// off; it will eventually be free'd or re-allocated
|
||||
virtual const char *GetPersonaName() = 0;
|
||||
|
||||
// sets the player name, stores it on the server and publishes the changes to all friends who are online
|
||||
virtual void SetPersonaName( const char *pchPersonaName ) = 0;
|
||||
|
||||
// gets the status of the current user
|
||||
virtual EPersonaState GetPersonaState() = 0;
|
||||
|
||||
// friend iteration
|
||||
// takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria
|
||||
// then GetFriendByIndex() can then be used to return the id's of each of those users
|
||||
virtual int GetFriendCount( int iFriendFlags ) = 0;
|
||||
|
||||
// returns the steamID of a user
|
||||
// iFriend is a index of range [0, GetFriendCount())
|
||||
// iFriendsFlags must be the same value as used in GetFriendCount()
|
||||
// the returned CSteamID can then be used by all the functions below to access details about the user
|
||||
virtual CSteamID GetFriendByIndex( int iFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// returns a relationship to a user
|
||||
virtual EFriendRelationship GetFriendRelationship( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the current status of the specified user
|
||||
// this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user
|
||||
virtual EPersonaState GetFriendPersonaState( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// returns the name another user - guaranteed to not be NULL.
|
||||
// same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user
|
||||
// note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously
|
||||
//
|
||||
virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// gets the avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetFriendAvatar( CSteamID steamIDFriend, int eAvatarSize ) = 0;
|
||||
// returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details
|
||||
virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, FriendGameInfo_t *pFriendGameInfo ) = 0;
|
||||
// accesses old friends names - returns an empty string when their are no more items in the history
|
||||
virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0;
|
||||
|
||||
// returns true if the specified user meets any of the criteria specified in iFriendFlags
|
||||
// iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values
|
||||
virtual bool HasFriend( CSteamID steamIDFriend, int iFriendFlags ) = 0;
|
||||
|
||||
// clan (group) iteration and access functions
|
||||
virtual int GetClanCount() = 0;
|
||||
virtual CSteamID GetClanByIndex( int iClan ) = 0;
|
||||
virtual const char *GetClanName( CSteamID steamIDClan ) = 0;
|
||||
|
||||
// iterators for getting users in a chat room, lobby, game server or clan
|
||||
// note that large clans that cannot be iterated by the local user
|
||||
// steamIDSource can be the steamID of a group, game server, lobby or chat room
|
||||
virtual int GetFriendCountFromSource( CSteamID steamIDSource ) = 0;
|
||||
virtual CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend ) = 0;
|
||||
|
||||
// returns true if the local user can see that steamIDUser is a member or in steamIDSource
|
||||
virtual bool IsUserInSource( CSteamID steamIDUser, CSteamID steamIDSource ) = 0;
|
||||
|
||||
// User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI)
|
||||
virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0;
|
||||
|
||||
// activates the game overlay, with an optional dialog to open
|
||||
// valid options are "Friends", "Community", "Players", "Settings", "LobbyInvite", "OfficialGameGroup", "Stats", "Achievements"
|
||||
virtual void ActivateGameOverlay( const char *pchDialog ) = 0;
|
||||
|
||||
// activates game overlay to a specific place
|
||||
// valid options are
|
||||
// "steamid" - opens the overlay web browser to the specified user or groups profile
|
||||
// "chat" - opens a chat window to the specified user, or joins the group chat
|
||||
virtual void ActivateGameOverlayToUser( const char *pchDialog, CSteamID steamID ) = 0;
|
||||
|
||||
// activates game overlay web browser directly to the specified URL
|
||||
// full address with protocol type is required, e.g. http://www.steamgames.com/
|
||||
virtual void ActivateGameOverlayToWebPage( const char *pchURL ) = 0;
|
||||
|
||||
// activates game overlay to store page for app
|
||||
virtual void ActivateGameOverlayToStore( AppId_t nAppID ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends005"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a friends' status changes
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PersonaStateChange_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamID; // steamID of the friend who changed
|
||||
int m_nChangeFlags; // what's changed
|
||||
};
|
||||
|
||||
|
||||
// used in PersonaStateChange_t::m_nChangeFlags to describe what's changed about a user
|
||||
// these flags describe what the client has learned has changed recently, so on startup you'll see a name, avatar & relationship change for every friend
|
||||
enum EPersonaChange
|
||||
{
|
||||
k_EPersonaChangeName = 0x001,
|
||||
k_EPersonaChangeStatus = 0x002,
|
||||
k_EPersonaChangeComeOnline = 0x004,
|
||||
k_EPersonaChangeGoneOffline = 0x008,
|
||||
k_EPersonaChangeGamePlayed = 0x010,
|
||||
k_EPersonaChangeGameServer = 0x020,
|
||||
k_EPersonaChangeAvatar = 0x040,
|
||||
k_EPersonaChangeJoinedSource= 0x080,
|
||||
k_EPersonaChangeLeftSource = 0x100,
|
||||
k_EPersonaChangeRelationshipChanged = 0x200,
|
||||
k_EPersonaChangeNameFirstSet = 0x400,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: posted when game overlay activates or deactivates
|
||||
// the game can use this to be pause or resume single player games
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameOverlayActivated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 31 };
|
||||
uint8 m_bActive; // true if it's just been activated, false otherwise
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the user tries to join a different game server from their friends list
|
||||
// game client should attempt to connect to specified server when this is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameServerChangeRequested_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 32 };
|
||||
char m_rgchServer[64]; // server address ("127.0.0.1:27015", "tf2.valvesoftware.com")
|
||||
char m_rgchPassword[64]; // server password, if any
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the user tries to join a lobby from their friends list
|
||||
// game client should attempt to connect to specified lobby when this is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameLobbyJoinRequested_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 33 };
|
||||
CSteamID m_steamIDLobby;
|
||||
CSteamID m_steamIDFriend; // the friend they did the join via (will be invalid if not directly via a friend)
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMFRIENDS_H
|
||||
202
res/steamworks/105/headers/isteamgameserver.h
Normal file
202
res/steamworks/105/headers/isteamgameserver.h
Normal file
@@ -0,0 +1,202 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMGAMESERVER_H
|
||||
#define ISTEAMGAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for authenticating users via Steam to play on a game server
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamGameServer
|
||||
{
|
||||
public:
|
||||
// connection functions
|
||||
virtual void LogOn() = 0;
|
||||
virtual void LogOff() = 0;
|
||||
|
||||
// status functions
|
||||
virtual bool BLoggedOn() = 0;
|
||||
virtual bool BSecure() = 0;
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Handles receiving a new connection from a Steam user. This call will ask the Steam
|
||||
// servers to validate the users identity, app ownership, and VAC status. If the Steam servers
|
||||
// are off-line, then it will validate the cached ticket itself which will validate app ownership
|
||||
// and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection()
|
||||
// and must then be sent up to the game server for authentication.
|
||||
//
|
||||
// Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL
|
||||
// If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication
|
||||
// for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)
|
||||
virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0;
|
||||
|
||||
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||
//
|
||||
// Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect()
|
||||
// when this user leaves the server just like you would for a real user.
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection() = 0;
|
||||
|
||||
// Should be called whenever a user leaves our game server, this lets Steam internally
|
||||
// track which users are currently on which servers for the purposes of preventing a single
|
||||
// account being logged into multiple servers, showing who is currently on a server, etc.
|
||||
virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// Update the data to be displayed in the server browser and matchmaking interfaces for a user
|
||||
// currently connected to the server. For regular users you must call this after you receive a
|
||||
// GSUserValidationSuccess callback.
|
||||
//
|
||||
// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
|
||||
virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
|
||||
|
||||
// You shouldn't need to call this as it is called internally by SteamGameServer_Init() and can only be called once.
|
||||
//
|
||||
// To update the data in this call which may change during the servers lifetime see UpdateServerStatus() below.
|
||||
//
|
||||
// Input: nGameAppID - The Steam assigned AppID for the game
|
||||
// unServerFlags - Any applicable combination of flags (see k_unServerFlag____ constants below)
|
||||
// unGameIP - The IP Address the server is listening for client connections on (might be INADDR_ANY)
|
||||
// unGamePort - The port which the server is listening for client connections on
|
||||
// unSpectatorPort - the port on which spectators can join to observe the server, 0 if spectating is not supported
|
||||
// usQueryPort - The port which the ISteamMasterServerUpdater API should use in order to listen for matchmaking requests
|
||||
// pchGameDir - A unique string identifier for your game
|
||||
// pchVersion - The current version of the server as a string like 1.0.0.0
|
||||
// bLanMode - Is this a LAN only server?
|
||||
//
|
||||
// bugbug jmccaskey - figure out how to remove this from the API and only expose via SteamGameServer_Init... or make this actually used,
|
||||
// and stop calling it in SteamGameServer_Init()?
|
||||
virtual bool BSetServerType( uint32 unServerFlags, uint32 unGameIP, uint16 unGamePort,
|
||||
uint16 unSpectatorPort, uint16 usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode ) = 0;
|
||||
|
||||
// Updates server status values which shows up in the server browser and matchmaking APIs
|
||||
virtual void UpdateServerStatus( int cPlayers, int cPlayersMax, int cBotPlayers,
|
||||
const char *pchServerName, const char *pSpectatorServerName,
|
||||
const char *pchMapName ) = 0;
|
||||
|
||||
// This can be called if spectator goes away or comes back (passing 0 means there is no spectator server now).
|
||||
virtual void UpdateSpectatorPort( uint16 unSpectatorPort ) = 0;
|
||||
|
||||
// Sets a string defining the "gametype" for this server, this is optional, but if it is set
|
||||
// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||
virtual void SetGameType( const char *pchGameType ) = 0;
|
||||
|
||||
// Ask if a user has a specific achievement for this game, will get a callback on reply
|
||||
virtual bool BGetUserAchievementStatus( CSteamID steamID, const char *pchAchievementName ) = 0;
|
||||
|
||||
// Ask for the gameplay stats for the server. Results returned in a callback
|
||||
virtual void GetGameplayStats( ) = 0;
|
||||
|
||||
// Ask if a user in in the specified group, results returns async by GSUserGroupStatus_t
|
||||
// returns false if we're not connected to the steam servers and thus cannot ask
|
||||
virtual bool RequestUserGroupStatus( CSteamID steamIDUser, CSteamID steamIDGroup ) = 0;
|
||||
|
||||
// Returns the public IP of the server according to Steam, useful when the server is
|
||||
// behind NAT and you want to advertise its IP in a lobby for other clients to directly
|
||||
// connect to
|
||||
virtual uint32 GetPublicIP() = 0;
|
||||
|
||||
// Sets a string defining the "gamedata" for this server, this is optional, but if it is set
|
||||
// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||
// don't set this unless it actually changes, its only uploaded to the master once (when
|
||||
// acknowledged)
|
||||
virtual void SetGameData( const char *pchGameData) = 0;
|
||||
|
||||
// After receiving a user's authentication data, and passing it to SendUserConnectAndAuthenticate, use this function
|
||||
// to determine if the user owns downloadable content specified by the provided AppID.
|
||||
virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer009"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unServerFlagNone = 0x00;
|
||||
const uint32 k_unServerFlagActive = 0x01; // server has users playing
|
||||
const uint32 k_unServerFlagSecure = 0x02; // server wants to be secure
|
||||
const uint32 k_unServerFlagDedicated = 0x04; // server is dedicated
|
||||
const uint32 k_unServerFlagLinux = 0x08; // linux build
|
||||
const uint32 k_unServerFlagPassworded = 0x10; // password protected
|
||||
const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and
|
||||
// won't enforce authentication of users that connect to the server.
|
||||
// Useful when you run a server where the clients may not
|
||||
// be connected to the internet but you want them to play (i.e LANs)
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
// client has been approved to connect to this game server
|
||||
struct GSClientApprove_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 1 };
|
||||
CSteamID m_SteamID;
|
||||
};
|
||||
|
||||
|
||||
// client has been denied to connection to this game server
|
||||
struct GSClientDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 2 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
char m_rgchOptionalText[128];
|
||||
};
|
||||
|
||||
|
||||
// request the game server should kick the user
|
||||
struct GSClientKick_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 3 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
};
|
||||
|
||||
// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks,
|
||||
// do not reuse them here.
|
||||
|
||||
|
||||
// client achievement info
|
||||
struct GSClientAchievementStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 6 };
|
||||
uint64 m_SteamID;
|
||||
char m_pchAchievement[128];
|
||||
bool m_bUnlocked;
|
||||
};
|
||||
|
||||
// received when the game server requests to be displayed as secure (VAC protected)
|
||||
// m_bSecure is true if the game server should display itself as secure to users, false otherwise
|
||||
struct GSPolicyResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 15 };
|
||||
uint8 m_bSecure;
|
||||
};
|
||||
|
||||
// GS gameplay stats info
|
||||
struct GSGameplayStats_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 7 };
|
||||
EResult m_eResult; // Result of the call
|
||||
int32 m_nRank; // Overall rank of the server (0-based)
|
||||
uint32 m_unTotalConnects; // Total number of clients who have ever connected to the server
|
||||
uint32 m_unTotalMinutesPlayed; // Total number of minutes ever played on the server
|
||||
};
|
||||
|
||||
// send as a reply to RequestUserGroupStatus()
|
||||
struct GSClientGroupStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 8 };
|
||||
CSteamID m_SteamIDUser;
|
||||
CSteamID m_SteamIDGroup;
|
||||
bool m_bMember;
|
||||
bool m_bOfficer;
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMGAMESERVER_H
|
||||
103
res/steamworks/105/headers/isteammasterserverupdater.h
Normal file
103
res/steamworks/105/headers/isteammasterserverupdater.h
Normal file
@@ -0,0 +1,103 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for retrieving list of game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMASTERSERVERUPDATER_H
|
||||
#define ISTEAMMASTERSERVERUPDATER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Game engines use this to tell the Steam master servers
|
||||
// about their games so their games can show up in the server browser.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMasterServerUpdater
|
||||
{
|
||||
public:
|
||||
|
||||
// Call this as often as you like to tell the master server updater whether or not
|
||||
// you want it to be active (default: off).
|
||||
virtual void SetActive( bool bActive ) = 0;
|
||||
|
||||
// You usually don't need to modify this.
|
||||
// Pass -1 to use the default value for iHeartbeatInterval.
|
||||
// Some mods change this.
|
||||
virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0;
|
||||
|
||||
|
||||
// These are in GameSocketShare mode, where instead of ISteamMasterServerUpdater creating its own
|
||||
// socket to talk to the master server on, it lets the game use its socket to forward messages
|
||||
// back and forth. This prevents us from requiring server ops to open up yet another port
|
||||
// in their firewalls.
|
||||
//
|
||||
// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001
|
||||
|
||||
// These are used when you've elected to multiplex the game server's UDP socket
|
||||
// rather than having the master server updater use its own sockets.
|
||||
//
|
||||
// Source games use this to simplify the job of the server admins, so they
|
||||
// don't have to open up more ports on their firewalls.
|
||||
|
||||
// Call this when a packet that starts with 0xFFFFFFFF comes in. That means
|
||||
// it's for us.
|
||||
virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0;
|
||||
|
||||
// AFTER calling HandleIncomingPacket for any packets that came in that frame, call this.
|
||||
// This gets a packet that the master server updater needs to send out on UDP.
|
||||
// It returns the length of the packet it wants to send, or 0 if there are no more packets to send.
|
||||
// Call this each frame until it returns 0.
|
||||
virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0;
|
||||
|
||||
|
||||
// Functions to set various fields that are used to respond to queries.
|
||||
|
||||
// Call this to set basic data that is passed to the server browser.
|
||||
virtual void SetBasicServerData(
|
||||
unsigned short nProtocolVersion,
|
||||
bool bDedicatedServer,
|
||||
const char *pRegionName,
|
||||
const char *pProductName,
|
||||
unsigned short nMaxReportedClients,
|
||||
bool bPasswordProtected,
|
||||
const char *pGameDescription ) = 0;
|
||||
|
||||
// Call this to clear the whole list of key/values that are sent in rules queries.
|
||||
virtual void ClearAllKeyValues() = 0;
|
||||
|
||||
// Call this to add/update a key/value pair.
|
||||
virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
|
||||
// You can call this upon shutdown to clear out data stored for this game server and
|
||||
// to tell the master servers that this server is going away.
|
||||
virtual void NotifyShutdown() = 0;
|
||||
|
||||
// Returns true if the master server has requested a restart.
|
||||
// Only returns true once per request.
|
||||
virtual bool WasRestartRequested() = 0;
|
||||
|
||||
// Force it to request a heartbeat from the master servers.
|
||||
virtual void ForceHeartbeat() = 0;
|
||||
|
||||
// Manually edit and query the master server list.
|
||||
// It will provide name resolution and use the default master server port if none is provided.
|
||||
virtual bool AddMasterServer( const char *pServerAddress ) = 0;
|
||||
virtual bool RemoveMasterServer( const char *pServerAddress ) = 0;
|
||||
|
||||
virtual int GetNumMasterServers() = 0;
|
||||
|
||||
// Returns the # of bytes written to pOut.
|
||||
virtual int GetMasterServerAddress( int iServer, char *pOut, int outBufferSize ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMMASTERSERVERUPDATER_INTERFACE_VERSION "SteamMasterServerUpdater001"
|
||||
|
||||
#endif // ISTEAMMASTERSERVERUPDATER_H
|
||||
589
res/steamworks/105/headers/isteammatchmaking.h
Normal file
589
res/steamworks/105/headers/isteammatchmaking.h
Normal file
@@ -0,0 +1,589 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing game server/client match making
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMMATCHMAKING
|
||||
#define ISTEAMMATCHMAKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
#include "matchmakingtypes.h"
|
||||
#include "isteamclient.h"
|
||||
#include "isteamfriends.h"
|
||||
|
||||
// lobby type description
|
||||
enum ELobbyType
|
||||
{
|
||||
k_ELobbyTypeFriendsOnly = 1, // shows for friends or invitees, but not in lobby list
|
||||
k_ELobbyTypePublic = 2, // visible for friends and in lobby list
|
||||
k_ELobbyTypeInvisible = 3, // returned by search, but not visible to other friends
|
||||
// useful if you want a user in two lobbies, for example matching groups together
|
||||
// a user can be in only one regular lobby, and up to two invisible lobbies
|
||||
};
|
||||
|
||||
// lobby search filter tools
|
||||
enum ELobbyComparison
|
||||
{
|
||||
k_ELobbyComparisonEqualToOrLessThan = -2,
|
||||
k_ELobbyComparisonLessThan = -1,
|
||||
k_ELobbyComparisonEqual = 0,
|
||||
k_ELobbyComparisonGreaterThan = 1,
|
||||
k_ELobbyComparisonEqualToOrGreaterThan = 2,
|
||||
k_ELobbyComparisonNotEqual = 3,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to favorites
|
||||
// and to operate on game lobbies.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmaking
|
||||
{
|
||||
public:
|
||||
// game server favorites storage
|
||||
// saves basic details about a multiplayer game server locally
|
||||
|
||||
// returns the number of favorites servers the user has stored
|
||||
virtual int GetFavoriteGameCount() = 0;
|
||||
|
||||
// returns the details of the game server
|
||||
// iGame is of range [0,GetFavoriteGameCount())
|
||||
// *pnIP, *pnConnPort are filled in the with IP:port of the game server
|
||||
// *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections
|
||||
// *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added
|
||||
virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0;
|
||||
|
||||
// adds the game server to the local list; updates the time played of the server if it already exists in the list
|
||||
virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0;
|
||||
|
||||
// removes the game server from the local storage; returns true if one was removed
|
||||
virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0;
|
||||
|
||||
///////
|
||||
// Game lobby functions
|
||||
|
||||
// Get a list of relevant lobbies
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyMatchList_t callback & call result, with the number of lobbies found
|
||||
// this will never return lobbies that are full
|
||||
// to add more filter, the filter calls below need to be call before each and every RequestLobbyList() call
|
||||
// use the CCallResult<> object in steam_api.h to match the SteamAPICall_t call result to a function in an object, e.g.
|
||||
/*
|
||||
class CMyLobbyListManager
|
||||
{
|
||||
CCallResult<CMyLobbyListManager, LobbyMatchList_t> m_CallResultLobbyMatchList;
|
||||
void FindLobbies()
|
||||
{
|
||||
// SteamMatchmaking()->AddRequestLobbyListFilter*() functions would be called here, before RequestLobbyList()
|
||||
SteamAPICall_t hSteamAPICall = SteamMatchmaking()->RequestLobbyList();
|
||||
m_CallResultLobbyMatchList.Set( hSteamAPICall, this, &CMyLobbyListManager::OnLobbyMatchList );
|
||||
}
|
||||
|
||||
void OnLobbyMatchList( LobbyMatchList_t *pLobbyMatchList, bool bIOFailure )
|
||||
{
|
||||
// lobby list has be retrieved from Steam back-end, use results
|
||||
}
|
||||
}
|
||||
*/
|
||||
//
|
||||
virtual SteamAPICall_t RequestLobbyList() = 0;
|
||||
// filters for lobbies
|
||||
// this needs to be called before RequestLobbyList() to take effect
|
||||
// these are cleared on each call to RequestLobbyList()
|
||||
virtual void AddRequestLobbyListStringFilter( const char *pchKeyToMatch, const char *pchValueToMatch, ELobbyComparison eComparisonType ) = 0;
|
||||
// numerical comparison
|
||||
virtual void AddRequestLobbyListNumericalFilter( const char *pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType ) = 0;
|
||||
// returns results closest to the specified value. Multiple near filters can be added, with early filters taking precedence
|
||||
virtual void AddRequestLobbyListNearValueFilter( const char *pchKeyToMatch, int nValueToBeCloseTo ) = 0;
|
||||
// returns only lobbies with the specified number of slots available
|
||||
virtual void AddRequestLobbyListFilterSlotsAvailable( int nSlotsAvailable ) = 0;
|
||||
|
||||
// returns the CSteamID of a lobby, as retrieved by a RequestLobbyList call
|
||||
// should only be called after a LobbyMatchList_t callback is received
|
||||
// iLobby is of the range [0, LobbyMatchList_t::m_nLobbiesMatching)
|
||||
// the returned CSteamID::IsValid() will be false if iLobby is out of range
|
||||
virtual CSteamID GetLobbyByIndex( int iLobby ) = 0;
|
||||
|
||||
// Create a lobby on the Steam servers.
|
||||
// If private, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID
|
||||
// of the lobby will need to be communicated via game channels or via InviteUserToLobby()
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyCreated_t callback and call result; lobby is joined & ready to use at this pointer
|
||||
// a LobbyEnter_t callback will also be received (since the local user is joining their own lobby)
|
||||
virtual SteamAPICall_t CreateLobby( ELobbyType eLobbyType, int cMaxMembers ) = 0;
|
||||
|
||||
// Joins an existing lobby
|
||||
// this is an asynchronous request
|
||||
// results will be returned by LobbyEnter_t callback & call result, check m_EChatRoomEnterResponse to see if was successful
|
||||
// lobby metadata is available to use immediately on this call completing
|
||||
virtual SteamAPICall_t JoinLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Leave a lobby; this will take effect immediately on the client side
|
||||
// other users in the lobby will be notified by a LobbyChatUpdate_t callback
|
||||
virtual void LeaveLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Invite another user to the lobby
|
||||
// the target user will receive a LobbyInvite_t callback
|
||||
// will return true if the invite is successfully sent, whether or not the target responds
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
// if the other user clicks the join link, a GameLobbyJoinRequested_t will be posted if the user is in-game,
|
||||
// or if the game isn't running yet the game will be launched with the parameter +connect_lobby <64-bit lobby id>
|
||||
virtual bool InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ) = 0;
|
||||
|
||||
// Lobby iteration, for viewing details of users in a lobby
|
||||
// only accessible if the lobby user is a member of the specified lobby
|
||||
// persona information for other lobby members (name, avatar, etc.) will be asynchronously received
|
||||
// and accessible via ISteamFriends interface
|
||||
|
||||
// returns the number of users in the specified lobby
|
||||
virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0;
|
||||
// returns the CSteamID of a user in the lobby
|
||||
// iMember is of range [0,GetNumLobbyMembers())
|
||||
virtual CSteamID GetLobbyMemberByIndex( CSteamID steamIDLobby, int iMember ) = 0;
|
||||
|
||||
// Get data associated with this lobby
|
||||
// takes a simple key, and returns the string associated with it
|
||||
// "" will be returned if no value is set, or if steamIDLobby is invalid
|
||||
virtual const char *GetLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0;
|
||||
// Sets a key/value pair in the lobby metadata
|
||||
// each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data
|
||||
// this can be used to set lobby names, map, etc.
|
||||
// to reset a key, just set it to ""
|
||||
// other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback
|
||||
virtual bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// returns the number of metadata keys set on the specified lobby
|
||||
virtual int GetLobbyDataCount( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// returns a lobby metadata key/values pair by index, of range [0, GetLobbyDataCount())
|
||||
virtual bool GetLobbyDataByIndex( CSteamID steamIDLobby, int iLobbyData, char *pchKey, int cchKeyBufferSize, char *pchValue, int cchValueBufferSize ) = 0;
|
||||
|
||||
// removes a metadata key from the lobby
|
||||
virtual bool DeleteLobbyData( CSteamID steamIDLobby, const char *pchKey ) = 0;
|
||||
|
||||
// Gets per-user metadata for someone in this lobby
|
||||
virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0;
|
||||
// Sets per-user metadata (for the local user implicitly)
|
||||
virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
// Broadcasts a chat message to the all the users in the lobby
|
||||
// users in the lobby (including the local user) will receive a LobbyChatMsg_t callback
|
||||
// returns true if the message is successfully sent
|
||||
// pvMsgBody can be binary or text data, up to 4k
|
||||
// if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator
|
||||
virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0;
|
||||
// Get a chat message as specified in a LobbyChatMsg_t callback
|
||||
// iChatID is the LobbyChatMsg_t::m_iChatID value in the callback
|
||||
// *pSteamIDUser is filled in with the CSteamID of the member
|
||||
// *pvData is filled in with the message itself
|
||||
// return value is the number of bytes written into the buffer
|
||||
virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0;
|
||||
|
||||
// Refreshes metadata for a lobby you're not necessarily in right now
|
||||
// you never do this for lobbies you're a member of, only if your
|
||||
// this will send down all the metadata associated with a lobby
|
||||
// this is an asynchronous call
|
||||
// returns false if the local user is not connected to the Steam servers
|
||||
// restart are returned by a LobbyDataUpdate_t callback
|
||||
virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// sets the game server associated with the lobby
|
||||
// usually at this point, the users will join the specified game server
|
||||
// either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect
|
||||
virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0;
|
||||
// returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist
|
||||
virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, CSteamID *psteamIDGameServer ) = 0;
|
||||
|
||||
// set the limit on the # of users who can join the lobby
|
||||
virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0;
|
||||
// returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined
|
||||
virtual int GetLobbyMemberLimit( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// updates which type of lobby it is
|
||||
// only lobbies that are k_ELobbyTypePublic or k_ELobbyTypeInvisible, and are set to joinable, will be returned by RequestLobbyList() calls
|
||||
virtual bool SetLobbyType( CSteamID steamIDLobby, ELobbyType eLobbyType ) = 0;
|
||||
|
||||
// sets whether or not a lobby is joinable - defaults to true for a new lobby
|
||||
// if set to false, no user can join, even if they are a friend or have been invited
|
||||
virtual bool SetLobbyJoinable( CSteamID steamIDLobby, bool bLobbyJoinable ) = 0;
|
||||
|
||||
// returns the current lobby owner
|
||||
// you must be a member of the lobby to access this
|
||||
// there always one lobby owner - if the current owner leaves, another user will become the owner
|
||||
// it is possible (bur rare) to join a lobby just as the owner is leaving, thus entering a lobby with self as the owner
|
||||
virtual CSteamID GetLobbyOwner( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// changes who the lobby owner is
|
||||
// you must be the lobby owner for this to succeed, and steamIDNewOwner must be in the lobby
|
||||
// after completion, the local user will no longer be the owner
|
||||
virtual bool SetLobbyOwner( CSteamID steamIDLobby, CSteamID steamIDNewOwner ) = 0;
|
||||
};
|
||||
#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking007"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callback interfaces for server list functions (see ISteamMatchmakingServers below)
|
||||
//
|
||||
// The idea here is that your game code implements objects that implement these
|
||||
// interfaces to receive callback notifications after calling asynchronous functions
|
||||
// inside the ISteamMatchmakingServers() interface below.
|
||||
//
|
||||
// This is different than normal Steam callback handling due to the potentially
|
||||
// large size of server lists.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after a server list refresh
|
||||
// or an individual server update.
|
||||
//
|
||||
// Since you get these callbacks after requesting full list refreshes you will
|
||||
// usually implement this interface inside an object like CServerBrowser. If that
|
||||
// object is getting destructed you should use ISteamMatchMakingServers()->CancelQuery()
|
||||
// to cancel any in-progress queries so you don't get a callback into the destructed
|
||||
// object and crash.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServerListResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded ok with updated data
|
||||
virtual void ServerResponded( int iServer ) = 0;
|
||||
|
||||
// Server has failed to respond
|
||||
virtual void ServerFailedToRespond( int iServer ) = 0;
|
||||
|
||||
// A list refresh you had initiated is now 100% completed
|
||||
virtual void RefreshComplete( EMatchMakingServerResponse response ) = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after pinging an individual server
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PingServer() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPingResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded successfully and has updated data
|
||||
virtual void ServerResponded( gameserveritem_t &server ) = 0;
|
||||
|
||||
// Server failed to respond to the ping request
|
||||
virtual void ServerFailedToRespond() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting details on
|
||||
// who is playing on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingPlayersResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a new player on the server -- you'll get this callback once per player
|
||||
// on the server which you have requested player data on.
|
||||
virtual void AddPlayerToList( const char *pchName, int nScore, float flTimePlayed ) = 0;
|
||||
|
||||
// The server failed to respond to the request for player details
|
||||
virtual void PlayersFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the player details request
|
||||
// (ie, you won't get anymore AddPlayerToList callbacks)
|
||||
virtual void PlayersRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting rules
|
||||
// details on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->ServerRules() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingRulesResponse
|
||||
{
|
||||
public:
|
||||
// Got data on a rule on the server -- you'll get one of these per rule defined on
|
||||
// the server you are querying
|
||||
virtual void RulesResponded( const char *pchRule, const char *pchValue ) = 0;
|
||||
|
||||
// The server failed to respond to the request for rule details
|
||||
virtual void RulesFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the rule details request
|
||||
// (ie, you won't get anymore RulesResponded callbacks)
|
||||
virtual void RulesRefreshComplete() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Typedef for handle type you will receive when querying details on an individual server.
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef int HServerQuery;
|
||||
const int HSERVERQUERY_INVALID = 0xffffffff;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for match making services for clients to get to game lists and details
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMatchmakingServers
|
||||
{
|
||||
public:
|
||||
// Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values.
|
||||
virtual void RequestInternetServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFriendsServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestFavoritesServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestHistoryServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual void RequestSpectatorServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
/* the filters that are available in the ppchFilters params are:
|
||||
|
||||
"map" - map the server is running, as set in the dedicated server api
|
||||
"dedicated" - reports bDedicated from the API
|
||||
"secure" - VAC-enabled
|
||||
"full" - not full
|
||||
"empty" - not empty
|
||||
"noplayers" - is empty
|
||||
"proxy" - a relay server
|
||||
|
||||
*/
|
||||
|
||||
// Get details on a given server in the list, you can get the valid range of index
|
||||
// values by calling GetServerCount(). You will also receive index values in
|
||||
// ISteamMatchmakingServerListResponse::ServerResponded() callbacks
|
||||
virtual gameserveritem_t *GetServerDetails( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
// Cancel an request which is operation on the given list type. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above list request calls. Not doing so may result in a crash when a callback
|
||||
// occurs on the destructed object.
|
||||
virtual void CancelQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Ping every server in your list again but don't update the list of servers
|
||||
virtual void RefreshQuery( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Returns true if the list is currently refreshing its server list
|
||||
virtual bool IsRefreshing( EMatchMakingType eType ) = 0;
|
||||
|
||||
// How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1
|
||||
virtual int GetServerCount( EMatchMakingType eType ) = 0;
|
||||
|
||||
// Refresh a single server inside of a query (rather than all the servers )
|
||||
virtual void RefreshServer( EMatchMakingType eType, int iServer ) = 0;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Queries to individual servers directly via IP/Port
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Request updated ping time and other details from a single server
|
||||
virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of players currently playing on a server
|
||||
virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of rules that the server is running (See ISteamMasterServerUpdater->SetKeyValue() to set the rules server side)
|
||||
virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above calls to avoid crashing when callbacks occur.
|
||||
virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0;
|
||||
};
|
||||
#define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "SteamMatchMakingServers001"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unFavoriteFlagNone = 0x00;
|
||||
const uint32 k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list
|
||||
const uint32 k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Used in ChatInfo messages - fields specific to a chat member - must fit in a uint32
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatMemberStateChange
|
||||
{
|
||||
// Specific to joining / leaving the chatroom
|
||||
k_EChatMemberStateChangeEntered = 0x0001, // This user has joined or is joining the chat room
|
||||
k_EChatMemberStateChangeLeft = 0x0002, // This user has left or is leaving the chat room
|
||||
k_EChatMemberStateChangeDisconnected = 0x0004, // User disconnected without leaving the chat first
|
||||
k_EChatMemberStateChangeKicked = 0x0008, // User kicked
|
||||
k_EChatMemberStateChangeBanned = 0x0010, // User kicked and banned
|
||||
};
|
||||
|
||||
// returns true of the flags indicate that a user has been removed from the chat
|
||||
#define BChatMemberStateChangeRemoved( rgfChatMemberStateChangeFlags ) ( rgfChatMemberStateChangeFlags & ( k_EChatMemberStateChangeDisconnected | k_EChatMemberStateChangeLeft | k_EChatMemberStateChangeKicked | k_EChatMemberStateChangeBanned ) )
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: a server was added/removed from the favorites list, you should refresh now
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FavoritesListChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 2 };
|
||||
uint32 m_nIP; // an IP of 0 means reload the whole list, any other value means just one server
|
||||
uint32 m_nQueryPort;
|
||||
uint32 m_nConnPort;
|
||||
uint32 m_nAppID;
|
||||
uint32 m_nFlags;
|
||||
bool m_bAdd; // true if this is adding the entry, otherwise it is a remove
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Someone has invited you to join a Lobby
|
||||
// normally you don't need to do anything with this, since
|
||||
// the Steam UI will also display a '<user> has invited you to the lobby, join?' dialog
|
||||
//
|
||||
// if the user outside a game chooses to join, your game will be launched with the parameter "+connect_lobby <64-bit lobby id>",
|
||||
// or with the callback GameLobbyJoinRequested_t if they're already in-game
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyInvite_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 3 };
|
||||
|
||||
uint64 m_ulSteamIDUser; // Steam ID of the person making the invite
|
||||
uint64 m_ulSteamIDLobby; // Steam ID of the Lobby
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent on entering a lobby, or on failing to enter
|
||||
// m_EChatRoomEnterResponse will be set to k_EChatRoomEnterResponseSuccess on success,
|
||||
// or a higher value on failure (see enum EChatRoomEnterResponse)
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyEnter_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 4 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // SteamID of the Lobby you have entered
|
||||
uint32 m_rgfChatPermissions; // Permissions of the current user
|
||||
bool m_bLocked; // If true, then only invited users may join
|
||||
uint32 m_EChatRoomEnterResponse; // EChatRoomEnterResponse
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby metadata has changed
|
||||
// if m_ulSteamIDMember is the steamID of a lobby member, use GetLobbyMemberData() to access per-user details
|
||||
// if m_ulSteamIDMember == m_ulSteamIDLobby, use GetLobbyData() to access lobby metadata
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyDataUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 5 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // steamID of the Lobby
|
||||
uint64 m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The lobby chat room state has changed
|
||||
// this is usually sent when a user has joined or left the lobby
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 6 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // Lobby ID
|
||||
uint64 m_ulSteamIDUserChanged; // user who's status in the lobby just changed - can be recipient
|
||||
uint64 m_ulSteamIDMakingChange; // Chat member who made the change (different from SteamIDUserChange if kicking, muting, etc.)
|
||||
// for example, if one user kicks another from the lobby, this will be set to the id of the user who initiated the kick
|
||||
uint32 m_rgfChatMemberStateChange; // bitfield of EChatMemberStateChange values
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A chat message for this lobby has been sent
|
||||
// use GetLobbyChatEntry( m_iChatID ) to retrieve the contents of this message
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyChatMsg_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 7 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby id this is in
|
||||
uint64 m_ulSteamIDUser; // steamID of the user who has sent this message
|
||||
uint8 m_eChatEntryType; // type of message
|
||||
uint32 m_iChatID; // index of the chat entry to lookup
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A game created a game for all the members of the lobby to join,
|
||||
// as triggered by a SetLobbyGameServer()
|
||||
// it's up to the individual clients to take action on this; the usual
|
||||
// game behavior is to leave the lobby and connect to the specified game server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyGameCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 9 };
|
||||
|
||||
uint64 m_ulSteamIDLobby; // the lobby we were in
|
||||
uint64 m_ulSteamIDGameServer; // the new game server that has been created or found for the lobby members
|
||||
uint32 m_unIP; // IP & Port of the game server (if any)
|
||||
uint16 m_usPort;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Number of matching lobbies found
|
||||
// iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyMatchList_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 10 };
|
||||
uint32 m_nLobbiesMatching; // Number of lobbies that matched search criteria and we have SteamIDs for
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Result of our request to create a Lobby
|
||||
// m_eResult == k_EResultOK on success
|
||||
// at this point, the local user may not have finishing joining this lobby;
|
||||
// game code should wait until the subsequent LobbyEnter_t callback is received
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LobbyCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 };
|
||||
|
||||
EResult m_eResult; // k_EResultOK - the lobby was successfully created
|
||||
// k_EResultNoConnection - your Steam client doesn't have a connection to the back-end
|
||||
// k_EResultTimeout - you the message to the Steam servers, but it didn't respond
|
||||
// k_EResultFail - the server responded, but with an unknown internal error
|
||||
// k_EResultAccessDenied - your game isn't set to allow lobbies, or your client does haven't rights to play the game
|
||||
// k_EResultLimitExceeded - your game client has created too many lobbies
|
||||
|
||||
uint64 m_ulSteamIDLobby; // chat room, zero if failed
|
||||
};
|
||||
|
||||
|
||||
// used by now obsolete RequestFriendsLobbiesResponse_t
|
||||
// enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 };
|
||||
|
||||
|
||||
|
||||
#endif // ISTEAMMATCHMAKING
|
||||
271
res/steamworks/105/headers/isteamnetworking.h
Normal file
271
res/steamworks/105/headers/isteamnetworking.h
Normal file
@@ -0,0 +1,271 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing network connections between game clients & servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMNETWORKING
|
||||
#define ISTEAMNETWORKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
|
||||
// list of possible errors returned by SendP2PPacket() API
|
||||
// these will be posted in the P2PSessionConnectFail_t callback
|
||||
enum EP2PSessionError
|
||||
{
|
||||
k_EP2PSessionErrorNone = 0,
|
||||
k_EP2PSessionErrorNotRunningApp = 1, // target is not running the same game
|
||||
k_EP2PSessionErrorNoRightsToApp = 2, // local user doesn't own the app that is running
|
||||
k_EP2PSessionErrorDestinationNotLoggedIn = 3, // target user isn't connected to Steam
|
||||
k_EP2PSessionErrorTimeout = 4, // target isn't responding, perhaps not calling AcceptP2PSessionWithUser()
|
||||
|
||||
};
|
||||
|
||||
// SendP2PPacket() send types
|
||||
// Typically k_EP2PSendUnreliable is what you want for UDP-like packets, k_EP2PSendReliable for TCP-like packets
|
||||
enum EP2PSend
|
||||
{
|
||||
// Basic UDP send. Packets can't be bigger than 1200 bytes (your typical MTU size). Can be lost, or arrive out of order (rare).
|
||||
// The sending API does have some knowledge of the underlying connection, so if there is no NAT-traversal accomplished or
|
||||
// there is a recognized adjustment happening on the connection, the packet will be batched until the connection is open again.
|
||||
k_EP2PSendUnreliable = 0,
|
||||
|
||||
// As above, but if the underlying p2p connection isn't yet established the packet will just be thrown away. Using this on the first
|
||||
// packet sent to a remote host almost guarantees the packet will be dropped.
|
||||
// This is only really useful for kinds of data that should never buffer up, i.e. voice payload packets
|
||||
k_EP2PSendUnreliableNoDelay = 1,
|
||||
|
||||
// Reliable message send. Can send up to 1MB of data in a single message.
|
||||
// Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for efficient sends of large chunks of data.
|
||||
k_EP2PSendReliable = 2,
|
||||
|
||||
// As above, but applies the Nagle algorithm to the send - sends will accumulate
|
||||
// until the current MTU size (typically ~1200 bytes, but can change) or ~200ms has passed (Nagle algorithm).
|
||||
// Useful if you want to send a set of smaller messages but have the coalesced into a single packet
|
||||
// Since the reliable stream is all ordered, you can do several small message sends with k_EP2PSendReliableWithBuffering and then
|
||||
// do a normal k_EP2PSendReliable to force all the buffered data to be sent.
|
||||
k_EP2PSendReliableWithBuffering = 3,
|
||||
|
||||
};
|
||||
|
||||
|
||||
// connection state to a specified user, returned by GetP2PSessionState()
|
||||
// this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin
|
||||
struct P2PSessionState_t
|
||||
{
|
||||
uint8 m_bConnectionActive; // true if we've got an active open connection
|
||||
uint8 m_bConnecting; // true if we're currently trying to establish a connection
|
||||
uint8 m_eP2PSessionError; // last error recorded (see enum above)
|
||||
uint8 m_bUsingRelay; // true if it's going through a relay server (TURN)
|
||||
int32 m_nBytesQueuedForSend;
|
||||
int32 m_nPacketsQueuedForSend;
|
||||
uint32 m_nRemoteIP; // potential IP:Port of remote host. Could be TURN server.
|
||||
uint16 m_nRemotePort; // Only exists for compatibility with older authentication api's
|
||||
};
|
||||
|
||||
|
||||
// handle to a socket
|
||||
typedef uint32 SNetSocket_t; // CreateP2PConnectionSocket()
|
||||
typedef uint32 SNetListenSocket_t; // CreateListenSocket()
|
||||
|
||||
// connection progress indicators, used by CreateP2PConnectionSocket()
|
||||
enum ESNetSocketState
|
||||
{
|
||||
k_ESNetSocketStateInvalid = 0,
|
||||
|
||||
// communication is valid
|
||||
k_ESNetSocketStateConnected = 1,
|
||||
|
||||
// states while establishing a connection
|
||||
k_ESNetSocketStateInitiated = 10, // the connection state machine has started
|
||||
|
||||
// p2p connections
|
||||
k_ESNetSocketStateLocalCandidatesFound = 11, // we've found our local IP info
|
||||
k_ESNetSocketStateReceivedRemoteCandidates = 12,// we've received information from the remote machine, via the Steam back-end, about their IP info
|
||||
|
||||
// direct connections
|
||||
k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server
|
||||
|
||||
// failure states
|
||||
k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end
|
||||
k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown
|
||||
k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection
|
||||
k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us
|
||||
k_ESNetSocketStateConnectionBroken = 25, // connection has been broken; either the other end has disappeared or our local network connection has broke
|
||||
|
||||
};
|
||||
|
||||
// describes how the socket is currently connected
|
||||
enum ESNetSocketConnectionType
|
||||
{
|
||||
k_ESNetSocketConnectionTypeNotConnected = 0,
|
||||
k_ESNetSocketConnectionTypeUDP = 1,
|
||||
k_ESNetSocketConnectionTypeUDPRelay = 2,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for making connections and sending data between clients,
|
||||
// traversing NAT's where possible
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamNetworking
|
||||
{
|
||||
public:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Session-less connection functions
|
||||
// automatically establishes NAT-traversing or Relay server connections
|
||||
|
||||
// Sends a P2P packet to the specified user
|
||||
// UDP-like, unreliable and a max packet size of 1200 bytes
|
||||
// the first packet send may be delayed as the NAT-traversal code runs
|
||||
// if we can't get through to the user, an error will be posted via the callback P2PSessionConnectFail_t
|
||||
// see EP2PSend enum above for the descriptions of the different ways of sending packets
|
||||
virtual bool SendP2PPacket( CSteamID steamIDRemote, const void *pubData, uint32 cubData, EP2PSend eP2PSendType ) = 0;
|
||||
|
||||
// returns true if any data is available for read, and the amount of data that will need to be read
|
||||
virtual bool IsP2PPacketAvailable( uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// reads in a packet that has been sent from another user via SendP2PPacket()
|
||||
// returns the size of the message and the steamID of the user who sent it in the last two parameters
|
||||
// if the buffer passed in is too small, the message will be truncated
|
||||
// this call is not blocking, and will return false if no data is available
|
||||
virtual bool ReadP2PPacket( void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, CSteamID *psteamIDRemote ) = 0;
|
||||
|
||||
// AcceptP2PSessionWithUser() should only be called in response to a P2PSessionRequest_t callback
|
||||
// P2PSessionRequest_t will be posted if another user tries to send you a packet that you haven't talked to yet
|
||||
// if you don't want to talk to the user, just ignore the request
|
||||
// if the user continues to send you packets, another P2PSessionRequest_t will be posted periodically
|
||||
// this may be called multiple times for a single user
|
||||
// (if you've called SendP2PPacket() on the other user, this implicitly accepts the session request)
|
||||
virtual bool AcceptP2PSessionWithUser( CSteamID steamIDRemote ) = 0;
|
||||
|
||||
// call CloseP2PSessionWithUser() when you're done talking to a user, will free up resources under-the-hood
|
||||
// if the remote user tries to send data to you again, another P2PSessionRequest_t callback will be posted
|
||||
virtual bool CloseP2PSessionWithUser( CSteamID steamIDRemote ) = 0;
|
||||
|
||||
// fills out P2PSessionState_t structure with details about the underlying connection to the user
|
||||
// should only needed for debugging purposes
|
||||
// returns false if no connection exists to the specified user
|
||||
virtual bool GetP2PSessionState( CSteamID steamIDRemote, P2PSessionState_t *pConnectionState ) = 0;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// LISTEN / CONNECT style interface functions
|
||||
//
|
||||
// This is an older set of functions designed around the Berkeley TCP sockets model
|
||||
// it's preferential that you use the above P2P functions, they're more robust
|
||||
// and these older functions will be removed eventually
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// creates a socket and listens others to connect
|
||||
// will trigger a SocketStatusCallback_t callback on another client connecting
|
||||
// nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports
|
||||
// this can usually just be 0 unless you want multiple sets of connections
|
||||
// unIP is the local IP address to bind to
|
||||
// pass in 0 if you just want the default local IP
|
||||
// unPort is the port to use
|
||||
// pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only
|
||||
virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay ) = 0;
|
||||
|
||||
// creates a socket and begin connection to a remote destination
|
||||
// can connect via a known steamID (client or game server), or directly to an IP
|
||||
// on success will trigger a SocketStatusCallback_t callback
|
||||
// on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState
|
||||
virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay ) = 0;
|
||||
virtual SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec ) = 0;
|
||||
|
||||
// disconnects the connection to the socket, if any, and invalidates the handle
|
||||
// any unread data on the socket will be thrown away
|
||||
// if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect
|
||||
virtual bool DestroySocket( SNetSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
// destroying a listen socket will automatically kill all the regular sockets generated from it
|
||||
virtual bool DestroyListenSocket( SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
|
||||
// sending data
|
||||
// must be a handle to a connected socket
|
||||
// data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets
|
||||
// use the reliable flag with caution; although the resend rate is pretty aggressive,
|
||||
// it can still cause stalls in receiving data (like TCP)
|
||||
virtual bool SendDataOnSocket( SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable ) = 0;
|
||||
|
||||
// receiving data
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// checks for data from any socket that has been connected off this listen socket
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool IsDataAvailable( SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// retrieves data from any socket that has been connected off this listen socket
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// returns information about the specified socket, filling out the contents of the pointers
|
||||
virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote ) = 0;
|
||||
|
||||
// returns which local port the listen socket is bound to
|
||||
// *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only
|
||||
virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort ) = 0;
|
||||
|
||||
// returns true to describe how the socket ended up connecting
|
||||
virtual ESNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket ) = 0;
|
||||
|
||||
// max packet size, in bytes
|
||||
virtual int GetMaxPacketSize( SNetSocket_t hSocket ) = 0;
|
||||
};
|
||||
#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking003"
|
||||
|
||||
|
||||
// callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API
|
||||
// in response, a call to AcceptP2PPacketsFromUser() needs to be made, if you want to talk with them
|
||||
struct P2PSessionRequest_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 2 };
|
||||
CSteamID m_steamIDRemote; // user who wants to talk to us
|
||||
};
|
||||
|
||||
|
||||
// callback notification - packets can't get through to the specified user via the SendP2PPacket() API
|
||||
// all packets queued packets unsent at this point will be dropped
|
||||
// further attempts to send will retry making the connection (but will be dropped if we fail again)
|
||||
struct P2PSessionConnectFail_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 3 };
|
||||
CSteamID m_steamIDRemote; // user we were sending packets to
|
||||
uint8 m_eP2PSessionError; // EP2PSessionError indicating why we're having trouble
|
||||
};
|
||||
|
||||
|
||||
// callback notification - status of a socket has changed
|
||||
// used as part of the CreateListenSocket() / CreateP2PConnectionSocket()
|
||||
struct SocketStatusCallback_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 };
|
||||
SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host
|
||||
SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection
|
||||
CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one
|
||||
int m_eSNetSocketState; // socket state, ESNetSocketState
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMNETWORKING
|
||||
45
res/steamworks/105/headers/isteamremotestorage.h
Normal file
45
res/steamworks/105/headers/isteamremotestorage.h
Normal file
@@ -0,0 +1,45 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: public interface to user remote file storage in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMREMOTESTORAGE_H
|
||||
#define ISTEAMREMOTESTORAGE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing, reading and writing files stored remotely
|
||||
// and cached locally
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamRemoteStorage
|
||||
{
|
||||
public:
|
||||
// NOTE
|
||||
//
|
||||
// Filenames are case-insensitive, and will be converted to lowercase automatically.
|
||||
// So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then
|
||||
// iterate the files, the filename returned will be "foo.bar".
|
||||
//
|
||||
|
||||
// file operations
|
||||
virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0;
|
||||
virtual int32 GetFileSize( const char *pchFile ) = 0;
|
||||
virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0;
|
||||
virtual bool FileExists( const char *pchFile ) = 0;
|
||||
|
||||
// iteration
|
||||
virtual int32 GetFileCount() = 0;
|
||||
virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0;
|
||||
|
||||
// quota management
|
||||
virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION002"
|
||||
|
||||
#endif // ISTEAMREMOTESTORAGE_H
|
||||
203
res/steamworks/105/headers/isteamuser.h
Normal file
203
res/steamworks/105/headers/isteamuser.h
Normal file
@@ -0,0 +1,203 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSER_H
|
||||
#define ISTEAMUSER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// structure that contains client callback data
|
||||
// see callbacks documentation for more details
|
||||
struct CallbackMsg_t
|
||||
{
|
||||
HSteamUser m_hSteamUser;
|
||||
int m_iCallback;
|
||||
uint8 *m_pubParam;
|
||||
int m_cubParam;
|
||||
};
|
||||
|
||||
// reference to a steam call, to filter results by
|
||||
typedef int32 HSteamCall;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing and manipulating a steam account
|
||||
// associated with one client instance
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUser
|
||||
{
|
||||
public:
|
||||
// returns the HSteamUser this interface represents
|
||||
// this is only used internally by the API, and by a few select interfaces that support multi-user
|
||||
virtual HSteamUser GetHSteamUser() = 0;
|
||||
|
||||
// returns true if the Steam client current has a live connection to the Steam servers.
|
||||
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
|
||||
// The Steam client will automatically be trying to recreate the connection as often as possible.
|
||||
virtual bool BLoggedOn() = 0;
|
||||
|
||||
// returns the CSteamID of the account currently logged into the Steam client
|
||||
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Multiplayer Authentication functions
|
||||
|
||||
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
|
||||
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
|
||||
//
|
||||
// Parameters:
|
||||
// void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.
|
||||
// int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
|
||||
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
|
||||
// CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )
|
||||
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
|
||||
// bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)
|
||||
//
|
||||
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
|
||||
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
|
||||
virtual int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
|
||||
|
||||
// notify of disconnect
|
||||
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
|
||||
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
|
||||
|
||||
// Legacy functions
|
||||
|
||||
// used by only a few games to track usage events
|
||||
virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
|
||||
|
||||
// get the local storage folder for current Steam account to write application data, e.g. save games, configs etc.
|
||||
// this will usually be something like "C:\Progam Files\Steam\userdata\<SteamID>\<AppID>\local"
|
||||
virtual bool GetUserDataFolder( char *pchBuffer, int cubBuffer ) = 0;
|
||||
|
||||
// Starts voice recording. Once started, use GetCompressedVoice() to get the data
|
||||
virtual void StartVoiceRecording( ) = 0;
|
||||
|
||||
// Stops voice recording. Because people often release push-to-talk keys early, the system will keep recording for
|
||||
// a little bit after this function is called. GetCompressedVoice() should continue to be called until it returns
|
||||
// k_eVoiceResultNotRecording
|
||||
virtual void StopVoiceRecording( ) = 0;
|
||||
|
||||
// Gets the latest voice data. It should be called as often as possible once recording has started.
|
||||
// nBytesWritten is set to the number of bytes written to pDestBuffer.
|
||||
virtual EVoiceResult GetCompressedVoice( void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten ) = 0;
|
||||
|
||||
// Decompresses a chunk of data produced by GetCompressedVoice(). nBytesWritten is set to the
|
||||
// number of bytes written to pDestBuffer. The output format of the data is 16-bit signed at
|
||||
// 11025 samples per second.
|
||||
virtual EVoiceResult DecompressVoice( void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten ) = 0;
|
||||
|
||||
// Retrieve ticket to be sent to the entity who wishes to authenticate you.
|
||||
// pcbTicket retrieves the length of the actual ticket.
|
||||
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
|
||||
|
||||
// Authenticate ticket from entity steamID to be sure it is valid and isnt reused
|
||||
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
|
||||
virtual EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID ) = 0;
|
||||
|
||||
// Stop tracking started by BeginAuthSession - called when no longer playing game with this entity
|
||||
virtual void EndAuthSession( CSteamID steamID ) = 0;
|
||||
|
||||
// Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to
|
||||
virtual void CancelAuthTicket( HAuthTicket hAuthTicket ) = 0;
|
||||
|
||||
// After receiving a user's authentication data, and passing it to BeginAuthSession, use this function
|
||||
// to determine if the user owns downloadable content specified by the provided AppID.
|
||||
virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser012"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connections to the Steam back-end has been established
|
||||
// this means the Steam client now has a working connection to the Steam servers
|
||||
// usually this will have occurred before the game has launched, and should
|
||||
// only be seen if the user has dropped connection due to a networking issue
|
||||
// or a Steam server update
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersConnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 1 };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connection attempt has failed
|
||||
// this will occur periodically if the Steam client is not connected,
|
||||
// and has failed in it's retry to establish a connection
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServerConnectFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 2 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called if the client has lost connection to the Steam servers
|
||||
// real-time services will be disabled until a matching SteamServersConnected_t has been posted
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersDisconnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 3 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server,
|
||||
// which it may be in the process of or already connected to.
|
||||
// The game client should immediately disconnect upon receiving this message.
|
||||
// This can usually occur if the user doesn't have rights to play on the game server.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ClientGameServerDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 13 };
|
||||
|
||||
uint32 m_uAppID;
|
||||
uint32 m_unGameServerIP;
|
||||
uint16 m_usGameServerPort;
|
||||
uint16 m_bSecure;
|
||||
uint32 m_uReason;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks)
|
||||
// When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect.
|
||||
// This usually occurs in the rare event the Steam client has some kind of fatal error.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct IPCFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 17 };
|
||||
enum EFailureType
|
||||
{
|
||||
k_EFailureFlushedCallbackQueue,
|
||||
k_EFailurePipeFail,
|
||||
};
|
||||
uint8 m_eFailureType;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for BeginAuthSession
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ValidateAuthTicketResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 43 };
|
||||
CSteamID m_SteamID;
|
||||
EAuthSessionResponse m_eAuthSessionResponse;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
277
res/steamworks/105/headers/isteamuserstats.h
Normal file
277
res/steamworks/105/headers/isteamuserstats.h
Normal file
@@ -0,0 +1,277 @@
|
||||
//====== Copyright <20> 1996-2009, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to stats, achievements, and leaderboards
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSERSTATS_H
|
||||
#define ISTEAMUSERSTATS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// size limit on stat or achievement name (UTF-8 encoded)
|
||||
enum { k_cchStatNameMax = 128 };
|
||||
|
||||
// maximum number of bytes for a leaderboard name (UTF-8 encoded)
|
||||
enum { k_cchLeaderboardNameMax = 128 };
|
||||
|
||||
// maximum number of details int32's storable for a single leaderboard entry
|
||||
enum { k_cLeaderboardDetailsMax = 64 };
|
||||
|
||||
// handle to a single leaderboard
|
||||
typedef uint64 SteamLeaderboard_t;
|
||||
|
||||
// handle to a set of downloaded entries in a leaderboard
|
||||
typedef uint64 SteamLeaderboardEntries_t;
|
||||
|
||||
// type of data request, when downloading leaderboard entries
|
||||
enum ELeaderboardDataRequest
|
||||
{
|
||||
k_ELeaderboardDataRequestGlobal = 0,
|
||||
k_ELeaderboardDataRequestGlobalAroundUser = 1,
|
||||
k_ELeaderboardDataRequestFriends = 2,
|
||||
};
|
||||
|
||||
// the sort order of a leaderboard
|
||||
enum ELeaderboardSortMethod
|
||||
{
|
||||
k_ELeaderboardSortMethodNone = 0,
|
||||
k_ELeaderboardSortMethodAscending = 1, // top-score is lowest number
|
||||
k_ELeaderboardSortMethodDescending = 2, // top-score is highest number
|
||||
};
|
||||
|
||||
// the display type (used by the Steam Community web site) for a leaderboard
|
||||
enum ELeaderboardDisplayType
|
||||
{
|
||||
k_ELeaderboardDisplayTypeNone = 0,
|
||||
k_ELeaderboardDisplayTypeNumeric = 1, // simple numerical score
|
||||
k_ELeaderboardDisplayTypeTimeSeconds = 2, // the score represents a time, in seconds
|
||||
k_ELeaderboardDisplayTypeTimeMilliSeconds = 3, // the score represents a time, in milliseconds
|
||||
};
|
||||
|
||||
enum ELeaderboardUploadScoreMethod
|
||||
{
|
||||
k_ELeaderboardUploadScoreMethodNone = 0,
|
||||
k_ELeaderboardUploadScoreMethodKeepBest = 1, // Leaderboard will keep user's best score
|
||||
k_ELeaderboardUploadScoreMethodForceUpdate = 2, // Leaderboard will always replace score with specified
|
||||
};
|
||||
|
||||
// a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry()
|
||||
struct LeaderboardEntry_t
|
||||
{
|
||||
CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info
|
||||
int32 m_nGlobalRank; // [1..N], where N is the number of users with an entry in the leaderboard
|
||||
int32 m_nScore; // score as set in the leaderboard
|
||||
int32 m_cDetails; // number of int32 details available for this entry
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing stats, achievements, and leaderboard information
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUserStats
|
||||
{
|
||||
public:
|
||||
// Ask the server to send down this user's data and achievements for this game
|
||||
virtual bool RequestCurrentStats() = 0;
|
||||
|
||||
// Data accessors
|
||||
virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetStat( const char *pchName, float *pData ) = 0;
|
||||
|
||||
// Set / update data
|
||||
virtual bool SetStat( const char *pchName, int32 nData ) = 0;
|
||||
virtual bool SetStat( const char *pchName, float fData ) = 0;
|
||||
virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||
|
||||
// Achievement flag accessors
|
||||
virtual bool GetAchievement( const char *pchName, bool *pbAchieved ) = 0;
|
||||
virtual bool SetAchievement( const char *pchName ) = 0;
|
||||
virtual bool ClearAchievement( const char *pchName ) = 0;
|
||||
|
||||
// Store the current data on the server, will get a callback when set
|
||||
// And one callback for every new achievement
|
||||
virtual bool StoreStats() = 0;
|
||||
|
||||
// Achievement / GroupAchievement metadata
|
||||
|
||||
// Gets the icon of the achievement, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set
|
||||
virtual int GetAchievementIcon( const char *pchName ) = 0;
|
||||
// Get general attributes (display name / text, etc) for an Achievement
|
||||
virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0;
|
||||
|
||||
// Achievement progress - triggers an AchievementProgress callback, that is all.
|
||||
// Calling this w/ N out of N progress will NOT set the achievement, the game must still do that.
|
||||
virtual bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint32 nMaxProgress ) = 0;
|
||||
|
||||
// Friends stats & achievements
|
||||
|
||||
// downloads stats for the user
|
||||
// returns a UserStatsReceived_t received when completed
|
||||
// if the other user has no stats, UserStatsReceived_t.m_eResult will be set to k_EResultFail
|
||||
// these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data
|
||||
virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// requests stat information for a user, usable after a successful call to RequestUserStats()
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
|
||||
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
|
||||
|
||||
// Reset stats
|
||||
virtual bool ResetAllStats( bool bAchievementsToo ) = 0;
|
||||
|
||||
// Leaderboard functions
|
||||
|
||||
// asks the Steam back-end for a leaderboard by name, and will create it if it's not yet
|
||||
// This call is asynchronous, with the result returned in LeaderboardFindResult_t
|
||||
virtual SteamAPICall_t FindOrCreateLeaderboard( const char *pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ) = 0;
|
||||
|
||||
// as above, but won't create the leaderboard if it's not found
|
||||
// This call is asynchronous, with the result returned in LeaderboardFindResult_t
|
||||
virtual SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName ) = 0;
|
||||
|
||||
// returns the name of a leaderboard
|
||||
virtual const char *GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// returns the total number of entries in a leaderboard, as of the last request
|
||||
virtual int GetLeaderboardEntryCount( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// returns the sort method of the leaderboard
|
||||
virtual ELeaderboardSortMethod GetLeaderboardSortMethod( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// returns the display type of the leaderboard
|
||||
virtual ELeaderboardDisplayType GetLeaderboardDisplayType( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// Asks the Steam back-end for a set of rows in the leaderboard.
|
||||
// This call is asynchronous, with the result returned in LeaderboardScoresDownloaded_t
|
||||
// LeaderboardScoresDownloaded_t will contain a handle to pull the results from GetDownloadedLeaderboardEntries() (below)
|
||||
// You can ask for more entries than exist, and it will return as many as do exist.
|
||||
// k_ELeaderboardDataRequestGlobal requests rows in the leaderboard from the full table, with nRangeStart & nRangeEnd in the range [1, TotalEntries]
|
||||
// k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user, nRangeStart being negate
|
||||
// e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after
|
||||
// k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user
|
||||
virtual SteamAPICall_t DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) = 0;
|
||||
|
||||
// Returns data about a single leaderboard entry
|
||||
// use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries
|
||||
// e.g.
|
||||
// void OnLeaderboardScoresDownloaded( LeaderboardScoresDownloaded_t *pLeaderboardScoresDownloaded )
|
||||
// {
|
||||
// for ( int index = 0; index < pLeaderboardScoresDownloaded->m_cEntryCount; index++ )
|
||||
// {
|
||||
// LeaderboardEntry_t leaderboardEntry;
|
||||
// int32 details[3]; // we know this is how many we've stored previously
|
||||
// GetDownloadedLeaderboardEntry( pLeaderboardScoresDownloaded->m_hSteamLeaderboardEntries, index, &leaderboardEntry, details, 3 );
|
||||
// assert( leaderboardEntry.m_cDetails == 3 );
|
||||
// ...
|
||||
// }
|
||||
// once you've accessed all the entries, the data will be free'd, and the SteamLeaderboardEntries_t handle will become invalid
|
||||
virtual bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, LeaderboardEntry_t *pLeaderboardEntry, int32 *pDetails, int cDetailsMax ) = 0;
|
||||
|
||||
// Uploads a user score to the Steam back-end.
|
||||
// This call is asynchronous, with the result returned in LeaderboardScoreUploaded_t
|
||||
// Details are extra game-defined information regarding how the user got that score
|
||||
// pScoreDetails points to an array of int32's, cScoreDetailsCount is the number of int32's in the list
|
||||
virtual SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32 *pScoreDetails, int cScoreDetailsCount ) = 0;
|
||||
|
||||
// Retrieves the number of players currently playing your game (online + offline)
|
||||
// This call is asynchronous, with the result returned in NumberOfCurrentPlayers_t
|
||||
virtual SteamAPICall_t GetNumberOfCurrentPlayers() = 0;
|
||||
};
|
||||
|
||||
#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION006"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the latests stats and achievements have been received
|
||||
// from the server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsReceived_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // Success / error fetching the stats
|
||||
CSteamID m_steamIDUser; // The user for whom the stats are retrieved for
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the user stats for a game
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // success / error
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the achievements for a game, or an
|
||||
// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress
|
||||
// are zero, that means the achievement has been fully unlocked.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserAchievementStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 };
|
||||
|
||||
uint64 m_nGameID; // Game this is for
|
||||
bool m_bGroupAchievement; // if this is a "group" achievement
|
||||
char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement
|
||||
uint32 m_nCurProgress; // current progress towards the achievement
|
||||
uint32 m_nMaxProgress; // "out of" this many
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: call result for finding a leaderboard, returned as a result of FindOrCreateLeaderboard() or FindLeaderboard()
|
||||
// use CCallResult<> to map this async result to a member function
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LeaderboardFindResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 4 };
|
||||
SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard serarched for, 0 if no leaderboard found
|
||||
uint8 m_bLeaderboardFound; // 0 if no leaderboard found
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: call result indicating scores for a leaderboard have been downloaded and are ready to be retrieved, returned as a result of DownloadLeaderboardEntries()
|
||||
// use CCallResult<> to map this async result to a member function
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LeaderboardScoresDownloaded_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 5 };
|
||||
SteamLeaderboard_t m_hSteamLeaderboard;
|
||||
SteamLeaderboardEntries_t m_hSteamLeaderboardEntries; // the handle to pass into GetDownloadedLeaderboardEntries()
|
||||
int m_cEntryCount; // the number of entries downloaded
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: call result indicating scores has been uploaded, returned as a result of UploadLeaderboardScore()
|
||||
// use CCallResult<> to map this async result to a member function
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LeaderboardScoreUploaded_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 6 };
|
||||
uint8 m_bSuccess; // 1 if the call was successful
|
||||
SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was
|
||||
int32 m_nScore; // the score that was attempted to set
|
||||
uint8 m_bScoreChanged; // true if the score in the leaderboard change, false if the existing score was better
|
||||
int m_nGlobalRankNew; // the new global rank of the user in this leaderboard
|
||||
int m_nGlobalRankPrevious; // the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard
|
||||
};
|
||||
|
||||
struct NumberOfCurrentPlayers_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 7 };
|
||||
uint8 m_bSuccess; // 1 if the call was successful
|
||||
int32 m_cPlayers; // Number of players currently playing
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
146
res/steamworks/105/headers/isteamutils.h
Normal file
146
res/steamworks/105/headers/isteamutils.h
Normal file
@@ -0,0 +1,146 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to utility functions in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUTILS_H
|
||||
#define ISTEAMUTILS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
|
||||
// Steam API call failure results
|
||||
enum ESteamAPICallFailure
|
||||
{
|
||||
k_ESteamAPICallFailureNone = -1, // no failure
|
||||
k_ESteamAPICallFailureSteamGone = 0, // the local Steam process has gone away
|
||||
k_ESteamAPICallFailureNetworkFailure = 1, // the network connection to Steam has been broken, or was already broken
|
||||
// SteamServersDisconnected_t callback will be sent around the same time
|
||||
// SteamServersConnected_t will be sent when the client is able to talk to the Steam servers again
|
||||
k_ESteamAPICallFailureInvalidHandle = 2, // the SteamAPICall_t handle passed in no longer exists
|
||||
k_ESteamAPICallFailureMismatchedCallback = 3,// GetAPICallResult() was called with the wrong callback type for this API call
|
||||
};
|
||||
|
||||
// function prototype for warning message hook
|
||||
#if defined( POSIX ) && !defined( _CYGWIN )
|
||||
#define __cdecl
|
||||
#endif
|
||||
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to user independent utility functions
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUtils
|
||||
{
|
||||
public:
|
||||
// return the number of seconds since the user
|
||||
virtual uint32 GetSecondsSinceAppActive() = 0;
|
||||
virtual uint32 GetSecondsSinceComputerActive() = 0;
|
||||
|
||||
// the universe this client is connecting to
|
||||
virtual EUniverse GetConnectedUniverse() = 0;
|
||||
|
||||
// Steam server time - in PST, number of seconds since January 1, 1970 (i.e unix time)
|
||||
virtual uint32 GetServerRealTime() = 0;
|
||||
|
||||
// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
|
||||
// e.g "US" or "UK".
|
||||
virtual const char *GetIPCountry() = 0;
|
||||
|
||||
// returns true if the image exists, and valid sizes were filled out
|
||||
virtual bool GetImageSize( int iImage, uint32 *pnWidth, uint32 *pnHeight ) = 0;
|
||||
|
||||
// returns true if the image exists, and the buffer was successfully filled out
|
||||
// results are returned in RGBA format
|
||||
// the destination buffer size should be 4 * height * width * sizeof(char)
|
||||
virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0;
|
||||
|
||||
// returns the IP of the reporting server for valve - currently only used in Source engine games
|
||||
virtual bool GetCSERIPPort( uint32 *unIP, uint16 *usPort ) = 0;
|
||||
|
||||
// return the amount of battery power left in the current system in % [0..100], 255 for being on AC power
|
||||
virtual uint8 GetCurrentBatteryPower() = 0;
|
||||
|
||||
// returns the appID of the current process
|
||||
virtual uint32 GetAppID() = 0;
|
||||
|
||||
// Sets the position where the overlay instance for the currently calling game should show notifications.
|
||||
// This position is per-game and if this function is called from outside of a game context it will do nothing.
|
||||
virtual void SetOverlayNotificationPosition( ENotificationPosition eNotificationPosition ) = 0;
|
||||
|
||||
// API asynchronous call results
|
||||
// can be used directly, but more commonly used via the callback dispatch API (see steam_api.h)
|
||||
virtual bool IsAPICallCompleted( SteamAPICall_t hSteamAPICall, bool *pbFailed ) = 0;
|
||||
virtual ESteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICall ) = 0;
|
||||
virtual bool GetAPICallResult( SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed ) = 0;
|
||||
|
||||
// this needs to be called every frame to process matchmaking results
|
||||
// redundant if you're already calling SteamAPI_RunCallbacks()
|
||||
virtual void RunFrame() = 0;
|
||||
|
||||
// returns the number of IPC calls made since the last time this function was called
|
||||
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
||||
// Every IPC call is at minimum a thread context switch if not a process one so you want to rate
|
||||
// control how often you do them.
|
||||
virtual uint32 GetIPCCallCount() = 0;
|
||||
|
||||
// API warning handling
|
||||
// 'int' is the severity; 0 for msg, 1 for warning
|
||||
// 'const char *' is the text of the message
|
||||
// callbacks will occur directly after the API function is called that generated the warning or message
|
||||
virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
|
||||
|
||||
// Returns true if the overlay is running & the user can access it. The overlay process could take a few seconds to
|
||||
// start & hook the game process, so this function will initially return false while the overlay is loading.
|
||||
virtual bool IsOverlayEnabled() = 0;
|
||||
};
|
||||
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils004"
|
||||
|
||||
|
||||
// callbacks
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The country of the user changed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct IPCountry_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 1 };
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LowBatteryPower_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 2 };
|
||||
uint8 m_nMinutesBatteryLeft;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a SteamAsyncCall_t has completed (or failed)
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamAPICallCompleted_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 3 };
|
||||
SteamAPICall_t m_hAsyncCall;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// called when Steam wants to shutdown
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamShutdown_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 4 };
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMUTILS_H
|
||||
242
res/steamworks/105/headers/matchmakingtypes.h
Normal file
242
res/steamworks/105/headers/matchmakingtypes.h
Normal file
@@ -0,0 +1,242 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
|
||||
#ifndef MATCHMAKINGTYPES_H
|
||||
#define MATCHMAKINGTYPES_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef POSIX
|
||||
#ifndef _snprintf
|
||||
#define _snprintf snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
struct MatchMakingKeyValuePair_t
|
||||
{
|
||||
MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; }
|
||||
MatchMakingKeyValuePair_t( const char *pchKey, const char *pchValue )
|
||||
{
|
||||
strncpy( m_szKey, pchKey, sizeof(m_szKey) ); // this is a public header, use basic c library string funcs only!
|
||||
strncpy( m_szValue, pchValue, sizeof(m_szValue) );
|
||||
}
|
||||
char m_szKey[ 256 ];
|
||||
char m_szValue[ 256 ];
|
||||
};
|
||||
|
||||
|
||||
enum EMatchMakingServerResponse
|
||||
{
|
||||
eServerResponded = 0,
|
||||
eServerFailedToRespond,
|
||||
eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match
|
||||
};
|
||||
|
||||
enum EMatchMakingType
|
||||
{
|
||||
eInternetServer = 0,
|
||||
eLANServer,
|
||||
eFriendsServer,
|
||||
eFavoritesServer,
|
||||
eHistoryServer,
|
||||
eSpectatorServer,
|
||||
eInvalidServer
|
||||
};
|
||||
|
||||
|
||||
// servernetadr_t is all the addressing info the serverbrowser needs to know about a game server,
|
||||
// namely: its IP, its connection port, and its query port.
|
||||
class servernetadr_t
|
||||
{
|
||||
public:
|
||||
|
||||
void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort );
|
||||
#ifdef NETADR_H
|
||||
void Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort );
|
||||
netadr_t& GetIPAndQueryPort();
|
||||
#endif
|
||||
|
||||
// Access the query port.
|
||||
uint16 GetQueryPort() const;
|
||||
void SetQueryPort( uint16 usPort );
|
||||
|
||||
// Access the connection port.
|
||||
uint16 GetConnectionPort() const;
|
||||
void SetConnectionPort( uint16 usPort );
|
||||
|
||||
// Access the IP
|
||||
uint32 GetIP() const;
|
||||
void SetIP( uint32 );
|
||||
|
||||
// This gets the 'a.b.c.d:port' string with the connection port (instead of the query port).
|
||||
const char *GetConnectionAddressString() const;
|
||||
const char *GetQueryAddressString() const;
|
||||
|
||||
// Comparison operators and functions.
|
||||
bool operator<(const servernetadr_t &netadr) const;
|
||||
void operator=( const servernetadr_t &that )
|
||||
{
|
||||
m_usConnectionPort = that.m_usConnectionPort;
|
||||
m_usQueryPort = that.m_usQueryPort;
|
||||
m_unIP = that.m_unIP;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
const char *ToString( uint32 unIP, uint16 usPort ) const;
|
||||
uint16 m_usConnectionPort; // (in HOST byte order)
|
||||
uint16 m_usQueryPort;
|
||||
uint32 m_unIP;
|
||||
};
|
||||
|
||||
|
||||
inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
m_unIP = ip;
|
||||
m_usQueryPort = usQueryPort;
|
||||
m_usConnectionPort = usConnectionPort;
|
||||
}
|
||||
|
||||
#ifdef NETADR_H
|
||||
inline void servernetadr_t::Init( const netadr_t &ipAndQueryPort, uint16 usConnectionPort )
|
||||
{
|
||||
Init( ipAndQueryPort.GetIP(), ipAndQueryPort.GetPort(), usConnectionPort );
|
||||
}
|
||||
|
||||
inline netadr_t& servernetadr_t::GetIPAndQueryPort()
|
||||
{
|
||||
static netadr_t netAdr;
|
||||
netAdr.SetIP( m_unIP );
|
||||
netAdr.SetPort( m_usQueryPort );
|
||||
return netAdr;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline uint16 servernetadr_t::GetQueryPort() const
|
||||
{
|
||||
return m_usQueryPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetQueryPort( uint16 usPort )
|
||||
{
|
||||
m_usQueryPort = usPort;
|
||||
}
|
||||
|
||||
inline uint16 servernetadr_t::GetConnectionPort() const
|
||||
{
|
||||
return m_usConnectionPort;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetConnectionPort( uint16 usPort )
|
||||
{
|
||||
m_usConnectionPort = usPort;
|
||||
}
|
||||
|
||||
inline uint32 servernetadr_t::GetIP() const
|
||||
{
|
||||
return m_unIP;
|
||||
}
|
||||
|
||||
inline void servernetadr_t::SetIP( uint32 unIP )
|
||||
{
|
||||
m_unIP = unIP;
|
||||
}
|
||||
|
||||
inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const
|
||||
{
|
||||
static char s[4][64];
|
||||
static int nBuf = 0;
|
||||
unsigned char *ipByte = (unsigned char *)&unIP;
|
||||
_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
|
||||
const char *pchRet = s[nBuf];
|
||||
++nBuf;
|
||||
nBuf %= ( (sizeof(s)/sizeof(s[0])) );
|
||||
return pchRet;
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetConnectionAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usConnectionPort );
|
||||
}
|
||||
|
||||
inline const char* servernetadr_t::GetQueryAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usQueryPort );
|
||||
}
|
||||
|
||||
inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const
|
||||
{
|
||||
return ( m_unIP < netadr.m_unIP ) || ( m_unIP == netadr.m_unIP && m_usQueryPort < netadr.m_usQueryPort );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Data describing a single server
|
||||
//-----------------------------------------------------------------------------
|
||||
class gameserveritem_t
|
||||
{
|
||||
public:
|
||||
gameserveritem_t();
|
||||
|
||||
const char* GetName() const;
|
||||
void SetName( const char *pName );
|
||||
|
||||
public:
|
||||
servernetadr_t m_NetAdr; // IP/Query Port/Connection Port for this server
|
||||
int m_nPing; // current ping time in milliseconds
|
||||
bool m_bHadSuccessfulResponse; // server has responded successfully in the past
|
||||
bool m_bDoNotRefresh; // server is marked as not responding and should no longer be refreshed
|
||||
char m_szGameDir[32]; // current game directory
|
||||
char m_szMap[32]; // current map
|
||||
char m_szGameDescription[64]; // game description
|
||||
int m_nAppID; // Steam App ID of this server
|
||||
int m_nPlayers; // current number of players on the server
|
||||
int m_nMaxPlayers; // Maximum players that can join this server
|
||||
int m_nBotPlayers; // Number of bots (i.e simulated players) on this server
|
||||
bool m_bPassword; // true if this server needs a password to join
|
||||
bool m_bSecure; // Is this server protected by VAC
|
||||
uint32 m_ulTimeLastPlayed; // time (in unix time) when this server was last played on (for favorite/history servers)
|
||||
int m_nServerVersion; // server version as reported to Steam
|
||||
|
||||
private:
|
||||
char m_szServerName[64]; // Game server name
|
||||
|
||||
// For data added after SteamMatchMaking001 add it here
|
||||
public:
|
||||
char m_szGameTags[128]; // the tags this server exposes
|
||||
CSteamID m_steamID; // steamID of the game server - invalid if it's doesn't have one (old server, or not connected to Steam)
|
||||
};
|
||||
|
||||
|
||||
inline gameserveritem_t::gameserveritem_t()
|
||||
{
|
||||
m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0;
|
||||
m_bHadSuccessfulResponse = m_bDoNotRefresh = m_bPassword = m_bSecure = false;
|
||||
m_nPing = m_nAppID = m_nPlayers = m_nMaxPlayers = m_nBotPlayers = m_ulTimeLastPlayed = m_nServerVersion = 0;
|
||||
m_szGameTags[0] = 0;
|
||||
}
|
||||
|
||||
inline const char* gameserveritem_t::GetName() const
|
||||
{
|
||||
// Use the IP address as the name if nothing is set yet.
|
||||
if ( m_szServerName[0] == 0 )
|
||||
return m_NetAdr.GetConnectionAddressString();
|
||||
else
|
||||
return m_szServerName;
|
||||
}
|
||||
|
||||
inline void gameserveritem_t::SetName( const char *pName )
|
||||
{
|
||||
strncpy( m_szServerName, pName, sizeof( m_szServerName ) );
|
||||
}
|
||||
|
||||
|
||||
#endif // MATCHMAKINGTYPES_H
|
||||
431
res/steamworks/105/headers/steam_api.h
Normal file
431
res/steamworks/105/headers/steam_api.h
Normal file
@@ -0,0 +1,431 @@
|
||||
//====== Copyright 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_API_H
|
||||
#define STEAM_API_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "isteamuser.h"
|
||||
#include "isteamfriends.h"
|
||||
#include "isteamutils.h"
|
||||
#include "isteammatchmaking.h"
|
||||
#include "isteamuserstats.h"
|
||||
#include "isteamapps.h"
|
||||
#include "isteamnetworking.h"
|
||||
#include "isteamremotestorage.h"
|
||||
|
||||
// Steam API export macro
|
||||
#if defined( _WIN32 ) && !defined( _X360 )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __declspec( dllexport )
|
||||
#elif defined( STEAM_API_NODLL )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C" __declspec( dllimport )
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#elif defined( GNUC )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#else // !WIN32
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C"
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// Steam API setup & shutdown
|
||||
//
|
||||
// These functions manage loading, initializing and shutdown of the steamclient.dll
|
||||
//
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// S_API void SteamAPI_Init(); (see below)
|
||||
S_API void SteamAPI_Shutdown();
|
||||
|
||||
// crash dump recording functions
|
||||
S_API void SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID );
|
||||
S_API void SteamAPI_SetMiniDumpComment( const char *pchMsg );
|
||||
|
||||
// interface pointers, configured by SteamAPI_Init()
|
||||
S_API ISteamClient *SteamClient();
|
||||
|
||||
|
||||
//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES is usually not necessary, but it provides safety against releasing
|
||||
// new steam_api.dll's without recompiling/rereleasing modules that use it.
|
||||
//
|
||||
// If you use VERSION_SAFE_STEAM_API_INTERFACES, then you should call SteamAPI_InitSafe(). Also, to get the
|
||||
// Steam interfaces, you must create and Init() a CSteamAPIContext (below) and use the interfaces in there.
|
||||
//
|
||||
// If you don't use VERSION_SAFE_STEAM_API_INTERFACES, then you can use SteamAPI_Init() and the SteamXXXX()
|
||||
// functions below to get at the Steam interfaces.
|
||||
//
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamAPI_InitSafe();
|
||||
#else
|
||||
S_API bool SteamAPI_Init();
|
||||
|
||||
S_API ISteamUser *SteamUser();
|
||||
S_API ISteamFriends *SteamFriends();
|
||||
S_API ISteamUtils *SteamUtils();
|
||||
S_API ISteamMatchmaking *SteamMatchmaking();
|
||||
S_API ISteamUserStats *SteamUserStats();
|
||||
S_API ISteamApps *SteamApps();
|
||||
S_API ISteamNetworking *SteamNetworking();
|
||||
S_API ISteamMatchmakingServers *SteamMatchmakingServers();
|
||||
S_API ISteamRemoteStorage *SteamRemoteStorage();
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steam callback helper functions
|
||||
//
|
||||
// The following classes/macros are used to be able to easily multiplex callbacks
|
||||
// from the Steam API into various objects in the app in a thread-safe manner
|
||||
//
|
||||
// These functors are triggered via the SteamAPI_RunCallbacks() function, mapping the callback
|
||||
// to as many functions/objects as are registered to it
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API void SteamAPI_RunCallbacks();
|
||||
|
||||
|
||||
|
||||
// functions used by the utility CCallback objects to receive callbacks
|
||||
S_API void SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback );
|
||||
S_API void SteamAPI_UnregisterCallback( class CCallbackBase *pCallback );
|
||||
// functions used by the utility CCallResult objects to receive async call results
|
||||
S_API void SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
|
||||
S_API void SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: base for callbacks,
|
||||
// used only by CCallback, shouldn't be used directly
|
||||
//-----------------------------------------------------------------------------
|
||||
class CCallbackBase
|
||||
{
|
||||
public:
|
||||
CCallbackBase() { m_nCallbackFlags = 0; m_iCallback = 0; }
|
||||
// don't add a virtual destructor because we export this binary interface across dll's
|
||||
virtual void Run( void *pvParam ) = 0;
|
||||
virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) = 0;
|
||||
int GetICallback() { return m_iCallback; }
|
||||
virtual int GetCallbackSizeBytes() = 0;
|
||||
|
||||
protected:
|
||||
enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 };
|
||||
uint8 m_nCallbackFlags;
|
||||
int m_iCallback;
|
||||
friend class CCallbackMgr;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: maps a steam async call result to a class member function
|
||||
// template params: T = local class, P = parameter struct
|
||||
//-----------------------------------------------------------------------------
|
||||
template< class T, class P >
|
||||
class CCallResult : private CCallbackBase
|
||||
{
|
||||
public:
|
||||
typedef void (T::*func_t)( P*, bool );
|
||||
|
||||
CCallResult()
|
||||
{
|
||||
m_hAPICall = 0;
|
||||
m_pObj = NULL;
|
||||
m_Func = NULL;
|
||||
m_iCallback = P::k_iCallback;
|
||||
}
|
||||
|
||||
void Set( SteamAPICall_t hAPICall, T *p, func_t func )
|
||||
{
|
||||
if ( m_hAPICall )
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
|
||||
m_hAPICall = hAPICall;
|
||||
m_pObj = p;
|
||||
m_Func = func;
|
||||
|
||||
if ( hAPICall )
|
||||
SteamAPI_RegisterCallResult( this, hAPICall );
|
||||
}
|
||||
|
||||
bool IsActive()
|
||||
{
|
||||
return ( m_hAPICall != 0 );
|
||||
}
|
||||
|
||||
void Cancel()
|
||||
{
|
||||
m_hAPICall = 0;
|
||||
}
|
||||
|
||||
~CCallResult()
|
||||
{
|
||||
if ( m_hAPICall )
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
m_hAPICall = 0;
|
||||
(m_pObj->*m_Func)( (P *)pvParam, false );
|
||||
}
|
||||
void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall )
|
||||
{
|
||||
if ( hSteamAPICall == m_hAPICall )
|
||||
{
|
||||
m_hAPICall = 0;
|
||||
(m_pObj->*m_Func)( (P *)pvParam, bIOFailure );
|
||||
}
|
||||
}
|
||||
int GetCallbackSizeBytes()
|
||||
{
|
||||
return sizeof( P );
|
||||
}
|
||||
|
||||
SteamAPICall_t m_hAPICall;
|
||||
T *m_pObj;
|
||||
func_t m_Func;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: maps a steam callback to a class member function
|
||||
// template params: T = local class, P = parameter struct
|
||||
//-----------------------------------------------------------------------------
|
||||
template< class T, class P, bool bGameServer >
|
||||
class CCallback : private CCallbackBase
|
||||
{
|
||||
public:
|
||||
typedef void (T::*func_t)( P* );
|
||||
|
||||
// If you can't support constructing a callback with the correct parameters
|
||||
// then uncomment the empty constructor below and manually call
|
||||
// ::Register() for your object
|
||||
// Or, just call the regular constructor with (NULL, NULL)
|
||||
// CCallback() {}
|
||||
|
||||
// constructor for initializing this object in owner's constructor
|
||||
CCallback( T *pObj, func_t func ) : m_pObj( pObj ), m_Func( func )
|
||||
{
|
||||
if ( pObj && func )
|
||||
Register( pObj, func );
|
||||
}
|
||||
|
||||
~CCallback()
|
||||
{
|
||||
Unregister();
|
||||
}
|
||||
|
||||
// manual registration of the callback
|
||||
void Register( T *pObj, func_t func )
|
||||
{
|
||||
if ( m_nCallbackFlags & k_ECallbackFlagsRegistered )
|
||||
Unregister();
|
||||
|
||||
if ( bGameServer )
|
||||
{
|
||||
m_nCallbackFlags |= k_ECallbackFlagsGameServer;
|
||||
}
|
||||
m_pObj = pObj;
|
||||
m_Func = func;
|
||||
SteamAPI_RegisterCallback( this, P::k_iCallback );
|
||||
}
|
||||
|
||||
void Unregister()
|
||||
{
|
||||
SteamAPI_UnregisterCallback( this );
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
virtual void Run( void *pvParam, bool, SteamAPICall_t )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
int GetCallbackSizeBytes()
|
||||
{
|
||||
return sizeof( P );
|
||||
}
|
||||
|
||||
T *m_pObj;
|
||||
func_t m_Func;
|
||||
};
|
||||
|
||||
// Allows you to defer registration of the callback
|
||||
template< class T, class P, bool bGameServer >
|
||||
class CCallbackManual : public CCallback< T, P, bGameServer >
|
||||
{
|
||||
public:
|
||||
CCallbackManual() : CCallback< T, P, bGameServer >( NULL, NULL ) {}
|
||||
};
|
||||
|
||||
// utility macro for declaring the function and callback object together
|
||||
#define STEAM_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, false > var; void func( param *pParam )
|
||||
|
||||
// same as above, but lets you defer the callback binding by calling Register later
|
||||
#define STEAM_CALLBACK_MANUAL( thisclass, func, param, var ) CCallbackManual< thisclass, param, false > var; void func( param *pParam )
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
// disable this warning; this pattern need for steam callback registration
|
||||
#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// pumps out all the steam messages, calling the register callback
|
||||
S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks );
|
||||
|
||||
// register the callback funcs to use to interact with the steam dll
|
||||
S_API void Steam_RegisterInterfaceFuncs( void *hModule );
|
||||
|
||||
// returns the HSteamUser of the last user to dispatch a callback
|
||||
S_API HSteamUser Steam_GetHSteamUserCurrent();
|
||||
|
||||
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name
|
||||
S_API const char *SteamAPI_GetSteamInstallPath();
|
||||
|
||||
// returns the pipe we are communicating to Steam with
|
||||
S_API HSteamPipe SteamAPI_GetHSteamPipe();
|
||||
|
||||
// sets whether or not Steam_RunCallbacks() should do a try {} catch (...) {} around calls to issuing callbacks
|
||||
S_API void SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks );
|
||||
|
||||
// backwards compat export, passes through to SteamAPI_ variants
|
||||
S_API HSteamPipe GetHSteamPipe();
|
||||
S_API HSteamUser GetHSteamUser();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamAPI_GetHSteamUser();
|
||||
|
||||
class CSteamAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamUser* SteamUser() { return m_pSteamUser; }
|
||||
ISteamFriends* SteamFriends() { return m_pSteamFriends; }
|
||||
ISteamUtils* SteamUtils() { return m_pSteamUtils; }
|
||||
ISteamMatchmaking* SteamMatchmaking() { return m_pSteamMatchmaking; }
|
||||
ISteamUserStats* SteamUserStats() { return m_pSteamUserStats; }
|
||||
ISteamApps* SteamApps() { return m_pSteamApps; }
|
||||
ISteamMatchmakingServers* SteamMatchmakingServers() { return m_pSteamMatchmakingServers; }
|
||||
ISteamNetworking* SteamNetworking() { return m_pSteamNetworking; }
|
||||
ISteamRemoteStorage* SteamRemoteStorage() { return m_pSteamRemoteStorage; }
|
||||
|
||||
private:
|
||||
ISteamUser *m_pSteamUser;
|
||||
ISteamFriends *m_pSteamFriends;
|
||||
ISteamUtils *m_pSteamUtils;
|
||||
ISteamMatchmaking *m_pSteamMatchmaking;
|
||||
ISteamUserStats *m_pSteamUserStats;
|
||||
ISteamApps *m_pSteamApps;
|
||||
ISteamMatchmakingServers *m_pSteamMatchmakingServers;
|
||||
ISteamNetworking *m_pSteamNetworking;
|
||||
ISteamRemoteStorage *m_pSteamRemoteStorage;
|
||||
};
|
||||
|
||||
inline CSteamAPIContext::CSteamAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamAPIContext::Clear()
|
||||
{
|
||||
m_pSteamUser = NULL;
|
||||
m_pSteamFriends = NULL;
|
||||
m_pSteamUtils = NULL;
|
||||
m_pSteamMatchmaking = NULL;
|
||||
m_pSteamUserStats = NULL;
|
||||
m_pSteamApps = NULL;
|
||||
m_pSteamMatchmakingServers = NULL;
|
||||
m_pSteamNetworking = NULL;
|
||||
m_pSteamRemoteStorage = NULL;
|
||||
}
|
||||
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamAPIContext::Init()
|
||||
{
|
||||
if ( !SteamClient() )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamAPI_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe();
|
||||
|
||||
m_pSteamUser = SteamClient()->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUser )
|
||||
return false;
|
||||
|
||||
m_pSteamFriends = SteamClient()->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamFriends )
|
||||
return false;
|
||||
|
||||
m_pSteamUtils = SteamClient()->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmaking = SteamClient()->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmaking )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmakingServers = SteamClient()->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmakingServers )
|
||||
return false;
|
||||
|
||||
m_pSteamUserStats = SteamClient()->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUserStats )
|
||||
return false;
|
||||
|
||||
m_pSteamApps = SteamClient()->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamApps )
|
||||
return false;
|
||||
|
||||
m_pSteamNetworking = SteamClient()->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamNetworking )
|
||||
return false;
|
||||
|
||||
m_pSteamRemoteStorage = SteamClient()->GetISteamRemoteStorage( hSteamUser, hSteamPipe, STEAMREMOTESTORAGE_INTERFACE_VERSION );
|
||||
if ( !m_pSteamRemoteStorage )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
#endif // STEAM_API_H
|
||||
134
res/steamworks/105/headers/steam_gameserver.h
Normal file
134
res/steamworks/105/headers/steam_gameserver.h
Normal file
@@ -0,0 +1,134 @@
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_GAMESERVER_H
|
||||
#define STEAM_GAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api.h"
|
||||
#include "isteamgameserver.h"
|
||||
#include "isteammasterserverupdater.h"
|
||||
|
||||
enum EServerMode
|
||||
{
|
||||
eServerModeInvalid = 0, // DO NOT USE
|
||||
eServerModeNoAuthentication = 1, // Don't authenticate user logins and don't list on the server list
|
||||
eServerModeAuthentication = 2, // Authenticate users, list on the server list, don't run VAC on clients that connect
|
||||
eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients
|
||||
};
|
||||
|
||||
// Note: if you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it will use "GameSocketShare" mode,
|
||||
// which means that the game is responsible for sending and receiving UDP packets for the master
|
||||
// server updater. See references to GameSocketShare in isteammasterserverupdater.h.
|
||||
//
|
||||
// Pass 0 for usGamePort or usSpectatorPort if you're not using that. Then, the master server updater will report
|
||||
// what's running based on that.
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamGameServer_InitSafe( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString );
|
||||
#else
|
||||
S_API bool SteamGameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString );
|
||||
|
||||
S_API ISteamGameServer *SteamGameServer();
|
||||
S_API ISteamUtils *SteamGameServerUtils();
|
||||
S_API ISteamMasterServerUpdater *SteamMasterServerUpdater();
|
||||
S_API ISteamNetworking *SteamGameServerNetworking();
|
||||
#endif
|
||||
|
||||
S_API void SteamGameServer_Shutdown();
|
||||
S_API void SteamGameServer_RunCallbacks();
|
||||
|
||||
S_API bool SteamGameServer_BSecure();
|
||||
S_API uint64 SteamGameServer_GetSteamID();
|
||||
|
||||
#define STEAM_GAMESERVER_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, true > var; void func( param *pParam )
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
S_API HSteamPipe SteamGameServer_GetHSteamPipe();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamGameServer_GetHSteamUser();
|
||||
|
||||
class CSteamGameServerAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamGameServerAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamGameServer *SteamGameServer() { return m_pSteamGameServer; }
|
||||
ISteamUtils *SteamGameServerUtils() { return m_pSteamGameServerUtils; }
|
||||
ISteamMasterServerUpdater *SteamMasterServerUpdater() { return m_pSteamMasterServerUpdater; }
|
||||
ISteamNetworking *SteamGameServerNetworking() { return m_pSteamGameServerNetworking; }
|
||||
|
||||
private:
|
||||
ISteamGameServer *m_pSteamGameServer;
|
||||
ISteamUtils *m_pSteamGameServerUtils;
|
||||
ISteamMasterServerUpdater *m_pSteamMasterServerUpdater;
|
||||
ISteamNetworking *m_pSteamGameServerNetworking;
|
||||
};
|
||||
|
||||
inline CSteamGameServerAPIContext::CSteamGameServerAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamGameServerAPIContext::Clear()
|
||||
{
|
||||
m_pSteamGameServer = NULL;
|
||||
m_pSteamGameServerUtils = NULL;
|
||||
m_pSteamMasterServerUpdater = NULL;
|
||||
m_pSteamGameServerNetworking = NULL;
|
||||
}
|
||||
|
||||
S_API ISteamClient *g_pSteamClientGameServer;
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamGameServerAPIContext::Init()
|
||||
{
|
||||
if ( !g_pSteamClientGameServer )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamGameServer_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe();
|
||||
|
||||
m_pSteamGameServer = g_pSteamClientGameServer->GetISteamGameServer( hSteamUser, hSteamPipe, STEAMGAMESERVER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServer )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerUtils = g_pSteamClientGameServer->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMasterServerUpdater = g_pSteamClientGameServer->GetISteamMasterServerUpdater( hSteamUser, hSteamPipe, STEAMMASTERSERVERUPDATER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMasterServerUpdater )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerNetworking = g_pSteamClientGameServer->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerNetworking )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
|
||||
#endif // STEAM_GAMESERVER_H
|
||||
883
res/steamworks/105/headers/steamclientpublic.h
Normal file
883
res/steamworks/105/headers/steamclientpublic.h
Normal file
@@ -0,0 +1,883 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMCLIENTPUBLIC_H
|
||||
#define STEAMCLIENTPUBLIC_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
//lint -save -e1931 -e1927 -e1924 -e613 -e726
|
||||
|
||||
// This header file defines the interface between the calling application and the code that
|
||||
// knows how to communicate with the connection manager (CM) from the Steam service
|
||||
|
||||
// This header file is intended to be portable; ideally this 1 header file plus a lib or dll
|
||||
// is all you need to integrate the client library into some other tree. So please avoid
|
||||
// including or requiring other header files if possible. This header should only describe the
|
||||
// interface layer, no need to include anything about the implementation.
|
||||
|
||||
#include "steamtypes.h"
|
||||
|
||||
|
||||
// General result codes
|
||||
enum EResult
|
||||
{
|
||||
k_EResultOK = 1, // success
|
||||
k_EResultFail = 2, // generic failure
|
||||
k_EResultNoConnection = 3, // no/failed network connection
|
||||
// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed
|
||||
k_EResultInvalidPassword = 5, // password/ticket is invalid
|
||||
k_EResultLoggedInElsewhere = 6, // same user logged in elsewhere
|
||||
k_EResultInvalidProtocolVer = 7, // protocol version is incorrect
|
||||
k_EResultInvalidParam = 8, // a parameter is incorrect
|
||||
k_EResultFileNotFound = 9, // file was not found
|
||||
k_EResultBusy = 10, // called method busy - action not taken
|
||||
k_EResultInvalidState = 11, // called object was in an invalid state
|
||||
k_EResultInvalidName = 12, // name is invalid
|
||||
k_EResultInvalidEmail = 13, // email is invalid
|
||||
k_EResultDuplicateName = 14, // name is not unique
|
||||
k_EResultAccessDenied = 15, // access is denied
|
||||
k_EResultTimeout = 16, // operation timed out
|
||||
k_EResultBanned = 17, // VAC2 banned
|
||||
k_EResultAccountNotFound = 18, // account not found
|
||||
k_EResultInvalidSteamID = 19, // steamID is invalid
|
||||
k_EResultServiceUnavailable = 20, // The requested service is currently unavailable
|
||||
k_EResultNotLoggedOn = 21, // The user is not logged on
|
||||
k_EResultPending = 22, // Request is pending (may be in process, or waiting on third party)
|
||||
k_EResultEncryptionFailure = 23, // Encryption or Decryption failed
|
||||
k_EResultInsufficientPrivilege = 24, // Insufficient privilege
|
||||
k_EResultLimitExceeded = 25, // Too much of a good thing
|
||||
k_EResultRevoked = 26, // Access has been revoked (used for revoked guest passes)
|
||||
k_EResultExpired = 27, // License/Guest pass the user is trying to access is expired
|
||||
k_EResultAlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again
|
||||
k_EResultDuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time
|
||||
k_EResultAlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user
|
||||
k_EResultIPNotFound = 31, // IP address not found
|
||||
k_EResultPersistFailed = 32, // failed to write change to the data store
|
||||
k_EResultLockingFailed = 33, // failed to acquire access lock for this operation
|
||||
k_EResultLogonSessionReplaced = 34,
|
||||
k_EResultConnectFailed = 35,
|
||||
k_EResultHandshakeFailed = 36,
|
||||
k_EResultIOFailure = 37,
|
||||
k_EResultRemoteDisconnect = 38,
|
||||
k_EResultShoppingCartNotFound = 39, // failed to find the shopping cart requested
|
||||
k_EResultBlocked = 40, // a user didn't allow it
|
||||
k_EResultIgnored = 41, // target is ignoring sender
|
||||
k_EResultNoMatch = 42, // nothing matching the request found
|
||||
k_EResultAccountDisabled = 43,
|
||||
k_EResultServiceReadOnly = 44, // this service is not accepting content changes right now
|
||||
k_EResultAccountNotFeatured = 45, // account doesn't have value, so this feature isn't available
|
||||
k_EResultAdministratorOK = 46, // allowed to take this action, but only because requester is admin
|
||||
k_EResultContentVersion = 47, // A Version mismatch in content transmitted within the Steam protocol.
|
||||
k_EResultTryAnotherCM = 48, // The current CM can't service the user making a request, user should try another.
|
||||
|
||||
};
|
||||
|
||||
// Error codes for use with the voice functions
|
||||
enum EVoiceResult
|
||||
{
|
||||
k_EVoiceResultOK = 0,
|
||||
k_EVoiceResultNotInitialized = 1,
|
||||
k_EVoiceResultNotRecording = 2,
|
||||
k_EVoiceResultNoData = 3,
|
||||
k_EVoiceResultBufferTooSmall = 4,
|
||||
k_EVoiceResultDataCorrupted = 5,
|
||||
};
|
||||
|
||||
// Result codes to GSHandleClientDeny/Kick
|
||||
typedef enum
|
||||
{
|
||||
k_EDenyInvalid = 0,
|
||||
k_EDenyInvalidVersion = 1,
|
||||
k_EDenyGeneric = 2,
|
||||
k_EDenyNotLoggedOn = 3,
|
||||
k_EDenyNoLicense = 4,
|
||||
k_EDenyCheater = 5,
|
||||
k_EDenyLoggedInElseWhere = 6,
|
||||
k_EDenyUnknownText = 7,
|
||||
k_EDenyIncompatibleAnticheat = 8,
|
||||
k_EDenyMemoryCorruption = 9,
|
||||
k_EDenyIncompatibleSoftware = 10,
|
||||
k_EDenySteamConnectionLost = 11,
|
||||
k_EDenySteamConnectionError = 12,
|
||||
k_EDenySteamResponseTimedOut = 13,
|
||||
k_EDenySteamValidationStalled = 14,
|
||||
k_EDenySteamOwnerLeftGuestUser = 15,
|
||||
} EDenyReason;
|
||||
|
||||
// return type of GetAuthSessionTicket
|
||||
typedef uint32 HAuthTicket;
|
||||
const HAuthTicket k_HAuthTicketInvalid = 0;
|
||||
|
||||
// results from BeginAuthSession
|
||||
typedef enum
|
||||
{
|
||||
k_EBeginAuthSessionResultOK = 0, // Ticket is valid for this game and this steamID.
|
||||
k_EBeginAuthSessionResultInvalidTicket = 1, // Ticket is not valid.
|
||||
k_EBeginAuthSessionResultDuplicateRequest = 2, // A ticket has already been submitted for this steamID
|
||||
k_EBeginAuthSessionResultInvalidVersion = 3, // Ticket is from an incompatible interface version
|
||||
k_EBeginAuthSessionResultGameMismatch = 4, // Ticket is not for this game
|
||||
k_EBeginAuthSessionResultExpiredTicket = 5, // Ticket has expired
|
||||
} EBeginAuthSessionResult;
|
||||
|
||||
// Callback values for callback ValidateAuthTicketResponse_t which is a response to BeginAuthSession
|
||||
typedef enum
|
||||
{
|
||||
k_EAuthSessionResponseOK = 0, // Steam has verified the user is online, the ticket is valid and ticket has not been reused.
|
||||
k_EAuthSessionResponseUserNotConnectedToSteam = 1, // The user in question is not connected to steam
|
||||
k_EAuthSessionResponseNoLicenseOrExpired = 2, // The license has expired.
|
||||
k_EAuthSessionResponseVACBanned = 3, // The user is VAC banned for this game.
|
||||
k_EAuthSessionResponseLoggedInElseWhere = 4, // The user account has logged in elsewhere and the session containing the game instance has been disconnected.
|
||||
k_EAuthSessionResponseVACCheckTimedOut = 5, // VAC has been unable to perform anti-cheat checks on this user
|
||||
k_EAuthSessionResponseAuthTicketCanceled = 6, // The ticket has been canceled by the issuer
|
||||
k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7, // This ticket has already been used, it is not valid.
|
||||
k_EAuthSessionResponseAuthTicketInvalid = 8, // This ticket is not from a user instance currently connected to steam.
|
||||
} EAuthSessionResponse;
|
||||
|
||||
// results from UserHasLicenseForApp
|
||||
typedef enum
|
||||
{
|
||||
k_EUserHasLicenseResultHasLicense = 0, // User has a license for specified app
|
||||
k_EUserHasLicenseResultDoesNotHaveLicense = 1, // User does not have a license for the specified app
|
||||
k_EUserHasLicenseResultNoAuth = 2, // User has not been authenticated
|
||||
} EUserHasLicenseForAppResult;
|
||||
|
||||
|
||||
// Steam universes. Each universe is a self-contained Steam instance.
|
||||
enum EUniverse
|
||||
{
|
||||
k_EUniverseInvalid = 0,
|
||||
k_EUniversePublic = 1,
|
||||
k_EUniverseBeta = 2,
|
||||
k_EUniverseInternal = 3,
|
||||
k_EUniverseDev = 4,
|
||||
k_EUniverseRC = 5,
|
||||
k_EUniverseMax
|
||||
};
|
||||
|
||||
// Steam account types
|
||||
enum EAccountType
|
||||
{
|
||||
k_EAccountTypeInvalid = 0,
|
||||
k_EAccountTypeIndividual = 1, // single user account
|
||||
k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account
|
||||
k_EAccountTypeGameServer = 3, // game server account
|
||||
k_EAccountTypeAnonGameServer = 4, // anonymous game server account
|
||||
k_EAccountTypePending = 5, // pending
|
||||
k_EAccountTypeContentServer = 6, // content server
|
||||
k_EAccountTypeClan = 7,
|
||||
k_EAccountTypeChat = 8,
|
||||
k_EAccountTypeP2PSuperSeeder = 9, // a fake steamid used by superpeers to seed content to users of Steam P2P stuff
|
||||
k_EAccountTypeAnonUser = 10,
|
||||
|
||||
// Max of 16 items in this field
|
||||
k_EAccountTypeMax
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// types of user game stats fields
|
||||
// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ESteamUserStatType
|
||||
{
|
||||
k_ESteamUserStatTypeINVALID = 0,
|
||||
k_ESteamUserStatTypeINT = 1,
|
||||
k_ESteamUserStatTypeFLOAT = 2,
|
||||
// Read as FLOAT, set with count / session length
|
||||
k_ESteamUserStatTypeAVGRATE = 3,
|
||||
k_ESteamUserStatTypeACHIEVEMENTS = 4,
|
||||
k_ESteamUserStatTypeGROUPACHIEVEMENTS = 5,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Entry Types (previously was only friend-to-friend message types)
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatEntryType
|
||||
{
|
||||
k_EChatEntryTypeInvalid = 0,
|
||||
k_EChatEntryTypeChatMsg = 1, // Normal text message from another user
|
||||
k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat)
|
||||
k_EChatEntryTypeInviteGame = 3, // Invite from other user into that users current game
|
||||
k_EChatEntryTypeEmote = 4, // text emote message
|
||||
k_EChatEntryTypeLobbyGameStart = 5, // lobby game is starting
|
||||
k_EChatEntryTypeLeftConversation = 6, // user has left the conversation ( closed chat window )
|
||||
// Above are previous FriendMsgType entries, now merged into more generic chat entry types
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Room Enter Responses
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatRoomEnterResponse
|
||||
{
|
||||
k_EChatRoomEnterResponseSuccess = 1, // Success
|
||||
k_EChatRoomEnterResponseDoesntExist = 2, // Chat doesn't exist (probably closed)
|
||||
k_EChatRoomEnterResponseNotAllowed = 3, // General Denied - You don't have the permissions needed to join the chat
|
||||
k_EChatRoomEnterResponseFull = 4, // Chat room has reached its maximum size
|
||||
k_EChatRoomEnterResponseError = 5, // Unexpected Error
|
||||
k_EChatRoomEnterResponseBanned = 6, // You are banned from this chat room and may not join
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Status of a given depot version, these are stored in the DB, don't renumber
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EStatusDepotVersion
|
||||
{
|
||||
k_EStatusDepotVersionInvalid = 0,
|
||||
k_EStatusDepotVersionCompleteDisabled = 1,
|
||||
k_EStatusDepotVersionCompleteEnabledBeta = 2,
|
||||
k_EStatusDepotVersionCompleteEnabledPublic = 3,
|
||||
};
|
||||
|
||||
|
||||
typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath );
|
||||
typedef bool (*PFNLegacyKeyInstalled)();
|
||||
|
||||
const int k_unSteamAccountIDMask = 0xFFFFFFFF;
|
||||
const int k_unSteamAccountInstanceMask = 0x000FFFFF;
|
||||
|
||||
// Special flags for Chat accounts - they go in the top 8 bits
|
||||
// of the steam ID's "instance", leaving 12 for the actual instances
|
||||
enum EChatSteamIDInstanceFlags
|
||||
{
|
||||
k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags
|
||||
|
||||
k_EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) >> 1, // top bit
|
||||
k_EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 2, // next one down, etc
|
||||
|
||||
// Max of 8 flags
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Possible positions to tell the overlay to show notifications in
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ENotificationPosition
|
||||
{
|
||||
k_EPositionTopLeft = 0,
|
||||
k_EPositionTopRight = 1,
|
||||
k_EPositionBottomLeft = 2,
|
||||
k_EPositionBottomRight = 3,
|
||||
};
|
||||
|
||||
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
// Steam ID structure (64 bits total)
|
||||
class CSteamID
|
||||
{
|
||||
public:
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID()
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = 0;
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeInvalid;
|
||||
m_steamid.m_comp.m_EUniverse = k_EUniverseInvalid;
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
Set( unAccountID, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// unAccountInstance - instance
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
#if defined(_SERVER) && defined(Assert)
|
||||
Assert( ! ( ( k_EAccountTypeIndividual == eAccountType ) && ( 1 != unAccountInstance ) ) ); // enforce that for individual accounts, instance is always 1
|
||||
#endif // _SERVER
|
||||
InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
// Note: Will not accept a uint32 or int32 as input, as that is a probable mistake.
|
||||
// See the stubbed out overloads in the private: section for more info.
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint64 ulSteamID )
|
||||
{
|
||||
SetFromUint64( ulSteamID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void Set( uint32 unAccountID, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = unAccountID;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_EAccountType = eAccountType;
|
||||
|
||||
if ( eAccountType == k_EAccountTypeClan )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountInstance = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets parameters for steam ID
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
void InstancedSet( uint32 unAccountID, uint32 unInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = unAccountID;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_EAccountType = eAccountType;
|
||||
m_steamid.m_comp.m_unAccountInstance = unInstance;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 52 bit parts and universe/type
|
||||
// Input : ulIdentifier - 52 bits of goodness
|
||||
//-----------------------------------------------------------------------------
|
||||
void FullSet( uint64 ulIdentifier, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = ( ulIdentifier & 0xFFFFFFFF ); // account ID is low 32 bits
|
||||
m_steamid.m_comp.m_unAccountInstance = ( ( ulIdentifier >> 32 ) & 0xFFFFF ); // account instance is next 20 bits
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_EAccountType = eAccountType;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from its 64-bit representation
|
||||
// Input : ulSteamID - 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromUint64( uint64 ulSteamID )
|
||||
{
|
||||
m_steamid.m_unAll64Bits = ulSteamID;
|
||||
}
|
||||
|
||||
|
||||
#if defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to convert
|
||||
// eUniverse - universe this ID belongs to
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromSteam2( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 +
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse; // set the universe
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeIndividual; // Steam 2 accounts always map to account type of individual
|
||||
m_steamid.m_comp.m_unAccountInstance = 1; // individual accounts always have an account instance ID of 1
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fills out a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to write to
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConvertToSteam2( TSteamGlobalUserID *pTSteamGlobalUserID ) const
|
||||
{
|
||||
// only individual accounts have any meaning in Steam 2, only they can be mapped
|
||||
// Assert( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual );
|
||||
|
||||
pTSteamGlobalUserID->m_SteamInstanceID = 0;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits = m_steamid.m_comp.m_unAccountID % 2;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits = m_steamid.m_comp.m_unAccountID / 2;
|
||||
}
|
||||
#endif // defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts steam ID to its 64-bit representation
|
||||
// Output : 64-bit representation of a Steam ID
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 ConvertToUint64() const
|
||||
{
|
||||
return m_steamid.m_unAll64Bits;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts the static parts of a steam ID to a 64-bit representation.
|
||||
// For multiseat accounts, all instances of that account will have the
|
||||
// same static account key, so they can be grouped together by the static
|
||||
// account key.
|
||||
// Output : 64-bit static account key
|
||||
//-----------------------------------------------------------------------------
|
||||
uint64 GetStaticAccountKey() const
|
||||
{
|
||||
// note we do NOT include the account instance (which is a dynamic property) in the static account key
|
||||
return (uint64) ( ( ( (uint64) m_steamid.m_comp.m_EUniverse ) << 56 ) + ((uint64) m_steamid.m_comp.m_EAccountType << 52 ) + m_steamid.m_comp.m_unAccountID );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = 0;
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonGameServer;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: create an anonymous game server login to be filled in by the AM
|
||||
//-----------------------------------------------------------------------------
|
||||
void CreateBlankAnonUserLogon( EUniverse eUniverse )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = 0;
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeAnonUser;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous game server login that will be filled in?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BBlankAnonAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_unAccountID == 0 && BAnonAccount() && m_steamid.m_comp.m_unAccountInstance == 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a game server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BGameServerAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a content server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BContentServerAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeContentServer;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a clan account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BClanAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a chat account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BChatAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a chat account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool IsLobby() const
|
||||
{
|
||||
return ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeChat )
|
||||
&& ( m_steamid.m_comp.m_unAccountInstance & k_EChatInstanceFlagLobby );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an individual user account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BIndividualAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous account?
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BAnonAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser || m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous user account? ( used to create an account or reset a password )
|
||||
//-----------------------------------------------------------------------------
|
||||
bool BAnonUserAccount() const
|
||||
{
|
||||
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeAnonUser;
|
||||
}
|
||||
|
||||
|
||||
// simple accessors
|
||||
void SetAccountID( uint32 unAccountID ) { m_steamid.m_comp.m_unAccountID = unAccountID; }
|
||||
uint32 GetAccountID() const { return m_steamid.m_comp.m_unAccountID; }
|
||||
uint32 GetUnAccountInstance() const { return m_steamid.m_comp.m_unAccountInstance; }
|
||||
EAccountType GetEAccountType() const { return ( EAccountType ) m_steamid.m_comp.m_EAccountType; }
|
||||
EUniverse GetEUniverse() const { return m_steamid.m_comp.m_EUniverse; }
|
||||
void SetEUniverse( EUniverse eUniverse ) { m_steamid.m_comp.m_EUniverse = eUniverse; }
|
||||
bool IsValid() const;
|
||||
|
||||
// this set of functions is hidden, will be moved out of class
|
||||
explicit CSteamID( const char *pchSteamID, EUniverse eDefaultUniverse = k_EUniverseInvalid );
|
||||
const char * Render() const; // renders this steam ID to string
|
||||
static const char * Render( uint64 ulSteamID ); // static method to render a uint64 representation of a steam ID to a string
|
||||
|
||||
void SetFromString( const char *pchSteamID, EUniverse eDefaultUniverse );
|
||||
bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse );
|
||||
|
||||
inline bool operator==( const CSteamID &val ) const { return m_steamid.m_unAll64Bits == val.m_steamid.m_unAll64Bits; }
|
||||
inline bool operator!=( const CSteamID &val ) const { return !operator==( val ); }
|
||||
inline bool operator<( const CSteamID &val ) const { return m_steamid.m_unAll64Bits < val.m_steamid.m_unAll64Bits; }
|
||||
inline bool operator>( const CSteamID &val ) const { return m_steamid.m_unAll64Bits > val.m_steamid.m_unAll64Bits; }
|
||||
|
||||
// DEBUG function
|
||||
bool BValidExternalSteamID() const;
|
||||
|
||||
private:
|
||||
// These are defined here to prevent accidental implicit conversion of a u32AccountID to a CSteamID.
|
||||
// If you get a compiler error about an ambiguous constructor/function then it may be because you're
|
||||
// passing a 32-bit int to a function that takes a CSteamID. You should explicitly create the SteamID
|
||||
// using the correct Universe and account Type/Instance values.
|
||||
CSteamID( uint32 );
|
||||
CSteamID( int32 );
|
||||
|
||||
// 64 bits total
|
||||
union SteamID_t
|
||||
{
|
||||
struct SteamIDComponent_t
|
||||
{
|
||||
uint32 m_unAccountID : 32; // unique account identifier
|
||||
unsigned int m_unAccountInstance : 20; // dynamic instance ID (used for multiseat type accounts only)
|
||||
unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference
|
||||
EUniverse m_EUniverse : 8; // universe this account belongs to
|
||||
} m_comp;
|
||||
|
||||
uint64 m_unAll64Bits;
|
||||
} m_steamid;
|
||||
};
|
||||
|
||||
inline bool CSteamID::IsValid() const
|
||||
{
|
||||
if ( m_steamid.m_comp.m_EAccountType <= k_EAccountTypeInvalid || m_steamid.m_comp.m_EAccountType >= k_EAccountTypeMax )
|
||||
return false;
|
||||
|
||||
if ( m_steamid.m_comp.m_EUniverse <= k_EUniverseInvalid || m_steamid.m_comp.m_EUniverse >= k_EUniverseMax )
|
||||
return false;
|
||||
|
||||
if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual )
|
||||
{
|
||||
if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != 1 )
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan )
|
||||
{
|
||||
if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != 0 )
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// generic invalid CSteamID
|
||||
const CSteamID k_steamIDNil;
|
||||
|
||||
// This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol
|
||||
// to provide its steamID
|
||||
const CSteamID k_steamIDOutofDateGS( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
// This steamID comes from a user game connection to an sv_lan GS
|
||||
const CSteamID k_steamIDLanModeGS( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid );
|
||||
// This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized
|
||||
// its steam3 component and started logging on.
|
||||
const CSteamID k_steamIDNotInitYetGS( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
// This steamID can come from a user game connection to a GS that isn't using the steam authentication system but still
|
||||
// wants to support the "Join Game" option in the friends list
|
||||
const CSteamID k_steamIDNonSteamGS( 2, 0, k_EUniverseInvalid, k_EAccountTypeInvalid );
|
||||
|
||||
|
||||
#ifdef STEAM
|
||||
// Returns the matching chat steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance
|
||||
CSteamID ChatIDFromSteamID( const CSteamID &steamID );
|
||||
// Returns the matching clan steamID, with the default instance of 0
|
||||
// If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance
|
||||
CSteamID ClanIDFromSteamID( const CSteamID &steamID );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ChatIDFromClanID( const CSteamID &steamIDClan );
|
||||
// Asserts steamID type before conversion
|
||||
CSteamID ClanIDFromChatID( const CSteamID &steamIDChat );
|
||||
|
||||
#endif // _STEAM
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: encapsulates an appID/modID pair
|
||||
//-----------------------------------------------------------------------------
|
||||
class CGameID
|
||||
{
|
||||
public:
|
||||
|
||||
CGameID()
|
||||
{
|
||||
m_gameID.m_nType = k_EGameIDTypeApp;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nModID = 0;
|
||||
}
|
||||
|
||||
explicit CGameID( uint64 ulGameID )
|
||||
{
|
||||
m_ulGameID = ulGameID;
|
||||
}
|
||||
|
||||
explicit CGameID( int32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
explicit CGameID( uint32 nAppID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
CGameID( uint32 nAppID, uint32 nModID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nModID = nModID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
}
|
||||
|
||||
// Hidden functions used only by Steam
|
||||
explicit CGameID( const char *pchGameID );
|
||||
const char *Render() const; // render this Game ID to string
|
||||
static const char *Render( uint64 ulGameID ); // static method to render a uint64 representation of a Game ID to a string
|
||||
|
||||
// must include checksum_crc.h first to get this functionality
|
||||
#if defined( CHECKSUM_CRC_H )
|
||||
CGameID( uint32 nAppID, const char *pchModPath )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
|
||||
char rgchModDir[MAX_PATH];
|
||||
Q_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) );
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, rgchModDir, Q_strlen( rgchModDir ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
CGameID( const char *pchExePath, const char *pchAppName )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeShortcut;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, pchExePath, Q_strlen( pchExePath ) );
|
||||
CRC32_ProcessBuffer( &crc32, pchAppName, Q_strlen( pchAppName ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#if defined( VSTFILEID_H )
|
||||
|
||||
CGameID( VstFileID vstFileID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeP2P;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
const char *pchFileId = vstFileID.Render();
|
||||
CRC32_ProcessBuffer( &crc32, pchFileId, Q_strlen( pchFileId ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#endif /* VSTFILEID_H */
|
||||
|
||||
#endif /* CHECKSUM_CRC_H */
|
||||
|
||||
|
||||
uint64 ToUint64() const
|
||||
{
|
||||
return m_ulGameID;
|
||||
}
|
||||
|
||||
uint64 *GetUint64Ptr()
|
||||
{
|
||||
return &m_ulGameID;
|
||||
}
|
||||
|
||||
bool IsMod() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeGameMod );
|
||||
}
|
||||
|
||||
bool IsShortcut() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeShortcut );
|
||||
}
|
||||
|
||||
bool IsP2PFile() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeP2P );
|
||||
}
|
||||
|
||||
bool IsSteamApp() const
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeApp );
|
||||
}
|
||||
|
||||
uint32 ModID() const
|
||||
{
|
||||
return m_gameID.m_nModID;
|
||||
}
|
||||
|
||||
uint32 AppID() const
|
||||
{
|
||||
return m_gameID.m_nAppID;
|
||||
}
|
||||
|
||||
bool operator == ( const CGameID &rhs ) const
|
||||
{
|
||||
return m_ulGameID == rhs.m_ulGameID;
|
||||
}
|
||||
|
||||
bool operator != ( const CGameID &rhs ) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
bool operator < ( const CGameID &rhs ) const
|
||||
{
|
||||
return ( m_ulGameID < rhs.m_ulGameID );
|
||||
}
|
||||
|
||||
bool IsValid() const
|
||||
{
|
||||
// each type has it's own invalid fixed point:
|
||||
switch( m_gameID.m_nType )
|
||||
{
|
||||
case k_EGameIDTypeApp:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid;
|
||||
break;
|
||||
case k_EGameIDTypeGameMod:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
case k_EGameIDTypeShortcut:
|
||||
return (m_gameID.m_nModID & 0x80000000) != 0;
|
||||
break;
|
||||
case k_EGameIDTypeP2P:
|
||||
return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
break;
|
||||
default:
|
||||
#if defined(Assert)
|
||||
Assert(false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
enum EGameIDType
|
||||
{
|
||||
k_EGameIDTypeApp = 0,
|
||||
k_EGameIDTypeGameMod = 1,
|
||||
k_EGameIDTypeShortcut = 2,
|
||||
k_EGameIDTypeP2P = 3,
|
||||
};
|
||||
|
||||
struct GameID_t
|
||||
{
|
||||
unsigned int m_nAppID : 24;
|
||||
unsigned int m_nType : 8;
|
||||
unsigned int m_nModID : 32;
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
uint64 m_ulGameID;
|
||||
GameID_t m_gameID;
|
||||
};
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
const int k_cchGameExtraInfoMax = 64;
|
||||
|
||||
|
||||
// Max number of credit cards stored for one account
|
||||
const int k_nMaxNumCardsPerAccount = 1;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constants used for query ports.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define QUERY_PORT_NOT_INITIALIZED 0xFFFF // We haven't asked the GS for this query port's actual value yet.
|
||||
#define QUERY_PORT_ERROR 0xFFFE // We were unable to get the query port for this server.
|
||||
|
||||
#endif // STEAMCLIENTPUBLIC_H
|
||||
98
res/steamworks/105/headers/steamtypes.h
Normal file
98
res/steamworks/105/headers/steamtypes.h
Normal file
@@ -0,0 +1,98 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMTYPES_H
|
||||
#define STEAMTYPES_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Steam-specific types. Defined here so this header file can be included in other code bases.
|
||||
#ifndef WCHARTYPES_H
|
||||
typedef unsigned char uint8;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(_WIN64)
|
||||
#define X64BITS
|
||||
#endif
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef signed char int8;
|
||||
|
||||
#if defined( _WIN32 )
|
||||
|
||||
typedef __int16 int16;
|
||||
typedef unsigned __int16 uint16;
|
||||
typedef __int32 int32;
|
||||
typedef unsigned __int32 uint32;
|
||||
typedef __int64 int64;
|
||||
typedef unsigned __int64 uint64;
|
||||
|
||||
#ifdef X64BITS
|
||||
typedef __int64 intp; // intp is an integer that can accomodate a pointer
|
||||
typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *)
|
||||
#else
|
||||
typedef __int32 intp;
|
||||
typedef unsigned __int32 uintp;
|
||||
#endif
|
||||
|
||||
#else // _WIN32
|
||||
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
#ifdef X64BITS
|
||||
typedef long long intp;
|
||||
typedef unsigned long long uintp;
|
||||
#else
|
||||
typedef int intp;
|
||||
typedef unsigned int uintp;
|
||||
#endif
|
||||
|
||||
#endif // else _WIN32
|
||||
|
||||
const int k_cubSaltSize = 8;
|
||||
typedef uint8 Salt_t[ k_cubSaltSize ];
|
||||
|
||||
typedef uint64 GID_t; // globally unique identifier
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 PackageId_t;
|
||||
const PackageId_t k_uPackageIdInvalid = 0xFFFFFFFF;
|
||||
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 AppId_t;
|
||||
const AppId_t k_uAppIdInvalid = 0x0;
|
||||
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this. AppIds and DepotIDs also presently
|
||||
// share the same namespace, but since we'd like to change that in the future
|
||||
// I've defined it seperately here.
|
||||
typedef uint32 DepotId_t;
|
||||
const DepotId_t k_uDepotIdInvalid = 0x0;
|
||||
|
||||
// RTime32
|
||||
// We use this 32 bit time representing real world time.
|
||||
// It offers 1 second resolution beginning on January 1, 1970 (Unix time)
|
||||
typedef uint32 RTime32;
|
||||
|
||||
typedef uint32 CellID_t;
|
||||
|
||||
// handle to a Steam API call
|
||||
typedef uint64 SteamAPICall_t;
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // STEAMTYPES_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user