1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-10-06 09:17:07 +02:00

Merge branch 'refactor-build-script' into 'master'

Refactor build script

See merge request kelteseth/ScreenPlay!89
This commit is contained in:
Elias Steurer 2022-01-04 09:12:03 +00:00
commit 6785199e15
51 changed files with 12570 additions and 12934 deletions

154
.gitignore vendored
View File

@ -95,4 +95,158 @@ _deps
/Common/ffmpeg/*
/Docs/html/screenplay.index
/ContentBuilder/**
#https://github.com/github/gitignore/blob/main/Python.gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
/aqtinstall.log

View File

@ -3,29 +3,69 @@ stages:
- build
- test
variables:
GIT_STRATEGY: clone
QT_VERSION: 6.2.2
PYTHON_VERSION: "3.10.1"
CQTDEPLOYER_URL: "https://github.com/QuasarApp/CQtDeployer/releases/download/1.5.4.10/CQtDeployer_1.5.4.10_Linux_x86_64.deb"
check:
stage: check
allow_failure: true
image:
name: ubuntu:20.04
tags:
- vs2019
- windows10
- gitlab-org-docker
before_script:
- apt-get update -y
- apt-get install python3-pip python-is-python3 -y
script:
- cd Tools
- pip install cmakelang
- python -m pip install -U pip wheel
- python -m pip install -U cmakelang
- cd ./Tools
- python clang_format.py
- python cmake_format.py
build:shared_windows_release:
stage: build
allow_failure: true
tags:
- shared-windows
needs:
- check
before_script:
# https://stackoverflow.com/a/68671843/12619313
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
- choco install python3 --version=$PYTHON_VERSION --yes --force --no-progress
- choco install powershell-core --yes --force --no-progress
- refreshenv
script:
- python -m pip install -U pip wheel
- python -m pip install -U aqtinstall
- aqt install-qt -O ../aqt windows desktop $QT_VERSION win64_msvc2019_64 -m all
- aqt install-tool -O ../aqt windows desktop tools_ifw
- cd Tools
- python setup.py
- python build.py -type release -use-aqt -installer
artifacts:
expire_in: "4 weeks"
paths:
- build-x64-windows-release/bin/
build:windows_release:
stage: build
tags:
- vs2019
- windows10
needs:
- check
script:
- python -m pip install -U pip wheel
- python -m pip install -U aqtinstall
- aqt install-qt -O ../aqt windows desktop $QT_VERSION win64_msvc2019_64 -m all
- aqt install-tool -O ../aqt windows desktop tools_ifw
- cd Tools
- python setup.py
- python build.py -t release -steam=False
- python build.py -type release -use-aqt -installer
artifacts:
expire_in: "4 weeks"
paths:
@ -34,31 +74,36 @@ build:windows_release:
build:windows_release_steam:
stage: build
tags:
- vs2019
- windows10
needs:
- check
script:
- python -m pip install -U pip wheel
- python -m pip install -U aqtinstall
- aqt install-qt -O ../aqt windows desktop $QT_VERSION win64_msvc2019_64 -m all
- aqt install-tool -O ../aqt windows desktop tools_ifw
- cd Tools
- python setup.py
- python build.py -t release -steam=True
- python build.py -type release -steam -use-aqt -installer
artifacts:
expire_in: "4 weeks"
paths:
- build-x64-windows-release/bin/
build:osx_release:
stage: build
allow_failure: true
tags:
- osx
needs:
- check
script:
- pip3 install -U pip
- pip3 install aqtinstall
- aqt install-qt -O ../aqt mac desktop $QT_VERSION clang_64 -m all
- aqt install-tool -O ../aqt mac desktop tools_ifw
- cd Tools
- python3 setup.py
- python3 build.py -t release -steam=False
- python3 build.py -type release -use-aqt -installer
artifacts:
expire_in: "4 weeks"
paths:
@ -66,15 +111,18 @@ build:osx_release:
build:osx_release_steam:
stage: build
allow_failure: true
tags:
- osx
needs:
- check
script:
- pip3 install -U pip
- pip3 install aqtinstall
- aqt install-qt -O ../aqt mac desktop $QT_VERSION clang_64 -m all
- aqt install-tool -O ../aqt mac desktop tools_ifw
- cd Tools
- python3 setup.py
- python3 build.py -t release -steam=True
- python3 build.py -type release -steam -use-aqt -installer
artifacts:
expire_in: "4 weeks"
paths:
@ -82,7 +130,6 @@ build:osx_release_steam:
build:linux_release:
stage: build
allow_failure: true
image:
name: ubuntu:20.04
tags:
@ -90,17 +137,21 @@ build:linux_release:
needs:
- check
script:
- apt update -y
- apt-get update -y
# Otherwise libglib2 needs interaction
- export DEBIAN_FRONTEND=noninteractive
- apt install mesa-common-dev curl zip unzip tar git pkg-config apt-transport-https ca-certificates gnupg software-properties-common wget software-properties-common wget python3-pip build-essential libgl1-mesa-dev lld ninja-build cmake -y
- apt-get install mesa-common-dev curl zip unzip tar git pkg-config apt-transport-https ca-certificates gnupg software-properties-common wget software-properties-common wget python3-pip build-essential libgl1-mesa-dev lld ninja-build cmake -y
- pip3 install -U pip
- pip3 install aqtinstall
- mkdir Qt
- aqt install --outputdir Qt/ 6.2.0 linux desktop
- cd Tools
- wget -q https://github.com/QuasarApp/CQtDeployer/releases/download/1.5.2/CQtDeployer_1.5.2_OfflineInstaller_Linux64.run
- python3 setup.py
- python3 build.py -t release -steam=False
- aqt install-qt -O ../aqt linux desktop $QT_VERSION gcc_64 -m all
- aqt install-tool -O ../aqt linux desktop tools_ifw
# - wget -q https://github.com/QuasarApp/CQtDeployer/releases/download/1.5.2/CQtDeployer_1.5.2_OfflineInstaller_Linux64.run
- curl -OL $CQTDEPLOYER_URL
- chmod +x ./CQtDeployer_*.deb
- apt-get install ./CQtDeployer_*.deb -y
- python3 ./Tools/setup.py
- python3 ./Tools/build.py -type release -steam -use-aqt -installer
artifacts:
expire_in: "4 weeks"
paths:
@ -109,8 +160,7 @@ build:linux_release:
test:windows_release:
stage: test
tags:
- windows10
- vs2019
- shared-windows
dependencies:
- build:windows_release
needs:

View File

@ -12,10 +12,12 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
option(SCREENPLAY_IFW_ROOT "" STRING )
option(SCREENPLAY_STEAM "For FOSS distribution so we do not bundle proprietary code." ON)
option(SCREENPLAY_TESTS "Enables UI tests." OFF)
option(SCREENPLAY_CREATE_INSTALLER "Indicates whether an installer via the Qt Installer Framework is created." OFF)
# Add our *.cmake diretory to the CMAKE_MODULE_PATH, so that our includes are found
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
@ -103,17 +105,27 @@ message(STATUS "[PROJECT] CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}")
message(STATUS "[PROJECT] VCPKG_PATH = ${VCPKG_PATH}")
message(STATUS "[PROJECT] VCPKG_TARGET_TRIPLET = ${VCPKG_TARGET_TRIPLET}")
message(STATUS "[PROJECT] CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
message(STATUS "[PROJECT] CPACK_GENERATOR = ${CPACK_GENERATOR}")
if(${SCREENPLAY_CREATE_INSTALLER})
message(STATUS "[INSTALLER] CPACK_GENERATOR = ${CPACK_GENERATOR}")
if(${SCREENPLAY_IFW_ROOT} STREQUAL "")
# Hardcoded Qt paths that are used by the QtMaintanance tool for now...
if(WIN32)
set(CPACK_IFW_ROOT "C:/Qt/Tools/QtInstallerFramework/4.2")
set(SCREENPLAY_IFW_ROOT "C:/Qt/Tools/QtInstallerFramework/4.2")
elseif(UNIX AND NOT APPLE)
set(CPACK_IFW_ROOT "$ENV{HOME}/Qt/Tools/QtInstallerFramework/4.2")
set(SCREENPLAY_IFW_ROOT "$ENV{HOME}/Qt/Tools/QtInstallerFramework/4.2")
endif()
message(STATUS "[CPACK_IFW_ROOT] Not set. Using hardcoded value: ${SCREENPLAY_IFW_ROOT}")
message(STATUS "WARNING: MAKE SURE YOU HAVE THIS EXACT VERSION INSTALLED VIA THE QTMAINTANANCE TOOL!")
else()
message(STATUS "[CPACK_IFW_ROOT] = ${SCREENPLAY_IFW_ROOT}")
endif()
message(STATUS "[IFW INSTALLER ENABLED]: Configuring. This can take some time...")
set(CPACK_IFW_ROOT ${SCREENPLAY_IFW_ROOT})
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-Installer")
set(CPACK_PACKAGE_VENDOR "Elias Steurer")
@ -122,7 +134,7 @@ if(${SCREENPLAY_CREATE_INSTALLER})
# Ensures that contents written to the CPack configuration files is escaped properly.
set(CPACK_VERBATIM_VARIABLES TRUE)
set(CPACK_GENERATOR IFW)
set(CPACK_GENERATOR "IFW")
set(CPACK_IFW_PACKAGE_START_MENU_DIRECTORY "") # empty => default is install to top-level (?)
set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/Apps/${CMAKE_PROJECT_NAME}")
@ -141,7 +153,7 @@ if(${SCREENPLAY_CREATE_INSTALLER})
install(
DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
COMPONENT ScreenPlay
DESTINATION ".")
DESTINATION "/")
cpack_add_component(
ScreenPlay
@ -158,3 +170,4 @@ if(${SCREENPLAY_CREATE_INSTALLER})
CHECKABLE FALSE)
endif()

View File

@ -361,7 +361,8 @@ const std::optional<QString> Wizards::createTemporaryFolder() const
const QDir dir { localStoragePathUrl.toLocalFile() };
// Create a temp dir so we can later alter it to the workshop id
const QString folderName = QString("_tmp_" + QTime::currentTime().toString()).replace(":", "");
const QString currentTime = QTime::currentTime().toString().replace(":", "");
const QString folderName = "_tmp_" + currentTime;
if (!dir.mkdir(folderName)) {
qWarning() << "Could create folder: " << folderName;

View File

@ -18,8 +18,7 @@
// This interface lets you detect installed apps for the local Steam client, useful for debugging tools
// to offer lists of apps to debug via Steam.
//-----------------------------------------------------------------------------
class ISteamAppList
{
class ISteamAppList {
public:
virtual uint32 GetNumInstalledApps() = 0;
virtual uint32 GetInstalledApps(AppId_t* pvecAppID, uint32 unMaxAppIDs) = 0;
@ -45,7 +44,6 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamAppList *, SteamAppList, STEAMAPPLIS
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
//---------------------------------------------------------------------------------
// Purpose: Sent when a new app is installed
//---------------------------------------------------------------------------------
@ -54,7 +52,6 @@ STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs
STEAM_CALLBACK_MEMBER(1, int, m_iInstallFolderIndex) // library folder the app is installed
STEAM_CALLBACK_END(2)
//---------------------------------------------------------------------------------
// Purpose: Sent when an app is uninstalled
//---------------------------------------------------------------------------------
@ -63,6 +60,5 @@ STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs
STEAM_CALLBACK_MEMBER(1, int, m_iInstallFolderIndex) // library folder the app was installed
STEAM_CALLBACK_END(2)
#pragma pack(pop)
#endif // ISTEAMAPPLIST_H

View File

@ -14,12 +14,10 @@
const int k_cubAppProofOfPurchaseKeyMax = 240; // max supported length of a legacy cd key
//-----------------------------------------------------------------------------
// Purpose: interface to app data
//-----------------------------------------------------------------------------
class ISteamApps
{
class ISteamApps {
public:
virtual bool BIsSubscribed() = 0;
virtual bool BIsLowViolence() = 0;
@ -127,18 +125,15 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamApps *, SteamApps, STEAMAPPS_INTERFA
//-----------------------------------------------------------------------------
// Purpose: posted after the user gains ownership of DLC & that DLC is installed
//-----------------------------------------------------------------------------
struct DlcInstalled_t
{
struct DlcInstalled_t {
enum { k_iCallback = k_iSteamAppsCallbacks + 5 };
AppId_t m_nAppID; // AppID of the DLC
};
//-----------------------------------------------------------------------------
// Purpose: possible results when registering an activation code
//-----------------------------------------------------------------------------
enum ERegisterActivationCodeResult
{
enum ERegisterActivationCodeResult {
k_ERegisterActivationCodeResultOK = 0,
k_ERegisterActivationCodeResultFail = 1,
k_ERegisterActivationCodeResultAlreadyRegistered = 2,
@ -146,36 +141,30 @@ enum ERegisterActivationCodeResult
k_ERegisterActivationCodeAlreadyOwned = 4,
};
//-----------------------------------------------------------------------------
// Purpose: response to RegisterActivationCode()
//-----------------------------------------------------------------------------
struct RegisterActivationCodeResponse_t
{
struct RegisterActivationCodeResponse_t {
enum { k_iCallback = k_iSteamAppsCallbacks + 8 };
ERegisterActivationCodeResult m_eResult;
uint32 m_unPackageRegistered; // package that was registered. Only set on success
};
//---------------------------------------------------------------------------------
// Purpose: posted after the user gains executes a Steam URL with command line or query parameters
// such as steam://run/<appid>//-commandline/?param1=value1&param2=value2&param3=value3 etc
// while the game is already running. The new params can be queried
// with GetLaunchQueryParam and GetLaunchCommandLine
//---------------------------------------------------------------------------------
struct NewUrlLaunchParameters_t
{
struct NewUrlLaunchParameters_t {
enum { k_iCallback = k_iSteamAppsCallbacks + 14 };
};
//-----------------------------------------------------------------------------
// Purpose: response to RequestAppProofOfPurchaseKey/RequestAllProofOfPurchaseKeys
// for supporting third-party CD keys, or other proof-of-purchase systems.
//-----------------------------------------------------------------------------
struct AppProofOfPurchaseKeyResponse_t
{
struct AppProofOfPurchaseKeyResponse_t {
enum { k_iCallback = k_iSteamAppsCallbacks + 21 };
EResult m_eResult;
uint32 m_nAppID;
@ -183,12 +172,10 @@ struct AppProofOfPurchaseKeyResponse_t
char m_rgchKey[k_cubAppProofOfPurchaseKeyMax];
};
//-----------------------------------------------------------------------------
// Purpose: response to GetFileDetails
//-----------------------------------------------------------------------------
struct FileDetailsResult_t
{
struct FileDetailsResult_t {
enum { k_iCallback = k_iSteamAppsCallbacks + 23 };
EResult m_eResult;
uint64 m_ulFileSize; // original file size in bytes
@ -196,12 +183,10 @@ struct FileDetailsResult_t
uint32 m_unFlags; //
};
//-----------------------------------------------------------------------------
// Purpose: called for games in Timed Trial mode
//-----------------------------------------------------------------------------
struct TimedTrialStatus_t
{
struct TimedTrialStatus_t {
enum { k_iCallback = k_iSteamAppsCallbacks + 30 };
AppId_t m_unAppID; // appID
bool m_bIsOffline; // if true, time allowed / played refers to offline time, not total time

View File

@ -16,13 +16,11 @@
// steamid are located. the sizes of the appid and steamid are implicit in
// (each version of) the interface - currently uin32 appid and uint64 steamid
//-----------------------------------------------------------------------------
class ISteamAppTicket
{
class ISteamAppTicket {
public:
virtual uint32 GetAppOwnershipTicketData(uint32 nAppID, void* pvBuffer, uint32 cbBufferLength, uint32* piAppId, uint32* piSteamId, uint32* piSignature, uint32* pcbSignature) = 0;
};
#define STEAMAPPTICKET_INTERFACE_VERSION "STEAMAPPTICKET_INTERFACE_VERSION001"
#endif // ISTEAMAPPTICKET_H

View File

@ -24,8 +24,7 @@
// or if you want to implement a multiplexed gameserver where a single process
// is handling multiple games at once with independent gameserver SteamIDs.
//-----------------------------------------------------------------------------
class ISteamClient
{
class ISteamClient {
public:
// Creates a communication pipe to the Steam client.
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
@ -160,7 +159,6 @@ public:
virtual ISteamRemotePlay* GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion) = 0;
STEAM_PRIVATE_API(virtual void DestroyAllInterfaces() = 0;)
};
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient020"

View File

@ -16,8 +16,8 @@
#pragma once
#endif
#include "steam_api_common.h"
#include "isteaminput.h"
#include "steam_api_common.h"
#define STEAM_CONTROLLER_MAX_COUNT 16
@ -36,8 +36,7 @@
#define STEAM_CONTROLLER_MAX_ANALOG_ACTION_DATA 1.0f
#ifndef ISTEAMINPUT_H
enum ESteamControllerPad
{
enum ESteamControllerPad {
k_ESteamControllerPad_Left,
k_ESteamControllerPad_Right
};
@ -47,8 +46,7 @@ enum ESteamControllerPad
// guarantee that they will be added in a contiguous manner - use GetInputTypeForHandle instead
// Versions of Steam that add new controller types in the future will extend this enum if you're
// using a lookup table please check the bounds of any origins returned by Steam.
enum EControllerActionOrigin
{
enum EControllerActionOrigin {
// Steam Controller
k_EControllerActionOrigin_None,
k_EControllerActionOrigin_A,
@ -378,8 +376,7 @@ enum EControllerActionOrigin
};
#ifndef ISTEAMINPUT_H
enum EXboxOrigin
{
enum EXboxOrigin {
k_EXboxOrigin_A,
k_EXboxOrigin_B,
k_EXboxOrigin_X,
@ -410,8 +407,7 @@ enum EXboxOrigin
k_EXboxOrigin_DPad_East,
};
enum ESteamInputType
{
enum ESteamInputType {
k_ESteamInputType_Unknown,
k_ESteamInputType_SteamController,
k_ESteamInputType_XBox360Controller,
@ -431,8 +427,7 @@ enum ESteamInputType
};
#endif
enum ESteamControllerLEDFlag
{
enum ESteamControllerLEDFlag {
k_ESteamControllerLEDFlag_SetColor,
k_ESteamControllerLEDFlag_RestoreUserDefault
};
@ -441,7 +436,6 @@ enum ESteamControllerLEDFlag
// This handle will consistently identify a controller, even if it is disconnected and re-connected
typedef uint64 ControllerHandle_t;
// These handles are used to refer to a specific in-game action or action set
// All action handles should be queried during initialization for performance reasons
typedef uint64 ControllerActionSetHandle_t;
@ -455,8 +449,7 @@ typedef uint64 ControllerAnalogActionHandle_t;
#define ControllerDigitalActionData_t InputDigitalActionData_t
#define ControllerMotionData_t InputMotionData_t
#else
struct ControllerAnalogActionData_t
{
struct ControllerAnalogActionData_t {
// Type of data coming from this action, this will match what got specified in the action set
EControllerSourceMode eMode;
@ -467,8 +460,7 @@ struct ControllerAnalogActionData_t
bool bActive;
};
struct ControllerDigitalActionData_t
{
struct ControllerDigitalActionData_t {
// The current state of this action; will be true if currently pressed
bool bState;
@ -476,8 +468,7 @@ struct ControllerDigitalActionData_t
bool bActive;
};
struct ControllerMotionData_t
{
struct ControllerMotionData_t {
// Sensor-fused absolute rotation; will drift in heading
float rotQuatX;
float rotQuatY;
@ -497,14 +488,11 @@ struct ControllerMotionData_t
#endif
#pragma pack(pop)
//-----------------------------------------------------------------------------
// Purpose: Steam Input API
//-----------------------------------------------------------------------------
class ISteamController
{
class ISteamController {
public:
// Init and Shutdown must be called when starting/ending use of this interface
virtual bool Init() = 0;
virtual bool Shutdown() = 0;

View File

@ -15,8 +15,7 @@
//-----------------------------------------------------------------------------
// Purpose: set of relationships to other users
//-----------------------------------------------------------------------------
enum EFriendRelationship
{
enum EFriendRelationship {
k_EFriendRelationshipNone = 0,
k_EFriendRelationshipBlocked = 1, // this doesn't get stored; the user has just done an Ignore on an friendship invite
k_EFriendRelationshipRequestRecipient = 2,
@ -44,12 +43,10 @@ const FriendsGroupID_t k_FriendsGroupID_Invalid = -1;
const int k_cEnumerateFollowersMax = 50;
//-----------------------------------------------------------------------------
// Purpose: list of states a friend can be in
//-----------------------------------------------------------------------------
enum EPersonaState
{
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
@ -61,12 +58,10 @@ enum EPersonaState
k_EPersonaStateMax,
};
//-----------------------------------------------------------------------------
// Purpose: flags for enumerating friends list, or quickly checking a the relationship between users
//-----------------------------------------------------------------------------
enum EFriendFlags
{
enum EFriendFlags {
k_EFriendFlagNone = 0x00,
k_EFriendFlagBlocked = 0x01,
k_EFriendFlagFriendshipRequested = 0x02,
@ -84,7 +79,6 @@ enum EFriendFlags
k_EFriendFlagAll = 0xFFFF,
};
// friend game played information
#if defined(VALVE_CALLBACK_PACK_SMALL)
#pragma pack(push, 4)
@ -93,8 +87,7 @@ enum EFriendFlags
#else
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
struct FriendGameInfo_t
{
struct FriendGameInfo_t {
CGameID m_gameID;
uint32 m_unGameIP;
uint16 m_usGamePort;
@ -106,8 +99,7 @@ struct FriendGameInfo_t
// maximum number of characters in a user's name. Two flavors; one for UTF-8 and one for UTF-16.
// The UTF-8 version has to be very generous to accomodate characters that get large when encoded
// in UTF-8.
enum
{
enum {
k_cchPersonaNameMax = 128,
k_cwchPersonaNameMax = 32,
};
@ -115,8 +107,7 @@ enum
//-----------------------------------------------------------------------------
// Purpose: user restriction flags
//-----------------------------------------------------------------------------
enum EUserRestriction
{
enum EUserRestriction {
k_nUserRestrictionNone = 0, // no known chat/content restriction
k_nUserRestrictionUnknown = 1, // we don't know yet (user offline)
k_nUserRestrictionAnyChat = 2, // user is not allowed to (or can't) send/recv any chat
@ -136,19 +127,16 @@ enum { k_cchMaxRichPresenceKeyLength = 64 };
enum { k_cchMaxRichPresenceValueLength = 256 };
// These values are passed as parameters to the store
enum EOverlayToStoreFlag
{
enum EOverlayToStoreFlag {
k_EOverlayToStoreFlag_None = 0,
k_EOverlayToStoreFlag_AddToCart = 1,
k_EOverlayToStoreFlag_AddToCartAndShow = 2,
};
//-----------------------------------------------------------------------------
// Purpose: Tells Steam where to place the browser window inside the overlay
//-----------------------------------------------------------------------------
enum EActivateGameOverlayToWebPageMode
{
enum EActivateGameOverlayToWebPageMode {
k_EActivateGameOverlayToWebPageMode_Default = 0, // Browser will open next to all other windows that the user has open in the overlay.
// The window will remain open, even if the user closes then re-opens the overlay.
@ -157,13 +145,11 @@ enum EActivateGameOverlayToWebPageMode
// will also close. When the user closes the browser window, the overlay will automatically close.
};
//-----------------------------------------------------------------------------
// 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
{
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
@ -442,19 +428,16 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamFriends *, SteamFriends, STEAMFRIEND
//-----------------------------------------------------------------------------
// Purpose: called when a friends' status changes
//-----------------------------------------------------------------------------
struct PersonaStateChange_t
{
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
{
enum EPersonaChange {
k_EPersonaChangeName = 0x0001,
k_EPersonaChangeStatus = 0x0002,
k_EPersonaChangeComeOnline = 0x0004,
@ -472,36 +455,30 @@ enum EPersonaChange
k_EPersonaChangeRichPresence = 0x4000,
};
//-----------------------------------------------------------------------------
// Purpose: posted when game overlay activates or deactivates
// the game can use this to be pause or resume single player games
//-----------------------------------------------------------------------------
struct GameOverlayActivated_t
{
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
{
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
{
struct GameLobbyJoinRequested_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 33 };
CSteamID m_steamIDLobby;
@ -513,13 +490,11 @@ struct GameLobbyJoinRequested_t
CSteamID m_steamIDFriend;
};
//-----------------------------------------------------------------------------
// Purpose: called when an avatar is loaded in from a previous GetLargeFriendAvatar() call
// if the image wasn't already available
//-----------------------------------------------------------------------------
struct AvatarImageLoaded_t
{
struct AvatarImageLoaded_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 34 };
CSteamID m_steamID; // steamid the avatar has been loaded for
int m_iImage; // the image index of the now loaded image
@ -527,70 +502,58 @@ struct AvatarImageLoaded_t
int m_iTall; // height of the loaded image
};
//-----------------------------------------------------------------------------
// Purpose: marks the return of a request officer list call
//-----------------------------------------------------------------------------
struct ClanOfficerListResponse_t
{
struct ClanOfficerListResponse_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 35 };
CSteamID m_steamIDClan;
int m_cOfficers;
uint8 m_bSuccess;
};
//-----------------------------------------------------------------------------
// Purpose: callback indicating updated data about friends rich presence information
//-----------------------------------------------------------------------------
struct FriendRichPresenceUpdate_t
{
struct FriendRichPresenceUpdate_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 36 };
CSteamID m_steamIDFriend; // friend who's rich presence has changed
AppId_t m_nAppID; // the appID of the game (should always be the current game)
};
//-----------------------------------------------------------------------------
// Purpose: called when the user tries to join a game from their friends list
// rich presence will have been set with the "connect" key which is set here
//-----------------------------------------------------------------------------
struct GameRichPresenceJoinRequested_t
{
struct GameRichPresenceJoinRequested_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 37 };
CSteamID m_steamIDFriend; // the friend they did the join via (will be invalid if not directly via a friend)
char m_rgchConnect[k_cchMaxRichPresenceValueLength];
};
//-----------------------------------------------------------------------------
// Purpose: a chat message has been received for a clan chat the game has joined
//-----------------------------------------------------------------------------
struct GameConnectedClanChatMsg_t
{
struct GameConnectedClanChatMsg_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 38 };
CSteamID m_steamIDClanChat;
CSteamID m_steamIDUser;
int m_iMessageID;
};
//-----------------------------------------------------------------------------
// Purpose: a user has joined a clan chat
//-----------------------------------------------------------------------------
struct GameConnectedChatJoin_t
{
struct GameConnectedChatJoin_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 39 };
CSteamID m_steamIDClanChat;
CSteamID m_steamIDUser;
};
//-----------------------------------------------------------------------------
// Purpose: a user has left the chat we're in
//-----------------------------------------------------------------------------
struct GameConnectedChatLeave_t
{
struct GameConnectedChatLeave_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 40 };
CSteamID m_steamIDClanChat;
CSteamID m_steamIDUser;
@ -598,22 +561,18 @@ struct GameConnectedChatLeave_t
bool m_bDropped; // true if Steam connection dropped
};
//-----------------------------------------------------------------------------
// Purpose: a DownloadClanActivityCounts() call has finished
//-----------------------------------------------------------------------------
struct DownloadClanActivityCountsResult_t
{
struct DownloadClanActivityCountsResult_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 41 };
bool m_bSuccess;
};
//-----------------------------------------------------------------------------
// Purpose: a JoinClanChatRoom() call has finished
//-----------------------------------------------------------------------------
struct JoinClanChatRoomCompletionResult_t
{
struct JoinClanChatRoomCompletionResult_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 42 };
CSteamID m_steamIDClanChat;
EChatRoomEnterResponse m_eChatRoomEnterResponse;
@ -622,34 +581,27 @@ struct JoinClanChatRoomCompletionResult_t
//-----------------------------------------------------------------------------
// Purpose: a chat message has been received from a user
//-----------------------------------------------------------------------------
struct GameConnectedFriendChatMsg_t
{
struct GameConnectedFriendChatMsg_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 43 };
CSteamID m_steamIDUser;
int m_iMessageID;
};
struct FriendsGetFollowerCount_t
{
struct FriendsGetFollowerCount_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 44 };
EResult m_eResult;
CSteamID m_steamID;
int m_nCount;
};
struct FriendsIsFollowing_t
{
struct FriendsIsFollowing_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 45 };
EResult m_eResult;
CSteamID m_steamID;
bool m_bIsFollowing;
};
struct FriendsEnumerateFollowingList_t
{
struct FriendsEnumerateFollowingList_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 46 };
EResult m_eResult;
CSteamID m_rgSteamID[k_cEnumerateFollowersMax];
@ -660,8 +612,7 @@ struct FriendsEnumerateFollowingList_t
//-----------------------------------------------------------------------------
// Purpose: reports the result of an attempt to change the user's persona name
//-----------------------------------------------------------------------------
struct SetPersonaNameResponse_t
{
struct SetPersonaNameResponse_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 47 };
bool m_bSuccess; // true if name change succeeded completely.
@ -672,22 +623,18 @@ struct SetPersonaNameResponse_t
//-----------------------------------------------------------------------------
// Purpose: Invoked when the status of unread messages changes
//-----------------------------------------------------------------------------
struct UnreadChatMessagesChanged_t
{
struct UnreadChatMessagesChanged_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 48 };
};
//-----------------------------------------------------------------------------
// Purpose: Dispatched when an overlay browser instance is navigated to a protocol/scheme registered by RegisterProtocolInOverlayBrowser()
//-----------------------------------------------------------------------------
struct OverlayBrowserProtocolNavigation_t
{
struct OverlayBrowserProtocolNavigation_t {
enum { k_iCallback = k_iSteamFriendsCallbacks + 49 };
char rgchURI[1024];
};
#pragma pack(pop)
#endif // ISTEAMFRIENDS_H

View File

@ -12,10 +12,8 @@
#include "steam_api_common.h"
// list of possible return values from the ISteamGameCoordinator API
enum EGCResults
{
enum EGCResults {
k_EGCResultOK = 0,
k_EGCResultNoMessage = 1, // There is no message in the queue
k_EGCResultBufferTooSmall = 2, // The buffer is too small for the requested message
@ -23,15 +21,12 @@ enum EGCResults
k_EGCResultInvalidMessage = 4, // Something was wrong with the message being sent with SendMessage
};
//-----------------------------------------------------------------------------
// Purpose: Functions for sending and receiving messages from the Game Coordinator
// for this application
//-----------------------------------------------------------------------------
class ISteamGameCoordinator
{
class ISteamGameCoordinator {
public:
// sends a message to the Game Coordinator
virtual EGCResults SendMessage(uint32 unMsgType, const void* pubData, uint32 cubData) = 0;
@ -43,7 +38,6 @@ public:
// If the provided buffer is not large enough to fit the entire message, k_EGCResultBufferTooSmall is returned
// and the message remains at the head of the queue.
virtual EGCResults RetrieveMessage(uint32* punMsgType, void* pubDest, uint32 cubDest, uint32* pcubMsgSize) = 0;
};
#define STEAMGAMECOORDINATOR_INTERFACE_VERSION "SteamGameCoordinator001"
@ -57,15 +51,13 @@ public:
#endif
// callback notification - A new message is available for reading from the message queue
struct GCMessageAvailable_t
{
struct GCMessageAvailable_t {
enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 1 };
uint32 m_nMessageSize;
};
// callback notification - A message failed to make it to the GC. It may be down temporarily
struct GCMessageFailed_t
{
struct GCMessageFailed_t {
enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 2 };
};

View File

@ -15,10 +15,8 @@
//-----------------------------------------------------------------------------
// Purpose: Functions for authenticating users via Steam to play on a game server
//-----------------------------------------------------------------------------
class ISteamGameServer
{
class ISteamGameServer {
public:
//
// Basic server data. These properties, if set, must be set before before calling LogOn. They
// may not be changed after logged in.
@ -172,7 +170,6 @@ public:
// returns false if we're not connected to the steam servers and thus cannot ask
virtual bool RequestUserGroupStatus(CSteamID steamIDUser, CSteamID steamIDGroup) = 0;
// these two functions s are deprecated, and will not return results
// they will be removed in a future version of the SDK
virtual void GetGameplayStats() = 0;
@ -216,9 +213,6 @@ public:
STEAM_CALL_RESULT(ComputeNewPlayerCompatibilityResult_t)
virtual SteamAPICall_t ComputeNewPlayerCompatibility(CSteamID steamIDNewPlayer) = 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
@ -260,8 +254,7 @@ public:
STEAM_PRIVATE_API(
virtual void SetMasterServerHeartbeatInterval_DEPRECATED(int iHeartbeatInterval) = 0;
virtual void ForceMasterServerHeartbeat_DEPRECATED() = 0;
)
virtual void ForceMasterServerHeartbeat_DEPRECATED() = 0;)
};
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer014"
@ -279,29 +272,23 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamGameServer *, SteamGameServer,
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
// client has been approved to connect to this game server
struct GSClientApprove_t
{
struct GSClientApprove_t {
enum { k_iCallback = k_iSteamGameServerCallbacks + 1 };
CSteamID m_SteamID; // SteamID of approved player
CSteamID m_OwnerSteamID; // SteamID of original owner for game license
};
// client has been denied to connection to this game server
struct GSClientDeny_t
{
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
{
struct GSClientKick_t {
enum { k_iCallback = k_iSteamGameServerCallbacks + 3 };
CSteamID m_SteamID;
EDenyReason m_eDenyReason;
@ -310,10 +297,8 @@ struct GSClientKick_t
// 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
{
struct GSClientAchievementStatus_t {
enum { k_iCallback = k_iSteamGameServerCallbacks + 6 };
uint64 m_SteamID;
char m_pchAchievement[128];
@ -322,15 +307,13 @@ struct GSClientAchievementStatus_t
// 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
{
struct GSPolicyResponse_t {
enum { k_iCallback = k_iSteamUserCallbacks + 15 };
uint8 m_bSecure;
};
// GS gameplay stats info
struct GSGameplayStats_t
{
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)
@ -339,8 +322,7 @@ struct GSGameplayStats_t
};
// send as a reply to RequestUserGroupStatus()
struct GSClientGroupStatus_t
{
struct GSClientGroupStatus_t {
enum { k_iCallback = k_iSteamGameServerCallbacks + 8 };
CSteamID m_SteamIDUser;
CSteamID m_SteamIDGroup;
@ -349,8 +331,7 @@ struct GSClientGroupStatus_t
};
// Sent as a reply to GetServerReputation()
struct GSReputation_t
{
struct GSReputation_t {
enum { k_iCallback = k_iSteamGameServerCallbacks + 9 };
EResult m_eResult; // Result of the call;
uint32 m_unReputationScore; // The reputation score for the game server
@ -369,15 +350,13 @@ struct GSReputation_t
};
// Sent as a reply to AssociateWithClan()
struct AssociateWithClanResult_t
{
struct AssociateWithClanResult_t {
enum { k_iCallback = k_iSteamGameServerCallbacks + 10 };
EResult m_eResult; // Result of the call;
};
// Sent as a reply to ComputeNewPlayerCompatibility()
struct ComputeNewPlayerCompatibilityResult_t
{
struct ComputeNewPlayerCompatibilityResult_t {
enum { k_iCallback = k_iSteamGameServerCallbacks + 11 };
EResult m_eResult; // Result of the call;
int m_cPlayersThatDontLikeCandidate;
@ -386,7 +365,6 @@ struct ComputeNewPlayerCompatibilityResult_t
CSteamID m_SteamIDCandidate;
};
#pragma pack(pop)
#endif // ISTEAMGAMESERVER_H

View File

@ -15,8 +15,7 @@
//-----------------------------------------------------------------------------
// Purpose: Functions for authenticating users via Steam to play on a game server
//-----------------------------------------------------------------------------
class ISteamGameServerStats
{
class ISteamGameServerStats {
public:
// downloads stats for the user
// returns a GSStatsReceived_t callback when completed
@ -66,7 +65,6 @@ public:
inline ISteamGameServerStats* SteamGameServerStats();
STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR(ISteamGameServerStats*, SteamGameServerStats, STEAMGAMESERVERSTATS_INTERFACE_VERSION);
// callbacks
#if defined(VALVE_CALLBACK_PACK_SMALL)
#pragma pack(push, 4)
@ -80,19 +78,16 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamGameServerStats *, SteamGameSe
// Purpose: called when the latests stats and achievements have been received
// from the server
//-----------------------------------------------------------------------------
struct GSStatsReceived_t
{
struct GSStatsReceived_t {
enum { k_iCallback = k_iSteamGameServerStatsCallbacks };
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 GSStatsStored_t
{
struct GSStatsStored_t {
enum { k_iCallback = k_iSteamGameServerStatsCallbacks + 1 };
EResult m_eResult; // success / error
CSteamID m_steamIDUser; // The user for whom the stats were stored
@ -102,13 +97,11 @@ struct GSStatsStored_t
// Purpose: Callback indicating that a user's stats have been unloaded.
// Call RequestUserStats again to access stats for this user
//-----------------------------------------------------------------------------
struct GSStatsUnloaded_t
{
struct GSStatsUnloaded_t {
enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 };
CSteamID m_steamIDUser; // User whose stats have been unloaded
};
#pragma pack(pop)
#endif // ISTEAMGAMESERVERSTATS_H

View File

@ -18,8 +18,7 @@ const uint32 INVALID_HTMLBROWSER = 0;
//-----------------------------------------------------------------------------
// Purpose: Functions for displaying HTML pages and interacting with them
//-----------------------------------------------------------------------------
class ISteamHTMLSurface
{
class ISteamHTMLSurface {
public:
virtual ~ISteamHTMLSurface() { }
@ -66,8 +65,7 @@ public:
// run this javascript script in the currently loaded page
virtual void ExecuteJavascript(HHTMLBrowser unBrowserHandle, const char* pchScript) = 0;
enum EHTMLMouseButton
{
enum EHTMLMouseButton {
eHTMLMouseButton_Left = 0,
eHTMLMouseButton_Right = 1,
eHTMLMouseButton_Middle = 2,
@ -82,8 +80,7 @@ public:
// nDelta is pixels of scroll
virtual void MouseWheel(HHTMLBrowser unBrowserHandle, int32 nDelta) = 0;
enum EMouseCursor
{
enum EMouseCursor {
dc_user = 0,
dc_none,
dc_arrow,
@ -129,8 +126,7 @@ public:
dc_last, // custom cursors start from this value and up
};
enum EHTMLKeyModifiers
{
enum EHTMLKeyModifiers {
k_eHTMLKeyModifier_None = 0,
k_eHTMLKeyModifier_AltDown = 1 << 0,
k_eHTMLKeyModifier_CtrlDown = 1 << 1,
@ -219,7 +215,6 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamHTMLSurface *, SteamHTMLSurface, STE
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
//-----------------------------------------------------------------------------
// Purpose: The browser is ready for use
//-----------------------------------------------------------------------------
@ -227,7 +222,6 @@ STEAM_CALLBACK_BEGIN( HTML_BrowserReady_t, k_iSteamHTMLSurfaceCallbacks + 1 )
STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // this browser is now fully created and ready to navigate to pages
STEAM_CALLBACK_END(1)
//-----------------------------------------------------------------------------
// Purpose: the browser has a pending paint
//-----------------------------------------------------------------------------
@ -246,7 +240,6 @@ STEAM_CALLBACK_MEMBER(10, float, flPageScale) // the page scale factor on this p
STEAM_CALLBACK_MEMBER(11, uint32, unPageSerial) // incremented on each new page load, you can use this to reject draws while navigating to new pages
STEAM_CALLBACK_END(12)
//-----------------------------------------------------------------------------
// Purpose: The browser wanted to navigate to a new page
// NOTE - you MUST call AllowStartRequest in response to this callback
@ -259,7 +252,6 @@ STEAM_CALLBACK_MEMBER(3, const char *, pchPostData ) // any posted data for the
STEAM_CALLBACK_MEMBER(4, bool, bIsRedirect) // true if this was a http/html redirect from the last load request
STEAM_CALLBACK_END(5)
//-----------------------------------------------------------------------------
// Purpose: The browser has been requested to close due to user interaction (usually from a javascript window.close() call)
//-----------------------------------------------------------------------------
@ -267,7 +259,6 @@ STEAM_CALLBACK_BEGIN(HTML_CloseBrowser_t, k_iSteamHTMLSurfaceCallbacks + 4)
STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface
STEAM_CALLBACK_END(1)
//-----------------------------------------------------------------------------
// Purpose: the browser is navigating to a new url
//-----------------------------------------------------------------------------
@ -280,7 +271,6 @@ STEAM_CALLBACK_MEMBER( 4, const char *, pchPageTitle ) // the title of the page
STEAM_CALLBACK_MEMBER(5, bool, bNewNavigation) // true if this was from a fresh tab and not a click on an existing page
STEAM_CALLBACK_END(6)
//-----------------------------------------------------------------------------
// Purpose: A page is finished loading
//-----------------------------------------------------------------------------
@ -290,7 +280,6 @@ STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) //
STEAM_CALLBACK_MEMBER(2, const char*, pchPageTitle) //
STEAM_CALLBACK_END(3)
//-----------------------------------------------------------------------------
// Purpose: a request to load this url in a new tab
//-----------------------------------------------------------------------------
@ -299,7 +288,6 @@ STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the s
STEAM_CALLBACK_MEMBER(1, const char*, pchURL) //
STEAM_CALLBACK_END(2)
//-----------------------------------------------------------------------------
// Purpose: the page has a new title now
//-----------------------------------------------------------------------------
@ -308,7 +296,6 @@ STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the s
STEAM_CALLBACK_MEMBER(1, const char*, pchTitle) //
STEAM_CALLBACK_END(2)
//-----------------------------------------------------------------------------
// Purpose: results from a search
//-----------------------------------------------------------------------------
@ -318,7 +305,6 @@ STEAM_CALLBACK_MEMBER( 1, uint32, unResults ) //
STEAM_CALLBACK_MEMBER(2, uint32, unCurrentMatch) //
STEAM_CALLBACK_END(3)
//-----------------------------------------------------------------------------
// Purpose: page history status changed on the ability to go backwards and forward
//-----------------------------------------------------------------------------
@ -328,7 +314,6 @@ STEAM_CALLBACK_MEMBER( 1, bool, bCanGoBack ) //
STEAM_CALLBACK_MEMBER(2, bool, bCanGoForward) //
STEAM_CALLBACK_END(3)
//-----------------------------------------------------------------------------
// Purpose: details on the visibility and size of the horizontal scrollbar
//-----------------------------------------------------------------------------
@ -341,7 +326,6 @@ STEAM_CALLBACK_MEMBER( 4, bool , bVisible ) //
STEAM_CALLBACK_MEMBER(5, uint32, unPageSize) //
STEAM_CALLBACK_END(6)
//-----------------------------------------------------------------------------
// Purpose: details on the visibility and size of the vertical scrollbar
//-----------------------------------------------------------------------------
@ -354,7 +338,6 @@ STEAM_CALLBACK_MEMBER( 4, bool, bVisible ) //
STEAM_CALLBACK_MEMBER(5, uint32, unPageSize) //
STEAM_CALLBACK_END(6)
//-----------------------------------------------------------------------------
// Purpose: response to GetLinkAtPosition call
//-----------------------------------------------------------------------------
@ -367,8 +350,6 @@ STEAM_CALLBACK_MEMBER( 4, bool, bInput ) //
STEAM_CALLBACK_MEMBER(5, bool, bLiveLink) //
STEAM_CALLBACK_END(6)
//-----------------------------------------------------------------------------
// Purpose: show a Javascript alert dialog, call JSDialogResponse
// when the user dismisses this dialog (or right away to ignore it)
@ -378,7 +359,6 @@ STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the s
STEAM_CALLBACK_MEMBER(1, const char*, pchMessage) //
STEAM_CALLBACK_END(2)
//-----------------------------------------------------------------------------
// Purpose: show a Javascript confirmation dialog, call JSDialogResponse
// when the user dismisses this dialog (or right away to ignore it)
@ -388,7 +368,6 @@ STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the s
STEAM_CALLBACK_MEMBER(1, const char*, pchMessage) //
STEAM_CALLBACK_END(2)
//-----------------------------------------------------------------------------
// Purpose: when received show a file open dialog
// then call FileLoadDialogResponse with the file(s) the user selected.
@ -399,7 +378,6 @@ STEAM_CALLBACK_MEMBER( 1, const char *, pchTitle ) //
STEAM_CALLBACK_MEMBER(2, const char*, pchInitialFile) //
STEAM_CALLBACK_END(3)
//-----------------------------------------------------------------------------
// Purpose: a new html window is being created.
//
@ -419,7 +397,6 @@ STEAM_CALLBACK_MEMBER( 5, uint32, unTall ) // the total height of the pBGRA text
STEAM_CALLBACK_MEMBER(6, HHTMLBrowser, unNewWindow_BrowserHandle_IGNORE)
STEAM_CALLBACK_END(7)
//-----------------------------------------------------------------------------
// Purpose: change the cursor to display
//-----------------------------------------------------------------------------
@ -428,7 +405,6 @@ STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the s
STEAM_CALLBACK_MEMBER(1, uint32, eMouseCursor) // the EMouseCursor to display
STEAM_CALLBACK_END(2)
//-----------------------------------------------------------------------------
// Purpose: informational message from the browser
//-----------------------------------------------------------------------------
@ -437,7 +413,6 @@ STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the s
STEAM_CALLBACK_MEMBER(1, const char*, pchMsg) // the EMouseCursor to display
STEAM_CALLBACK_END(2)
//-----------------------------------------------------------------------------
// Purpose: show a tooltip
//-----------------------------------------------------------------------------
@ -446,7 +421,6 @@ STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the s
STEAM_CALLBACK_MEMBER(1, const char*, pchMsg) // the EMouseCursor to display
STEAM_CALLBACK_END(2)
//-----------------------------------------------------------------------------
// Purpose: update the text of an existing tooltip
//-----------------------------------------------------------------------------
@ -455,7 +429,6 @@ STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the s
STEAM_CALLBACK_MEMBER(1, const char*, pchMsg) // the EMouseCursor to display
STEAM_CALLBACK_END(2)
//-----------------------------------------------------------------------------
// Purpose: hide the tooltip you are showing
//-----------------------------------------------------------------------------
@ -463,7 +436,6 @@ STEAM_CALLBACK_BEGIN( HTML_HideToolTip_t, k_iSteamHTMLSurfaceCallbacks + 26 )
STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface
STEAM_CALLBACK_END(1)
//-----------------------------------------------------------------------------
// Purpose: The browser has restarted due to an internal failure, use this new handle value
//-----------------------------------------------------------------------------
@ -472,8 +444,6 @@ STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this is the new bro
STEAM_CALLBACK_MEMBER(1, HHTMLBrowser, unOldBrowserHandle) // the handle for the browser before the restart, if your handle was this then switch to using unBrowserHandle for API calls
STEAM_CALLBACK_END(2)
#pragma pack(pop)
#endif // ISTEAMHTMLSURFACE_H

View File

@ -23,10 +23,8 @@ typedef uint32 HTTPCookieContainerHandle;
//-----------------------------------------------------------------------------
// Purpose: interface to http client
//-----------------------------------------------------------------------------
class ISteamHTTP
{
class ISteamHTTP {
public:
// Initializes a new HTTP request, returning a handle to use in further operations on it. Requires
// the method (GET or POST) and the absolute URL for the request. Both http and https are supported,
// so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/
@ -159,8 +157,7 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamHTTP *, SteamGameServerHTTP, S
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
struct HTTPRequestCompleted_t
{
struct HTTPRequestCompleted_t {
enum { k_iCallback = k_iClientHTTPCallbacks + 1 };
// Handle value for the request that has completed.
@ -181,9 +178,7 @@ struct HTTPRequestCompleted_t
uint32 m_unBodySize; // Same as GetHTTPResponseBodySize()
};
struct HTTPRequestHeadersReceived_t
{
struct HTTPRequestHeadersReceived_t {
enum { k_iCallback = k_iClientHTTPCallbacks + 2 };
// Handle value for the request that has received headers.
@ -194,8 +189,7 @@ struct HTTPRequestHeadersReceived_t
uint64 m_ulContextValue;
};
struct HTTPRequestDataReceived_t
{
struct HTTPRequestDataReceived_t {
enum { k_iCallback = k_iClientHTTPCallbacks + 3 };
// Handle value for the request that has received data.
@ -205,7 +199,6 @@ struct HTTPRequestDataReceived_t
// no context value was set.
uint64 m_ulContextValue;
// Offset to provide to GetHTTPStreamingResponseBodyData to get this chunk of data
uint32 m_cOffset;
@ -213,7 +206,6 @@ struct HTTPRequestDataReceived_t
uint32 m_cBytesReceived;
};
#pragma pack(pop)
#endif // ISTEAMHTTP_H

View File

@ -31,8 +31,7 @@
#define STEAM_INPUT_MIN_ANALOG_ACTION_DATA -1.0f
#define STEAM_INPUT_MAX_ANALOG_ACTION_DATA 1.0f
enum EInputSourceMode
{
enum EInputSourceMode {
k_EInputSourceMode_None,
k_EInputSourceMode_Dpad,
k_EInputSourceMode_Buttons,
@ -56,8 +55,7 @@ enum EInputSourceMode
// guarantee that they will be added in a contiguous manner - use GetInputTypeForHandle instead.
// Versions of Steam that add new controller types in the future will extend this enum so if you're
// using a lookup table please check the bounds of any origins returned by Steam.
enum EInputActionOrigin
{
enum EInputActionOrigin {
// Steam Controller
k_EInputActionOrigin_None,
k_EInputActionOrigin_SteamController_A,
@ -258,7 +256,6 @@ enum EInputActionOrigin
k_EInputActionOrigin_XBox360_Reserved9,
k_EInputActionOrigin_XBox360_Reserved10,
// Switch - Pro or Joycons used as a single input device.
// This does not apply to a single joycon
k_EInputActionOrigin_Switch_A,
@ -411,8 +408,7 @@ enum EInputActionOrigin
k_EInputActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits.
};
enum EXboxOrigin
{
enum EXboxOrigin {
k_EXboxOrigin_A,
k_EXboxOrigin_B,
k_EXboxOrigin_X,
@ -444,28 +440,24 @@ enum EXboxOrigin
k_EXboxOrigin_Count,
};
enum ESteamControllerPad
{
enum ESteamControllerPad {
k_ESteamControllerPad_Left,
k_ESteamControllerPad_Right
};
enum EControllerHapticLocation
{
enum EControllerHapticLocation {
k_EControllerHapticLocation_Left = (1 << k_ESteamControllerPad_Left),
k_EControllerHapticLocation_Right = (1 << k_ESteamControllerPad_Right),
k_EControllerHapticLocation_Both = (1 << k_ESteamControllerPad_Left | 1 << k_ESteamControllerPad_Right),
};
enum EControllerHapticType
{
enum EControllerHapticType {
k_EControllerHapticType_Off,
k_EControllerHapticType_Tick,
k_EControllerHapticType_Click,
};
enum ESteamInputType
{
enum ESteamInputType {
k_ESteamInputType_Unknown,
k_ESteamInputType_SteamController,
k_ESteamInputType_XBox360Controller,
@ -485,8 +477,7 @@ enum ESteamInputType
};
// Individual values are used by the GetSessionInputConfigurationSettings bitmask
enum ESteamInputConfigurationEnableType
{
enum ESteamInputConfigurationEnableType {
k_ESteamInputConfigurationEnableType_None = 0x0000,
k_ESteamInputConfigurationEnableType_Playstation = 0x0001,
k_ESteamInputConfigurationEnableType_Xbox = 0x0002,
@ -495,8 +486,7 @@ enum ESteamInputConfigurationEnableType
};
// These values are passed into SetLEDColor
enum ESteamInputLEDFlag
{
enum ESteamInputLEDFlag {
k_ESteamInputLEDFlag_SetColor,
// Restore the LED color to the user's preference setting as set in the controller personalization menu.
// This also happens automatically on exit of your game.
@ -504,15 +494,13 @@ enum ESteamInputLEDFlag
};
// These values are passed into GetGlyphPNGForActionOrigin
enum ESteamInputGlyphSize
{
enum ESteamInputGlyphSize {
k_ESteamInputGlyphSize_Small,
k_ESteamInputGlyphSize_Medium,
k_ESteamInputGlyphSize_Large,
};
enum ESteamInputActionEventType
{
enum ESteamInputActionEventType {
ESteamInputActionEventType_DigitalAction,
ESteamInputActionEventType_AnalogAction,
};
@ -529,8 +517,7 @@ typedef uint64 InputAnalogActionHandle_t;
#pragma pack(push, 1)
struct InputAnalogActionData_t
{
struct InputAnalogActionData_t {
// Type of data coming from this action, this will match what got specified in the action set
EInputSourceMode eMode;
@ -541,8 +528,7 @@ struct InputAnalogActionData_t
bool bActive;
};
struct InputDigitalActionData_t
{
struct InputDigitalActionData_t {
// The current state of this action; will be true if currently pressed
bool bState;
@ -550,8 +536,7 @@ struct InputDigitalActionData_t
bool bActive;
};
struct InputMotionData_t
{
struct InputMotionData_t {
// Sensor-fused absolute rotation; will drift in heading
float rotQuatX;
float rotQuatY;
@ -573,8 +558,7 @@ struct InputMotionData_t
// Purpose: when callbacks are enabled this fires each time a controller action
// state changes
//-----------------------------------------------------------------------------
struct SteamInputActionEvent_t
{
struct SteamInputActionEvent_t {
InputHandle_t controllerHandle;
ESteamInputActionEventType eEventType;
union {
@ -596,10 +580,8 @@ typedef void ( *SteamInputActionEventCallbackPointer )( SteamInputActionEvent_t
//-----------------------------------------------------------------------------
// Purpose: Steam Input API
//-----------------------------------------------------------------------------
class ISteamInput
{
class ISteamInput {
public:
// Init and Shutdown must be called when starting/ending use of this interface.
// if bExplicitlyCallRunFrame is called then you will need to manually call RunFrame
// each frame, otherwise Steam Input will updated when SteamAPI_RunCallbacks() is called
@ -822,8 +804,7 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamInput *, SteamInput, STEAMINPUT_INTE
// Purpose: called when a new controller has been connected, will fire once
// per controller if multiple new controllers connect in the same frame
//-----------------------------------------------------------------------------
struct SteamInputDeviceConnected_t
{
struct SteamInputDeviceConnected_t {
enum { k_iCallback = k_iSteamControllerCallbacks + 1 };
InputHandle_t m_ulConnectedDeviceHandle; // Handle for device
};
@ -832,8 +813,7 @@ struct SteamInputDeviceConnected_t
// Purpose: called when a new controller has been connected, will fire once
// per controller if multiple new controllers connect in the same frame
//-----------------------------------------------------------------------------
struct SteamInputDeviceDisconnected_t
{
struct SteamInputDeviceDisconnected_t {
enum { k_iCallback = k_iSteamControllerCallbacks + 2 };
InputHandle_t m_ulDisconnectedDeviceHandle; // Handle for device
};
@ -842,8 +822,7 @@ struct SteamInputDeviceDisconnected_t
// Purpose: called when a controller configuration has been loaded, will fire once
// per controller per focus change for Steam Input enabled controllers
//-----------------------------------------------------------------------------
struct SteamInputConfigurationLoaded_t
{
struct SteamInputConfigurationLoaded_t {
enum { k_iCallback = k_iSteamControllerCallbacks + 3 };
AppId_t m_unAppID;
InputHandle_t m_ulDeviceHandle; // Handle for device

View File

@ -21,7 +21,6 @@
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
// Every individual instance of an item has a globally-unique ItemInstanceID.
// This ID is unique to the combination of (player, specific item instance)
// and will not be transferred to another player or re-used for another item.
@ -35,9 +34,7 @@ static const SteamItemInstanceID_t k_SteamItemInstanceIDInvalid = (SteamItemInst
// reserved for internal Steam use.
typedef int32 SteamItemDef_t;
enum ESteamItemFlags
{
enum ESteamItemFlags {
// Item status flags - these flags are permanently attached to specific item instances
k_ESteamItemNoTrade = 1 << 0, // This item is account-locked and cannot be traded or given away.
@ -49,8 +46,7 @@ enum ESteamItemFlags
// Do not assume anything about the state of other flags which are not defined here.
};
struct SteamItemDetails_t
{
struct SteamItemDetails_t {
SteamItemInstanceID_t m_itemId;
SteamItemDef_t m_iDefinition;
uint16 m_unQuantity;
@ -67,10 +63,8 @@ const SteamInventoryUpdateHandle_t k_SteamInventoryUpdateHandleInvalid = 0xfffff
//-----------------------------------------------------------------------------
// Purpose: Steam Inventory query and manipulation API
//-----------------------------------------------------------------------------
class ISteamInventory
{
class ISteamInventory {
public:
// INVENTORY ASYNC RESULT MANAGEMENT
//
// Asynchronous inventory queries always output a result handle which can be used with
@ -92,7 +86,8 @@ public:
// contents of the result set depend on which query which was used.
virtual bool GetResultItems(SteamInventoryResult_t resultHandle,
STEAM_OUT_ARRAY_COUNT(punOutItemsArraySize, Output array) SteamItemDetails_t* pOutItemsArray,
uint32 *punOutItemsArraySize ) = 0;
uint32* punOutItemsArraySize)
= 0;
// In combination with GetResultItems, you can use GetResultItemProperty to retrieve
// dynamic string properties for a given item returned in the result set.
@ -109,7 +104,8 @@ public:
virtual bool GetResultItemProperty(SteamInventoryResult_t resultHandle,
uint32 unItemIndex,
const char* pchPropertyName,
STEAM_OUT_STRING_COUNT( punValueBufferSizeOut ) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0;
STEAM_OUT_STRING_COUNT(punValueBufferSizeOut) char* pchValueBuffer, uint32* punValueBufferSizeOut)
= 0;
// Returns the server time at which the result was generated. Compare against
// the value of IClientUtils::GetServerRealTime() to determine age.
@ -123,7 +119,6 @@ public:
// Destroys a result handle and frees all associated memory.
virtual void DestroyResult(SteamInventoryResult_t resultHandle) = 0;
// INVENTORY ASYNC QUERY
//
@ -136,7 +131,6 @@ public:
// or if you expect that the inventory may have changed.
virtual bool GetAllItems(SteamInventoryResult_t* pResultHandle) = 0;
// Captures the state of a subset of the current user's Steam inventory,
// identified by an array of item instance IDs. The results from this call
// can be serialized and passed to other players to "prove" that the current
@ -146,7 +140,6 @@ public:
// then transmit this buffer to other players upon joining a game.
virtual bool GetItemsByID(SteamInventoryResult_t* pResultHandle, STEAM_ARRAY_COUNT(unCountInstanceIDs) const SteamItemInstanceID_t* pInstanceIDs, uint32 unCountInstanceIDs) = 0;
// RESULT SERIALIZATION AND AUTHENTICATION
//
// Serialized result sets contain a short signature which can't be forged
@ -182,7 +175,6 @@ public:
// could challenge the player with expired data to send an updated result set.
virtual bool DeserializeResult(SteamInventoryResult_t* pOutResultHandle, STEAM_BUFFER_COUNT(punOutBufferSize) const void* pBuffer, uint32 unBufferSize, bool bRESERVED_MUST_BE_FALSE = false) = 0;
// INVENTORY ASYNC MODIFICATION
//
@ -222,8 +214,8 @@ public:
// exchange will fail.
virtual bool ExchangeItems(SteamInventoryResult_t* pResultHandle,
STEAM_ARRAY_COUNT(unArrayGenerateLength) const SteamItemDef_t* pArrayGenerate, STEAM_ARRAY_COUNT(unArrayGenerateLength) const uint32* punArrayGenerateQuantity, uint32 unArrayGenerateLength,
STEAM_ARRAY_COUNT(unArrayDestroyLength) const SteamItemInstanceID_t *pArrayDestroy, STEAM_ARRAY_COUNT(unArrayDestroyLength) const uint32 *punArrayDestroyQuantity, uint32 unArrayDestroyLength ) = 0;
STEAM_ARRAY_COUNT(unArrayDestroyLength) const SteamItemInstanceID_t* pArrayDestroy, STEAM_ARRAY_COUNT(unArrayDestroyLength) const uint32* punArrayDestroyQuantity, uint32 unArrayDestroyLength)
= 0;
// TransferItemQuantity() is intended for use with items which are "stackable" (can have
// quantity greater than one). It can be used to split a stack into two, or to transfer
@ -231,7 +223,6 @@ public:
// two, pass k_SteamItemInstanceIDInvalid for itemIdDest and a new item will be generated.
virtual bool TransferItemQuantity(SteamInventoryResult_t* pResultHandle, SteamItemInstanceID_t itemIdSource, uint32 unQuantity, SteamItemInstanceID_t itemIdDest) = 0;
// TIMED DROPS AND PLAYTIME CREDIT
//
@ -249,12 +240,11 @@ public:
// The client library will suppress too-frequent calls to this method.
virtual bool TriggerItemDrop(SteamInventoryResult_t* pResultHandle, SteamItemDef_t dropListDefinition) = 0;
// Deprecated. This method is not supported.
virtual bool TradeItems(SteamInventoryResult_t* pResultHandle, CSteamID steamIDTradePartner,
STEAM_ARRAY_COUNT(nArrayGiveLength) const SteamItemInstanceID_t* pArrayGive, STEAM_ARRAY_COUNT(nArrayGiveLength) const uint32* pArrayGiveQuantity, uint32 nArrayGiveLength,
STEAM_ARRAY_COUNT(nArrayGetLength) const SteamItemInstanceID_t *pArrayGet, STEAM_ARRAY_COUNT(nArrayGetLength) const uint32 *pArrayGetQuantity, uint32 nArrayGetLength ) = 0;
STEAM_ARRAY_COUNT(nArrayGetLength) const SteamItemInstanceID_t* pArrayGet, STEAM_ARRAY_COUNT(nArrayGetLength) const uint32* pArrayGetQuantity, uint32 nArrayGetLength)
= 0;
// ITEM DEFINITIONS
//
@ -279,7 +269,8 @@ public:
// return false if and only if there is not enough space in the output array.
virtual bool GetItemDefinitionIDs(
STEAM_OUT_ARRAY_COUNT(punItemDefIDsArraySize, List of item definition IDs) SteamItemDef_t* pItemDefIDs,
STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0;
STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32* punItemDefIDsArraySize)
= 0;
// GetItemDefinitionProperty returns a string property from a given item definition.
// Note that some properties (for example, "name") may be localized and will depend
@ -291,7 +282,8 @@ public:
// to pchValueBuffer. If the results do not fit in the given buffer, partial
// results may be copied.
virtual bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, const char* pchPropertyName,
STEAM_OUT_STRING_COUNT(punValueBufferSizeOut) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0;
STEAM_OUT_STRING_COUNT(punValueBufferSizeOut) char* pchValueBuffer, uint32* punValueBufferSizeOut)
= 0;
// Request the list of "eligible" promo items that can be manually granted to the given
// user. These are promo items of type "manual" that won't be granted automatically.
@ -305,7 +297,8 @@ public:
virtual bool GetEligiblePromoItemDefinitionIDs(
CSteamID steamID,
STEAM_OUT_ARRAY_COUNT(punItemDefIDsArraySize, List of item definition IDs) SteamItemDef_t* pItemDefIDs,
STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0;
STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32* punItemDefIDsArraySize)
= 0;
// Starts the purchase process for the given item definitions. The callback SteamInventoryStartPurchaseResult_t
// will be posted if Steam was able to initialize the transaction.
@ -370,14 +363,12 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamInventory *, SteamGameServerIn
// SteamInventoryResultReady_t callbacks are fired whenever asynchronous
// results transition from "Pending" to "OK" or an error state. There will
// always be exactly one callback per handle.
struct SteamInventoryResultReady_t
{
struct SteamInventoryResultReady_t {
enum { k_iCallback = k_iClientInventoryCallbacks + 0 };
SteamInventoryResult_t m_handle;
EResult m_result;
};
// SteamInventoryFullUpdate_t callbacks are triggered when GetAllItems
// successfully returns a result which is newer / fresher than the last
// known result. (It will not trigger if the inventory hasn't changed,
@ -385,25 +376,21 @@ struct SteamInventoryResultReady_t
// the earlier result is already known to be stale/out-of-date.)
// The normal ResultReady callback will still be triggered immediately
// afterwards; this is an additional notification for your convenience.
struct SteamInventoryFullUpdate_t
{
struct SteamInventoryFullUpdate_t {
enum { k_iCallback = k_iClientInventoryCallbacks + 1 };
SteamInventoryResult_t m_handle;
};
// A SteamInventoryDefinitionUpdate_t callback is triggered whenever
// item definitions have been updated, which could be in response to
// LoadItemDefinitions() or any other async request which required
// a definition update in order to process results from the server.
struct SteamInventoryDefinitionUpdate_t
{
struct SteamInventoryDefinitionUpdate_t {
enum { k_iCallback = k_iClientInventoryCallbacks + 2 };
};
// Returned
struct SteamInventoryEligiblePromoItemDefIDs_t
{
struct SteamInventoryEligiblePromoItemDefIDs_t {
enum { k_iCallback = k_iClientInventoryCallbacks + 3 };
EResult m_result;
CSteamID m_steamID;
@ -412,18 +399,15 @@ struct SteamInventoryEligiblePromoItemDefIDs_t
};
// Triggered from StartPurchase call
struct SteamInventoryStartPurchaseResult_t
{
struct SteamInventoryStartPurchaseResult_t {
enum { k_iCallback = k_iClientInventoryCallbacks + 4 };
EResult m_result;
uint64 m_ulOrderID;
uint64 m_ulTransID;
};
// Triggered from RequestPrices
struct SteamInventoryRequestPricesResult_t
{
struct SteamInventoryRequestPricesResult_t {
enum { k_iCallback = k_iClientInventoryCallbacks + 5 };
EResult m_result;
char m_rgchCurrency[4];
@ -431,5 +415,4 @@ struct SteamInventoryRequestPricesResult_t
#pragma pack(pop)
#endif // ISTEAMCONTROLLER_H

View File

@ -10,13 +10,12 @@
#pragma once
#endif
#include "steam_api_common.h"
#include "matchmakingtypes.h"
#include "isteamfriends.h"
#include "matchmakingtypes.h"
#include "steam_api_common.h"
// lobby type description
enum ELobbyType
{
enum ELobbyType {
k_ELobbyTypePrivate = 0, // only way to join the lobby is to invite to someone else
k_ELobbyTypeFriendsOnly = 1, // shows for friends or invitees, but not in lobby list
k_ELobbyTypePublic = 2, // visible for friends and in lobby list
@ -28,8 +27,7 @@ enum ELobbyType
};
// lobby search filter tools
enum ELobbyComparison
{
enum ELobbyComparison {
k_ELobbyComparisonEqualToOrLessThan = -2,
k_ELobbyComparisonLessThan = -1,
k_ELobbyComparisonEqual = 0,
@ -39,8 +37,7 @@ enum ELobbyComparison
};
// lobby search distance. Lobby results are sorted from closest to farthest.
enum ELobbyDistanceFilter
{
enum ELobbyDistanceFilter {
k_ELobbyDistanceFilterClose, // only lobbies in the same immediate region will be returned
k_ELobbyDistanceFilterDefault, // only lobbies in the same region or near by regions
k_ELobbyDistanceFilterFar, // for games that don't have many latency requirements, will return lobbies about half-way around the globe
@ -54,8 +51,7 @@ enum ELobbyDistanceFilter
// Purpose: Functions for match making services for clients to get to favorites
// and to operate on game lobbies.
//-----------------------------------------------------------------------------
class ISteamMatchmaking
{
class ISteamMatchmaking {
public:
// game server favorites storage
// saves basic details about a multiplayer game server locally
@ -289,8 +285,7 @@ typedef void* HServerListRequest;
// to cancel any in-progress queries so you don't get a callback into the destructed
// object and crash.
//-----------------------------------------------------------------------------
class ISteamMatchmakingServerListResponse
{
class ISteamMatchmakingServerListResponse {
public:
// Server has responded ok with updated data
virtual void ServerResponded(HServerListRequest hRequest, int iServer) = 0;
@ -302,7 +297,6 @@ public:
virtual void RefreshComplete(HServerListRequest hRequest, EMatchMakingServerResponse response) = 0;
};
//-----------------------------------------------------------------------------
// Purpose: Callback interface for receiving responses after pinging an individual server
//
@ -313,8 +307,7 @@ public:
// 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
{
class ISteamMatchmakingPingResponse {
public:
// Server has responded successfully and has updated data
virtual void ServerResponded(gameserveritem_t& server) = 0;
@ -323,7 +316,6 @@ public:
virtual void ServerFailedToRespond() = 0;
};
//-----------------------------------------------------------------------------
// Purpose: Callback interface for receiving responses after requesting details on
// who is playing on a particular server.
@ -335,8 +327,7 @@ public:
// 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
{
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.
@ -350,7 +341,6 @@ public:
virtual void PlayersRefreshComplete() = 0;
};
//-----------------------------------------------------------------------------
// Purpose: Callback interface for receiving responses after requesting rules
// details on a particular server.
@ -362,8 +352,7 @@ public:
// 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
{
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
@ -377,7 +366,6 @@ public:
virtual void RulesRefreshComplete() = 0;
};
//-----------------------------------------------------------------------------
// Typedef for handle type you will receive when querying details on an individual server.
//-----------------------------------------------------------------------------
@ -387,8 +375,7 @@ const int HSERVERQUERY_INVALID = 0xffffffff;
//-----------------------------------------------------------------------------
// Purpose: Functions for match making services for clients to get to game lists and details
//-----------------------------------------------------------------------------
class ISteamMatchmakingServers
{
class ISteamMatchmakingServers {
public:
// Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values.
// Each call allocates a new asynchronous request object.
@ -503,7 +490,6 @@ public:
// Refresh a single server inside of a query (rather than all the servers )
virtual void RefreshServer(HServerListRequest hRequest, int iServer) = 0;
//-----------------------------------------------------------------------------
// Queries to individual servers directly via IP/Port
//-----------------------------------------------------------------------------
@ -533,12 +519,10 @@ 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
{
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
@ -550,14 +534,11 @@ enum EChatMemberStateChange
// 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))
//-----------------------------------------------------------------------------
// Purpose: Functions for match making services for clients to get to favorites
// and to operate on game lobbies.
//-----------------------------------------------------------------------------
class ISteamGameSearch
{
class ISteamGameSearch {
public:
// =============================================================================================
// Game Player APIs
@ -617,7 +598,6 @@ public:
// ends the game. no further SubmitPlayerResults for ullUniqueGameID will be accepted
// any future requests will provide a new ullUniqueGameID
virtual EGameSearchErrorCode_t EndGame(uint64 ullUniqueGameID) = 0;
};
#define STEAMGAMESEARCH_INTERFACE_VERSION "SteamMatchGameSearch001"
@ -625,20 +605,17 @@ public:
inline ISteamGameSearch* SteamGameSearch();
STEAM_DEFINE_USER_INTERFACE_ACCESSOR(ISteamGameSearch*, SteamGameSearch, STEAMGAMESEARCH_INTERFACE_VERSION);
//-----------------------------------------------------------------------------
// Purpose: Functions for quickly creating a Party with friends or acquaintances,
// EG from chat rooms.
//-----------------------------------------------------------------------------
enum ESteamPartyBeaconLocationType
{
enum ESteamPartyBeaconLocationType {
k_ESteamPartyBeaconLocationType_Invalid = 0,
k_ESteamPartyBeaconLocationType_ChatGroup = 1,
k_ESteamPartyBeaconLocationType_Max,
};
#if defined(VALVE_CALLBACK_PACK_SMALL)
#pragma pack(push, 4)
#elif defined(VALVE_CALLBACK_PACK_LARGE)
@ -647,15 +624,12 @@ enum ESteamPartyBeaconLocationType
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
struct SteamPartyBeaconLocation_t
{
struct SteamPartyBeaconLocation_t {
ESteamPartyBeaconLocationType m_eType;
uint64 m_ulLocationID;
};
enum ESteamPartyBeaconLocationData
{
enum ESteamPartyBeaconLocationData {
k_ESteamPartyBeaconLocationDataInvalid = 0,
k_ESteamPartyBeaconLocationDataName = 1,
k_ESteamPartyBeaconLocationDataIconURLSmall = 2,
@ -663,10 +637,8 @@ enum ESteamPartyBeaconLocationData
k_ESteamPartyBeaconLocationDataIconURLLarge = 4,
};
class ISteamParties
{
class ISteamParties {
public:
// =============================================================================================
// Party Client APIs
@ -714,7 +686,6 @@ public:
// Utils
virtual bool GetBeaconLocationData(SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, STEAM_OUT_STRING_COUNT(cchDataStringOut) char* pchDataStringOut, int cchDataStringOut) = 0;
};
#define STEAMPARTIES_INTERFACE_VERSION "SteamParties002"
@ -722,15 +693,13 @@ public:
inline ISteamParties* SteamParties();
STEAM_DEFINE_USER_INTERFACE_ACCESSOR(ISteamParties*, SteamParties, STEAMPARTIES_INTERFACE_VERSION);
//-----------------------------------------------------------------------------
// 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
{
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;
@ -741,7 +710,6 @@ struct FavoritesListChanged_t
AccountID_t m_unAccountId;
};
//-----------------------------------------------------------------------------
// Purpose: Someone has invited you to join a Lobby
// normally you don't need to do anything with this, since
@ -750,8 +718,7 @@ struct FavoritesListChanged_t
// 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
{
struct LobbyInvite_t {
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 3 };
uint64 m_ulSteamIDUser; // Steam ID of the person making the invite
@ -759,14 +726,12 @@ struct LobbyInvite_t
uint64 m_ulGameID; // GameID 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
{
struct LobbyEnter_t {
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 4 };
uint64 m_ulSteamIDLobby; // SteamID of the Lobby you have entered
@ -775,14 +740,12 @@ struct LobbyEnter_t
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
{
struct LobbyDataUpdate_t {
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 5 };
uint64 m_ulSteamIDLobby; // steamID of the Lobby
@ -791,13 +754,11 @@ struct LobbyDataUpdate_t
// will only be false if RequestLobbyData() was called on a lobby that no longer exists
};
//-----------------------------------------------------------------------------
// Purpose: The lobby chat room state has changed
// this is usually sent when a user has joined or left the lobby
//-----------------------------------------------------------------------------
struct LobbyChatUpdate_t
{
struct LobbyChatUpdate_t {
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 6 };
uint64 m_ulSteamIDLobby; // Lobby ID
@ -807,13 +768,11 @@ struct LobbyChatUpdate_t
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
{
struct LobbyChatMsg_t {
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 7 };
uint64 m_ulSteamIDLobby; // the lobby id this is in
@ -822,15 +781,13 @@ struct LobbyChatMsg_t
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
{
struct LobbyGameCreated_t {
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 9 };
uint64 m_ulSteamIDLobby; // the lobby we were in
@ -839,39 +796,33 @@ struct LobbyGameCreated_t
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
{
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: posted if a user is forcefully removed from a lobby
// can occur if a user loses connection to Steam
//-----------------------------------------------------------------------------
struct LobbyKicked_t
{
struct LobbyKicked_t {
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 12 };
uint64 m_ulSteamIDLobby; // Lobby
uint64 m_ulSteamIDAdmin; // User who kicked you - possibly the ID of the lobby itself
uint8 m_bKickedDueToDisconnect; // true if you were kicked from the lobby due to the user losing connection to Steam (currently always true)
};
//-----------------------------------------------------------------------------
// Purpose: Result of our request to create a Lobby
// m_eResult == k_EResultOK on success
// at this point, the lobby has been joined and is ready for use
// a LobbyEnter_t callback will also be received (since the local user is joining their own lobby)
//-----------------------------------------------------------------------------
struct LobbyCreated_t
{
struct LobbyCreated_t {
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 };
EResult m_eResult; // k_EResultOK - the lobby was successfully created
@ -887,42 +838,35 @@ struct LobbyCreated_t
// used by now obsolete RequestFriendsLobbiesResponse_t
// enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 };
//-----------------------------------------------------------------------------
// Purpose: Result of CheckForPSNGameBootInvite
// 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 PSNGameBootInviteResult_t
{
struct PSNGameBootInviteResult_t {
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 15 };
bool m_bGameBootInviteExists;
CSteamID m_steamIDLobby; // Should be valid if m_bGameBootInviteExists == true
};
//-----------------------------------------------------------------------------
// Purpose: Result of our request to create a Lobby
// m_eResult == k_EResultOK on success
// at this point, the lobby has been joined and is ready for use
// a LobbyEnter_t callback will also be received (since the local user is joining their own lobby)
//-----------------------------------------------------------------------------
struct FavoritesListAccountsUpdated_t
{
struct FavoritesListAccountsUpdated_t {
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 16 };
EResult m_eResult;
};
//-----------------------------------------------------------------------------
// Callbacks for ISteamGameSearch (which go through the regular Steam callback registration system)
struct SearchForGameProgressCallback_t
{
struct SearchForGameProgressCallback_t {
enum { k_iCallback = k_iSteamGameSearchCallbacks + 1 };
uint64 m_ullSearchID; // all future callbacks referencing this search will include this Search ID
@ -936,8 +880,7 @@ struct SearchForGameProgressCallback_t
};
// notification to all players searching that a game has been found
struct SearchForGameResultCallback_t
{
struct SearchForGameResultCallback_t {
enum { k_iCallback = k_iSteamGameSearchCallbacks + 2 };
uint64 m_ullSearchID;
@ -952,14 +895,12 @@ struct SearchForGameResultCallback_t
bool m_bFinalCallback;
};
//-----------------------------------------------------------------------------
// ISteamGameSearch : Game Host API callbacks
// callback from RequestPlayersForGame when the matchmaking service has started or ended search
// callback will also follow a call from CancelRequestPlayersForGame - m_bSearchInProgress will be false
struct RequestPlayersForGameProgressCallback_t
{
struct RequestPlayersForGameProgressCallback_t {
enum { k_iCallback = k_iSteamGameSearchCallbacks + 11 };
EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK
@ -969,8 +910,7 @@ struct RequestPlayersForGameProgressCallback_t
// callback from RequestPlayersForGame
// one of these will be sent per player
// followed by additional callbacks when players accept or decline the game
struct RequestPlayersForGameResultCallback_t
{
struct RequestPlayersForGameResultCallback_t {
enum { k_iCallback = k_iSteamGameSearchCallbacks + 12 };
EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK
@ -978,8 +918,7 @@ struct RequestPlayersForGameResultCallback_t
CSteamID m_SteamIDPlayerFound; // player steamID
CSteamID m_SteamIDLobby; // if the player is in a lobby, the lobby ID
enum PlayerAcceptState_t
{
enum PlayerAcceptState_t {
k_EStateUnknown = 0,
k_EStatePlayerAccepted = 1,
k_EStatePlayerDeclined = 2,
@ -992,9 +931,7 @@ struct RequestPlayersForGameResultCallback_t
uint64 m_ullUniqueGameID;
};
struct RequestPlayersForGameFinalResultCallback_t
{
struct RequestPlayersForGameFinalResultCallback_t {
enum { k_iCallback = k_iSteamGameSearchCallbacks + 13 };
EResult m_eResult;
@ -1002,11 +939,8 @@ struct RequestPlayersForGameFinalResultCallback_t
uint64 m_ullUniqueGameID;
};
// this callback confirms that results were received by the matchmaking service for this player
struct SubmitPlayerResultResultCallback_t
{
struct SubmitPlayerResultResultCallback_t {
enum { k_iCallback = k_iSteamGameSearchCallbacks + 14 };
EResult m_eResult;
@ -1014,23 +948,19 @@ struct SubmitPlayerResultResultCallback_t
CSteamID steamIDPlayer;
};
// this callback confirms that the game is recorded as complete on the matchmaking service
// the next call to RequestPlayersForGame will generate a new unique game ID
struct EndGameResultCallback_t
{
struct EndGameResultCallback_t {
enum { k_iCallback = k_iSteamGameSearchCallbacks + 15 };
EResult m_eResult;
uint64 ullUniqueGameID;
};
// Steam has responded to the user request to join a party via the given Beacon ID.
// If successful, the connect string contains game-specific instructions to connect
// to the game with that party.
struct JoinPartyCallback_t
{
struct JoinPartyCallback_t {
enum { k_iCallback = k_iSteamPartiesCallbacks + 1 };
EResult m_eResult;
@ -1040,8 +970,7 @@ struct JoinPartyCallback_t
};
// Response to CreateBeacon request. If successful, the beacon ID is provided.
struct CreateBeaconCallback_t
{
struct CreateBeaconCallback_t {
enum { k_iCallback = k_iSteamPartiesCallbacks + 2 };
EResult m_eResult;
@ -1052,8 +981,7 @@ struct CreateBeaconCallback_t
// and we've reserved one of the open slots for them.
// You should confirm when they join your party by calling OnReservationCompleted().
// Otherwise, Steam may timeout their reservation eventually.
struct ReservationNotificationCallback_t
{
struct ReservationNotificationCallback_t {
enum { k_iCallback = k_iSteamPartiesCallbacks + 3 };
PartyBeaconID_t m_ulBeaconID;
@ -1061,27 +989,22 @@ struct ReservationNotificationCallback_t
};
// Response to ChangeNumOpenSlots call
struct ChangeNumOpenSlotsCallback_t
{
struct ChangeNumOpenSlotsCallback_t {
enum { k_iCallback = k_iSteamPartiesCallbacks + 4 };
EResult m_eResult;
};
// The list of possible Party beacon locations has changed
struct AvailableBeaconLocationsUpdated_t
{
struct AvailableBeaconLocationsUpdated_t {
enum { k_iCallback = k_iSteamPartiesCallbacks + 5 };
};
// The list of active beacons may have changed
struct ActiveBeaconsUpdated_t
{
struct ActiveBeaconsUpdated_t {
enum { k_iCallback = k_iSteamPartiesCallbacks + 6 };
};
#pragma pack(pop)
#endif // ISTEAMMATCHMAKING

View File

@ -11,20 +11,17 @@
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
enum AudioPlayback_Status
{
enum AudioPlayback_Status {
AudioPlayback_Undefined = 0,
AudioPlayback_Playing = 1,
AudioPlayback_Paused = 2,
AudioPlayback_Idle = 3
};
//-----------------------------------------------------------------------------
// Purpose: Functions to control music playback in the steam client
//-----------------------------------------------------------------------------
class ISteamMusic
{
class ISteamMusic {
public:
virtual bool BIsEnabled() = 0;
virtual bool BIsPlaying() = 0;
@ -39,7 +36,6 @@ public:
// volume is between 0.0 and 1.0
virtual void SetVolume(float flVolume) = 0;
virtual float GetVolume() = 0;
};
#define STEAMMUSIC_INTERFACE_VERSION "STEAMMUSIC_INTERFACE_VERSION001"
@ -57,7 +53,6 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMusic *, SteamMusic, STEAMMUSIC_INTE
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
STEAM_CALLBACK_BEGIN(PlaybackStatusHasChanged_t, k_iSteamMusicCallbacks + 1)
STEAM_CALLBACK_END(0)
@ -67,5 +62,4 @@ STEAM_CALLBACK_END(1)
#pragma pack(pop)
#endif // #define ISTEAMMUSIC_H

View File

@ -6,15 +6,13 @@
#pragma once
#endif
#include "steam_api_common.h"
#include "isteammusic.h"
#include "steam_api_common.h"
#define k_SteamMusicNameMaxLength 255
#define k_SteamMusicPNGMaxLength 65535
class ISteamMusicRemote
{
class ISteamMusicRemote {
public:
// Service Definition
virtual bool RegisterSteamMusicRemote(const char* pchName) = 0;
@ -77,7 +75,6 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMusicRemote *, SteamMusicRemote, STE
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
STEAM_CALLBACK_BEGIN(MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1)
STEAM_CALLBACK_END(0)
@ -128,6 +125,4 @@ STEAM_CALLBACK_END(1)
#pragma pack(pop)
#endif // #define ISTEAMMUSICREMOTE_H

View File

@ -14,8 +14,7 @@
// list of possible errors returned by SendP2PPacket() API
// these will be posted in the P2PSessionConnectFail_t callback
enum EP2PSessionError
{
enum EP2PSessionError {
k_EP2PSessionErrorNone = 0,
k_EP2PSessionErrorNoRightsToApp = 2, // local user doesn't own the app that is running
k_EP2PSessionErrorTimeout = 4, // target isn't responding, perhaps not calling AcceptP2PSessionWithUser()
@ -32,8 +31,7 @@ enum EP2PSessionError
// SendP2PPacket() send types
// Typically k_EP2PSendUnreliable is what you want for UDP-like packets, k_EP2PSendReliable for TCP-like packets
enum EP2PSend
{
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.
@ -57,7 +55,6 @@ enum EP2PSend
};
// 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
#if defined(VALVE_CALLBACK_PACK_SMALL)
@ -67,8 +64,7 @@ enum EP2PSend
#else
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
struct P2PSessionState_t
{
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)
@ -80,14 +76,12 @@ struct P2PSessionState_t
};
#pragma pack(pop)
// handle to a socket
typedef uint32 SNetSocket_t; // CreateP2PConnectionSocket()
typedef uint32 SNetListenSocket_t; // CreateListenSocket()
// connection progress indicators, used by CreateP2PConnectionSocket()
enum ESNetSocketState
{
enum ESNetSocketState {
k_ESNetSocketStateInvalid = 0,
// communication is valid
@ -113,14 +107,12 @@ enum ESNetSocketState
};
// describes how the socket is currently connected
enum ESNetSocketConnectionType
{
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
@ -129,8 +121,7 @@ enum ESNetSocketConnectionType
/// the Steamworks SDK. Please see ISteamNetworkingSockets and
/// ISteamNetworkingMessages
//-----------------------------------------------------------------------------
class ISteamNetworking
{
class ISteamNetworking {
public:
////////////////////////////////////////////////////////////////////////////////////////////
//
@ -198,7 +189,6 @@ public:
// to this function, to prevent revealing the client's IP address top another peer.
virtual bool AllowP2PPacketRelay(bool bAllow) = 0;
////////////////////////////////////////////////////////////////////////////////////////////
//
// LISTEN / CONNECT connection-oriented interface functions
@ -218,7 +208,6 @@ 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
@ -309,28 +298,23 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworking *, SteamGameServerN
// 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
{
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
{
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
{
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

View File

@ -4,8 +4,8 @@
#define ISTEAMNETWORKINGMESSAGES
#pragma once
#include "steamnetworkingtypes.h"
#include "steam_api_common.h"
#include "steamnetworkingtypes.h"
//-----------------------------------------------------------------------------
/// The non-connection-oriented interface to send and receive messages
@ -33,8 +33,7 @@
/// you may find the symmetric connection mode of ISteamNetworkingSockets useful.
/// (See k_ESteamNetworkingConfig_SymmetricConnect.)
///
class ISteamNetworkingMessages
{
class ISteamNetworkingMessages {
public:
/// Sends a message to the specified host. If we don't already have a session with that user,
/// a session is implicitly created. There might be some handshaking that needs to happen
@ -131,8 +130,7 @@ public:
#pragma pack(push, 1)
/// Posted when a remote host is sending us a message, and we do not already have a session with them
struct SteamNetworkingMessagesSessionRequest_t
{
struct SteamNetworkingMessagesSessionRequest_t {
enum { k_iCallback = k_iSteamNetworkingMessagesCallbacks + 1 };
SteamNetworkingIdentity m_identityRemote; // user who wants to talk to us
};
@ -148,8 +146,7 @@ struct SteamNetworkingMessagesSessionRequest_t
/// Also, if a session times out due to inactivity, no callbacks will be posted. The only
/// way to detect that this is happening is that querying the session state may return
/// none, connecting, and findingroute again.
struct SteamNetworkingMessagesSessionFailed_t
{
struct SteamNetworkingMessagesSessionFailed_t {
enum { k_iCallback = k_iSteamNetworkingMessagesCallbacks + 2 };
/// Detailed info about the session that failed.
@ -176,9 +173,15 @@ struct SteamNetworkingMessagesSessionFailed_t
#endif
#ifndef STEAMNETWORKINGSOCKETS_STEAMAPI
inline ISteamNetworkingMessages *SteamNetworkingMessages() { return SteamNetworkingMessages_LibV2(); }
inline ISteamNetworkingMessages* SteamNetworkingMessages()
{
return SteamNetworkingMessages_LibV2();
}
#ifdef STEAMNETWORKINGSOCKETS_STEAM
inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages() { return SteamGameServerNetworkingMessages_LibV2(); }
inline ISteamNetworkingMessages* SteamGameServerNetworkingMessages()
{
return SteamGameServerNetworkingMessages_LibV2();
}
#endif
#endif
#endif
@ -191,7 +194,10 @@ struct SteamNetworkingMessagesSessionFailed_t
STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR(ISteamNetworkingMessages*, SteamGameServerNetworkingMessages_SteamAPI, STEAMNETWORKINGMESSAGES_INTERFACE_VERSION);
#ifndef STEAMNETWORKINGSOCKETS_STANDALONELIB
inline ISteamNetworkingMessages *SteamNetworkingMessages() { return SteamNetworkingMessages_SteamAPI(); }
inline ISteamNetworkingMessages* SteamNetworkingMessages()
{
return SteamNetworkingMessages_SteamAPI();
}
inline ISteamNetworkingMessages* SteamGameServerNetworkingMessages() { return SteamGameServerNetworkingMessages_SteamAPI(); }
#endif
#endif

View File

@ -4,8 +4,8 @@
#define ISTEAMNETWORKINGSOCKETS
#pragma once
#include "steamnetworkingtypes.h"
#include "steam_api_common.h"
#include "steamnetworkingtypes.h"
struct SteamNetAuthenticationStatus_t;
class ISteamNetworkingConnectionSignaling;
@ -37,10 +37,8 @@ class ISteamNetworkingSignalingRecvContext;
///
/// See also: ISteamNetworkingMessages, the UDP-style interface. This API might be
/// easier to use, especially when porting existing UDP code.
class ISteamNetworkingSockets
{
class ISteamNetworkingSockets {
public:
/// Creates a "server" socket that listens for clients to connect to by
/// calling ConnectByIPAddress, over ordinary UDP (IPv4 or IPv6)
///
@ -599,7 +597,6 @@ public:
/// and don't share it directly with clients.
virtual EResult GetGameCoordinatorServerLogin(SteamDatagramGameCoordinatorServerLogin* pLoginInfo, int* pcbSignedBlob, void* pBlob) = 0;
//
// Relayed connections using custom signaling protocol
//
@ -696,6 +693,7 @@ public:
/// You don't need to call this if you are using Steam's callback dispatch
/// mechanism (SteamAPI_RunCallbacks and SteamGameserver_RunCallbacks).
virtual void RunCallbacks() = 0;
protected:
~ISteamNetworkingSockets(); // Silence some warnings
};
@ -717,9 +715,15 @@ protected:
#endif
#ifndef STEAMNETWORKINGSOCKETS_STEAMAPI
inline ISteamNetworkingSockets *SteamNetworkingSockets() { return SteamNetworkingSockets_LibV9(); }
inline ISteamNetworkingSockets* SteamNetworkingSockets()
{
return SteamNetworkingSockets_LibV9();
}
#ifdef STEAMNETWORKINGSOCKETS_STEAM
inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_LibV9(); }
inline ISteamNetworkingSockets* SteamGameServerNetworkingSockets()
{
return SteamGameServerNetworkingSockets_LibV9();
}
#endif
#endif
#endif
@ -732,7 +736,10 @@ protected:
STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR(ISteamNetworkingSockets*, SteamGameServerNetworkingSockets_SteamAPI, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION);
#ifndef STEAMNETWORKINGSOCKETS_STANDALONELIB
inline ISteamNetworkingSockets *SteamNetworkingSockets() { return SteamNetworkingSockets_SteamAPI(); }
inline ISteamNetworkingSockets* SteamNetworkingSockets()
{
return SteamNetworkingSockets_SteamAPI();
}
inline ISteamNetworkingSockets* SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_SteamAPI(); }
#endif
#endif
@ -781,8 +788,7 @@ protected:
/// state by the time you process this callback.
///
/// Also note that callbacks will be posted when connections are created and destroyed by your own API calls.
struct SteamNetConnectionStatusChangedCallback_t
{
struct SteamNetConnectionStatusChangedCallback_t {
enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 1 };
/// Connection handle
@ -803,8 +809,7 @@ struct SteamNetConnectionStatusChangedCallback_t
/// - A valid certificate issued by a CA.
///
/// This callback is posted whenever the state of our readiness changes.
struct SteamNetAuthenticationStatus_t
{
struct SteamNetAuthenticationStatus_t {
enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 2 };
/// Status

View File

@ -8,8 +8,8 @@
#define ISTEAMNETWORKINGUTILS
#pragma once
#include "steamnetworkingtypes.h"
#include "steam_api_common.h"
#include "steamnetworkingtypes.h"
struct SteamDatagramRelayAuthTicket;
struct SteamRelayNetworkStatus_t;
@ -17,8 +17,7 @@ struct SteamRelayNetworkStatus_t;
//-----------------------------------------------------------------------------
/// Misc networking utilities for checking the local networking environment
/// and estimating pings.
class ISteamNetworkingUtils
{
class ISteamNetworkingUtils {
public:
//
// Efficient message sending
@ -277,7 +276,8 @@ public:
/// NOTE: When setting pointers (e.g. callback functions), do not pass the function pointer directly.
/// Your argument should be a pointer to a function pointer.
virtual bool SetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj,
ESteamNetworkingConfigDataType eDataType, const void *pArg ) = 0;
ESteamNetworkingConfigDataType eDataType, const void* pArg)
= 0;
/// Set a configuration value, using a struct to pass the value.
/// (This is just a convenience shortcut; see below for the implementation and
@ -293,7 +293,8 @@ public:
/// - pResult: Where to put the result. Pass NULL to query the required buffer size. (k_ESteamNetworkingGetConfigValue_BufferTooSmall will be returned.)
/// - cbResult: IN: the size of your buffer. OUT: the number of bytes filled in or required.
virtual ESteamNetworkingGetConfigValueResult GetConfigValue(ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj,
ESteamNetworkingConfigDataType *pOutDataType, void *pResult, size_t *cbResult ) = 0;
ESteamNetworkingConfigDataType* pOutDataType, void* pResult, size_t* cbResult)
= 0;
/// Returns info about a configuration value. Returns false if the value does not exist.
/// pOutNextValue can be used to iterate through all of the known configuration values.
@ -329,7 +330,10 @@ protected:
inline ISteamNetworkingUtils* SteamNetworkingUtils_Lib() { return SteamNetworkingUtils_LibV3(); }
#ifndef STEAMNETWORKINGSOCKETS_STEAMAPI
inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_LibV3(); }
inline ISteamNetworkingUtils* SteamNetworkingUtils()
{
return SteamNetworkingUtils_LibV3();
}
#endif
#endif
@ -338,23 +342,22 @@ protected:
STEAM_DEFINE_INTERFACE_ACCESSOR(ISteamNetworkingUtils*, SteamNetworkingUtils_SteamAPI,
/* Prefer user version of the interface. But if it isn't found, then use
gameserver one. Yes, this is a completely terrible hack */
SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) ?
SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) :
SteamInternal_FindOrCreateGameServerInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ),
SteamInternal_FindOrCreateUserInterface(0, STEAMNETWORKINGUTILS_INTERFACE_VERSION) ? SteamInternal_FindOrCreateUserInterface(0, STEAMNETWORKINGUTILS_INTERFACE_VERSION) : SteamInternal_FindOrCreateGameServerInterface(0, STEAMNETWORKINGUTILS_INTERFACE_VERSION),
"global",
STEAMNETWORKINGUTILS_INTERFACE_VERSION
)
STEAMNETWORKINGUTILS_INTERFACE_VERSION)
#ifndef STEAMNETWORKINGSOCKETS_STANDALONELIB
inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_SteamAPI(); }
inline ISteamNetworkingUtils* SteamNetworkingUtils()
{
return SteamNetworkingUtils_SteamAPI();
}
#endif
#endif
/// A struct used to describe our readiness to use the relay network.
/// To do this we first need to fetch the network configuration,
/// which describes what POPs are available.
struct SteamRelayNetworkStatus_t
{
struct SteamRelayNetworkStatus_t {
enum { k_iCallback = k_iSteamNetworkingUtilsCallbacks + 1 };
/// Summary status. When this is "current", initialization has
@ -387,19 +390,19 @@ struct SteamRelayNetworkStatus_t
/// Utility class for printing a SteamNetworkingIdentity.
/// E.g. printf( "Identity is '%s'\n", SteamNetworkingIdentityRender( identity ).c_str() );
struct SteamNetworkingIdentityRender
{
struct SteamNetworkingIdentityRender {
SteamNetworkingIdentityRender(const SteamNetworkingIdentity& x) { x.ToString(buf, sizeof(buf)); }
inline const char* c_str() const { return buf; }
private:
char buf[SteamNetworkingIdentity::k_cchMaxString];
};
/// Utility class for printing a SteamNetworkingIPAddrRender.
struct SteamNetworkingIPAddrRender
{
struct SteamNetworkingIPAddrRender {
SteamNetworkingIPAddrRender(const SteamNetworkingIPAddr& x, bool bWithPort = true) { x.ToString(buf, sizeof(buf), bWithPort); }
inline const char* c_str() const { return buf; }
private:
char buf[SteamNetworkingIPAddr::k_cchMaxString];
};

View File

@ -13,8 +13,7 @@
#include "steam_api_common.h"
// Feature types for parental settings
enum EParentalFeature
{
enum EParentalFeature {
k_EFeatureInvalid = 0,
k_EFeatureStore = 1,
k_EFeatureCommunity = 2,
@ -32,8 +31,7 @@ enum EParentalFeature
k_EFeatureMax
};
class ISteamParentalSettings
{
class ISteamParentalSettings {
public:
virtual bool BIsParentalLockEnabled() = 0;
virtual bool BIsParentalLockLocked() = 0;
@ -54,10 +52,8 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamParentalSettings *, SteamParentalSet
//-----------------------------------------------------------------------------
// Purpose: Callback for querying UGC
//-----------------------------------------------------------------------------
struct SteamParentalSettingsChanged_t
{
struct SteamParentalSettingsChanged_t {
enum { k_iCallback = k_ISteamParentalSettingsCallbacks + 1 };
};
#endif // ISTEAMPARENTALSETTINGS_H

View File

@ -16,8 +16,7 @@
//-----------------------------------------------------------------------------
// Purpose: Enum for supported gradient directions
//-----------------------------------------------------------------------------
enum EOverlayGradientDirection
{
enum EOverlayGradientDirection {
k_EOverlayGradientHorizontal = 1,
k_EOverlayGradientVertical = 2,
k_EOverlayGradientNone = 3,
@ -36,14 +35,11 @@ enum EOverlayGradientDirection
#define STEAM_COLOR_ALPHA(color) \
(int)(((color) >> 24) & 0xff)
//-----------------------------------------------------------------------------
// Purpose: Interface the game must expose to Steam for rendering
//-----------------------------------------------------------------------------
class ISteamPS3OverlayRenderHost
{
class ISteamPS3OverlayRenderHost {
public:
// Interface for game engine to implement which Steam requires to render.
// Draw a textured rect. This may use only part of the texture and will pass texture coords, it will also possibly request a gradient and will specify colors for vertexes.
@ -59,14 +55,11 @@ public:
virtual void DeleteAllTextures() = 0;
};
//-----------------------------------------------------------------------------
// Purpose: Interface Steam exposes for the game to tell it when to render, etc.
//-----------------------------------------------------------------------------
class ISteamPS3OverlayRender
{
class ISteamPS3OverlayRender {
public:
// Call once at startup to initialize the Steam overlay and pass it your host interface ptr
virtual bool BHostInitialize(uint32 unScreenWidth, uint32 unScreenHeight, uint32 unRefreshRate, ISteamPS3OverlayRenderHost* pRenderHost, void* CellFontLib) = 0;
@ -87,5 +80,4 @@ public:
virtual bool BResetInputState() = 0;
};
#endif // ISTEAMPS3OVERLAYRENDERER_H

View File

@ -8,12 +8,10 @@
#include "steam_api_common.h"
//-----------------------------------------------------------------------------
// Purpose: The form factor of a device
//-----------------------------------------------------------------------------
enum ESteamDeviceFormFactor
{
enum ESteamDeviceFormFactor {
k_ESteamDeviceFormFactorUnknown = 0,
k_ESteamDeviceFormFactorPhone = 1,
k_ESteamDeviceFormFactorTablet = 2,
@ -24,12 +22,10 @@ enum ESteamDeviceFormFactor
// Steam Remote Play session ID
typedef uint32 RemotePlaySessionID_t;
//-----------------------------------------------------------------------------
// Purpose: Functions to provide information about Steam Remote Play sessions
//-----------------------------------------------------------------------------
class ISteamRemotePlay
{
class ISteamRemotePlay {
public:
// Get the number of currently connected Steam Remote Play sessions
virtual uint32 GetSessionCount() = 0;
@ -71,18 +67,14 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemotePlay *, SteamRemotePlay, STEAM
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
STEAM_CALLBACK_BEGIN(SteamRemotePlaySessionConnected_t, k_iSteamRemotePlayCallbacks + 1)
STEAM_CALLBACK_MEMBER(0, RemotePlaySessionID_t, m_unSessionID)
STEAM_CALLBACK_END(0)
STEAM_CALLBACK_BEGIN(SteamRemotePlaySessionDisconnected_t, k_iSteamRemotePlayCallbacks + 2)
STEAM_CALLBACK_MEMBER(0, RemotePlaySessionID_t, m_unSessionID)
STEAM_CALLBACK_END(0)
#pragma pack(pop)
#endif // #define ISTEAMREMOTEPLAY_H

View File

@ -12,14 +12,12 @@
#include "steam_api_common.h"
//-----------------------------------------------------------------------------
// Purpose: Defines the largest allowed file size. Cloud files cannot be written
// in a single chunk over 100MB (and cannot be over 200MB total.)
//-----------------------------------------------------------------------------
const uint32 k_unMaxCloudFileChunkSize = 100 * 1024 * 1024;
//-----------------------------------------------------------------------------
// Purpose: Structure that contains an array of const char * strings and the number of those strings
//-----------------------------------------------------------------------------
@ -30,8 +28,7 @@ const uint32 k_unMaxCloudFileChunkSize = 100 * 1024 * 1024;
#else
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
struct SteamParamStringArray_t
{
struct SteamParamStringArray_t {
const char** m_ppStrings;
int32 m_nNumStrings;
};
@ -57,9 +54,7 @@ const uint32 k_cchTagListMax = 1024 + 1;
const uint32 k_cchFilenameMax = 260;
const uint32 k_cchPublishedFileURLMax = 256;
enum ERemoteStoragePlatform
{
enum ERemoteStoragePlatform {
k_ERemoteStoragePlatformNone = 0,
k_ERemoteStoragePlatformWindows = (1 << 0),
k_ERemoteStoragePlatformOSX = (1 << 1),
@ -73,17 +68,14 @@ enum ERemoteStoragePlatform
k_ERemoteStoragePlatformAll = 0xffffffff
};
enum ERemoteStoragePublishedFileVisibility
{
enum ERemoteStoragePublishedFileVisibility {
k_ERemoteStoragePublishedFileVisibilityPublic = 0,
k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1,
k_ERemoteStoragePublishedFileVisibilityPrivate = 2,
k_ERemoteStoragePublishedFileVisibilityUnlisted = 3,
};
enum EWorkshopFileType
{
enum EWorkshopFileType {
k_EWorkshopFileTypeFirst = 0,
k_EWorkshopFileTypeCommunity = 0, // normal Workshop item that can be subscribed to
@ -108,22 +100,19 @@ enum EWorkshopFileType
};
enum EWorkshopVote
{
enum EWorkshopVote {
k_EWorkshopVoteUnvoted = 0,
k_EWorkshopVoteFor = 1,
k_EWorkshopVoteAgainst = 2,
k_EWorkshopVoteLater = 3,
};
enum EWorkshopFileAction
{
enum EWorkshopFileAction {
k_EWorkshopFileActionPlayed = 0,
k_EWorkshopFileActionCompleted = 1,
};
enum EWorkshopEnumerationType
{
enum EWorkshopEnumerationType {
k_EWorkshopEnumerationTypeRankedByVote = 0,
k_EWorkshopEnumerationTypeRecent = 1,
k_EWorkshopEnumerationTypeTrending = 2,
@ -133,15 +122,12 @@ enum EWorkshopEnumerationType
k_EWorkshopEnumerationTypeRecentFromFollowedUsers = 6,
};
enum EWorkshopVideoProvider
{
enum EWorkshopVideoProvider {
k_EWorkshopVideoProviderNone = 0,
k_EWorkshopVideoProviderYoutube = 1
};
enum EUGCReadAction
{
enum EUGCReadAction {
// Keeps the file handle open unless the last byte is read. You can use this when reading large files (over 100MB) in sequential chunks.
// If the last byte is read, this will behave the same as k_EUGCRead_Close. Otherwise, it behaves the same as k_EUGCRead_ContinueReading.
// This value maintains the same behavior as before the EUGCReadAction parameter was introduced.
@ -156,8 +142,7 @@ enum EUGCReadAction
k_EUGCRead_Close = 2,
};
enum ERemoteStorageLocalFileChange
{
enum ERemoteStorageLocalFileChange {
k_ERemoteStorageLocalFileChange_Invalid = 0,
// The file was updated from another device
@ -167,8 +152,7 @@ enum ERemoteStorageLocalFileChange
k_ERemoteStorageLocalFileChange_FileDeleted = 2,
};
enum ERemoteStorageFilePathType
{
enum ERemoteStorageFilePathType {
k_ERemoteStorageFilePathType_Invalid = 0,
// The file is directly accessed by the game and this is the full path
@ -178,13 +162,11 @@ enum ERemoteStorageFilePathType
k_ERemoteStorageFilePathType_APIFilename = 2,
};
//-----------------------------------------------------------------------------
// Purpose: Functions for accessing, reading and writing files stored remotely
// and cached locally
//-----------------------------------------------------------------------------
class ISteamRemoteStorage
{
class ISteamRemoteStorage {
public:
// NOTE
//
@ -335,33 +317,26 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemoteStorage *, SteamRemoteStorage,
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
//
// IMPORTANT! k_iClientRemoteStorageCallbacks 1 through 6 are used, see iclientremotestorage.h
//
//-----------------------------------------------------------------------------
// Purpose: The result of a call to FileShare()
//-----------------------------------------------------------------------------
struct RemoteStorageFileShareResult_t
{
struct RemoteStorageFileShareResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 7 };
EResult m_eResult; // The result of the operation
UGCHandle_t m_hFile; // The handle that can be shared with users and features
char m_rgchFilename[k_cchFilenameMax]; // The name of the file that was shared
};
// k_iClientRemoteStorageCallbacks + 8 is deprecated! Do not reuse
//-----------------------------------------------------------------------------
// Purpose: The result of a call to PublishFile()
//-----------------------------------------------------------------------------
struct RemoteStoragePublishFileResult_t
{
struct RemoteStoragePublishFileResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 9 };
EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId;
@ -370,24 +345,19 @@ struct RemoteStoragePublishFileResult_t
// k_iClientRemoteStorageCallbacks + 10 is deprecated! Do not reuse
//-----------------------------------------------------------------------------
// Purpose: The result of a call to DeletePublishedFile()
//-----------------------------------------------------------------------------
struct RemoteStorageDeletePublishedFileResult_t
{
struct RemoteStorageDeletePublishedFileResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 11 };
EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId;
};
//-----------------------------------------------------------------------------
// Purpose: The result of a call to EnumerateUserPublishedFiles()
//-----------------------------------------------------------------------------
struct RemoteStorageEnumerateUserPublishedFilesResult_t
{
struct RemoteStorageEnumerateUserPublishedFilesResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 12 };
EResult m_eResult; // The result of the operation.
int32 m_nResultsReturned;
@ -395,23 +365,19 @@ struct RemoteStorageEnumerateUserPublishedFilesResult_t
PublishedFileId_t m_rgPublishedFileId[k_unEnumeratePublishedFilesMaxResults];
};
//-----------------------------------------------------------------------------
// Purpose: The result of a call to SubscribePublishedFile()
//-----------------------------------------------------------------------------
struct RemoteStorageSubscribePublishedFileResult_t
{
struct RemoteStorageSubscribePublishedFileResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 13 };
EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId;
};
//-----------------------------------------------------------------------------
// Purpose: The result of a call to EnumerateSubscribePublishedFiles()
//-----------------------------------------------------------------------------
struct RemoteStorageEnumerateUserSubscribedFilesResult_t
{
struct RemoteStorageEnumerateUserSubscribedFilesResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 14 };
EResult m_eResult; // The result of the operation.
int32 m_nResultsReturned;
@ -431,31 +397,26 @@ struct RemoteStorageEnumerateUserSubscribedFilesResult_t
//-----------------------------------------------------------------------------
// Purpose: The result of a call to UnsubscribePublishedFile()
//-----------------------------------------------------------------------------
struct RemoteStorageUnsubscribePublishedFileResult_t
{
struct RemoteStorageUnsubscribePublishedFileResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 15 };
EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId;
};
//-----------------------------------------------------------------------------
// Purpose: The result of a call to CommitPublishedFileUpdate()
//-----------------------------------------------------------------------------
struct RemoteStorageUpdatePublishedFileResult_t
{
struct RemoteStorageUpdatePublishedFileResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 16 };
EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId;
bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
};
//-----------------------------------------------------------------------------
// Purpose: The result of a call to UGCDownload()
//-----------------------------------------------------------------------------
struct RemoteStorageDownloadUGCResult_t
{
struct RemoteStorageDownloadUGCResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 17 };
EResult m_eResult; // The result of the operation.
UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded.
@ -465,12 +426,10 @@ struct RemoteStorageDownloadUGCResult_t
uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content.
};
//-----------------------------------------------------------------------------
// Purpose: The result of a call to GetPublishedFileDetails()
//-----------------------------------------------------------------------------
struct RemoteStorageGetPublishedFileDetailsResult_t
{
struct RemoteStorageGetPublishedFileDetailsResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 18 };
EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId;
@ -495,9 +454,7 @@ struct RemoteStorageGetPublishedFileDetailsResult_t
bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop
};
struct RemoteStorageEnumerateWorkshopFilesResult_t
{
struct RemoteStorageEnumerateWorkshopFilesResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 19 };
EResult m_eResult;
int32 m_nResultsReturned;
@ -508,12 +465,10 @@ struct RemoteStorageEnumerateWorkshopFilesResult_t
uint32 m_unStartIndex;
};
//-----------------------------------------------------------------------------
// Purpose: The result of GetPublishedItemVoteDetails
//-----------------------------------------------------------------------------
struct RemoteStorageGetPublishedItemVoteDetailsResult_t
{
struct RemoteStorageGetPublishedItemVoteDetailsResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 20 };
EResult m_eResult;
PublishedFileId_t m_unPublishedFileId;
@ -523,12 +478,10 @@ struct RemoteStorageGetPublishedItemVoteDetailsResult_t
float m_fScore;
};
//-----------------------------------------------------------------------------
// Purpose: User subscribed to a file for the app (from within the app or on the web)
//-----------------------------------------------------------------------------
struct RemoteStoragePublishedFileSubscribed_t
{
struct RemoteStoragePublishedFileSubscribed_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 21 };
PublishedFileId_t m_nPublishedFileId; // The published file id
AppId_t m_nAppID; // ID of the app that will consume this file.
@ -537,49 +490,41 @@ struct RemoteStoragePublishedFileSubscribed_t
//-----------------------------------------------------------------------------
// Purpose: User unsubscribed from a file for the app (from within the app or on the web)
//-----------------------------------------------------------------------------
struct RemoteStoragePublishedFileUnsubscribed_t
{
struct RemoteStoragePublishedFileUnsubscribed_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 22 };
PublishedFileId_t m_nPublishedFileId; // The published file id
AppId_t m_nAppID; // ID of the app that will consume this file.
};
//-----------------------------------------------------------------------------
// Purpose: Published file that a user owns was deleted (from within the app or the web)
//-----------------------------------------------------------------------------
struct RemoteStoragePublishedFileDeleted_t
{
struct RemoteStoragePublishedFileDeleted_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 23 };
PublishedFileId_t m_nPublishedFileId; // The published file id
AppId_t m_nAppID; // ID of the app that will consume this file.
};
//-----------------------------------------------------------------------------
// Purpose: The result of a call to UpdateUserPublishedItemVote()
//-----------------------------------------------------------------------------
struct RemoteStorageUpdateUserPublishedItemVoteResult_t
{
struct RemoteStorageUpdateUserPublishedItemVoteResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 24 };
EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; // The published file id
};
//-----------------------------------------------------------------------------
// Purpose: The result of a call to GetUserPublishedItemVoteDetails()
//-----------------------------------------------------------------------------
struct RemoteStorageUserVoteDetails_t
{
struct RemoteStorageUserVoteDetails_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 25 };
EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; // The published file id
EWorkshopVote m_eVote; // what the user voted
};
struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t
{
struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 26 };
EResult m_eResult; // The result of the operation.
int32 m_nResultsReturned;
@ -587,16 +532,14 @@ struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t
PublishedFileId_t m_rgPublishedFileId[k_unEnumeratePublishedFilesMaxResults];
};
struct RemoteStorageSetUserPublishedFileActionResult_t
{
struct RemoteStorageSetUserPublishedFileActionResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 27 };
EResult m_eResult; // The result of the operation.
PublishedFileId_t m_nPublishedFileId; // The published file id
EWorkshopFileAction m_eAction; // the action that was attempted
};
struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t
{
struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 28 };
EResult m_eResult; // The result of the operation.
EWorkshopFileAction m_eAction; // the action that was filtered on
@ -606,23 +549,19 @@ struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t
uint32 m_rgRTimeUpdated[k_unEnumeratePublishedFilesMaxResults];
};
//-----------------------------------------------------------------------------
// Purpose: Called periodically while a PublishWorkshopFile is in progress
//-----------------------------------------------------------------------------
struct RemoteStoragePublishFileProgress_t
{
struct RemoteStoragePublishFileProgress_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 29 };
double m_dPercentFile;
bool m_bPreview;
};
//-----------------------------------------------------------------------------
// Purpose: Called when the content for a published file is updated
//-----------------------------------------------------------------------------
struct RemoteStoragePublishedFileUpdated_t
{
struct RemoteStoragePublishedFileUpdated_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 30 };
PublishedFileId_t m_nPublishedFileId; // The published file id
AppId_t m_nAppID; // ID of the app that will consume this file.
@ -632,8 +571,7 @@ struct RemoteStoragePublishedFileUpdated_t
//-----------------------------------------------------------------------------
// Purpose: Called when a FileWriteAsync completes
//-----------------------------------------------------------------------------
struct RemoteStorageFileWriteAsyncComplete_t
{
struct RemoteStorageFileWriteAsyncComplete_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 31 };
EResult m_eResult; // result
};
@ -641,8 +579,7 @@ struct RemoteStorageFileWriteAsyncComplete_t
//-----------------------------------------------------------------------------
// Purpose: Called when a FileReadAsync completes
//-----------------------------------------------------------------------------
struct RemoteStorageFileReadAsyncComplete_t
{
struct RemoteStorageFileReadAsyncComplete_t {
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 32 };
SteamAPICall_t m_hFileReadAsync; // call handle of the async read which was made
EResult m_eResult; // result
@ -660,5 +597,4 @@ STEAM_CALLBACK_END( 0 )
#pragma pack(pop)
#endif // ISTEAMREMOTESTORAGE_H

View File

@ -25,8 +25,7 @@ const int k_ScreenshotThumbWidth = 200;
typedef uint32 ScreenshotHandle;
#define INVALID_SCREENSHOT_HANDLE 0
enum EVRScreenshotType
{
enum EVRScreenshotType {
k_EVRScreenshotType_None = 0,
k_EVRScreenshotType_Mono = 1,
k_EVRScreenshotType_Stereo = 2,
@ -38,8 +37,7 @@ enum EVRScreenshotType
//-----------------------------------------------------------------------------
// Purpose: Functions for adding screenshots to the user's screenshot library
//-----------------------------------------------------------------------------
class ISteamScreenshots
{
class ISteamScreenshots {
public:
// Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format.
// The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
@ -97,8 +95,7 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamScreenshots *, SteamScreenshots, STE
// Purpose: Screenshot successfully written or otherwise added to the library
// and can now be tagged
//-----------------------------------------------------------------------------
struct ScreenshotReady_t
{
struct ScreenshotReady_t {
enum { k_iCallback = k_iSteamScreenshotsCallbacks + 1 };
ScreenshotHandle m_hLocal;
EResult m_eResult;
@ -109,12 +106,10 @@ struct ScreenshotReady_t
// HookScreenshots() has been called, in which case Steam will not take
// the screenshot itself.
//-----------------------------------------------------------------------------
struct ScreenshotRequested_t
{
struct ScreenshotRequested_t {
enum { k_iCallback = k_iSteamScreenshotsCallbacks + 2 };
};
#pragma pack(pop)
#endif // ISTEAMSCREENSHOTS_H

View File

@ -10,8 +10,8 @@
#pragma once
#endif
#include "steam_api_common.h"
#include "isteamremotestorage.h"
#include "steam_api_common.h"
// callbacks
#if defined(VALVE_CALLBACK_PACK_SMALL)
@ -22,18 +22,14 @@
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
typedef uint64 UGCQueryHandle_t;
typedef uint64 UGCUpdateHandle_t;
const UGCQueryHandle_t k_UGCQueryHandleInvalid = 0xffffffffffffffffull;
const UGCUpdateHandle_t k_UGCUpdateHandleInvalid = 0xffffffffffffffffull;
// Matching UGC types for queries
enum EUGCMatchingUGCType
{
enum EUGCMatchingUGCType {
k_EUGCMatchingUGCType_Items = 0, // both mtx items and ready-to-use items
k_EUGCMatchingUGCType_Items_Mtx = 1,
k_EUGCMatchingUGCType_Items_ReadyToUse = 2,
@ -52,8 +48,7 @@ enum EUGCMatchingUGCType
// Different lists of published UGC for a user.
// If the current logged in user is different than the specified user, then some options may not be allowed.
enum EUserUGCList
{
enum EUserUGCList {
k_EUserUGCList_Published,
k_EUserUGCList_VotedOn,
k_EUserUGCList_VotedUp,
@ -66,8 +61,7 @@ enum EUserUGCList
};
// Sort order for user published UGC lists (defaults to creation order descending)
enum EUserUGCListSortOrder
{
enum EUserUGCListSortOrder {
k_EUserUGCListSortOrder_CreationOrderDesc,
k_EUserUGCListSortOrder_CreationOrderAsc,
k_EUserUGCListSortOrder_TitleAsc,
@ -78,8 +72,7 @@ enum EUserUGCListSortOrder
};
// Combination of sorting and filtering for queries across all UGC
enum EUGCQuery
{
enum EUGCQuery {
k_EUGCQuery_RankedByVote = 0,
k_EUGCQuery_RankedByPublicationDate = 1,
k_EUGCQuery_AcceptedForGameRankedByAcceptanceDate = 2,
@ -102,8 +95,7 @@ enum EUGCQuery
k_EUGCQuery_RankedByLastUpdatedDate = 19,
};
enum EItemUpdateStatus
{
enum EItemUpdateStatus {
k_EItemUpdateStatusInvalid = 0, // The item update handle was invalid, job might be finished, listen too SubmitItemUpdateResult_t
k_EItemUpdateStatusPreparingConfig = 1, // The item update is processing configuration data
k_EItemUpdateStatusPreparingContent = 2, // The item update is reading and processing content files
@ -112,8 +104,7 @@ enum EItemUpdateStatus
k_EItemUpdateStatusCommittingChanges = 5 // The item update is committing all changes
};
enum EItemState
{
enum EItemState {
k_EItemStateNone = 0, // item not tracked on client
k_EItemStateSubscribed = 1, // current user is subscribed to this item. Not just cached.
k_EItemStateLegacyItem = 2, // item was created with ISteamRemoteStorage
@ -123,8 +114,7 @@ enum EItemState
k_EItemStateDownloadPending = 32, // DownloadItem() was called for this item, content isn't available until DownloadItemResult_t is fired
};
enum EItemStatistic
{
enum EItemStatistic {
k_EItemStatistic_NumSubscriptions = 0,
k_EItemStatistic_NumFavorites = 1,
k_EItemStatistic_NumFollowers = 2,
@ -140,8 +130,7 @@ enum EItemStatistic
k_EItemStatistic_NumPlaytimeSessionsDuringTimePeriod = 12,
};
enum EItemPreviewType
{
enum EItemPreviewType {
k_EItemPreviewType_Image = 0, // standard image file expected (e.g. jpg, png, gif, etc.)
k_EItemPreviewType_YouTubeVideo = 1, // video id is stored
k_EItemPreviewType_Sketchfab = 2, // model id is stored
@ -161,8 +150,7 @@ const uint32 kNumUGCResultsPerPage = 50;
const uint32 k_cchDeveloperMetadataMax = 5000;
// Details for a single published file/UGC
struct SteamUGCDetails_t
{
struct SteamUGCDetails_t {
PublishedFileId_t m_nPublishedFileId;
EResult m_eResult; // The result of the operation.
EWorkshopFileType m_eFileType; // Type of the file
@ -197,10 +185,8 @@ struct SteamUGCDetails_t
//-----------------------------------------------------------------------------
// Purpose: Steam UGC support API
//-----------------------------------------------------------------------------
class ISteamUGC
{
class ISteamUGC {
public:
// Query UGC associated with a user. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.
virtual UGCQueryHandle_t CreateQueryUserUGCRequest(AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage) = 0;
@ -382,8 +368,7 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamUGC *, SteamGameServerUGC, STE
//-----------------------------------------------------------------------------
// Purpose: Callback for querying UGC
//-----------------------------------------------------------------------------
struct SteamUGCQueryCompleted_t
{
struct SteamUGCQueryCompleted_t {
enum { k_iCallback = k_iClientUGCCallbacks + 1 };
UGCQueryHandle_t m_handle;
EResult m_eResult;
@ -393,58 +378,48 @@ struct SteamUGCQueryCompleted_t
char m_rgchNextCursor[k_cchPublishedFileURLMax]; // If a paging cursor was used, then this will be the next cursor to get the next result set.
};
//-----------------------------------------------------------------------------
// Purpose: Callback for requesting details on one piece of UGC
//-----------------------------------------------------------------------------
struct SteamUGCRequestUGCDetailsResult_t
{
struct SteamUGCRequestUGCDetailsResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 2 };
SteamUGCDetails_t m_details;
bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache
};
//-----------------------------------------------------------------------------
// Purpose: result for ISteamUGC::CreateItem()
//-----------------------------------------------------------------------------
struct CreateItemResult_t
{
struct CreateItemResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 3 };
EResult m_eResult;
PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID
bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
};
//-----------------------------------------------------------------------------
// Purpose: result for ISteamUGC::SubmitItemUpdate()
//-----------------------------------------------------------------------------
struct SubmitItemUpdateResult_t
{
struct SubmitItemUpdateResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 4 };
EResult m_eResult;
bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
PublishedFileId_t m_nPublishedFileId;
};
//-----------------------------------------------------------------------------
// Purpose: a Workshop item has been installed or updated
//-----------------------------------------------------------------------------
struct ItemInstalled_t
{
struct ItemInstalled_t {
enum { k_iCallback = k_iClientUGCCallbacks + 5 };
AppId_t m_unAppID;
PublishedFileId_t m_nPublishedFileId;
};
//-----------------------------------------------------------------------------
// Purpose: result of DownloadItem(), existing item files can be accessed again
//-----------------------------------------------------------------------------
struct DownloadItemResult_t
{
struct DownloadItemResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 6 };
AppId_t m_unAppID;
PublishedFileId_t m_nPublishedFileId;
@ -454,8 +429,7 @@ struct DownloadItemResult_t
//-----------------------------------------------------------------------------
// Purpose: result of AddItemToFavorites() or RemoveItemFromFavorites()
//-----------------------------------------------------------------------------
struct UserFavoriteItemsListChanged_t
{
struct UserFavoriteItemsListChanged_t {
enum { k_iCallback = k_iClientUGCCallbacks + 7 };
PublishedFileId_t m_nPublishedFileId;
EResult m_eResult;
@ -465,8 +439,7 @@ struct UserFavoriteItemsListChanged_t
//-----------------------------------------------------------------------------
// Purpose: The result of a call to SetUserItemVote()
//-----------------------------------------------------------------------------
struct SetUserItemVoteResult_t
{
struct SetUserItemVoteResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 8 };
PublishedFileId_t m_nPublishedFileId;
EResult m_eResult;
@ -476,8 +449,7 @@ struct SetUserItemVoteResult_t
//-----------------------------------------------------------------------------
// Purpose: The result of a call to GetUserItemVote()
//-----------------------------------------------------------------------------
struct GetUserItemVoteResult_t
{
struct GetUserItemVoteResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 9 };
PublishedFileId_t m_nPublishedFileId;
EResult m_eResult;
@ -489,8 +461,7 @@ struct GetUserItemVoteResult_t
//-----------------------------------------------------------------------------
// Purpose: The result of a call to StartPlaytimeTracking()
//-----------------------------------------------------------------------------
struct StartPlaytimeTrackingResult_t
{
struct StartPlaytimeTrackingResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 10 };
EResult m_eResult;
};
@ -498,8 +469,7 @@ struct StartPlaytimeTrackingResult_t
//-----------------------------------------------------------------------------
// Purpose: The result of a call to StopPlaytimeTracking()
//-----------------------------------------------------------------------------
struct StopPlaytimeTrackingResult_t
{
struct StopPlaytimeTrackingResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 11 };
EResult m_eResult;
};
@ -507,8 +477,7 @@ struct StopPlaytimeTrackingResult_t
//-----------------------------------------------------------------------------
// Purpose: The result of a call to AddDependency
//-----------------------------------------------------------------------------
struct AddUGCDependencyResult_t
{
struct AddUGCDependencyResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 12 };
EResult m_eResult;
PublishedFileId_t m_nPublishedFileId;
@ -518,20 +487,17 @@ struct AddUGCDependencyResult_t
//-----------------------------------------------------------------------------
// Purpose: The result of a call to RemoveDependency
//-----------------------------------------------------------------------------
struct RemoveUGCDependencyResult_t
{
struct RemoveUGCDependencyResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 13 };
EResult m_eResult;
PublishedFileId_t m_nPublishedFileId;
PublishedFileId_t m_nChildPublishedFileId;
};
//-----------------------------------------------------------------------------
// Purpose: The result of a call to AddAppDependency
//-----------------------------------------------------------------------------
struct AddAppDependencyResult_t
{
struct AddAppDependencyResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 14 };
EResult m_eResult;
PublishedFileId_t m_nPublishedFileId;
@ -541,8 +507,7 @@ struct AddAppDependencyResult_t
//-----------------------------------------------------------------------------
// Purpose: The result of a call to RemoveAppDependency
//-----------------------------------------------------------------------------
struct RemoveAppDependencyResult_t
{
struct RemoveAppDependencyResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 15 };
EResult m_eResult;
PublishedFileId_t m_nPublishedFileId;
@ -553,8 +518,7 @@ struct RemoveAppDependencyResult_t
// Purpose: The result of a call to GetAppDependencies. Callback may be called
// multiple times until all app dependencies have been returned.
//-----------------------------------------------------------------------------
struct GetAppDependenciesResult_t
{
struct GetAppDependenciesResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 16 };
EResult m_eResult;
PublishedFileId_t m_nPublishedFileId;
@ -566,29 +530,24 @@ struct GetAppDependenciesResult_t
//-----------------------------------------------------------------------------
// Purpose: The result of a call to DeleteItem
//-----------------------------------------------------------------------------
struct DeleteItemResult_t
{
struct DeleteItemResult_t {
enum { k_iCallback = k_iClientUGCCallbacks + 17 };
EResult m_eResult;
PublishedFileId_t m_nPublishedFileId;
};
//-----------------------------------------------------------------------------
// Purpose: signal that the list of subscribed items changed
//-----------------------------------------------------------------------------
struct UserSubscribedItemsListChanged_t
{
struct UserSubscribedItemsListChanged_t {
enum { k_iCallback = k_iClientUGCCallbacks + 18 };
AppId_t m_nAppID;
};
//-----------------------------------------------------------------------------
// Purpose: Status of the user's acceptable/rejection of the app's specific Workshop EULA
//-----------------------------------------------------------------------------
struct WorkshopEULAStatus_t
{
struct WorkshopEULAStatus_t {
enum { k_iCallback = k_iClientUGCCallbacks + 20 };
EResult m_eResult;
AppId_t m_nAppID;

View File

@ -16,8 +16,7 @@
// Purpose: Functions for accessing and manipulating a steam account
// associated with one client instance
//-----------------------------------------------------------------------------
class ISteamUser
{
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
@ -207,7 +206,6 @@ public:
// This will prevent offline gameplay time from counting against a user's
// playtime limits.
virtual bool BSetDurationControlOnlineState(EDurationControlOnlineState eNewState) = 0;
};
#define STEAMUSER_INTERFACE_VERSION "SteamUser021"
@ -232,8 +230,7 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUser *, SteamUser, STEAMUSER_INTERFA
// only be seen if the user has dropped connection due to a networking issue
// or a Steam server update
//-----------------------------------------------------------------------------
struct SteamServersConnected_t
{
struct SteamServersConnected_t {
enum { k_iCallback = k_iSteamUserCallbacks + 1 };
};
@ -242,33 +239,28 @@ struct SteamServersConnected_t
// 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
{
struct SteamServerConnectFailure_t {
enum { k_iCallback = k_iSteamUserCallbacks + 2 };
EResult m_eResult;
bool m_bStillRetrying;
};
//-----------------------------------------------------------------------------
// 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
{
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
{
struct ClientGameServerDeny_t {
enum { k_iCallback = k_iSteamUserCallbacks + 13 };
uint32 m_uAppID;
@ -278,50 +270,41 @@ struct ClientGameServerDeny_t
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
{
struct IPCFailure_t {
enum { k_iCallback = k_iSteamUserCallbacks + 17 };
enum EFailureType
{
enum EFailureType {
k_EFailureFlushedCallbackQueue,
k_EFailurePipeFail,
};
uint8 m_eFailureType;
};
//-----------------------------------------------------------------------------
// Purpose: Signaled whenever licenses change
//-----------------------------------------------------------------------------
struct LicensesUpdated_t
{
struct LicensesUpdated_t {
enum { k_iCallback = k_iSteamUserCallbacks + 25 };
};
//-----------------------------------------------------------------------------
// callback for BeginAuthSession
//-----------------------------------------------------------------------------
struct ValidateAuthTicketResponse_t
{
struct ValidateAuthTicketResponse_t {
enum { k_iCallback = k_iSteamUserCallbacks + 43 };
CSteamID m_SteamID;
EAuthSessionResponse m_eAuthSessionResponse;
CSteamID m_OwnerSteamID; // different from m_SteamID if borrowed
};
//-----------------------------------------------------------------------------
// Purpose: called when a user has responded to a microtransaction authorization request
//-----------------------------------------------------------------------------
struct MicroTxnAuthorizationResponse_t
{
struct MicroTxnAuthorizationResponse_t {
enum { k_iCallback = k_iSteamUserCallbacks + 52 };
uint32 m_unAppID; // AppID for this microtransaction
@ -329,12 +312,10 @@ struct MicroTxnAuthorizationResponse_t
uint8 m_bAuthorized; // if user authorized transaction
};
//-----------------------------------------------------------------------------
// Purpose: Result from RequestEncryptedAppTicket
//-----------------------------------------------------------------------------
struct EncryptedAppTicketResponse_t
{
struct EncryptedAppTicketResponse_t {
enum { k_iCallback = k_iSteamUserCallbacks + 54 };
EResult m_eResult;
@ -343,19 +324,16 @@ struct EncryptedAppTicketResponse_t
//-----------------------------------------------------------------------------
// callback for GetAuthSessionTicket
//-----------------------------------------------------------------------------
struct GetAuthSessionTicketResponse_t
{
struct GetAuthSessionTicketResponse_t {
enum { k_iCallback = k_iSteamUserCallbacks + 63 };
HAuthTicket m_hAuthTicket;
EResult m_eResult;
};
//-----------------------------------------------------------------------------
// Purpose: sent to your game in response to a steam://gamewebcallback/ command
//-----------------------------------------------------------------------------
struct GameWebCallback_t
{
struct GameWebCallback_t {
enum { k_iCallback = k_iSteamUserCallbacks + 64 };
char m_szURL[256];
};
@ -363,18 +341,15 @@ struct GameWebCallback_t
//-----------------------------------------------------------------------------
// Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL
//-----------------------------------------------------------------------------
struct StoreAuthURLResponse_t
{
struct StoreAuthURLResponse_t {
enum { k_iCallback = k_iSteamUserCallbacks + 65 };
char m_szURL[512];
};
//-----------------------------------------------------------------------------
// Purpose: sent in response to ISteamUser::GetMarketEligibility
//-----------------------------------------------------------------------------
struct MarketEligibilityResponse_t
{
struct MarketEligibilityResponse_t {
enum { k_iCallback = k_iSteamUserCallbacks + 66 };
bool m_bAllowed;
EMarketNotAllowedReasonFlags m_eNotAllowedReason;
@ -384,7 +359,6 @@ struct MarketEligibilityResponse_t
int m_cdayNewDeviceCooldown; // The number of days after initial device authorization a user must wait before using the market on that device
};
//-----------------------------------------------------------------------------
// Purpose: sent for games with enabled anti indulgence / duration control, for
// enabled users. Lets the game know whether the user can keep playing or
@ -393,8 +367,7 @@ struct MarketEligibilityResponse_t
// This callback is fired asynchronously in response to timers triggering.
// It is also fired in response to calls to GetDurationControl().
//-----------------------------------------------------------------------------
struct DurationControl_t
{
struct DurationControl_t {
enum { k_iCallback = k_iSteamUserCallbacks + 67 };
EResult m_eResult; // result of call (always k_EResultOK for asynchronous timer-based notifications)
@ -410,7 +383,6 @@ struct DurationControl_t
int32 m_csecsRemaining; // playtime remaining until the user hits a regulatory limit
};
#pragma pack(pop)
#endif // ISTEAMUSER_H

View File

@ -10,8 +10,8 @@
#pragma once
#endif
#include "steam_api_common.h"
#include "isteamremotestorage.h"
#include "steam_api_common.h"
// size limit on stat or achievement name (UTF-8 encoded)
enum { k_cchStatNameMax = 128 };
@ -29,8 +29,7 @@ typedef uint64 SteamLeaderboard_t;
typedef uint64 SteamLeaderboardEntries_t;
// type of data request, when downloading leaderboard entries
enum ELeaderboardDataRequest
{
enum ELeaderboardDataRequest {
k_ELeaderboardDataRequestGlobal = 0,
k_ELeaderboardDataRequestGlobalAroundUser = 1,
k_ELeaderboardDataRequestFriends = 2,
@ -38,24 +37,21 @@ enum ELeaderboardDataRequest
};
// the sort order of a leaderboard
enum ELeaderboardSortMethod
{
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
{
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
{
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
@ -70,8 +66,7 @@ enum ELeaderboardUploadScoreMethod
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
struct LeaderboardEntry_t
{
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
@ -81,12 +76,10 @@ struct LeaderboardEntry_t
#pragma pack(pop)
//-----------------------------------------------------------------------------
// Purpose: Functions for accessing stats, achievements, and leaderboard information
//-----------------------------------------------------------------------------
class ISteamUserStats
{
class ISteamUserStats {
public:
// Ask the server to send down this user's data and achievements for this game
STEAM_CALL_BACK(UserStatsReceived_t)
@ -212,7 +205,8 @@ public:
// a max of 100 users can be downloaded at a time, with only one outstanding call at a time
STEAM_CALL_RESULT(LeaderboardScoresDownloaded_t)
virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers(SteamLeaderboard_t hSteamLeaderboard,
STEAM_ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers ) = 0;
STEAM_ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID* prgUsers, int cUsers)
= 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
@ -300,7 +294,6 @@ public:
STEAM_FLAT_NAME(GetAchievementProgressLimitsFloat)
virtual bool GetAchievementProgressLimits(const char* pchName, float* pfMinProgress, float* pfMaxProgress) = 0;
};
#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION012"
@ -322,33 +315,28 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUserStats *, SteamUserStats, STEAMUS
// Purpose: called when the latests stats and achievements have been received
// from the server
//-----------------------------------------------------------------------------
struct UserStatsReceived_t
{
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
{
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
{
struct UserAchievementStored_t {
enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 };
uint64 m_nGameID; // Game this is for
@ -358,38 +346,32 @@ struct UserAchievementStored_t
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
{
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
{
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
{
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
@ -399,32 +381,25 @@ struct LeaderboardScoreUploaded_t
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
{
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
};
//-----------------------------------------------------------------------------
// Purpose: Callback indicating that a user's stats have been unloaded.
// Call RequestUserStats again to access stats for this user
//-----------------------------------------------------------------------------
struct UserStatsUnloaded_t
{
struct UserStatsUnloaded_t {
enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 };
CSteamID m_steamIDUser; // User whose stats have been unloaded
};
//-----------------------------------------------------------------------------
// Purpose: Callback indicating that an achievement icon has been fetched
//-----------------------------------------------------------------------------
struct UserAchievementIconFetched_t
{
struct UserAchievementIconFetched_t {
enum { k_iCallback = k_iSteamUserStatsCallbacks + 9 };
CGameID m_nGameID; // Game this is for
@ -433,49 +408,40 @@ struct UserAchievementIconFetched_t
int m_nIconHandle; // Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement
};
//-----------------------------------------------------------------------------
// Purpose: Callback indicating that global achievement percentages are fetched
//-----------------------------------------------------------------------------
struct GlobalAchievementPercentagesReady_t
{
struct GlobalAchievementPercentagesReady_t {
enum { k_iCallback = k_iSteamUserStatsCallbacks + 10 };
uint64 m_nGameID; // Game this is for
EResult m_eResult; // Result of the operation
};
//-----------------------------------------------------------------------------
// Purpose: call result indicating UGC has been uploaded, returned as a result of SetLeaderboardUGC()
//-----------------------------------------------------------------------------
struct LeaderboardUGCSet_t
{
struct LeaderboardUGCSet_t {
enum { k_iCallback = k_iSteamUserStatsCallbacks + 11 };
EResult m_eResult; // The result of the operation
SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was
};
//-----------------------------------------------------------------------------
// Purpose: callback indicating that PS3 trophies have been installed
//-----------------------------------------------------------------------------
struct PS3TrophiesInstalled_t
{
struct PS3TrophiesInstalled_t {
enum { k_iCallback = k_iSteamUserStatsCallbacks + 12 };
uint64 m_nGameID; // Game these stats are for
EResult m_eResult; // The result of the operation
uint64 m_ulRequiredDiskSpace; // If m_eResult is k_EResultDiskFull, will contain the amount of space needed to install trophies
};
//-----------------------------------------------------------------------------
// Purpose: callback indicating global stats have been received.
// Returned as a result of RequestGlobalStats()
//-----------------------------------------------------------------------------
struct GlobalStatsReceived_t
{
struct GlobalStatsReceived_t {
enum { k_iCallback = k_iSteamUserStatsCallbacks + 12 };
uint64 m_nGameID; // Game global stats were requested for
EResult m_eResult; // The result of the request
@ -483,5 +449,4 @@ struct GlobalStatsReceived_t
#pragma pack(pop)
#endif // ISTEAMUSER_H

View File

@ -12,10 +12,8 @@
#include "steam_api_common.h"
// Steam API call failure results
enum ESteamAPICallFailure
{
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
@ -25,24 +23,19 @@ enum ESteamAPICallFailure
k_ESteamAPICallFailureMismatchedCallback = 3, // GetAPICallResult() was called with the wrong callback type for this API call
};
// Input modes for the Big Picture gamepad text entry
enum EGamepadTextInputMode
{
enum EGamepadTextInputMode {
k_EGamepadTextInputModeNormal = 0,
k_EGamepadTextInputModePassword = 1
};
// Controls number of allowed lines for the Big Picture gamepad text entry
enum EGamepadTextInputLineMode
{
enum EGamepadTextInputLineMode {
k_EGamepadTextInputLineModeSingleLine = 0,
k_EGamepadTextInputLineModeMultipleLines = 1
};
enum EFloatingGamepadTextInputMode
{
enum EFloatingGamepadTextInputMode {
k_EFloatingGamepadTextInputModeModeSingleLine = 0, // Enter dismisses the keyboard
k_EFloatingGamepadTextInputModeModeMultipleLines = 1, // User needs to explictly close the keyboard
k_EFloatingGamepadTextInputModeModeEmail = 2,
@ -51,15 +44,13 @@ enum EFloatingGamepadTextInputMode
};
// The context where text filtering is being done
enum ETextFilteringContext
{
enum ETextFilteringContext {
k_ETextFilteringContextUnknown = 0, // Unknown context
k_ETextFilteringContextGameContent = 1, // Game content, only legally required filtering is performed
k_ETextFilteringContextChat = 2, // Chat from another player
k_ETextFilteringContextName = 3, // Character or item name
};
// function prototype for warning message hook
#if defined(POSIX)
#define __cdecl
@ -69,8 +60,7 @@ extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char
//-----------------------------------------------------------------------------
// Purpose: interface to user independent utility functions
//-----------------------------------------------------------------------------
class ISteamUtils
{
class ISteamUtils {
public:
// return the number of seconds since the user
virtual uint32 GetSecondsSinceAppActive() = 0;
@ -245,47 +235,39 @@ STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamGameServerUtils, SteamInter
//-----------------------------------------------------------------------------
// Purpose: The country of the user changed
//-----------------------------------------------------------------------------
struct IPCountry_t
{
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
{
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
{
struct SteamAPICallCompleted_t {
enum { k_iCallback = k_iSteamUtilsCallbacks + 3 };
SteamAPICall_t m_hAsyncCall;
int m_iCallback;
uint32 m_cubParam;
};
//-----------------------------------------------------------------------------
// called when Steam wants to shutdown
//-----------------------------------------------------------------------------
struct SteamShutdown_t
{
struct SteamShutdown_t {
enum { k_iCallback = k_iSteamUtilsCallbacks + 4 };
};
//-----------------------------------------------------------------------------
// results for CheckFileSignature
//-----------------------------------------------------------------------------
enum ECheckFileSignature
{
enum ECheckFileSignature {
k_ECheckFileSignatureInvalidSignature = 0,
k_ECheckFileSignatureValidSignature = 1,
k_ECheckFileSignatureFileNotFound = 2,
@ -296,21 +278,17 @@ enum ECheckFileSignature
//-----------------------------------------------------------------------------
// callback for CheckFileSignature
//-----------------------------------------------------------------------------
struct CheckFileSignature_t
{
struct CheckFileSignature_t {
enum { k_iCallback = k_iSteamUtilsCallbacks + 5 };
ECheckFileSignature m_eCheckFileSignature;
};
// k_iSteamUtilsCallbacks + 13 is taken
//-----------------------------------------------------------------------------
// Full Screen gamepad text input has been closed
//-----------------------------------------------------------------------------
struct GamepadTextInputDismissed_t
{
struct GamepadTextInputDismissed_t {
enum { k_iCallback = k_iSteamUtilsCallbacks + 14 };
bool m_bSubmitted; // true if user entered & accepted text (Call ISteamUtils::GetEnteredGamepadTextInput() for text), false if canceled input
uint32 m_unSubmittedText;
@ -326,8 +304,7 @@ STEAM_CALLBACK_END(0)
//-----------------------------------------------------------------------------
// The floating on-screen keyboard has been closed
//-----------------------------------------------------------------------------
struct FloatingGamepadTextInputDismissed_t
{
struct FloatingGamepadTextInputDismissed_t {
enum { k_iCallback = k_iSteamUtilsCallbacks + 38 };
};

View File

@ -21,16 +21,11 @@
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
//-----------------------------------------------------------------------------
// Purpose: Steam Video API
//-----------------------------------------------------------------------------
class ISteamVideo
{
class ISteamVideo {
public:
// Get a URL suitable for streaming the given Video app ID's video
virtual void GetVideoURL(AppId_t unVideoAppID) = 0;
@ -55,14 +50,11 @@ STEAM_CALLBACK_BEGIN( GetVideoURLResult_t, k_iClientVideoCallbacks + 11 )
STEAM_CALLBACK_MEMBER(2, char, m_rgchURL[256])
STEAM_CALLBACK_END(3)
STEAM_CALLBACK_BEGIN(GetOPFSettingsResult_t, k_iClientVideoCallbacks + 24)
STEAM_CALLBACK_MEMBER(0, EResult, m_eResult)
STEAM_CALLBACK_MEMBER(1, AppId_t, m_unVideoAppID)
STEAM_CALLBACK_END(2)
#pragma pack(pop)
#endif // ISTEAMVIDEO_H

View File

@ -37,8 +37,7 @@ const int k_cbMaxGameServerGameData = 2048;
/// Actually, the name Key/Value is a bit misleading. The "key" is better
/// understood as "filter operation code" and the "value" is the operand to this
/// filter operation. The meaning of the operand depends upon the filter.
struct MatchMakingKeyValuePair_t
{
struct MatchMakingKeyValuePair_t {
MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; }
MatchMakingKeyValuePair_t(const char* pchKey, const char* pchValue)
{
@ -51,9 +50,7 @@ struct MatchMakingKeyValuePair_t
char m_szValue[256];
};
enum EMatchMakingServerResponse
{
enum EMatchMakingServerResponse {
eServerResponded = 0,
eServerFailedToRespond,
eNoServersListedOnMasterServer // for the Internet query type, returned in response callback if no servers of this type match
@ -61,11 +58,14 @@ enum EMatchMakingServerResponse
// 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
{
class servernetadr_t {
public:
servernetadr_t() : m_usConnectionPort( 0 ), m_usQueryPort( 0 ), m_unIP( 0 ) {}
servernetadr_t()
: m_usConnectionPort(0)
, m_usQueryPort(0)
, m_unIP(0)
{
}
void Init(unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort);
#ifdef NETADR_H
@ -97,7 +97,6 @@ public:
m_unIP = that.m_unIP;
}
private:
const char* ToString(uint32 unIP, uint16 usPort) const;
uint16 m_usConnectionPort; // (in HOST byte order)
@ -105,7 +104,6 @@ private:
uint32 m_unIP;
};
inline void servernetadr_t::Init(unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort)
{
m_unIP = ip;
@ -184,8 +182,7 @@ inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const
//-----------------------------------------------------------------------------
// Purpose: Data describing a single server
//-----------------------------------------------------------------------------
class gameserveritem_t
{
class gameserveritem_t {
public:
gameserveritem_t();
@ -210,7 +207,6 @@ public:
int m_nServerVersion; ///< server version as reported to Steam
private:
/// Game server name
char m_szServerName[k_cbMaxGameServerName];
@ -223,7 +219,6 @@ public:
CSteamID m_steamID;
};
inline gameserveritem_t::gameserveritem_t()
{
m_szGameDir[0] = m_szMap[0] = m_szGameDescription[0] = m_szServerName[0] = 0;
@ -247,5 +242,4 @@ inline void gameserveritem_t::SetName( const char *pName )
m_szServerName[sizeof(m_szServerName) - 1] = '\0';
}
#endif // MATCHMAKINGTYPES_H

View File

@ -21,32 +21,31 @@
#include "steam_api_common.h"
// All of the interfaces
#include "isteamclient.h"
#include "isteamuser.h"
#include "isteamfriends.h"
#include "isteamutils.h"
#include "isteammatchmaking.h"
#include "isteamuserstats.h"
#include "isteamapplist.h"
#include "isteamapps.h"
#include "isteamnetworking.h"
#include "isteamremotestorage.h"
#include "isteamscreenshots.h"
#include "isteamclient.h"
#include "isteamcontroller.h"
#include "isteamfriends.h"
#include "isteamhtmlsurface.h"
#include "isteamhttp.h"
#include "isteaminput.h"
#include "isteaminventory.h"
#include "isteammatchmaking.h"
#include "isteammusic.h"
#include "isteammusicremote.h"
#include "isteamhttp.h"
#include "isteamcontroller.h"
#include "isteamugc.h"
#include "isteamapplist.h"
#include "isteamhtmlsurface.h"
#include "isteaminventory.h"
#include "isteamvideo.h"
#include "isteamparentalsettings.h"
#include "isteaminput.h"
#include "isteamremoteplay.h"
#include "isteamnetworking.h"
#include "isteamnetworkingmessages.h"
#include "isteamnetworkingsockets.h"
#include "isteamnetworkingutils.h"
#include "isteamparentalsettings.h"
#include "isteamremoteplay.h"
#include "isteamremotestorage.h"
#include "isteamscreenshots.h"
#include "isteamugc.h"
#include "isteamuser.h"
#include "isteamuserstats.h"
#include "isteamutils.h"
#include "isteamvideo.h"
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
// Steam API setup & shutdown
@ -55,7 +54,6 @@
//
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
// SteamAPI_Init must be called before using any other API functions. If it fails, an
// error message will be output to the debugger (or stderr) with further information.
S_API bool S_CALLTYPE SteamAPI_Init();
@ -81,7 +79,6 @@ S_API bool S_CALLTYPE SteamAPI_RestartAppIfNecessary( uint32 unOwnAppID );
// program never needs to explicitly call this function.
S_API void S_CALLTYPE SteamAPI_ReleaseCurrentThreadMemory();
// crash dump recording functions
S_API void S_CALLTYPE SteamAPI_WriteMiniDump(uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID);
S_API void S_CALLTYPE SteamAPI_SetMiniDumpComment(const char* pchMsg);

View File

@ -13,8 +13,8 @@
#pragma once
#endif
#include "steamtypes.h"
#include "steamclientpublic.h"
#include "steamtypes.h"
// S_API defines the linkage and calling conventions for steam_api.dll exports
#if defined(_WIN32) && !defined(_X360)
@ -44,7 +44,9 @@
#elif defined(STEAM_API_EXPORTS) && defined(API_GEN)
#define STEAM_PRIVATE_API(...)
#else
#define STEAM_PRIVATE_API( ... ) protected: __VA_ARGS__ public:
#define STEAM_PRIVATE_API(...) \
protected: \
__VA_ARGS__ public:
#endif
// handle to a communication pipe to the Steam client
@ -104,7 +106,8 @@ S_API void S_CALLTYPE SteamAPI_RunCallbacks();
// Declares a callback function and a named CCallbackManual variable which
// has Register and Unregister functions instead of automatic registration.
#define STEAM_CALLBACK_MANUAL(thisclass, func, callback_type, var) \
CCallbackManual< thisclass, callback_type > var; void func( callback_type *pParam )
CCallbackManual<thisclass, callback_type> var; \
void func(callback_type* pParam)
// Dispatch callbacks relevant to the gameserver client and interfaces.
// To register for these, you need to use STEAM_GAMESERVER_CALLBACK.
@ -116,15 +119,19 @@ S_API void S_CALLTYPE SteamGameServer_RunCallbacks();
#define STEAM_GAMESERVER_CALLBACK(thisclass, func, /*callback_type, [deprecated] var*/...) \
_STEAM_CALLBACK_SELECT((__VA_ARGS__, GS, 3), (this->SetGameserverFlag();, thisclass, func, __VA_ARGS__))
#define STEAM_GAMESERVER_CALLBACK_MANUAL(thisclass, func, callback_type, var) \
CCallbackManual< thisclass, callback_type, true > var; void func( callback_type *pParam )
CCallbackManual<thisclass, callback_type, true> var; \
void func(callback_type* pParam)
//-----------------------------------------------------------------------------
// Purpose: base for callbacks and call results - internal implementation detail
//-----------------------------------------------------------------------------
class CCallbackBase
{
class CCallbackBase {
public:
CCallbackBase() { m_nCallbackFlags = 0; m_iCallback = 0; }
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;
@ -132,7 +139,8 @@ public:
virtual int GetCallbackSizeBytes() = 0;
protected:
enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 };
enum { k_ECallbackFlagsRegistered = 0x01,
k_ECallbackFlagsGameServer = 0x02 };
uint8 m_nCallbackFlags;
int m_iCallback;
friend class CCallbackMgr;
@ -146,10 +154,13 @@ private:
// Purpose: templated base for callbacks - internal implementation detail
//-----------------------------------------------------------------------------
template <int sizeof_P>
class CCallbackImpl : protected CCallbackBase
{
class CCallbackImpl : protected CCallbackBase {
public:
virtual ~CCallbackImpl() { if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) SteamAPI_UnregisterCallback( this ); }
virtual ~CCallbackImpl()
{
if (m_nCallbackFlags & k_ECallbackFlagsRegistered)
SteamAPI_UnregisterCallback(this);
}
void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; }
protected:
@ -159,14 +170,12 @@ protected:
virtual int GetCallbackSizeBytes() { return sizeof_P; }
};
//-----------------------------------------------------------------------------
// 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
{
class CCallResult : private CCallbackBase {
public:
typedef void (T::*func_t)(P*, bool);
@ -178,6 +187,7 @@ public:
void Cancel();
void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; }
private:
virtual void Run(void* pvParam);
virtual void Run(void* pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall);
@ -188,16 +198,13 @@ private:
func_t m_Func;
};
//-----------------------------------------------------------------------------
// Purpose: maps a steam callback to a class member function
// template params: T = local class, P = parameter struct,
// bGameserver = listen for gameserver callbacks instead of client callbacks
//-----------------------------------------------------------------------------
template <class T, class P, bool bGameserver = false>
class CCallback : public CCallbackImpl< sizeof( P ) >
{
class CCallback : public CCallbackImpl<sizeof(P)> {
public:
typedef void (T::*func_t)(P*);
@ -215,16 +222,17 @@ protected:
func_t m_Func;
};
//-----------------------------------------------------------------------------
// Purpose: subclass of CCallback which allows default-construction in
// an unregistered state; you must call Register manually
//-----------------------------------------------------------------------------
template <class T, class P, bool bGameServer = false>
class CCallbackManual : public CCallback< T, P, bGameServer >
{
class CCallbackManual : public CCallback<T, P, bGameServer> {
public:
CCallbackManual() : CCallback< T, P, bGameServer >( nullptr, nullptr ) {}
CCallbackManual()
: CCallback<T, P, bGameServer>(nullptr, nullptr)
{
}
// Inherits public Register and Unregister functions from base class
};

View File

@ -8,15 +8,13 @@
#ifndef STEAMAPIFLAT_H
#define STEAMAPIFLAT_H
#include "steam/steam_api.h"
#include "steam/isteamgameserver.h"
#include "steam/isteamgameserverstats.h"
#include "steam/steam_api.h"
typedef uint64 uint64_steamid; // Used when passing or returning CSteamID
typedef uint64 uint64_gameid; // Used when passing or return CGameID
// ISteamClient
S_API HSteamPipe SteamAPI_ISteamClient_CreateSteamPipe(ISteamClient* self);
S_API bool SteamAPI_ISteamClient_BReleaseSteamPipe(ISteamClient* self, HSteamPipe hSteamPipe);

View File

@ -33,7 +33,8 @@ S_API void *S_CALLTYPE SteamInternal_FindOrCreateGameServerInterface( HSteamUser
#define STEAM_DEFINE_INTERFACE_ACCESSOR(type, name, expr, kind, version) \
inline void S_CALLTYPE SteamInternal_Init_##name(type* p) { *p = (type)(expr); } \
STEAM_CLANG_ATTR("interface_accessor_kind:" kind ";interface_accessor_version:" version ";") \
inline type name() { \
inline type name() \
{ \
static void* s_CallbackCounterAndContext[3] = { (void*)&SteamInternal_Init_##name, 0, 0 }; \
return *(type*)SteamInternal_ContextInit(s_CallbackCounterAndContext); \
}
@ -68,15 +69,22 @@ S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallb
CCallbackInternal_##func() { extra_code SteamAPI_RegisterCallback(this, param::k_iCallback); } \
CCallbackInternal_##func(const CCallbackInternal_##func&) { extra_code SteamAPI_RegisterCallback(this, param::k_iCallback); } \
CCallbackInternal_##func& operator=(const CCallbackInternal_##func&) { return *this; } \
private: virtual void Run( void *pvParam ) { _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) \
\
private: \
virtual void Run(void* pvParam) \
{ \
_STEAM_CALLBACK_AUTO_HOOK(thisclass, func, param) \
thisclass* pOuter = reinterpret_cast<thisclass*>(reinterpret_cast<char*>(this) - offsetof(thisclass, m_steamcallback_##func)); \
pOuter->func(reinterpret_cast<param*>(pvParam)); \
} \
} m_steamcallback_ ## func ; void func( param *pParam )
} m_steamcallback_##func; \
void func(param* pParam)
#define _STEAM_CALLBACK_4(_, thisclass, func, param, var) \
CCallback< thisclass, param > var; void func( param *pParam )
CCallback<thisclass, param> var; \
void func(param* pParam)
#define _STEAM_CALLBACK_GS(_, thisclass, func, param, var) \
CCallback< thisclass, param, true > var; void func( param *pParam )
CCallback<thisclass, param, true> var; \
void func(param* pParam)
#ifndef API_GEN
@ -112,8 +120,7 @@ inline bool CCallResult<T, P>::IsActive() const
template <class T, class P>
inline void CCallResult<T, P>::Cancel()
{
if ( m_hAPICall != k_uAPICallInvalid )
{
if (m_hAPICall != k_uAPICallInvalid) {
SteamAPI_UnregisterCallResult(this, m_hAPICall);
m_hAPICall = k_uAPICallInvalid;
}
@ -135,8 +142,7 @@ inline void CCallResult<T, P>::Run( void *pvParam )
template <class T, class P>
inline void CCallResult<T, P>::Run(void* pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall)
{
if ( hSteamAPICall == m_hAPICall )
{
if (hSteamAPICall == m_hAPICall) {
m_hAPICall = k_uAPICallInvalid; // caller unregisters for us
(m_pObj->*m_Func)((P*)pvParam, bIOFailure);
}
@ -144,10 +150,10 @@ inline void CCallResult<T, P>::Run( void *pvParam, bool bIOFailure, SteamAPICall
template <class T, class P, bool bGameserver>
inline CCallback<T, P, bGameserver>::CCallback(T* pObj, func_t func)
: m_pObj( nullptr ), m_Func( nullptr )
{
if ( bGameserver )
: m_pObj(nullptr)
, m_Func(nullptr)
{
if (bGameserver) {
this->SetGameserverFlag();
}
Register(pObj, func);
@ -194,8 +200,7 @@ inline void CCallback< T, P, bGameserver >::Run( void *pvParam )
#endif
/// Internal structure used in manual callback dispatch
struct CallbackMsg_t
{
struct CallbackMsg_t {
HSteamUser m_hSteamUser; // Specific user to whom this callback applies.
int m_iCallback; // Callback identifier. (Corresponds to the k_iCallback enum in the callback structure.)
uint8* m_pubParam; // Points to the callback structure
@ -207,10 +212,14 @@ struct CallbackMsg_t
#ifdef STEAM_CALLBACK_INSPECTION_ENABLED
#include "../../clientdll/steam_api_callback_inspection.h"
#else
#define STEAM_CALLBACK_BEGIN( callbackname, callbackid ) struct callbackname { enum { k_iCallback = callbackid };
#define STEAM_CALLBACK_BEGIN(callbackname, callbackid) \
struct callbackname { \
enum { k_iCallback = callbackid };
#define STEAM_CALLBACK_MEMBER(varidx, vartype, varname) vartype varname;
#define STEAM_CALLBACK_MEMBER_ARRAY(varidx, vartype, varname, varcount) vartype varname[varcount];
#define STEAM_CALLBACK_END(nArgs) };
#define STEAM_CALLBACK_END(nArgs) \
} \
;
#endif
// Forward declare all of the Steam interfaces. (Do we really need to do this?)
@ -346,8 +355,7 @@ enum { k_iClientStorageDeviceManagerCallbacks = 6200 };
// DEPRECATED: Used the global interface accessors instead!
//
// This will be removed in a future iteration of the SDK
class CSteamAPIContext
{
class CSteamAPIContext {
public:
CSteamAPIContext() { Clear(); }
inline void Clear() { memset(this, 0, sizeof(*this)); }
@ -375,6 +383,7 @@ public:
ISteamVideo* SteamVideo() const { return m_pSteamVideo; }
ISteamParentalSettings* SteamParentalSettings() const { return m_pSteamParentalSettings; }
ISteamInput* SteamInput() const { return m_pSteamInput; }
private:
ISteamClient* m_pSteamClient;
ISteamUser* m_pSteamUser;
@ -401,8 +410,7 @@ private:
ISteamInput* m_pSteamInput;
};
class CSteamGameServerAPIContext
{
class CSteamGameServerAPIContext {
public:
CSteamGameServerAPIContext() { Clear(); }
inline void Clear() { memset(this, 0, sizeof(*this)); }
@ -427,5 +435,3 @@ private:
ISteamInventory* m_pSteamInventory;
ISteamUGC* m_pSteamUGC;
};

View File

@ -10,12 +10,11 @@
#pragma once
#endif
#include "steam_api.h"
#include "isteamgameserver.h"
#include "isteamgameserverstats.h"
#include "steam_api.h"
enum EServerMode
{
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

View File

@ -9,15 +9,13 @@ namespace ScreenPlayWorkshopSteamEnums {
Q_NAMESPACE
enum class ESteamIPType
{
enum class ESteamIPType {
K_ESteamIPTypeIPv4 = 0,
K_ESteamIPTypeIPv6 = 1,
};
Q_ENUM_NS(ESteamIPType)
enum class EUniverse
{
enum class EUniverse {
K_EUniverseInvalid = 0,
K_EUniversePublic = 1,
K_EUniverseBeta = 2,
@ -27,8 +25,7 @@ enum class EUniverse
};
Q_ENUM_NS(EUniverse)
enum class EResult
{
enum class EResult {
K_EResultNone = 0,
K_EResultOK = 1,
K_EResultFail = 2,
@ -154,8 +151,7 @@ enum class EResult
};
Q_ENUM_NS(EResult)
enum class EVoiceResult
{
enum class EVoiceResult {
K_EVoiceResultOK = 0,
K_EVoiceResultNotInitialized = 1,
K_EVoiceResultNotRecording = 2,
@ -169,8 +165,7 @@ enum class EVoiceResult
};
Q_ENUM_NS(EVoiceResult)
enum class EDenyReason
{
enum class EDenyReason {
K_EDenyInvalid = 0,
K_EDenyInvalidVersion = 1,
K_EDenyGeneric = 2,
@ -190,8 +185,7 @@ enum class EDenyReason
};
Q_ENUM_NS(EDenyReason)
enum class EBeginAuthSessionResult
{
enum class EBeginAuthSessionResult {
K_EBeginAuthSessionResultOK = 0,
K_EBeginAuthSessionResultInvalidTicket = 1,
K_EBeginAuthSessionResultDuplicateRequest = 2,
@ -201,8 +195,7 @@ enum class EBeginAuthSessionResult
};
Q_ENUM_NS(EBeginAuthSessionResult)
enum class EAuthSessionResponse
{
enum class EAuthSessionResponse {
K_EAuthSessionResponseOK = 0,
K_EAuthSessionResponseUserNotConnectedToSteam = 1,
K_EAuthSessionResponseNoLicenseOrExpired = 2,
@ -216,16 +209,14 @@ enum class EAuthSessionResponse
};
Q_ENUM_NS(EAuthSessionResponse)
enum class EUserHasLicenseForAppResult
{
enum class EUserHasLicenseForAppResult {
K_EUserHasLicenseResultHasLicense = 0,
K_EUserHasLicenseResultDoesNotHaveLicense = 1,
K_EUserHasLicenseResultNoAuth = 2,
};
Q_ENUM_NS(EUserHasLicenseForAppResult)
enum class EAccountType
{
enum class EAccountType {
K_EAccountTypeInvalid = 0,
K_EAccountTypeIndividual = 1,
K_EAccountTypeMultiseat = 2,
@ -241,8 +232,7 @@ enum class EAccountType
};
Q_ENUM_NS(EAccountType)
enum class EChatEntryType
{
enum class EChatEntryType {
K_EChatEntryTypeInvalid = 0,
K_EChatEntryTypeChatMsg = 1,
K_EChatEntryTypeTyping = 2,
@ -258,8 +248,7 @@ enum class EChatEntryType
};
Q_ENUM_NS(EChatEntryType)
enum class EChatRoomEnterResponse
{
enum class EChatRoomEnterResponse {
K_EChatRoomEnterResponseSuccess = 1,
K_EChatRoomEnterResponseDoesntExist = 2,
K_EChatRoomEnterResponseNotAllowed = 3,
@ -275,8 +264,7 @@ enum class EChatRoomEnterResponse
};
Q_ENUM_NS(EChatRoomEnterResponse)
enum class EChatSteamIDInstanceFlags
{
enum class EChatSteamIDInstanceFlags {
K_EChatAccountInstanceMask = 4095,
K_EChatInstanceFlagClan = 524288,
K_EChatInstanceFlagLobby = 262144,
@ -284,8 +272,7 @@ enum class EChatSteamIDInstanceFlags
};
Q_ENUM_NS(EChatSteamIDInstanceFlags)
enum class ENotificationPosition
{
enum class ENotificationPosition {
K_EPositionTopLeft = 0,
K_EPositionTopRight = 1,
K_EPositionBottomLeft = 2,
@ -293,8 +280,7 @@ enum class ENotificationPosition
};
Q_ENUM_NS(ENotificationPosition)
enum class EBroadcastUploadResult
{
enum class EBroadcastUploadResult {
K_EBroadcastUploadResultNone = 0,
K_EBroadcastUploadResultOK = 1,
K_EBroadcastUploadResultInitFailed = 2,
@ -322,8 +308,7 @@ enum class EBroadcastUploadResult
};
Q_ENUM_NS(EBroadcastUploadResult)
enum class EMarketNotAllowedReasonFlags
{
enum class EMarketNotAllowedReasonFlags {
K_EMarketNotAllowedReason_None = 0,
K_EMarketNotAllowedReason_TemporaryFailure = 1,
K_EMarketNotAllowedReason_AccountDisabled = 2,
@ -344,8 +329,7 @@ enum class EMarketNotAllowedReasonFlags
};
Q_ENUM_NS(EMarketNotAllowedReasonFlags)
enum class EDurationControlProgress
{
enum class EDurationControlProgress {
K_EDurationControlProgress_Full = 0,
K_EDurationControlProgress_Half = 1,
K_EDurationControlProgress_None = 2,
@ -355,8 +339,7 @@ enum class EDurationControlProgress
};
Q_ENUM_NS(EDurationControlProgress)
enum class EDurationControlNotification
{
enum class EDurationControlNotification {
K_EDurationControlNotification_None = 0,
K_EDurationControlNotification_1Hour = 1,
K_EDurationControlNotification_3Hours = 2,
@ -368,8 +351,7 @@ enum class EDurationControlNotification
};
Q_ENUM_NS(EDurationControlNotification)
enum class EDurationControlOnlineState
{
enum class EDurationControlOnlineState {
K_EDurationControlOnlineState_Invalid = 0,
K_EDurationControlOnlineState_Offline = 1,
K_EDurationControlOnlineState_Online = 2,
@ -377,8 +359,7 @@ enum class EDurationControlOnlineState
};
Q_ENUM_NS(EDurationControlOnlineState)
enum class EGameSearchErrorCode_t
{
enum class EGameSearchErrorCode_t {
K_EGameSearchErrorCode_OK = 1,
K_EGameSearchErrorCode_Failed_Search_Already_In_Progress = 2,
K_EGameSearchErrorCode_Failed_No_Search_In_Progress = 3,
@ -391,8 +372,7 @@ enum class EGameSearchErrorCode_t
};
Q_ENUM_NS(EGameSearchErrorCode_t)
enum class EPlayerResult_t
{
enum class EPlayerResult_t {
K_EPlayerResultFailedToConnect = 1,
K_EPlayerResultAbandoned = 2,
K_EPlayerResultKicked = 3,
@ -401,24 +381,21 @@ enum class EPlayerResult_t
};
Q_ENUM_NS(EPlayerResult_t)
enum class ESteamIPv6ConnectivityProtocol
{
enum class ESteamIPv6ConnectivityProtocol {
K_ESteamIPv6ConnectivityProtocol_Invalid = 0,
K_ESteamIPv6ConnectivityProtocol_HTTP = 1,
K_ESteamIPv6ConnectivityProtocol_UDP = 2,
};
Q_ENUM_NS(ESteamIPv6ConnectivityProtocol)
enum class ESteamIPv6ConnectivityState
{
enum class ESteamIPv6ConnectivityState {
K_ESteamIPv6ConnectivityState_Unknown = 0,
K_ESteamIPv6ConnectivityState_Good = 1,
K_ESteamIPv6ConnectivityState_Bad = 2,
};
Q_ENUM_NS(ESteamIPv6ConnectivityState)
enum class EFriendRelationship
{
enum class EFriendRelationship {
K_EFriendRelationshipNone = 0,
K_EFriendRelationshipBlocked = 1,
K_EFriendRelationshipRequestRecipient = 2,
@ -431,8 +408,7 @@ enum class EFriendRelationship
};
Q_ENUM_NS(EFriendRelationship)
enum class EPersonaState
{
enum class EPersonaState {
K_EPersonaStateOffline = 0,
K_EPersonaStateOnline = 1,
K_EPersonaStateBusy = 2,
@ -445,8 +421,7 @@ enum class EPersonaState
};
Q_ENUM_NS(EPersonaState)
enum class EFriendFlags
{
enum class EFriendFlags {
K_EFriendFlagNone = 0,
K_EFriendFlagBlocked = 1,
K_EFriendFlagFriendshipRequested = 2,
@ -462,8 +437,7 @@ enum class EFriendFlags
};
Q_ENUM_NS(EFriendFlags)
enum class EUserRestriction
{
enum class EUserRestriction {
K_nUserRestrictionNone = 0,
K_nUserRestrictionUnknown = 1,
K_nUserRestrictionAnyChat = 2,
@ -475,23 +449,20 @@ enum class EUserRestriction
};
Q_ENUM_NS(EUserRestriction)
enum class EOverlayToStoreFlag
{
enum class EOverlayToStoreFlag {
K_EOverlayToStoreFlag_None = 0,
K_EOverlayToStoreFlag_AddToCart = 1,
K_EOverlayToStoreFlag_AddToCartAndShow = 2,
};
Q_ENUM_NS(EOverlayToStoreFlag)
enum class EActivateGameOverlayToWebPageMode
{
enum class EActivateGameOverlayToWebPageMode {
K_EActivateGameOverlayToWebPageMode_Default = 0,
K_EActivateGameOverlayToWebPageMode_Modal = 1,
};
Q_ENUM_NS(EActivateGameOverlayToWebPageMode)
enum class EPersonaChange
{
enum class EPersonaChange {
K_EPersonaChangeName = 1,
K_EPersonaChangeStatus = 2,
K_EPersonaChangeComeOnline = 4,
@ -510,8 +481,7 @@ enum class EPersonaChange
};
Q_ENUM_NS(EPersonaChange)
enum class ESteamAPICallFailure
{
enum class ESteamAPICallFailure {
K_ESteamAPICallFailureNone = -1,
K_ESteamAPICallFailureSteamGone = 0,
K_ESteamAPICallFailureNetworkFailure = 1,
@ -520,22 +490,19 @@ enum class ESteamAPICallFailure
};
Q_ENUM_NS(ESteamAPICallFailure)
enum class EGamepadTextInputMode
{
enum class EGamepadTextInputMode {
K_EGamepadTextInputModeNormal = 0,
K_EGamepadTextInputModePassword = 1,
};
Q_ENUM_NS(EGamepadTextInputMode)
enum class EGamepadTextInputLineMode
{
enum class EGamepadTextInputLineMode {
K_EGamepadTextInputLineModeSingleLine = 0,
K_EGamepadTextInputLineModeMultipleLines = 1,
};
Q_ENUM_NS(EGamepadTextInputLineMode)
enum class ETextFilteringContext
{
enum class ETextFilteringContext {
K_ETextFilteringContextUnknown = 0,
K_ETextFilteringContextGameContent = 1,
K_ETextFilteringContextChat = 2,
@ -543,8 +510,7 @@ enum class ETextFilteringContext
};
Q_ENUM_NS(ETextFilteringContext)
enum class ECheckFileSignature
{
enum class ECheckFileSignature {
K_ECheckFileSignatureInvalidSignature = 0,
K_ECheckFileSignatureValidSignature = 1,
K_ECheckFileSignatureFileNotFound = 2,
@ -553,16 +519,14 @@ enum class ECheckFileSignature
};
Q_ENUM_NS(ECheckFileSignature)
enum class EMatchMakingServerResponse
{
enum class EMatchMakingServerResponse {
EServerResponded = 0,
EServerFailedToRespond = 1,
ENoServersListedOnMasterServer = 2,
};
Q_ENUM_NS(EMatchMakingServerResponse)
enum class ELobbyType
{
enum class ELobbyType {
K_ELobbyTypePrivate = 0,
K_ELobbyTypeFriendsOnly = 1,
K_ELobbyTypePublic = 2,
@ -571,8 +535,7 @@ enum class ELobbyType
};
Q_ENUM_NS(ELobbyType)
enum class ELobbyComparison
{
enum class ELobbyComparison {
K_ELobbyComparisonEqualToOrLessThan = -2,
K_ELobbyComparisonLessThan = -1,
K_ELobbyComparisonEqual = 0,
@ -582,8 +545,7 @@ enum class ELobbyComparison
};
Q_ENUM_NS(ELobbyComparison)
enum class ELobbyDistanceFilter
{
enum class ELobbyDistanceFilter {
K_ELobbyDistanceFilterClose = 0,
K_ELobbyDistanceFilterDefault = 1,
K_ELobbyDistanceFilterFar = 2,
@ -591,8 +553,7 @@ enum class ELobbyDistanceFilter
};
Q_ENUM_NS(ELobbyDistanceFilter)
enum class EChatMemberStateChange
{
enum class EChatMemberStateChange {
K_EChatMemberStateChangeEntered = 1,
K_EChatMemberStateChangeLeft = 2,
K_EChatMemberStateChangeDisconnected = 4,
@ -601,16 +562,14 @@ enum class EChatMemberStateChange
};
Q_ENUM_NS(EChatMemberStateChange)
enum class ESteamPartyBeaconLocationType
{
enum class ESteamPartyBeaconLocationType {
K_ESteamPartyBeaconLocationType_Invalid = 0,
K_ESteamPartyBeaconLocationType_ChatGroup = 1,
K_ESteamPartyBeaconLocationType_Max = 2,
};
Q_ENUM_NS(ESteamPartyBeaconLocationType)
enum class ESteamPartyBeaconLocationData
{
enum class ESteamPartyBeaconLocationData {
K_ESteamPartyBeaconLocationDataInvalid = 0,
K_ESteamPartyBeaconLocationDataName = 1,
K_ESteamPartyBeaconLocationDataIconURLSmall = 2,
@ -619,8 +578,7 @@ enum class ESteamPartyBeaconLocationData
};
Q_ENUM_NS(ESteamPartyBeaconLocationData)
enum class ERemoteStoragePlatform
{
enum class ERemoteStoragePlatform {
K_ERemoteStoragePlatformNone = 0,
K_ERemoteStoragePlatformWindows = 1,
K_ERemoteStoragePlatformOSX = 2,
@ -633,8 +591,7 @@ enum class ERemoteStoragePlatform
};
Q_ENUM_NS(ERemoteStoragePlatform)
enum class ERemoteStoragePublishedFileVisibility
{
enum class ERemoteStoragePublishedFileVisibility {
K_ERemoteStoragePublishedFileVisibilityPublic = 0,
K_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1,
K_ERemoteStoragePublishedFileVisibilityPrivate = 2,
@ -642,8 +599,7 @@ enum class ERemoteStoragePublishedFileVisibility
};
Q_ENUM_NS(ERemoteStoragePublishedFileVisibility)
enum class EWorkshopFileType
{
enum class EWorkshopFileType {
K_EWorkshopFileTypeFirst = 0,
K_EWorkshopFileTypeCommunity = 0,
K_EWorkshopFileTypeMicrotransaction = 1,
@ -665,8 +621,7 @@ enum class EWorkshopFileType
};
Q_ENUM_NS(EWorkshopFileType)
enum class EWorkshopVote
{
enum class EWorkshopVote {
K_EWorkshopVoteUnvoted = 0,
K_EWorkshopVoteFor = 1,
K_EWorkshopVoteAgainst = 2,
@ -674,15 +629,13 @@ enum class EWorkshopVote
};
Q_ENUM_NS(EWorkshopVote)
enum class EWorkshopFileAction
{
enum class EWorkshopFileAction {
K_EWorkshopFileActionPlayed = 0,
K_EWorkshopFileActionCompleted = 1,
};
Q_ENUM_NS(EWorkshopFileAction)
enum class EWorkshopEnumerationType
{
enum class EWorkshopEnumerationType {
K_EWorkshopEnumerationTypeRankedByVote = 0,
K_EWorkshopEnumerationTypeRecent = 1,
K_EWorkshopEnumerationTypeTrending = 2,
@ -693,39 +646,34 @@ enum class EWorkshopEnumerationType
};
Q_ENUM_NS(EWorkshopEnumerationType)
enum class EWorkshopVideoProvider
{
enum class EWorkshopVideoProvider {
K_EWorkshopVideoProviderNone = 0,
K_EWorkshopVideoProviderYoutube = 1,
};
Q_ENUM_NS(EWorkshopVideoProvider)
enum class EUGCReadAction
{
enum class EUGCReadAction {
K_EUGCRead_ContinueReadingUntilFinished = 0,
K_EUGCRead_ContinueReading = 1,
K_EUGCRead_Close = 2,
};
Q_ENUM_NS(EUGCReadAction)
enum class ERemoteStorageLocalFileChange
{
enum class ERemoteStorageLocalFileChange {
K_ERemoteStorageLocalFileChange_Invalid = 0,
K_ERemoteStorageLocalFileChange_FileUpdated = 1,
K_ERemoteStorageLocalFileChange_FileDeleted = 2,
};
Q_ENUM_NS(ERemoteStorageLocalFileChange)
enum class ERemoteStorageFilePathType
{
enum class ERemoteStorageFilePathType {
K_ERemoteStorageFilePathType_Invalid = 0,
K_ERemoteStorageFilePathType_Absolute = 1,
K_ERemoteStorageFilePathType_APIFilename = 2,
};
Q_ENUM_NS(ERemoteStorageFilePathType)
enum class ELeaderboardDataRequest
{
enum class ELeaderboardDataRequest {
K_ELeaderboardDataRequestGlobal = 0,
K_ELeaderboardDataRequestGlobalAroundUser = 1,
K_ELeaderboardDataRequestFriends = 2,
@ -733,16 +681,14 @@ enum class ELeaderboardDataRequest
};
Q_ENUM_NS(ELeaderboardDataRequest)
enum class ELeaderboardSortMethod
{
enum class ELeaderboardSortMethod {
K_ELeaderboardSortMethodNone = 0,
K_ELeaderboardSortMethodAscending = 1,
K_ELeaderboardSortMethodDescending = 2,
};
Q_ENUM_NS(ELeaderboardSortMethod)
enum class ELeaderboardDisplayType
{
enum class ELeaderboardDisplayType {
K_ELeaderboardDisplayTypeNone = 0,
K_ELeaderboardDisplayTypeNumeric = 1,
K_ELeaderboardDisplayTypeTimeSeconds = 2,
@ -750,16 +696,14 @@ enum class ELeaderboardDisplayType
};
Q_ENUM_NS(ELeaderboardDisplayType)
enum class ELeaderboardUploadScoreMethod
{
enum class ELeaderboardUploadScoreMethod {
K_ELeaderboardUploadScoreMethodNone = 0,
K_ELeaderboardUploadScoreMethodKeepBest = 1,
K_ELeaderboardUploadScoreMethodForceUpdate = 2,
};
Q_ENUM_NS(ELeaderboardUploadScoreMethod)
enum class ERegisterActivationCodeResult
{
enum class ERegisterActivationCodeResult {
K_ERegisterActivationCodeResultOK = 0,
K_ERegisterActivationCodeResultFail = 1,
K_ERegisterActivationCodeResultAlreadyRegistered = 2,
@ -768,8 +712,7 @@ enum class ERegisterActivationCodeResult
};
Q_ENUM_NS(ERegisterActivationCodeResult)
enum class EP2PSessionError
{
enum class EP2PSessionError {
K_EP2PSessionErrorNone = 0,
K_EP2PSessionErrorNoRightsToApp = 2,
K_EP2PSessionErrorTimeout = 4,
@ -779,8 +722,7 @@ enum class EP2PSessionError
};
Q_ENUM_NS(EP2PSessionError)
enum class EP2PSend
{
enum class EP2PSend {
K_EP2PSendUnreliable = 0,
K_EP2PSendUnreliableNoDelay = 1,
K_EP2PSendReliable = 2,
@ -788,8 +730,7 @@ enum class EP2PSend
};
Q_ENUM_NS(EP2PSend)
enum class ESNetSocketState
{
enum class ESNetSocketState {
K_ESNetSocketStateInvalid = 0,
K_ESNetSocketStateConnected = 1,
K_ESNetSocketStateInitiated = 10,
@ -804,16 +745,14 @@ enum class ESNetSocketState
};
Q_ENUM_NS(ESNetSocketState)
enum class ESNetSocketConnectionType
{
enum class ESNetSocketConnectionType {
K_ESNetSocketConnectionTypeNotConnected = 0,
K_ESNetSocketConnectionTypeUDP = 1,
K_ESNetSocketConnectionTypeUDPRelay = 2,
};
Q_ENUM_NS(ESNetSocketConnectionType)
enum class EVRScreenshotType
{
enum class EVRScreenshotType {
K_EVRScreenshotType_None = 0,
K_EVRScreenshotType_Mono = 1,
K_EVRScreenshotType_Stereo = 2,
@ -823,8 +762,7 @@ enum class EVRScreenshotType
};
Q_ENUM_NS(EVRScreenshotType)
enum class AudioPlayback_Status
{
enum class AudioPlayback_Status {
AudioPlayback_Undefined = 0,
AudioPlayback_Playing = 1,
AudioPlayback_Paused = 2,
@ -832,8 +770,7 @@ enum class AudioPlayback_Status
};
Q_ENUM_NS(AudioPlayback_Status)
enum class EHTTPMethod
{
enum class EHTTPMethod {
K_EHTTPMethodInvalid = 0,
K_EHTTPMethodGET = 1,
K_EHTTPMethodHEAD = 2,
@ -845,8 +782,7 @@ enum class EHTTPMethod
};
Q_ENUM_NS(EHTTPMethod)
enum class EHTTPStatusCode
{
enum class EHTTPStatusCode {
K_EHTTPStatusCodeInvalid = 0,
K_EHTTPStatusCode100Continue = 100,
K_EHTTPStatusCode101SwitchingProtocols = 101,
@ -895,8 +831,7 @@ enum class EHTTPStatusCode
};
Q_ENUM_NS(EHTTPStatusCode)
enum class EInputSourceMode
{
enum class EInputSourceMode {
K_EInputSourceMode_None = 0,
K_EInputSourceMode_Dpad = 1,
K_EInputSourceMode_Buttons = 2,
@ -917,8 +852,7 @@ enum class EInputSourceMode
};
Q_ENUM_NS(EInputSourceMode)
enum class EInputActionOrigin
{
enum class EInputActionOrigin {
K_EInputActionOrigin_None = 0,
K_EInputActionOrigin_SteamController_A = 1,
K_EInputActionOrigin_SteamController_B = 2,
@ -1257,8 +1191,7 @@ enum class EInputActionOrigin
};
Q_ENUM_NS(EInputActionOrigin)
enum class EXboxOrigin
{
enum class EXboxOrigin {
K_EXboxOrigin_A = 0,
K_EXboxOrigin_B = 1,
K_EXboxOrigin_X = 2,
@ -1291,31 +1224,27 @@ enum class EXboxOrigin
};
Q_ENUM_NS(EXboxOrigin)
enum class ESteamControllerPad
{
enum class ESteamControllerPad {
K_ESteamControllerPad_Left = 0,
K_ESteamControllerPad_Right = 1,
};
Q_ENUM_NS(ESteamControllerPad)
enum class EControllerHapticLocation
{
enum class EControllerHapticLocation {
K_EControllerHapticLocation_Left = 1,
K_EControllerHapticLocation_Right = 2,
K_EControllerHapticLocation_Both = 3,
};
Q_ENUM_NS(EControllerHapticLocation)
enum class EControllerHapticType
{
enum class EControllerHapticType {
K_EControllerHapticType_Off = 0,
K_EControllerHapticType_Tick = 1,
K_EControllerHapticType_Click = 2,
};
Q_ENUM_NS(EControllerHapticType)
enum class ESteamInputType
{
enum class ESteamInputType {
K_ESteamInputType_Unknown = 0,
K_ESteamInputType_SteamController = 1,
K_ESteamInputType_XBox360Controller = 2,
@ -1335,8 +1264,7 @@ enum class ESteamInputType
};
Q_ENUM_NS(ESteamInputType)
enum class ESteamInputConfigurationEnableType
{
enum class ESteamInputConfigurationEnableType {
K_ESteamInputConfigurationEnableType_None = 0,
K_ESteamInputConfigurationEnableType_Playstation = 1,
K_ESteamInputConfigurationEnableType_Xbox = 2,
@ -1345,30 +1273,26 @@ enum class ESteamInputConfigurationEnableType
};
Q_ENUM_NS(ESteamInputConfigurationEnableType)
enum class ESteamInputLEDFlag
{
enum class ESteamInputLEDFlag {
K_ESteamInputLEDFlag_SetColor = 0,
K_ESteamInputLEDFlag_RestoreUserDefault = 1,
};
Q_ENUM_NS(ESteamInputLEDFlag)
enum class ESteamInputGlyphSize
{
enum class ESteamInputGlyphSize {
K_ESteamInputGlyphSize_Small = 0,
K_ESteamInputGlyphSize_Medium = 1,
K_ESteamInputGlyphSize_Large = 2,
};
Q_ENUM_NS(ESteamInputGlyphSize)
enum class ESteamInputActionEventType
{
enum class ESteamInputActionEventType {
ESteamInputActionEventType_DigitalAction = 0,
ESteamInputActionEventType_AnalogAction = 1,
};
Q_ENUM_NS(ESteamInputActionEventType)
enum class EControllerActionOrigin
{
enum class EControllerActionOrigin {
K_EControllerActionOrigin_None = 0,
K_EControllerActionOrigin_A = 1,
K_EControllerActionOrigin_B = 2,
@ -1679,15 +1603,13 @@ enum class EControllerActionOrigin
};
Q_ENUM_NS(EControllerActionOrigin)
enum class ESteamControllerLEDFlag
{
enum class ESteamControllerLEDFlag {
K_ESteamControllerLEDFlag_SetColor = 0,
K_ESteamControllerLEDFlag_RestoreUserDefault = 1,
};
Q_ENUM_NS(ESteamControllerLEDFlag)
enum class EUGCMatchingUGCType
{
enum class EUGCMatchingUGCType {
K_EUGCMatchingUGCType_Items = 0,
K_EUGCMatchingUGCType_Items_Mtx = 1,
K_EUGCMatchingUGCType_Items_ReadyToUse = 2,
@ -1705,8 +1627,7 @@ enum class EUGCMatchingUGCType
};
Q_ENUM_NS(EUGCMatchingUGCType)
enum class EUserUGCList
{
enum class EUserUGCList {
K_EUserUGCList_Published = 0,
K_EUserUGCList_VotedOn = 1,
K_EUserUGCList_VotedUp = 2,
@ -1719,8 +1640,7 @@ enum class EUserUGCList
};
Q_ENUM_NS(EUserUGCList)
enum class EUserUGCListSortOrder
{
enum class EUserUGCListSortOrder {
K_EUserUGCListSortOrder_CreationOrderDesc = 0,
K_EUserUGCListSortOrder_CreationOrderAsc = 1,
K_EUserUGCListSortOrder_TitleAsc = 2,
@ -1731,8 +1651,7 @@ enum class EUserUGCListSortOrder
};
Q_ENUM_NS(EUserUGCListSortOrder)
enum class EUGCQuery
{
enum class EUGCQuery {
K_EUGCQuery_RankedByVote = 0,
K_EUGCQuery_RankedByPublicationDate = 1,
K_EUGCQuery_AcceptedForGameRankedByAcceptanceDate = 2,
@ -1756,8 +1675,7 @@ enum class EUGCQuery
};
Q_ENUM_NS(EUGCQuery)
enum class EItemUpdateStatus
{
enum class EItemUpdateStatus {
K_EItemUpdateStatusInvalid = 0,
K_EItemUpdateStatusPreparingConfig = 1,
K_EItemUpdateStatusPreparingContent = 2,
@ -1767,8 +1685,7 @@ enum class EItemUpdateStatus
};
Q_ENUM_NS(EItemUpdateStatus)
enum class EItemState
{
enum class EItemState {
K_EItemStateNone = 0,
K_EItemStateSubscribed = 1,
K_EItemStateLegacyItem = 2,
@ -1779,8 +1696,7 @@ enum class EItemState
};
Q_ENUM_NS(EItemState)
enum class EItemStatistic
{
enum class EItemStatistic {
K_EItemStatistic_NumSubscriptions = 0,
K_EItemStatistic_NumFavorites = 1,
K_EItemStatistic_NumFollowers = 2,
@ -1797,8 +1713,7 @@ enum class EItemStatistic
};
Q_ENUM_NS(EItemStatistic)
enum class EItemPreviewType
{
enum class EItemPreviewType {
K_EItemPreviewType_Image = 0,
K_EItemPreviewType_YouTubeVideo = 1,
K_EItemPreviewType_Sketchfab = 2,
@ -1808,16 +1723,14 @@ enum class EItemPreviewType
};
Q_ENUM_NS(EItemPreviewType)
enum class ESteamItemFlags
{
enum class ESteamItemFlags {
K_ESteamItemNoTrade = 1,
K_ESteamItemRemoved = 256,
K_ESteamItemConsumed = 512,
};
Q_ENUM_NS(ESteamItemFlags)
enum class EParentalFeature
{
enum class EParentalFeature {
K_EFeatureInvalid = 0,
K_EFeatureStore = 1,
K_EFeatureCommunity = 2,
@ -1836,8 +1749,7 @@ enum class EParentalFeature
};
Q_ENUM_NS(EParentalFeature)
enum class ESteamDeviceFormFactor
{
enum class ESteamDeviceFormFactor {
K_ESteamDeviceFormFactorUnknown = 0,
K_ESteamDeviceFormFactorPhone = 1,
K_ESteamDeviceFormFactorTablet = 2,
@ -1846,8 +1758,7 @@ enum class ESteamDeviceFormFactor
};
Q_ENUM_NS(ESteamDeviceFormFactor)
enum class ESteamNetworkingAvailability
{
enum class ESteamNetworkingAvailability {
K_ESteamNetworkingAvailability_CannotTry = -102,
K_ESteamNetworkingAvailability_Failed = -101,
K_ESteamNetworkingAvailability_Previously = -100,
@ -1861,8 +1772,7 @@ enum class ESteamNetworkingAvailability
};
Q_ENUM_NS(ESteamNetworkingAvailability)
enum class ESteamNetworkingIdentityType
{
enum class ESteamNetworkingIdentityType {
K_ESteamNetworkingIdentityType_Invalid = 0,
K_ESteamNetworkingIdentityType_SteamID = 16,
K_ESteamNetworkingIdentityType_XboxPairwiseID = 17,
@ -1876,8 +1786,7 @@ enum class ESteamNetworkingIdentityType
};
Q_ENUM_NS(ESteamNetworkingIdentityType)
enum class ESteamNetworkingConnectionState
{
enum class ESteamNetworkingConnectionState {
K_ESteamNetworkingConnectionState_None = 0,
K_ESteamNetworkingConnectionState_Connecting = 1,
K_ESteamNetworkingConnectionState_FindingRoute = 2,
@ -1891,8 +1800,7 @@ enum class ESteamNetworkingConnectionState
};
Q_ENUM_NS(ESteamNetworkingConnectionState)
enum class ESteamNetConnectionEnd
{
enum class ESteamNetConnectionEnd {
K_ESteamNetConnectionEnd_Invalid = 0,
K_ESteamNetConnectionEnd_App_Min = 1000,
K_ESteamNetConnectionEnd_App_Generic = 1000,
@ -1929,8 +1837,7 @@ enum class ESteamNetConnectionEnd
};
Q_ENUM_NS(ESteamNetConnectionEnd)
enum class ESteamNetworkingConfigScope
{
enum class ESteamNetworkingConfigScope {
K_ESteamNetworkingConfig_Global = 1,
K_ESteamNetworkingConfig_SocketsInterface = 2,
K_ESteamNetworkingConfig_ListenSocket = 3,
@ -1939,8 +1846,7 @@ enum class ESteamNetworkingConfigScope
};
Q_ENUM_NS(ESteamNetworkingConfigScope)
enum class ESteamNetworkingConfigDataType
{
enum class ESteamNetworkingConfigDataType {
K_ESteamNetworkingConfig_Int32 = 1,
K_ESteamNetworkingConfig_Int64 = 2,
K_ESteamNetworkingConfig_Float = 3,
@ -1950,8 +1856,7 @@ enum class ESteamNetworkingConfigDataType
};
Q_ENUM_NS(ESteamNetworkingConfigDataType)
enum class ESteamNetworkingConfigValue
{
enum class ESteamNetworkingConfigValue {
K_ESteamNetworkingConfig_Invalid = 0,
K_ESteamNetworkingConfig_TimeoutInitial = 24,
K_ESteamNetworkingConfig_TimeoutConnected = 25,
@ -2011,8 +1916,7 @@ enum class ESteamNetworkingConfigValue
};
Q_ENUM_NS(ESteamNetworkingConfigValue)
enum class ESteamNetworkingGetConfigValueResult
{
enum class ESteamNetworkingGetConfigValueResult {
K_ESteamNetworkingGetConfigValue_BadValue = -1,
K_ESteamNetworkingGetConfigValue_BadScopeObj = -2,
K_ESteamNetworkingGetConfigValue_BufferTooSmall = -3,
@ -2022,8 +1926,7 @@ enum class ESteamNetworkingGetConfigValueResult
};
Q_ENUM_NS(ESteamNetworkingGetConfigValueResult)
enum class ESteamNetworkingSocketsDebugOutputType
{
enum class ESteamNetworkingSocketsDebugOutputType {
K_ESteamNetworkingSocketsDebugOutputType_None = 0,
K_ESteamNetworkingSocketsDebugOutputType_Bug = 1,
K_ESteamNetworkingSocketsDebugOutputType_Error = 2,
@ -2037,8 +1940,7 @@ enum class ESteamNetworkingSocketsDebugOutputType
};
Q_ENUM_NS(ESteamNetworkingSocketsDebugOutputType)
enum class EServerMode
{
enum class EServerMode {
EServerModeInvalid = 0,
EServerModeNoAuthentication = 1,
EServerModeAuthentication = 2,
@ -2046,7 +1948,4 @@ enum class EServerMode
};
Q_ENUM_NS(EServerMode)
}

View File

@ -11,8 +11,7 @@
#include "steamuniverse.h"
// General result codes
enum EResult
{
enum EResult {
k_EResultNone = 0, // no result
k_EResultOK = 1, // success
k_EResultFail = 2, // generic failure
@ -139,8 +138,7 @@ enum EResult
};
// Error codes for use with the voice functions
enum EVoiceResult
{
enum EVoiceResult {
k_EVoiceResultOK = 0,
k_EVoiceResultNotInitialized = 1,
k_EVoiceResultNotRecording = 2,
@ -155,8 +153,7 @@ enum EVoiceResult
};
// Result codes to GSHandleClientDeny/Kick
enum EDenyReason
{
enum EDenyReason {
k_EDenyInvalid = 0,
k_EDenyInvalidVersion = 1,
k_EDenyGeneric = 2,
@ -180,8 +177,7 @@ typedef uint32 HAuthTicket;
const HAuthTicket k_HAuthTicketInvalid = 0;
// results from BeginAuthSession
enum EBeginAuthSessionResult
{
enum EBeginAuthSessionResult {
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
@ -191,8 +187,7 @@ enum EBeginAuthSessionResult
};
// Callback values for callback ValidateAuthTicketResponse_t which is a response to BeginAuthSession
enum EAuthSessionResponse
{
enum EAuthSessionResponse {
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.
@ -206,17 +201,14 @@ enum EAuthSessionResponse
};
// results from UserHasLicenseForApp
enum EUserHasLicenseForAppResult
{
enum EUserHasLicenseForAppResult {
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
};
// Steam account types
enum EAccountType
{
enum EAccountType {
k_EAccountTypeInvalid = 0,
k_EAccountTypeIndividual = 1, // single user account
k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account
@ -233,13 +225,10 @@ enum EAccountType
k_EAccountTypeMax
};
//-----------------------------------------------------------------------------
// Purpose: Chat Entry Types (previously was only friend-to-friend message types)
//-----------------------------------------------------------------------------
enum EChatEntryType
{
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)
@ -258,12 +247,10 @@ enum EChatEntryType
k_EChatEntryTypeLinkBlocked = 14, // a link was removed by the chat filter.
};
//-----------------------------------------------------------------------------
// Purpose: Chat Room Enter Responses
//-----------------------------------------------------------------------------
enum EChatRoomEnterResponse
{
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
@ -281,15 +268,13 @@ enum EChatRoomEnterResponse
k_EChatRoomEnterResponseRatelimitExceeded = 15, // Join failed - to many join attempts in a very short period of time
};
const unsigned int k_unSteamAccountIDMask = 0xFFFFFFFF;
const unsigned int k_unSteamAccountInstanceMask = 0x000FFFFF;
const unsigned int k_unSteamUserDefaultInstance = 1; // fixed instance for all individual users
// 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
{
enum EChatSteamIDInstanceFlags {
k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags
k_EChatInstanceFlagClan = (k_unSteamAccountInstanceMask + 1) >> 1, // top bit
@ -299,24 +284,20 @@ enum EChatSteamIDInstanceFlags
// Max of 8 flags
};
//-----------------------------------------------------------------------------
// Purpose: Possible positions to tell the overlay to show notifications in
//-----------------------------------------------------------------------------
enum ENotificationPosition
{
enum ENotificationPosition {
k_EPositionTopLeft = 0,
k_EPositionTopRight = 1,
k_EPositionBottomLeft = 2,
k_EPositionBottomRight = 3,
};
//-----------------------------------------------------------------------------
// Purpose: Broadcast upload result details
//-----------------------------------------------------------------------------
enum EBroadcastUploadResult
{
enum EBroadcastUploadResult {
k_EBroadcastUploadResultNone = 0, // broadcast state unknown
k_EBroadcastUploadResultOK = 1, // broadcast was good, no problems
k_EBroadcastUploadResultInitFailed = 2, // broadcast init failed
@ -343,13 +324,11 @@ enum EBroadcastUploadResult
k_EBroadcastUploadResultAudioInitFailed = 23, // invalid audio settings
};
//-----------------------------------------------------------------------------
// Purpose: Reasons a user may not use the Community Market.
// Used in MarketEligibilityResponse_t.
//-----------------------------------------------------------------------------
enum EMarketNotAllowedReasonFlags
{
enum EMarketNotAllowedReasonFlags {
k_EMarketNotAllowedReason_None = 0,
// A back-end call failed or something that might work again on retry
@ -403,14 +382,12 @@ enum EMarketNotAllowedReasonFlags
k_EMarketNotAllowedReason_AcceptedWalletGift = (1 << 15),
};
//
// describes XP / progress restrictions to apply for games with duration control /
// anti-indulgence enabled for minor Steam China users.
//
// WARNING: DO NOT RENUMBER
enum EDurationControlProgress
{
enum EDurationControlProgress {
k_EDurationControlProgress_Full = 0, // Full progress
k_EDurationControlProgress_Half = 1, // deprecated - XP or persistent rewards should be halved
k_EDurationControlProgress_None = 2, // deprecated - XP or persistent rewards should be stopped
@ -420,13 +397,11 @@ enum EDurationControlProgress
k_EDurationControl_ExitSoon_Night = 5, // game running after day period, game should exit - steam will terminate the game soon
};
//
// describes which notification timer has expired, for steam china duration control feature
//
// WARNING: DO NOT RENUMBER
enum EDurationControlNotification
{
enum EDurationControlNotification {
k_EDurationControlNotification_None = 0, // just informing you about progress, no notification to show
k_EDurationControlNotification_1Hour = 1, // "you've been playing for N hours"
@ -439,28 +414,23 @@ enum EDurationControlNotification
k_EDurationControlNotification_ExitSoon_Night = 7, // game running after day period, game should exit - steam will terminate the game soon
};
//
// Specifies a game's online state in relation to duration control
//
enum EDurationControlOnlineState
{
enum EDurationControlOnlineState {
k_EDurationControlOnlineState_Invalid = 0, // nil value
k_EDurationControlOnlineState_Offline = 1, // currently in offline play - single-player, offline co-op, etc.
k_EDurationControlOnlineState_Online = 2, // currently in online play
k_EDurationControlOnlineState_OnlineHighPri = 3, // currently in online play and requests not to be interrupted
};
#pragma pack(push, 1)
#define CSTEAMID_DEFINED
// Steam ID structure (64 bits total)
class CSteamID
{
class CSteamID {
public:
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
@ -472,7 +442,6 @@ public:
m_steamid.m_comp.m_unAccountInstance = 0;
}
//-----------------------------------------------------------------------------
// Purpose: Constructor
// Input : unAccountID - 32-bit account ID
@ -484,7 +453,6 @@ public:
Set(unAccountID, eUniverse, eAccountType);
}
//-----------------------------------------------------------------------------
// Purpose: Constructor
// Input : unAccountID - 32-bit account ID
@ -500,7 +468,6 @@ public:
InstancedSet(unAccountID, unAccountInstance, eUniverse, eAccountType);
}
//-----------------------------------------------------------------------------
// Purpose: Constructor
// Input : ulSteamID - 64-bit representation of a Steam ID
@ -518,7 +485,6 @@ public:
}
#endif
//-----------------------------------------------------------------------------
// Purpose: Sets parameters for steam ID
// Input : unAccountID - 32-bit account ID
@ -531,17 +497,13 @@ public:
m_steamid.m_comp.m_EUniverse = eUniverse;
m_steamid.m_comp.m_EAccountType = eAccountType;
if ( eAccountType == k_EAccountTypeClan || eAccountType == k_EAccountTypeGameServer )
{
if (eAccountType == k_EAccountTypeClan || eAccountType == k_EAccountTypeGameServer) {
m_steamid.m_comp.m_unAccountInstance = 0;
}
else
{
} else {
m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDefaultInstance;
}
}
//-----------------------------------------------------------------------------
// Purpose: Sets parameters for steam ID
// Input : unAccountID - 32-bit account ID
@ -556,7 +518,6 @@ public:
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
@ -569,7 +530,6 @@ public:
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
@ -579,7 +539,6 @@ public:
m_steamid.m_unAll64Bits = ulSteamID;
}
//-----------------------------------------------------------------------------
// Purpose: Clear all fields, leaving an invalid ID.
//-----------------------------------------------------------------------------
@ -591,7 +550,6 @@ public:
m_steamid.m_comp.m_unAccountInstance = 0;
}
#if defined(INCLUDED_STEAM2_USERID_STRUCTS)
//-----------------------------------------------------------------------------
// Purpose: Initializes a steam ID from a Steam2 ID structure
@ -600,8 +558,7 @@ public:
//-----------------------------------------------------------------------------
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_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 = k_unSteamUserDefaultInstance; // Steam2 only knew one instance
@ -631,7 +588,6 @@ public:
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
@ -645,7 +601,6 @@ public:
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
//-----------------------------------------------------------------------------
@ -657,7 +612,6 @@ public:
m_steamid.m_comp.m_unAccountInstance = 0;
}
//-----------------------------------------------------------------------------
// Purpose: create an anonymous game server login to be filled in by the AM
//-----------------------------------------------------------------------------
@ -709,7 +663,6 @@ public:
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeContentServer;
}
//-----------------------------------------------------------------------------
// Purpose: Is this a clan account id?
//-----------------------------------------------------------------------------
@ -718,7 +671,6 @@ public:
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan;
}
//-----------------------------------------------------------------------------
// Purpose: Is this a chat account id?
//-----------------------------------------------------------------------------
@ -736,7 +688,6 @@ public:
&& (m_steamid.m_comp.m_unAccountInstance & k_EChatInstanceFlagLobby);
}
//-----------------------------------------------------------------------------
// Purpose: Is this an individual user account id?
//-----------------------------------------------------------------------------
@ -745,7 +696,6 @@ public:
return m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual || m_steamid.m_comp.m_EAccountType == k_EAccountTypeConsoleUser;
}
//-----------------------------------------------------------------------------
// Purpose: Is this an anonymous account?
//-----------------------------------------------------------------------------
@ -812,10 +762,8 @@ private:
CSteamID(int32);
// 64 bits total
union SteamID_t
{
struct SteamIDComponent_t
{
union SteamID_t {
struct SteamIDComponent_t {
#ifdef VALVE_BIG_ENDIAN
EUniverse m_EUniverse : 8; // universe this account belongs to
unsigned int m_EAccountType : 4; // type of account - can't show as EAccountType, due to signed / unsigned difference
@ -841,20 +789,17 @@ inline bool CSteamID::IsValid() const
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_EAccountType == k_EAccountTypeIndividual) {
if (m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != k_unSteamUserDefaultInstance)
return false;
}
if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan )
{
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;
}
if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer )
{
if (m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer) {
if (m_steamid.m_comp.m_unAccountID == 0)
return false;
// Any limit on instances? We use them for local users and bots
@ -877,7 +822,6 @@ inline bool CSteamID::IsValid() const
// wants to support the "Join Game" option in the friends list
#define k_steamIDNonSteamGS CSteamID(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
@ -892,14 +836,11 @@ CSteamID ClanIDFromChatID( const CSteamID &steamIDChat );
#endif // _STEAM
//-----------------------------------------------------------------------------
// Purpose: encapsulates an appID/modID pair
//-----------------------------------------------------------------------------
class CGameID
{
class CGameID {
public:
CGameID()
{
m_gameID.m_nType = k_EGameIDTypeApp;
@ -1017,8 +958,7 @@ public:
bool IsValid() const
{
// each type has it's own invalid fixed point:
switch( m_gameID.m_nType )
{
switch (m_gameID.m_nType) {
case k_EGameIDTypeApp:
return m_gameID.m_nAppID != k_uAppIdInvalid;
@ -1034,7 +974,6 @@ public:
default:
return false;
}
}
void Reset()
@ -1046,16 +985,14 @@ public:
// Internal stuff. Use the accessors above if possible
//
enum EGameIDType
{
enum EGameIDType {
k_EGameIDTypeApp = 0,
k_EGameIDTypeGameMod = 1,
k_EGameIDTypeShortcut = 2,
k_EGameIDTypeP2P = 3,
};
struct GameID_t
{
struct GameID_t {
#ifdef VALVE_BIG_ENDIAN
unsigned int m_nModID : 32;
unsigned int m_nType : 8;
@ -1067,8 +1004,7 @@ public:
#endif
};
union
{
union {
uint64 m_ulGameID;
GameID_t m_gameID;
};
@ -1078,15 +1014,13 @@ public:
const int k_cchGameExtraInfoMax = 64;
//-----------------------------------------------------------------------------
// Purpose: Passed as argument to SteamAPI_UseBreakpadCrashHandler to enable optional callback
// just before minidump file is captured after a crash has occurred. (Allows app to append additional comment data to the dump, etc.)
//-----------------------------------------------------------------------------
typedef void (*PFNPreMinidumpCallback)(void* context);
enum EGameSearchErrorCode_t
{
enum EGameSearchErrorCode_t {
k_EGameSearchErrorCode_OK = 1,
k_EGameSearchErrorCode_Failed_Search_Already_In_Progress = 2,
k_EGameSearchErrorCode_Failed_No_Search_In_Progress = 3,
@ -1098,8 +1032,7 @@ enum EGameSearchErrorCode_t
k_EGameSearchErrorCode_Failed_Unknown_Error = 9, // unknown error
};
enum EPlayerResult_t
{
enum EPlayerResult_t {
k_EPlayerResultFailedToConnect = 1, // failed to connect after confirming
k_EPlayerResultAbandoned = 2, // quit game without completing it
k_EPlayerResultKicked = 3, // kicked by other players/moderator/server rules
@ -1107,23 +1040,19 @@ enum EPlayerResult_t
k_EPlayerResultCompleted = 5, // player completed game
};
enum ESteamIPv6ConnectivityProtocol
{
enum ESteamIPv6ConnectivityProtocol {
k_ESteamIPv6ConnectivityProtocol_Invalid = 0,
k_ESteamIPv6ConnectivityProtocol_HTTP = 1, // because a proxy may make this different than other protocols
k_ESteamIPv6ConnectivityProtocol_UDP = 2, // test UDP connectivity. Uses a port that is commonly needed for other Steam stuff. If UDP works, TCP probably works.
};
// For the above transport protocol, what do we think the local machine's connectivity to the internet over ipv6 is like
enum ESteamIPv6ConnectivityState
{
enum ESteamIPv6ConnectivityState {
k_ESteamIPv6ConnectivityState_Unknown = 0, // We haven't run a test yet
k_ESteamIPv6ConnectivityState_Good = 1, // We have recently been able to make a request on ipv6 for the given protocol
k_ESteamIPv6ConnectivityState_Bad = 2, // We failed to make a request, either because this machine has no ipv6 address assigned, or it has no upstream connectivity
};
// Define compile time assert macros to let us validate the structure sizes.
#define VALVE_COMPILE_TIME_ASSERT(pred) typedef char compile_time_assert_type[(pred) ? 1 : -1];
@ -1146,8 +1075,7 @@ enum ESteamIPv6ConnectivityState
#error ???
#endif
typedef struct ValvePackingSentinel_t
{
typedef struct ValvePackingSentinel_t {
uint32 m_u32;
uint64 m_u64;
uint16 m_u16;
@ -1156,7 +1084,6 @@ typedef struct ValvePackingSentinel_t
#pragma pack(pop)
#if defined(VALVE_CALLBACK_PACK_SMALL)
VALVE_COMPILE_TIME_ASSERT(sizeof(ValvePackingSentinel_t) == 24)
#elif defined(VALVE_CALLBACK_PACK_LARGE)

View File

@ -12,7 +12,6 @@
static const int k_nSteamEncryptedAppTicketSymmetricKeyLen = 32;
S_API bool SteamEncryptedAppTicket_BDecryptTicket(const uint8* rgubTicketEncrypted, uint32 cubTicketEncrypted,
uint8* rgubTicketDecrypted, uint32* pcubTicketDecrypted,
const uint8 rgubKey[k_nSteamEncryptedAppTicketSymmetricKeyLen], int cubKey);

View File

@ -14,8 +14,7 @@
// HTTP related types
// This enum is used in client API methods, do not re-number existing values.
enum EHTTPMethod
{
enum EHTTPMethod {
k_EHTTPMethodInvalid = 0,
k_EHTTPMethodGET,
k_EHTTPMethodHEAD,
@ -32,11 +31,9 @@ enum EHTTPMethod
// k_EHTTPMethodCONNECT
};
// HTTP Status codes that the server can send in response to a request, see rfc2616 section 10.3 for descriptions
// of each of these.
enum EHTTPStatusCode
{
enum EHTTPStatusCode {
// Invalid status code (this isn't defined in HTTP, used to indicate unset in our code)
k_EHTTPStatusCodeInvalid = 0,

View File

@ -8,10 +8,10 @@
#define STEAMNETWORKINGTYPES
#pragma once
#include <string.h>
#include <stdint.h>
#include "steamtypes.h"
#include "steamclientpublic.h"
#include "steamtypes.h"
#include <stdint.h>
#include <string.h>
//-----------------------------------------------------------------------------
// SteamNetworkingSockets config.
@ -98,8 +98,7 @@ typedef uint32 SteamNetworkingPOPID;
typedef int64 SteamNetworkingMicroseconds;
/// Describe the status of a particular network resource
enum ESteamNetworkingAvailability
{
enum ESteamNetworkingAvailability {
// Negative values indicate a problem.
//
// In general, we will not automatically retry unless you take some action that
@ -119,7 +118,6 @@ enum ESteamNetworkingAvailability
k_ESteamNetworkingAvailability_Current = 100, // Resource is online/available
k_ESteamNetworkingAvailability_Unknown = 0, // Internal dummy/sentinel, or value is not applicable in this context
k_ESteamNetworkingAvailability__Force32bit = 0x7fffffff,
};
@ -129,8 +127,7 @@ enum ESteamNetworkingAvailability
//
/// Different methods of describing the identity of a network host
enum ESteamNetworkingIdentityType
{
enum ESteamNetworkingIdentityType {
// Dummy/empty/invalid.
// Please note that if we parse a string that we don't recognize
// but that appears reasonable, we will NOT use this type. Instead
@ -181,8 +178,7 @@ enum ESteamNetworkingIdentityType
/// Store an IP and port. IPv6 is always used; IPv4 is represented using
/// "IPv4-mapped" addresses: IPv4 aa.bb.cc.dd => IPv6 ::ffff:aabb:ccdd
/// (RFC 4291 section 2.5.5.2.)
struct SteamNetworkingIPAddr
{
struct SteamNetworkingIPAddr {
void Clear(); // Set everything to zero. E.g. [::]:0
bool IsIPv6AllZeros() const; // Return true if the IP is ::0. (Doesn't check port.)
void SetIPv6(const uint8* ipv6, uint16 nPort); // Set IPv6 address. IP is interpreted as bytes, so there are no endian issues. (Same as inaddr_in6.) The IP can be a mapped IPv4 address
@ -217,8 +213,7 @@ struct SteamNetworkingIPAddr
uint8 m_ip[4]; // NOTE: As bytes, i.e. network byte order
};
union
{
union {
uint8 m_ipv6[16];
IPv4MappedAddress m_ipv4;
};
@ -233,8 +228,7 @@ struct SteamNetworkingIPAddr
/// used on the wire in several places, even though it is less efficient, in order to
/// facilitate forward compatibility. (Old client code can handle an identity type that
/// it doesn't understand.)
struct SteamNetworkingIdentity
{
struct SteamNetworkingIdentity {
/// Type of identity.
ESteamNetworkingIdentityType m_eType;
@ -312,8 +306,7 @@ struct SteamNetworkingIdentity
//
/// High level connection status
enum ESteamNetworkingConnectionState
{
enum ESteamNetworkingConnectionState {
/// Dummy value used to indicate an error condition in the API.
/// Specified connection doesn't exist or has already been closed.
@ -419,8 +412,7 @@ enum ESteamNetworkingConnectionState
/// Enumerate various causes of connection termination. These are designed to work similar
/// to HTTP error codes: the numeric range gives you a rough classification as to the source
/// of the problem.
enum ESteamNetConnectionEnd
{
enum ESteamNetConnectionEnd {
// Invalid/sentinel value
k_ESteamNetConnectionEnd_Invalid = 0,
@ -625,8 +617,7 @@ const int k_cchSteamNetworkingMaxConnectionCloseReason = 128;
const int k_cchSteamNetworkingMaxConnectionDescription = 128;
/// Describe the state of a connection.
struct SteamNetConnectionInfo_t
{
struct SteamNetConnectionInfo_t {
/// Who is on the other end? Depending on the connection type and phase of the connection, we might not know
SteamNetworkingIdentity m_identityRemote;
@ -677,8 +668,7 @@ struct SteamNetConnectionInfo_t
/// Quick connection state, pared down to something you could call
/// more frequently without it being too big of a perf hit.
struct SteamNetworkingQuickConnectionStatus
{
struct SteamNetworkingQuickConnectionStatus {
/// High level state of the connection
ESteamNetworkingConnectionState m_eState;
@ -760,8 +750,7 @@ struct SteamNetworkingQuickConnectionStatus
const int k_cbMaxSteamNetworkingSocketsMessageSizeSend = 512 * 1024;
/// A message that has been received.
struct SteamNetworkingMessage_t
{
struct SteamNetworkingMessage_t {
/// Message payload
void* m_pData;
@ -840,7 +829,10 @@ struct SteamNetworkingMessage_t
// For code compatibility, some accessors
#ifndef API_GEN
inline uint32 GetSize() const { return m_cbSize; }
inline uint32 GetSize() const
{
return m_cbSize;
}
inline const void* GetData() const { return m_pData; }
inline int GetChannel() const { return m_nChannel; }
inline HSteamNetConnection GetConnection() const { return m_conn; }
@ -985,8 +977,7 @@ const int k_nSteamNetworkingSend_AutoRestartBrokenSession = 32;
/// send it over the wire, or persist it in a file or database! If you need
/// to do that, convert it to a string representation using the methods in
/// ISteamNetworkingUtils().
struct SteamNetworkPingLocation_t
{
struct SteamNetworkPingLocation_t {
uint8 m_data[512];
};
@ -1006,8 +997,7 @@ const int k_nSteamNetworkingPing_Unknown = -2;
//
/// Configuration values can be applied to different types of objects.
enum ESteamNetworkingConfigScope
{
enum ESteamNetworkingConfigScope {
/// Get/set global option, or defaults. Even options that apply to more specific scopes
/// have global scope, and you may be able to just change the global defaults. If you
@ -1034,8 +1024,7 @@ enum ESteamNetworkingConfigScope
};
// Different configuration values have different data types
enum ESteamNetworkingConfigDataType
{
enum ESteamNetworkingConfigDataType {
k_ESteamNetworkingConfig_Int32 = 1,
k_ESteamNetworkingConfig_Int64 = 2,
k_ESteamNetworkingConfig_Float = 3,
@ -1046,8 +1035,7 @@ enum ESteamNetworkingConfigDataType
};
/// Configuration options
enum ESteamNetworkingConfigValue
{
enum ESteamNetworkingConfigValue {
k_ESteamNetworkingConfig_Invalid = 0,
//
@ -1259,7 +1247,6 @@ enum ESteamNetworkingConfigValue
/// This value should not be read or written in any other context.
k_ESteamNetworkingConfig_LocalVirtualPort = 38,
//
// Simulating network conditions
//
@ -1298,7 +1285,6 @@ enum ESteamNetworkingConfigValue
// 0 only traces the info but no actual data bytes
k_ESteamNetworkingConfig_PacketTraceMaxBytes = 41,
// [global int32] Global UDP token bucket rate limits.
// "Rate" refers to the steady state rate. (Bytes/sec, the
// rate that tokens are put into the bucket.) "Burst"
@ -1498,8 +1484,7 @@ const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_All = 0x7fffffff;
/// when the object is created, we just iterate over the list of options and call
/// ISteamNetworkingUtils::SetConfigValueStruct, where the scope arguments are supplied by the
/// object being created.
struct SteamNetworkingConfigValue_t
{
struct SteamNetworkingConfigValue_t {
/// Which option is being set
ESteamNetworkingConfigValue m_eValue;
@ -1507,8 +1492,7 @@ struct SteamNetworkingConfigValue_t
ESteamNetworkingConfigDataType m_eDataType;
/// Option value
union
{
union {
int32_t m_int32;
int64_t m_int64;
float m_float;
@ -1552,8 +1536,7 @@ struct SteamNetworkingConfigValue_t
};
/// Return value of ISteamNetworkintgUtils::GetConfigValue
enum ESteamNetworkingGetConfigValueResult
{
enum ESteamNetworkingGetConfigValueResult {
k_ESteamNetworkingGetConfigValue_BadValue = -1, // No such configuration value
k_ESteamNetworkingGetConfigValue_BadScopeObj = -2, // Bad connection handle, etc
k_ESteamNetworkingGetConfigValue_BufferTooSmall = -3, // Couldn't fit the result in your buffer
@ -1569,8 +1552,7 @@ enum ESteamNetworkingGetConfigValueResult
/// Detail level for diagnostic output callback.
/// See ISteamNetworkingUtils::SetDebugOutputFunction
enum ESteamNetworkingSocketsDebugOutputType
{
enum ESteamNetworkingSocketsDebugOutputType {
k_ESteamNetworkingSocketsDebugOutputType_None = 0,
k_ESteamNetworkingSocketsDebugOutputType_Bug = 1, // You used the API incorrectly, or an internal error happened
k_ESteamNetworkingSocketsDebugOutputType_Error = 2, // Run-time error condition that isn't the result of a bug. (E.g. we are offline, cannot bind a port, etc)
@ -1605,11 +1587,9 @@ inline SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString( const char
//
// There is also extra paranoia to make sure the bytes are not treated as signed.
SteamNetworkingPOPID result = (uint32)(uint8)pszCode[0] << 16U;
if ( pszCode[1] )
{
if (pszCode[1]) {
result |= ((uint32)(uint8)pszCode[1] << 8U);
if ( pszCode[2] )
{
if (pszCode[2]) {
result |= (uint32)(uint8)pszCode[2] | ((uint32)(uint8)pszCode[3] << 24U);
}
}
@ -1634,15 +1614,14 @@ inline void GetSteamNetworkingLocationPOPStringFromID( SteamNetworkingPOPID id,
const SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ((uint32)'d' << 16U) | ((uint32)'e' << 8U) | (uint32)'v';
/// Utility class for printing a SteamNetworkingPOPID.
struct SteamNetworkingPOPIDRender
{
struct SteamNetworkingPOPIDRender {
SteamNetworkingPOPIDRender(SteamNetworkingPOPID x) { GetSteamNetworkingLocationPOPStringFromID(x, buf); }
inline const char* c_str() const { return buf; }
private:
char buf[8];
};
///////////////////////////////////////////////////////////////////////////////
//
// Internal stuff
@ -1653,12 +1632,40 @@ typedef SteamNetworkingMessage_t ISteamNetworkingMessage;
typedef SteamNetworkingErrMsg SteamDatagramErrMsg;
inline void SteamNetworkingIPAddr::Clear() { memset(this, 0, sizeof(*this)); }
inline bool SteamNetworkingIPAddr::IsIPv6AllZeros() const { const uint64 *q = (const uint64 *)m_ipv6; return q[0] == 0 && q[1] == 0; }
inline void SteamNetworkingIPAddr::SetIPv6( const uint8 *ipv6, uint16 nPort ) { memcpy( m_ipv6, ipv6, 16 ); m_port = nPort; }
inline void SteamNetworkingIPAddr::SetIPv4( uint32 nIP, uint16 nPort ) { m_ipv4.m_8zeros = 0; m_ipv4.m_0000 = 0; m_ipv4.m_ffff = 0xffff; m_ipv4.m_ip[0] = uint8(nIP>>24); m_ipv4.m_ip[1] = uint8(nIP>>16); m_ipv4.m_ip[2] = uint8(nIP>>8); m_ipv4.m_ip[3] = uint8(nIP); m_port = nPort; }
inline bool SteamNetworkingIPAddr::IsIPv6AllZeros() const
{
const uint64* q = (const uint64*)m_ipv6;
return q[0] == 0 && q[1] == 0;
}
inline void SteamNetworkingIPAddr::SetIPv6(const uint8* ipv6, uint16 nPort)
{
memcpy(m_ipv6, ipv6, 16);
m_port = nPort;
}
inline void SteamNetworkingIPAddr::SetIPv4(uint32 nIP, uint16 nPort)
{
m_ipv4.m_8zeros = 0;
m_ipv4.m_0000 = 0;
m_ipv4.m_ffff = 0xffff;
m_ipv4.m_ip[0] = uint8(nIP >> 24);
m_ipv4.m_ip[1] = uint8(nIP >> 16);
m_ipv4.m_ip[2] = uint8(nIP >> 8);
m_ipv4.m_ip[3] = uint8(nIP);
m_port = nPort;
}
inline bool SteamNetworkingIPAddr::IsIPv4() const { return m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0xffff; }
inline uint32 SteamNetworkingIPAddr::GetIPv4() const { return IsIPv4() ? ((uint32(m_ipv4.m_ip[0]) << 24) | (uint32(m_ipv4.m_ip[1]) << 16) | (uint32(m_ipv4.m_ip[2]) << 8) | uint32(m_ipv4.m_ip[3])) : 0; }
inline void SteamNetworkingIPAddr::SetIPv6LocalHost( uint16 nPort ) { m_ipv4.m_8zeros = 0; m_ipv4.m_0000 = 0; m_ipv4.m_ffff = 0; m_ipv6[12] = 0; m_ipv6[13] = 0; m_ipv6[14] = 0; m_ipv6[15] = 1; m_port = nPort; }
inline void SteamNetworkingIPAddr::SetIPv6LocalHost(uint16 nPort)
{
m_ipv4.m_8zeros = 0;
m_ipv4.m_0000 = 0;
m_ipv4.m_ffff = 0;
m_ipv6[12] = 0;
m_ipv6[13] = 0;
m_ipv6[14] = 0;
m_ipv6[15] = 1;
m_port = nPort;
}
inline bool SteamNetworkingIPAddr::IsLocalHost() const { return (m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0 && m_ipv6[12] == 0 && m_ipv6[13] == 0 && m_ipv6[14] == 0 && m_ipv6[15] == 1) || (GetIPv4() == 0x7f000001); }
inline bool SteamNetworkingIPAddr::operator==(const SteamNetworkingIPAddr& x) const { return memcmp(this, &x, sizeof(SteamNetworkingIPAddr)) == 0; }
@ -1666,19 +1673,54 @@ inline void SteamNetworkingIdentity::Clear() { memset( this, 0, sizeof(*this) );
inline bool SteamNetworkingIdentity::IsInvalid() const { return m_eType == k_ESteamNetworkingIdentityType_Invalid; }
inline void SteamNetworkingIdentity::SetSteamID(CSteamID steamID) { SetSteamID64(steamID.ConvertToUint64()); }
inline CSteamID SteamNetworkingIdentity::GetSteamID() const { return CSteamID(GetSteamID64()); }
inline void SteamNetworkingIdentity::SetSteamID64( uint64 steamID ) { m_eType = k_ESteamNetworkingIdentityType_SteamID; m_cbSize = sizeof( m_steamID64 ); m_steamID64 = steamID; }
inline void SteamNetworkingIdentity::SetSteamID64(uint64 steamID)
{
m_eType = k_ESteamNetworkingIdentityType_SteamID;
m_cbSize = sizeof(m_steamID64);
m_steamID64 = steamID;
}
inline uint64 SteamNetworkingIdentity::GetSteamID64() const { return m_eType == k_ESteamNetworkingIdentityType_SteamID ? m_steamID64 : 0; }
inline void SteamNetworkingIdentity::SetIPAddr( const SteamNetworkingIPAddr &addr ) { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip = addr; }
inline void SteamNetworkingIdentity::SetIPAddr(const SteamNetworkingIPAddr& addr)
{
m_eType = k_ESteamNetworkingIdentityType_IPAddress;
m_cbSize = (int)sizeof(m_ip);
m_ip = addr;
}
inline const SteamNetworkingIPAddr* SteamNetworkingIdentity::GetIPAddr() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? &m_ip : NULL; }
inline void SteamNetworkingIdentity::SetLocalHost() { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip.SetIPv6LocalHost(); }
inline void SteamNetworkingIdentity::SetLocalHost()
{
m_eType = k_ESteamNetworkingIdentityType_IPAddress;
m_cbSize = (int)sizeof(m_ip);
m_ip.SetIPv6LocalHost();
}
inline bool SteamNetworkingIdentity::IsLocalHost() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress && m_ip.IsLocalHost(); }
inline bool SteamNetworkingIdentity::SetGenericString( const char *pszString ) { size_t l = strlen( pszString ); if ( l >= sizeof(m_szGenericString) ) return false;
m_eType = k_ESteamNetworkingIdentityType_GenericString; m_cbSize = int(l+1); memcpy( m_szGenericString, pszString, m_cbSize ); return true; }
inline bool SteamNetworkingIdentity::SetGenericString(const char* pszString)
{
size_t l = strlen(pszString);
if (l >= sizeof(m_szGenericString))
return false;
m_eType = k_ESteamNetworkingIdentityType_GenericString;
m_cbSize = int(l + 1);
memcpy(m_szGenericString, pszString, m_cbSize);
return true;
}
inline const char* SteamNetworkingIdentity::GetGenericString() const { return m_eType == k_ESteamNetworkingIdentityType_GenericString ? m_szGenericString : NULL; }
inline bool SteamNetworkingIdentity::SetGenericBytes( const void *data, size_t cbLen ) { if ( cbLen > sizeof(m_genericBytes) ) return false;
m_eType = k_ESteamNetworkingIdentityType_GenericBytes; m_cbSize = int(cbLen); memcpy( m_genericBytes, data, m_cbSize ); return true; }
inline const uint8 *SteamNetworkingIdentity::GetGenericBytes( int &cbLen ) const { if ( m_eType != k_ESteamNetworkingIdentityType_GenericBytes ) return NULL;
cbLen = m_cbSize; return m_genericBytes; }
inline bool SteamNetworkingIdentity::SetGenericBytes(const void* data, size_t cbLen)
{
if (cbLen > sizeof(m_genericBytes))
return false;
m_eType = k_ESteamNetworkingIdentityType_GenericBytes;
m_cbSize = int(cbLen);
memcpy(m_genericBytes, data, m_cbSize);
return true;
}
inline const uint8* SteamNetworkingIdentity::GetGenericBytes(int& cbLen) const
{
if (m_eType != k_ESteamNetworkingIdentityType_GenericBytes)
return NULL;
cbLen = m_cbSize;
return m_genericBytes;
}
inline bool SteamNetworkingIdentity::operator==(const SteamNetworkingIdentity& x) const { return m_eType == x.m_eType && m_cbSize == x.m_cbSize && memcmp(m_genericBytes, x.m_genericBytes, m_cbSize) == 0; }
inline void SteamNetworkingMessage_t::Release() { (*m_pfnRelease)(this); }

View File

@ -22,8 +22,7 @@
#define STEAM_PS3_LANGUAGE_MAX 64
#define STEAM_PS3_REGION_CODE_MAX 16
#define STEAM_PS3_CURRENT_PARAMS_VER 2
struct SteamPS3Params_t
{
struct SteamPS3Params_t {
uint32 m_unVersion; // set to STEAM_PS3_CURRENT_PARAMS_VER
void* pReserved;
@ -63,41 +62,35 @@ struct SteamPS3Params_t
// like: profile_on, profile_off, profile_dump, mem_stats, mem_validate.
unsigned int m_cSteamInputTTY;
struct Ps3netInit_t
{
struct Ps3netInit_t {
bool m_bNeedInit;
void* m_pMemory;
int m_nMemorySize;
int m_flags;
} m_sysNetInitInfo;
struct Ps3jpgInit_t
{
struct Ps3jpgInit_t {
bool m_bNeedInit;
} m_sysJpgInitInfo;
struct Ps3pngInit_t
{
struct Ps3pngInit_t {
bool m_bNeedInit;
} m_sysPngInitInfo;
struct Ps3sysutilUserInfo_t
{
struct Ps3sysutilUserInfo_t {
bool m_bNeedInit;
} m_sysSysUtilUserInfo;
bool m_bIncludeNewsPage;
};
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
// PlayStation 3 memory structure
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
#define STEAMPS3_MALLOC_INUSE 0x53D04A51
#define STEAMPS3_MALLOC_SYSTEM 0x0D102C48
#define STEAMPS3_MALLOC_OK 0xFFD04A51
struct SteamPS3Memory_t
{
struct SteamPS3Memory_t {
bool m_bSingleAllocation; // If true, Steam will request one 6MB allocation and use the returned memory for all future allocations
// If false, Steam will make call malloc for each allocation
@ -108,5 +101,4 @@ struct SteamPS3Memory_t
size_t (*m_pUsable_size)(void*);
};
#endif // STEAMPS3PARAMS_H

View File

@ -110,16 +110,14 @@ typedef uint32 AccountID_t;
typedef uint64 PartyBeaconID_t;
const PartyBeaconID_t k_ulPartyBeaconIdInvalid = 0;
enum ESteamIPType
{
enum ESteamIPType {
k_ESteamIPTypeIPv4 = 0,
k_ESteamIPTypeIPv6 = 1,
};
#pragma pack(push, 1)
struct SteamIPAddress_t
{
struct SteamIPAddress_t {
union {
uint32 m_unIPv4; // Host order
@ -133,12 +131,9 @@ struct SteamIPAddress_t
bool IsSet() const
{
if ( k_ESteamIPTypeIPv4 == m_eType )
{
if (k_ESteamIPTypeIPv4 == m_eType) {
return m_unIPv4 != 0;
}
else
{
} else {
return m_ipv6Qword[0] != 0 || m_ipv6Qword[1] != 0;
}
}

View File

@ -10,10 +10,8 @@
#pragma once
#endif
// Steam universes. Each universe is a self-contained Steam instance.
enum EUniverse
{
enum EUniverse {
k_EUniverseInvalid = 0,
k_EUniversePublic = 1,
k_EUniverseBeta = 2,
@ -23,5 +21,4 @@ enum EUniverse
k_EUniverseMax
};
#endif // STEAMUNIVERSE_H

312
Tools/build.py Normal file → Executable file
View File

@ -1,18 +1,49 @@
from sys import platform
from concurrent.futures import ThreadPoolExecutor
#!/usr/bin/python3
import platform
import os
import sys
import subprocess
import shutil
import argparse
from execute_util import execute
import time
from pathlib import Path
from concurrent.futures import ThreadPoolExecutor
qt_version = "6.2.2"
steam_build = "OFF"
build_tests = "OFF"
create_installer = "OFF"
qt_path = ""
cmake_target_triplet = ""
cmake_build_type = ""
executable_file_ending = ""
deploy_command = ""
aqt_path = ""
ifw_root_path = ""
cmake_bin_path = ""
file_endings = [".ninja_deps", ".ninja", ".ninja_log", ".lib", ".a", ".dylib", ".exp",
".manifest", ".cmake", ".cbp", "CMakeCache.txt"]
vcvars = "" # We support 2019 or 2022
# Based on https://gist.github.com/l2m2/0d3146c53c767841c6ba8c4edbeb4c2c
def get_vs_env_dict():
# Hardcoded VS path
# check if vcvars64.bat is available
msvc_2019_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat"
msvc_2022_path = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat"
if Path(msvc_2019_path).exists():
vcvars = msvc_2019_path
elif Path(msvc_2022_path).exists():
vcvars = msvc_2022_path
else:
raise RuntimeError("No Visual Studio installation found, only 2019 and 2022 are supported.")
def vs_env_dict():
vsvar32 = 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat'
cmd = [vsvar32, '&&', 'set']
print("Loading MSVC env variables via {vcvars}".format(vcvars=vcvars))
cmd = [vcvars, '&&', 'set']
popen = subprocess.Popen(
cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = popen.communicate()
@ -22,38 +53,87 @@ def vs_env_dict():
output = stdout.decode("mbcs").split("\r\n")
return dict((e[0].upper(), e[1]) for e in [p.rstrip().split("=", 1) for p in output] if len(e) == 2)
# Based on https://stackoverflow.com/questions/7207309/how-to-run-functions-in-parallel
def run_io_tasks_in_parallel(tasks):
with ThreadPoolExecutor() as executor:
running_tasks = [executor.submit(task) for task in tasks]
for running_task in running_tasks:
running_task.result()
def clean_build_dir(build_dir):
if isinstance(build_dir, str):
build_dir = Path(build_dir)
if build_dir.exists():
print(f"Remove previous build folder: {build_dir}")
shutil.rmtree(build_dir)
build_dir.mkdir(parents=True, exist_ok=True)
# MAIN
def run(cmd, cwd = Path.cwd()):
result = subprocess.run(cmd, shell=True, cwd=cwd)
if result.returncode != 0:
raise RuntimeError(f"Failed to execute {cmd}")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Build and Package ScreenPlay')
parser.add_argument('-t', action="store", dest="build_type",
parser.add_argument('-type', action="store", dest="build_type",
help="Build type. This is either debug or release.")
parser.add_argument('-sign', action="store", dest="sign_build",
help="Enable if you want to sign the apps. This is macos only for now.")
parser.add_argument('-steam', action="store", dest="steam_build",
parser.add_argument('-use-aqt', action="store_true", dest="use_aqt",
help="Absolute qt path. If not set the default path is used\Windows: C:\Qt\nLinux & macOS:~/Qt/.")
parser.add_argument('-sign', action="store_true", dest="sign_build",
help="Enable if you want to sign the apps. This is macOS only for now.")
parser.add_argument('-steam', action="store_true", dest="steam_build",
help="Enable if you want to build the Steam workshop plugin.")
parser.add_argument('-tests', action="store", dest="build_tests",
parser.add_argument('-tests', action="store_true", dest="build_tests",
help="Build tests.")
parser.add_argument('-installer', action="store", dest="create_installer",
parser.add_argument('-installer', action="store_true", dest="create_installer",
help="Create a installer.")
args = parser.parse_args()
if not args.build_type:
print("Build type argument is missing (release,debug). Example: python build.py -t release -steam=True")
sys.exit(1)
print("Build type argument is missing (release, debug). E.g: python build.py -t release -steam=True")
exit(1)
qt_version = "6.2.2"
steam_build = "OFF"
build_tests = "OFF"
create_installer = "OFF"
root_path = Path.cwd()
if root_path.name == "Tools":
root_path = root_path.parent
if args.use_aqt:
aqt_path = Path(("{root_path}/../aqt/").format(root_path=root_path)).resolve()
if not Path(aqt_path).exists():
print("aqt path does not exist at %s. Please make sure you have installed aqt." % aqt_path)
exit(2)
if platform.system() == "Windows":
cmake_target_triplet = "x64-windows"
cmake_build_type = args.build_type
windows_msvc = "msvc2019_64"
executable_file_ending = ".exe"
qt_path = aqt_path.joinpath(qt_version).joinpath(windows_msvc) if args.use_aqt else Path(f"C:/Qt/{qt_version}/{windows_msvc}")
vs_env_dict = get_vs_env_dict()
vs_env_dict["PATH"] = vs_env_dict["PATH"] + ";" + str(qt_path) + "\\bin"
os.environ.update(vs_env_dict)
deploy_command = "windeployqt.exe --{type} --qmldir ../../{app}/qml {app}{executable_file_ending}"
elif platform.system() == "Darwin":
cmake_target_triplet = "x64-osx"
qt_path = aqt_path.joinpath(f"{qt_version}/macos") if args.use_aqt else Path(f"~/Qt/{qt_version}/macos")
deploy_command = "{prefix_path}/bin/macdeployqt {app}.app -qmldir=../../{app}/qml -executable={app}.app/Contents/MacOS/{app}"
elif platform.system() == "Linux":
cmake_target_triplet = "x64-linux"
qt_path = aqt_path.joinpath(f"{qt_version}/gcc_64") if args.use_aqt else Path(f"~/Qt/{qt_version}/gcc_64")
if shutil.which("cqtdeployer"):
deploy_command = "cqtdeployer -qmlDir ../../{app}/qml -bin {app}"
else:
print("cqtdeployer not available, build may be incomplete and incompatible with some distro (typically Ubuntu)")
else:
raise NotImplementedError("Unsupported platform, ScreenPlay only supports Windows, macOS and Linux.")
# Prepare
cmake_toolchain_file = ("'{root_path}/../ScreenPlay-vcpkg/scripts/buildsystems/vcpkg.cmake'").format(root_path=root_path)
print("cmake_toolchain_file: %s " % cmake_toolchain_file)
print("Starting build with type %s. Qt Version: %s. Root path: %s" % (args.build_type, qt_version, root_path))
if args.steam_build:
steam_build = "ON"
@ -61,144 +141,106 @@ if args.build_tests:
build_tests = "ON"
if args.create_installer:
create_installer = "ON"
ifw_root_path = ("{aqt_path}\\Tools\\QtInstallerFramework\\4.2").format(aqt_path=aqt_path)
print("Starting build with type %s. Qt Version: %s" %
(args.build_type, qt_version))
cmake_prefix_path = ""
cmake_target_triplet = ""
cmake_build_type = ""
executable_file_ending = ""
deploy_command = ""
if platform == "win32":
print("Loading MSVC env variables via vsvars32.bat")
cmake_build_type = args.build_type
windows_msvc = "msvc2019_64"
executable_file_ending = ".exe"
deploy_command = "windeployqt.exe --{type} --qmldir ../../{app}/qml {app}{executable_file_ending}"
dict = vs_env_dict()
dict["PATH"] = dict["PATH"] + ";C:\\Qt\\" + qt_version + \
"\\" + windows_msvc + "\\bin;C:\\Qt\\Tools\\QtCreator\\bin"
os.environ.update(dict)
cmake_prefix_path = "c:/Qt/" + qt_version + "/" + windows_msvc
cmake_target_triplet = "x64-windows"
elif platform == "darwin":
cmake_prefix_path = "~/Qt/" + qt_version + "/macos"
deploy_command = "{prefix_path}/bin/macdeployqt {app}.app -qmldir=../../{app}/qml -executable={app}.app/Contents/MacOS/{app}"
cmake_target_triplet = "x64-osx"
elif platform == "linux":
deploy_command = "cqtdeployer -qmlDir ../../{app}/qml -bin {app}"
cmake_prefix_path = "~/Qt/" + qt_version + "/gcc_64"
cmake_target_triplet = "x64-linux"
# REMOVE OLD BUILD FOLDER
cwd = os.getcwd()
root_path = os.path.abspath((cwd+"/../"))
os.chdir(root_path)
cmake_toolchain_file = (
"'{root_path}/../ScreenPlay-vcpkg/scripts/buildsystems/vcpkg.cmake'").format(root_path=root_path)
print("cmake_toolchain_file: %s " % cmake_toolchain_file)
build_folder = root_path + "/build-" + \
cmake_target_triplet + "-" + args.build_type
if os.path.isdir(build_folder):
print("Remove previous build folder: " + build_folder)
shutil.rmtree(build_folder)
os.mkdir(build_folder)
os.chdir(build_folder)
cmake_configure_command = """cmake ../
-DCMAKE_PREFIX_PATH={prefix_path}
-DCMAKE_BUILD_TYPE={type}
-DCMAKE_TOOLCHAIN_FILE={toolchain}
-DVCPKG_TARGET_TRIPLET={triplet}
-DSCREENPLAY_STEAM={steam}
-DSCREENPLAY_TESTS={tests}
-DSCREENPLAY_CREATE_INSTALLER={installer}
-G "CodeBlocks - Ninja"
-B.
""".format(
cmake_configure_command = 'cmake ../ \
-DCMAKE_PREFIX_PATH={prefix_path} \
-DCMAKE_BUILD_TYPE={type} \
-DVCPKG_TARGET_TRIPLET={triplet} \
-DCMAKE_TOOLCHAIN_FILE={toolchain} \
-DSCREENPLAY_STEAM={steam} \
-DSCREENPLAY_TESTS={tests} \
-DSCREENPLAY_CREATE_INSTALLER={installer} \
-DSCREENPLAY_IFW_ROOT:STRING={ifw} \
-G "CodeBlocks - Ninja" \
-B.'.format(
prefix_path=qt_path,
type=args.build_type,
prefix_path=cmake_prefix_path,
triplet=cmake_target_triplet,
toolchain=cmake_toolchain_file,
steam=steam_build,
tests = build_tests,
installer= create_installer
).replace("\n", "")
installer= create_installer,
ifw= ifw_root_path)
execute(cmake_configure_command)
execute("cmake --build . --target all")
os.chdir("bin")
build_folder = root_path.joinpath(f"build-{cmake_target_triplet}-{args.build_type}")
clean_build_dir(build_folder)
execute(deploy_command.format(
# Build
start_time = time.time()
run(cmake_configure_command, cwd=build_folder)
run("cmake --build . --target all", cwd=build_folder)
bin_dir = build_folder.joinpath("bin")
# Deploy dependencies
if deploy_command: # Only deploy if we have the dependencies
print("Executing deploy commands...")
run(deploy_command.format(
type=cmake_build_type,
prefix_path=cmake_prefix_path,
prefix_path=qt_path,
app="ScreenPlay",
executable_file_ending=executable_file_ending))
executable_file_ending=executable_file_ending), cwd=bin_dir)
execute(deploy_command.format(
run(deploy_command.format(
type=cmake_build_type,
prefix_path=cmake_prefix_path,
prefix_path=qt_path,
app="ScreenPlayWidget",
executable_file_ending=executable_file_ending))
executable_file_ending=executable_file_ending), cwd=bin_dir)
execute(deploy_command.format(
run(deploy_command.format(
type=cmake_build_type,
prefix_path=cmake_prefix_path,
prefix_path=qt_path,
app="ScreenPlayWallpaper",
executable_file_ending=executable_file_ending))
executable_file_ending=executable_file_ending), cwd=bin_dir)
else:
print("Not executing deploy commands due to missing dependencies.")
if platform == "darwin" and args.sign_build:
execute("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --entitlements \"../../ScreenPlay/entitlements.plist\" --deep \"ScreenPlay.app/\"")
execute("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --deep \"ScreenPlayWallpaper.app/\"")
execute("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --deep \"ScreenPlayWidget.app/\"")
# Post-build
if platform.system() == "Darwin" and args.sign_build:
print("Remove workshop build folder (macos only).")
shutil.rmtree(build_folder + "/bin/workshop")
execute("codesign --verify --verbose=4 \"ScreenPlay.app/\"")
execute("codesign --verify --verbose=4 \"ScreenPlayWallpaper.app/\"")
execute("codesign --verify --verbose=4 \"ScreenPlayWidget.app/\"")
run("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --entitlements \"../../ScreenPlay/entitlements.plist\" --deep \"ScreenPlay.app/\"", cwd=bin_dir)
run("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --deep \"ScreenPlayWallpaper.app/\"", cwd=bin_dir)
run("codesign --deep -f -s \"Developer ID Application: Elias Steurer (V887LHYKRH)\" --timestamp --options \"runtime\" -f --deep \"ScreenPlayWidget.app/\"", cwd=bin_dir)
run("codesign --verify --verbose=4 \"ScreenPlay.app/\"", cwd=bin_dir)
run("codesign --verify --verbose=4 \"ScreenPlayWallpaper.app/\"", cwd=bin_dir)
run("codesign --verify --verbose=4 \"ScreenPlayWidget.app/\"", cwd=bin_dir)
run_io_tasks_in_parallel([
lambda: execute(
"xcnotary notarize ScreenPlay.app -d kelteseth@gmail.com -k ScreenPlay"),
lambda: execute(
"xcnotary notarize ScreenPlayWallpaper.app -d kelteseth@gmail.com -k ScreenPlay"),
lambda: execute(
"xcnotary notarize ScreenPlayWidget.app -d kelteseth@gmail.com -k ScreenPlay")
lambda: run("xcnotary notarize ScreenPlay.app -d kelteseth@gmail.com -k ScreenPlay", cwd=bin_dir),
lambda: run("xcnotary notarize ScreenPlayWallpaper.app -d kelteseth@gmail.com -k ScreenPlay", cwd=bin_dir),
lambda: run("xcnotary notarize ScreenPlayWidget.app -d kelteseth@gmail.com -k ScreenPlay", cwd=bin_dir)
])
execute("spctl --assess --verbose \"ScreenPlay.app/\"")
execute("spctl --assess --verbose \"ScreenPlayWallpaper.app/\"")
execute("spctl --assess --verbose \"ScreenPlayWidget.app/\"")
run("spctl --assess --verbose \"ScreenPlay.app/\"", cwd=bin_dir)
run("spctl --assess --verbose \"ScreenPlayWallpaper.app/\"", cwd=bin_dir)
run("spctl --assess --verbose \"ScreenPlayWidget.app/\"", cwd=bin_dir)
# Some dlls like openssl do no longer get copied automatically.
# Lets just copy all of them into bin.
if platform == "win32":
vcpkg_bin_path = os.path.abspath(
("{root_path}/../ScreenPlay-vcpkg/installed/x64-windows/bin").format(root_path=root_path))
if platform.system() == "Windows":
vcpkg_bin_path = Path(("{root_path}/../ScreenPlay-vcpkg/installed/x64-windows/bin").format(root_path=root_path)).resolve()
print(vcpkg_bin_path)
for basename in os.listdir(vcpkg_bin_path):
if basename.endswith('.dll'):
pathname = os.path.join(vcpkg_bin_path, basename)
print(pathname, os.getcwd())
if os.path.isfile(pathname):
shutil.copy2(pathname, os.getcwd())
for file in vcpkg_bin_path.iterdir():
if file.suffix == ".dll" and file.is_file():
print(file, bin_dir)
shutil.copy2(file, bin_dir)
file_endings = [".ninja_deps", ".ninja", ".ninja_log", ".lib", ".a", ".dylib", ".exp",
".manifest", ".cmake", ".cbp", "CMakeCache.txt"]
for filename in os.listdir(os.getcwd()):
for ending in file_endings:
if filename.endswith(ending):
full_file_path = os.path.join(os.getcwd(), filename)
print("Remove: %s" % full_file_path)
os.remove(full_file_path)
for file_ending in file_endings:
for file in bin_dir.rglob("*" + file_ending):
if file.is_file():
print("Remove: %s" % file.resolve())
file.unlink()
if args.create_installer:
os.chdir("..")
execute("cpack")
os.chdir(build_folder)
print("Running cpack at: ", os.getcwd())
print("SKIP INSTALLER UNTIL CMAKE OUT OF SPACE ERROR IS FIXED IN 3.23")
print("https://cmake.org/cmake/help/git-stage/cpack_gen/ifw.html#variable:CPACK_IFW_ARCHIVE_FORMAT")
#run("cpack", cwd=build_folder)
print("Time taken: {}s".format(time.time() - start_time))

View File

@ -37,9 +37,9 @@ def execute(command, workingDir=".", ignore_error=False, use_shell=True, print_c
process.communicate()
exitCode = process.returncode
if exitCode and ignore_error:
printYellow("Ignore error ")
return
if exitCode:
if ignore_error:
printYellow("Ignore error {}".format(exitCode))
else:
raise subprocess.CalledProcessError(exitCode, command)

131
Tools/setup.py Normal file → Executable file
View File

@ -1,76 +1,117 @@
import os
import sys
#!/usr/bin/python3
import argparse
import shutil
from platform import system
from pathlib import Path
from execute_util import execute
from download_ffmpeg import download_prebuild_ffmpeg
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description='Installs ScreenPlay dependencies.')
parser.add_argument(
'--path', help='You can manually set the vcpkg path via -p. This path must be an absolute path and without the ScreenPlay-vcpkg name! py.exe .\setup.py --path "D:/Backup/Code/Qt/" ')
args = parser.parse_args()
# ScreenPlay source and ScreenPlay-vcpkg have to be on the same file system hierarchy
project_source_parent_path = ""
project_source_path = os.path.abspath(os.path.join(os.getcwd(), "../"))
if args.path is not None:
project_source_parent_path = os.path.abspath(args.path)
else:
print("No --path provided!")
project_source_parent_path = os.path.abspath(
os.path.join(os.getcwd(), "../../"))
print("\nproject_source_parent_path: ", project_source_parent_path,
"\nproject_source_path: ", project_source_path,
"\n")
execute("git clone https://github.com/microsoft/vcpkg.git ScreenPlay-vcpkg",
project_source_parent_path, True)
vcpkg_path = os.path.join(project_source_parent_path, "ScreenPlay-vcpkg")
print("vcpkg_path: ", vcpkg_path)
vcpkg_version = "5ddd7f0" # Master 02.12.2021
print("Build vcpkg ", vcpkg_version)
execute("git fetch", vcpkg_path)
execute("git checkout {}".format(vcpkg_version), vcpkg_path)
vcpkg_version = "1085a57da0725c19e19586025438e8c16f34c890" # Master 31.12.2021
vcpkg_packages_list = [
"openssl",
"curl",
"sentry-native",
"doctest",
"benchmark",
"cpp-httplib"
]
class commands_list():
def __init__(self):
self.commands = []
def add(self, command, cwd=".", ignore_error=False, use_shell=True, print_command=True):
self.commands.append({
"command": command,
"cwd": cwd,
"ignore_error": ignore_error,
"use_shell": use_shell,
"print_command": print_command
})
def get_commands(self):
return self.commands
def execute_commands(self):
'''
This function execute all commands added to the list.
'''
for command in self.commands:
# Check if the command if a string.
if isinstance(command["command"], str):
execute(command["command"], command["cwd"], command["ignore_error"], command["use_shell"], command["print_command"])
else:
# Function call
command["command"]()
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description='Install ScreenPlay dependencies.')
parser.add_argument(
'--path', help='Manually set the vcpkg path. The path must be an absolute path \
without the ScreenPlay-vcpkg folder (E.g. py .\setup.py --path "D:/Backup/Code/Qt/")')
args = parser.parse_args()
# ScreenPlay source and ScreenPlay-vcpkg have to be on the same file system hierarchy
project_source_parent_path = ""
project_source_path = Path.cwd().resolve()
if project_source_path.name == "Tools":
project_source_path = project_source_path.parent
if args.path is not None:
project_source_parent_path = Path(args.path).resolve()
else:
print("No --path provided, using default path.")
project_source_parent_path = project_source_path.parent
print("project_source_parent_path: {}".format(project_source_parent_path))
print("project_source_path: {}".format(project_source_path))
vcpkg_path = project_source_parent_path.joinpath("ScreenPlay-vcpkg")
print("vcpkg_path: ", vcpkg_path)
print("Build vcpkg ", vcpkg_version)
vcpkg_triplet = ""
vcpkg_command = ""
platform_command = commands_list()
if sys.platform == "win32":
if system() == "Windows":
vcpkg_command = "vcpkg.exe"
vcpkg_packages_list.append("infoware[d3d]")
execute("download_ffmpeg.bat", project_source_path + "/Tools", False)
execute("bootstrap-vcpkg.bat", vcpkg_path, False)
if shutil.which("pwsh"):
print("Using experimental pwsh, may not work properly.")
platform_command.add("pwsh.exe -NoProfile -ExecutionPolicy Bypass .\scripts\\bootstrap.ps1", vcpkg_path)
else:
platform_command.add("bootstrap-vcpkg.bat", vcpkg_path, False)
platform_command.add("download_ffmpeg.bat", project_source_path.joinpath("Tools"), False)
vcpkg_triplet = "x64-windows"
elif sys.platform == "darwin":
elif system() == "Darwin":
vcpkg_command = "./vcpkg"
vcpkg_packages_list.append("infoware[opencl]")
vcpkg_packages_list.append("curl") # Hidden dependency from sentry
execute("chmod +x bootstrap-vcpkg.sh", vcpkg_path)
execute("./bootstrap-vcpkg.sh", vcpkg_path, False)
execute("chmod +x vcpkg", vcpkg_path)
platform_command.add("chmod +x bootstrap-vcpkg.sh", vcpkg_path)
platform_command.add("./bootstrap-vcpkg.sh", vcpkg_path, False)
platform_command.add("chmod +x vcpkg", vcpkg_path)
vcpkg_triplet = "x64-osx"
download_prebuild_ffmpeg()
elif sys.platform == "linux":
platform_command.add(download_prebuild_ffmpeg)
elif system() == "Linux":
vcpkg_command = "./vcpkg"
#vcpkg_packages_list.append("infoware[opengl]")
execute("chmod +x bootstrap-vcpkg.sh", vcpkg_path)
execute("./bootstrap-vcpkg.sh", vcpkg_path, False)
execute("chmod +x vcpkg", vcpkg_path)
platform_command.add("chmod +x bootstrap-vcpkg.sh", vcpkg_path)
platform_command.add("./bootstrap-vcpkg.sh", vcpkg_path, False)
platform_command.add("chmod +x vcpkg", vcpkg_path)
vcpkg_triplet = "x64-linux"
else:
raise NotImplementedError("Unknown system: {}".format(system()))
execute("git clone https://github.com/microsoft/vcpkg.git ScreenPlay-vcpkg", project_source_parent_path, True)
execute("git fetch", vcpkg_path)
execute("git checkout {}".format(vcpkg_version), vcpkg_path)
platform_command.execute_commands() # Execute platform specific commands.
vcpkg_packages = " ".join(vcpkg_packages_list)
execute("{} remove --outdated --recurse".format(vcpkg_command), vcpkg_path, False)
execute("{} update".format(vcpkg_command), vcpkg_path, False)
execute("{} upgrade --no-dry-run".format(vcpkg_command),
vcpkg_path, False)