### GOG GALAXY SDK - Specific Listener Examples Source: https://docs.gog.com/galaxyapi/hierarchy Illustrates specific listener implementations derived from the type-aware listener template for various GOG Galaxy SDK events. Examples include listeners for friend invitations, lobby events, leaderboards, file sharing, and telemetry. ```C++ class CISentFriendInvitationListRetrieveListener : public CGalaxyTypeAwareListener {}; class CILobbyLeftListener : public CGalaxyTypeAwareListener {}; class CILeaderboardsRetrieveListener : public CGalaxyTypeAwareListener {}; class CIFriendInvitationListRetrieveListener : public CGalaxyTypeAwareListener {}; class CIFileShareListener : public CGalaxyTypeAwareListener {}; class CIEncryptedAppTicketListener : public CGalaxyTypeAwareListener {}; class CIChatRoomMessagesRetrieveListener : public CGalaxyTypeAwareListener {}; class CIUserStatsAndAchievementsRetrieveListener : public CGalaxyTypeAwareListener {}; class CITelemetryEventSendListener : public CGalaxyTypeAwareListener {}; class CILobbyEnteredListener : public CGalaxyTypeAwareListener {}; class CIGameJoinRequestedListener : public CGalaxyTypeAwareListener {}; class CILobbyOwnerChangeListener : public CGalaxyTypeAwareListener {}; class CILobbyMemberStateListener : public CGalaxyTypeAwareListener {}; class CILobbyListListener : public CGalaxyTypeAwareListener {}; class CILobbyDataRetrieveListener : public CGalaxyTypeAwareListener {}; ``` -------------------------------- ### Other Session Start Listener Interface Source: https://docs.gog.com/galaxyapi/IUser_8h Defines the IOtherSessionStartListener interface, which is used to handle events triggered when other sessions related to the user start. This is important for coordinating multiple concurrent sessions or activities. ```c++ class IOtherSessionStartListener { // Listener for the events related to starting of other sessions. More... }; ``` -------------------------------- ### GOG Galaxy Other Session Start Listener Source: https://docs.gog.com/galaxyapi/IUser_8h_source An interface for listening to events related to the start of other user sessions. It provides a callback for when a session is successfully started. ```C++ class IOtherSessionStartListener { public: virtual void OnOtherSessionStarted() = 0; }; ``` -------------------------------- ### IUtils Interface Source: https://docs.gog.com/galaxyapi/IUtils_8h_source Provides utility functions for interacting with GOG GALAXY features, including image retrieval, overlay management, and service state checks. It includes methods for getting image dimensions and RGBA data, registering for notifications, showing web pages in the overlay, checking overlay visibility, retrieving overlay state, disabling overlay popups, and getting the GOG services connection state. ```C++ class IUtils { public: virtual ~IUtils() { } virtual void GetImageSize(uint32_t imageID, int32_t& width, int32_t& height) = 0; virtual void GetImageRGBA(uint32_t imageID, void* buffer, uint32_t bufferLength) = 0; virtual void RegisterForNotification(const char* type) = 0; virtual uint32_t GetNotification(NotificationID notificationID, bool& consumable, char* type, uint32_t typeLength, void* content, uint32_t contentSize) = 0; virtual void ShowOverlayWithWebPage(const char* url) = 0; virtual bool IsOverlayVisible() = 0; virtual OverlayState GetOverlayState() = 0; virtual void DisableOverlayPopups(const char* popupGroup) = 0; virtual GogServicesConnectionState GetGogServicesConnectionState() = 0; }; } } #endif ``` -------------------------------- ### Initialize Galaxy Peer Source: https://docs.gog.com/galaxyapi/GalaxyApi_8h_source Initializes the Galaxy Peer with specified credentials. This function is essential for starting any Galaxy API operations. ```C++ GALAXY_DLL_EXPORT void GALAXY_CALLTYPE Init(const InitOptions &initOptions) ``` -------------------------------- ### Get Utils Interface Source: https://docs.gog.com/galaxyapi/GalaxyApi_8h_source Returns an instance of IUtils for managing images. This interface provides utility functions for image handling. ```C++ GALAXY_DLL_EXPORT IUtils *GALAXY_CALLTYPE Utils() ``` -------------------------------- ### SetLobbyJoinable - Galaxy API Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IMatchmaking Sets whether a specified lobby is joinable. If a lobby is not joinable, no new members can join, and it will be hidden from matchmaking. Newly created lobbies are joinable by default. This function is useful for closing a lobby when no new members are allowed, for example, after a game has started. ```cpp virtual void SetLobbyJoinable(GalaxyID _lobbyID, bool _joinable, ILobbyDataUpdateListener* const _listener = NULL) ``` -------------------------------- ### GOG GALAXY SDK Initialization Options Source: https://docs.gog.com/galaxyapi/functions_vars Defines key parameters for initializing the GOG GALAXY SDK. These include client credentials, configuration paths, and network host details. ```C++ clientID : InitOptions clientSecret : InitOptions configFilePath : InitOptions host : InitOptions port : InitOptions storagePath : InitOptions galaxyThreadFactory : InitOptions ``` -------------------------------- ### GOG GALAXY SDK Initialization Libraries Source: https://docs.gog.com/galaxyapi/index To begin developing with the Galaxy SDK, you need to link your application with the appropriate libraries. These libraries are loaded dynamically and should be placed in the same directory as your executable. ```C++ #include // On Windows: // Galaxy.lib or Galaxy64.lib // On MacOSX: // libGalaxy64.dylib ``` -------------------------------- ### Check if DLC is Installed Source: https://docs.gog.com/galaxyapi/IApps_8h_source Synchronously checks if a specific DLC is installed for the current user. This method returns a boolean value indicating the installation status. ```C++ #include "IApps.h" // Assuming 'apps' is a pointer to an IApps object ProductID myDlcId = 12345; bool isInstalled = apps->IsDlcInstalled(myDlcId); ``` -------------------------------- ### GOG GALAXY SDK - InitOptions Header Source: https://docs.gog.com/galaxyapi/files The InitOptions.h file contains a class that holds the parameters required for initializing the GOG GALAXY SDK. Proper initialization is the first step to using the SDK's features. ```c++ #include "InitOptions.h" ``` -------------------------------- ### Initialize GOG GALAXY SDK Source: https://docs.gog.com/galaxyapi/GalaxyApi_8h_source Initializes the GOG GALAXY SDK with the provided options. This function must be called before any other SDK functions. It sets up the necessary components for the SDK to operate. ```C++ void GALAXY_CALLTYPE Init(const InitOptions& initOptions); ``` -------------------------------- ### Other Session Start Listener Source: https://docs.gog.com/galaxyapi/hierarchy Listens for events related to the start of other user sessions. ```C++ CIOtherSessionStartListener | Listener for the events related to starting of other sessions ``` -------------------------------- ### GOG GALAXY SDK - IMatchmaking Header Source: https://docs.gog.com/galaxyapi/files The IMatchmaking.h file contains data structures and interfaces related to matchmaking services in the GOG GALAXY SDK. This allows players to find and join games together. ```c++ #include "IMatchmaking.h" ``` -------------------------------- ### Check if DLC is Installed Source: https://docs.gog.com/galaxyapi/index Determines if a DLC is installed by calling IApps::IsDlcInstalled() with the Product ID. Does not require the user to be online. ```cpp bool isInstalled = IApps::IsDlcInstalled(dlcProductID); // Requires Init() to be called first. ``` -------------------------------- ### Check DLC Installation Status Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IApps Determines if a specific DLC is installed for the current product. This function is a pure virtual method. ```C++ virtual bool IsDlcInstalled (ProductID productID)=0 ``` -------------------------------- ### Initialize GOG Galaxy SDK with InitOptions Source: https://docs.gog.com/galaxyapi/InitOptions_8h_source Defines the InitOptions struct used to configure the GOG Galaxy SDK during initialization. It includes a constructor that takes various parameters such as client ID, client secret, configuration file path, custom allocator, storage path, host, port, and a thread factory. ```C++ #ifndef GALAXY_INIT_OPTIONS_H #define GALAXY_INIT_OPTIONS_H #include "GalaxyAllocator.h" #include "GalaxyThread.h" #include "stdint.h" #include namespace galaxy { namespace api { struct InitOptions { InitOptions( const char* _clientID, const char* _clientSecret, const char* _configFilePath = ".", GalaxyAllocator* _galaxyAllocator = NULL, const char* _storagePath = NULL, const char* _host = NULL, uint16_t _port = 0, IGalaxyThreadFactory* _galaxyThreadFactory = NULL) : clientID(_clientID) , clientSecret(_clientSecret) , configFilePath(_configFilePath) , storagePath(_storagePath) , galaxyAllocator(_galaxyAllocator) , galaxyThreadFactory(_galaxyThreadFactory) , host(_host) , port(_port) { } const char* clientID; const char* clientSecret; const char* configFilePath; const char* storagePath; GalaxyAllocator* galaxyAllocator; IGalaxyThreadFactory* galaxyThreadFactory; const char* host; uint16_t port; }; } } #endif ``` -------------------------------- ### C++ Global Other Session Start Listener Source: https://docs.gog.com/galaxyapi/group__api Defines a globally self-registering listener for other session start events. This is a C++ typedef for `SelfRegisteringListener`. ```C++ typedef SelfRegisteringListener | GlobalOtherSessionStartListener ``` -------------------------------- ### Initialize GOG GALAXY SDK Source: https://docs.gog.com/galaxyapi/GalaxyApi_8h Initializes the Galaxy Peer with specified credentials. This function is essential for starting any interaction with the GOG GALAXY services. ```c++ #include "GalaxyExport.h" #include "InitOptions.h" GALAXY_DLL_EXPORT void GALAXY_CALLTYPE Init(const InitOptions &initOptions); ``` -------------------------------- ### C++ Get Rich Presence Count Source: https://docs.gog.com/galaxyapi/IFriends_8h_source Gets the number of rich presence entries for a given user. If no userID is provided, it counts for the current user. ```C++ virtual uint32_t GetRichPresenceCount(GalaxyID userID = GalaxyID()) = 0; ``` -------------------------------- ### Initialize Game Server Source: https://docs.gog.com/galaxyapi/GalaxyGameServerApi_8h Initializes the Galaxy Game Server with specified credentials. This function requires the InitOptions structure containing the necessary configuration. ```C++ #include "GalaxyExport.h" #include "InitOptions.h" GALAXY_DLL_EXPORT void GALAXY_CALLTYPE InitGameServer(const InitOptions &initOptions); ``` -------------------------------- ### GOG Galaxy API Cloud Storage Get File List Listener Source: https://docs.gog.com/galaxyapi/IListenerRegistrar_8h_source Interface for handling cloud storage get file list events. Used by ICloudStorageGetFileListListener. ```C++ #define CLOUD_STORAGE_GET_FILE_LIST Used by ICloudStorageGetFileListListener. **Definition:** IListenerRegistrar.h:90 galaxy::api::SPECIFIC_USER_DATA ``` -------------------------------- ### C++: IMatchmaking Interface - CreateLobby Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h_source Initiates the creation of a new lobby. Requires specifying lobby type, maximum members, joinability, topology, and optional listeners for creation and entry events. ```C++ virtual void CreateLobby( LobbyType lobbyType, uint32_t maxMembers, bool joinable, LobbyTopologyType lobbyTopologyType, ILobbyCreatedListener* const lobbyCreatedListener = NULL, ILobbyEnteredListener* const lobbyEnteredListener = NULL) = 0; ``` -------------------------------- ### Check DLC Installation Status - C++ Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IApps-members Checks if a specific downloadable content (DLC) is installed for a given product ID. This is a pure virtual function of the IApps interface. ```C++ IsDlcInstalled(ProductID productID)=0 ``` -------------------------------- ### GOG Galaxy API - Initialization and Allocation Functions Source: https://docs.gog.com/galaxyapi/functions_g Includes functions for initializing the GOG Galaxy SDK and managing memory allocation. These involve GalaxyAllocator, InitOptions, and related functions. ```C++ GalaxyAllocator() galaxyAllocator : InitOptions galaxyFree : GalaxyAllocator galaxyMalloc : GalaxyAllocator galaxyRealloc : GalaxyAllocator galaxyThreadFactory : InitOptions ``` -------------------------------- ### C++ Game Server Global Other Session Start Listener Source: https://docs.gog.com/galaxyapi/group__api Defines a globally self-registering listener for other session start events, specifically for game servers. This is a C++ typedef for `SelfRegisteringListener`. ```C++ typedef SelfRegisteringListener | GameServerGlobalOtherSessionStartListener ``` -------------------------------- ### GOG GALAXY SDK - InitOptions Function Source: https://docs.gog.com/galaxyapi/functions_func_i Initializes options for the GOG GALAXY SDK. This function is crucial for setting up the SDK's configuration. ```cpp InitOptions() : InitOptions ``` -------------------------------- ### InitOptions Constructor Source: https://docs.gog.com/galaxyapi/structgalaxy_1_1api_1_1InitOptions Initializes the InitOptions object with various parameters required for GOG Galaxy SDK configuration. This includes client credentials, file paths, memory allocator, and network settings. ```C++ InitOptions( const char * __clientID_, const char * __clientSecret_, const char * __configFilePath_ = ".", GalaxyAllocator * __galaxyAllocator_ = NULL, const char * __storagePath_ = NULL, const char * __host_ = NULL, uint16_t __port_ = 0, IGalaxyThreadFactory * __galaxyThreadFactory_ = NULL ) ``` -------------------------------- ### Set and Get Galaxy API Lobby Properties Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IMatchmaking Manages custom key-value properties for a lobby. Allows setting, getting, and deleting properties, as well as retrieving the count and data by index. ```C++ virtual void SetLobbyData (GalaxyID lobbyID, const char *key, const char *value, ILobbyDataUpdateListener *const listener=NULL)=0 ``` ```C++ virtual uint32_t GetLobbyDataCount (GalaxyID lobbyID)=0 ``` ```C++ virtual bool GetLobbyDataByIndex (GalaxyID lobbyID, uint32_t index, char *key, uint32_t keyLength, char *value, uint32_t valueLength)=0 ``` ```C++ virtual void DeleteLobbyData (GalaxyID lobbyID, const char *key, ILobbyDataUpdateListener *const listener=NULL)=0 ``` -------------------------------- ### Init Options Source: https://docs.gog.com/galaxyapi/hierarchy Configuration options used for initializing the Galaxy SDK. ```C++ CInitOptions | The group of options used for Init configuration ``` -------------------------------- ### Show Web Page in Overlay (C++) Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IUtils Displays a specified web page within the GOG Galaxy overlay. The overlay must be initialized prior to this call. The URL parameter has a limit of 2047 bytes. ```C++ virtual void ShowOverlayWithWebPage(const char * _url_) pure virtual ``` -------------------------------- ### Manage Galaxy API Lobby Members Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IMatchmaking Functions to manage the number of members in a lobby and retrieve information about lobby members. Includes setting the maximum number of members, getting the current maximum, and getting the number of current members. ```C++ virtual void SetMaxNumLobbyMembers (GalaxyID lobbyID, uint32_t maxNumLobbyMembers, ILobbyDataUpdateListener *const listener=NULL)=0 ``` ```C++ virtual uint32_t GetMaxNumLobbyMembers (GalaxyID lobbyID)=0 ``` ```C++ virtual uint32_t GetNumLobbyMembers (GalaxyID lobbyID)=0 ``` ```C++ virtual GalaxyID GetLobbyMemberByIndex (GalaxyID lobbyID, uint32_t index)=0 ``` -------------------------------- ### GOG Overlay Initialization State Change Listener Source: https://docs.gog.com/galaxyapi/IUtils_8h_source Defines the interface for listening to changes in the GOG overlay's initialization state. Includes a globally self-registering listener. ```C++ namespace galaxy { namespace api { // Listener for the event of changing overlay state. // Definition: IUtils.h:61 class IOverlayInitializationStateChangeListener { public: virtual void OnOverlayStateChanged(OverlayState overlayState) = 0; }; // Globally self-registering version of IOverlayStateChangeListener. // Definition: IUtils.h:75 class GlobalOverlayInitializationStateChangeListener : public SelfRegisteringListener {}; } } // State of the overlay. // Definition: IUtils.h:29 // Using a placeholder for OverlayState as its definition is not provided. // enum OverlayState { OVERLAY_STATE_UNDEFINED, OVERLAY_STATE_VISIBLE, OVERLAY_STATE_HIDDEN }; ``` -------------------------------- ### GOG GALAXY SDK: IOtherSessionStartListener Interface Source: https://docs.gog.com/galaxyapi/IUser_8h_source Defines the interface for listening to events when another user's session starts. It provides a callback for when a session is initiated by another user. ```C++ #include "GalaxyID.h" #include "IListenerRegistrar.h" namespace galaxy { namespace api { class IOtherSessionStartListener : public GalaxyTypeAwareListener { public: virtual void OnOtherSessionStarted() = 0; }; typedef SelfRegisteringListener GlobalOtherSessionStartListener; typedef SelfRegisteringListener GameServerGlobalOtherSessionStartListener; ``` -------------------------------- ### Get Session ID Source: https://docs.gog.com/galaxyapi/IUser_8h_source Retrieves the current session identifier. ```C++ virtual SessionID GetSessionID() = 0; ``` -------------------------------- ### Get ID Token Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IUser Returns the ID token for the current PlayFab session. ```C++ virtual const char * | GetIDToken ()=0 ``` -------------------------------- ### Implement IOtherSessionStartListener Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IOtherSessionStartListener The IOtherSessionStartListener class is an abstract base class for handling notifications when another session starts. Implement this interface to receive these events. ```C++ #include class MyOtherSessionStartListener : public IOtherSessionStartListener { public: virtual void OnOtherSessionStarted() override { // Handle the event here } }; ``` -------------------------------- ### Create OpenID Connection Source: https://docs.gog.com/galaxyapi/IUser_8h_source Establishes an OpenID connection for authentication. It can optionally ignore nonces and accepts a listener for callbacks. ```C++ virtual void CreateOpenIDConnection(const char* secretKey, const char* titleID, const char* connectionID, bool ignoreNonce = true, IPlayFabCreateOpenIDConnectionListener* const listener = NULL) = 0; ``` -------------------------------- ### Get Refresh Token Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IUser Returns the refresh token for the current PlayFab session. ```C++ virtual const char * | GetRefreshToken ()=0 ``` -------------------------------- ### Get File Count Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage Returns the total number of files available in the storage. ```C++ virtual uint32_t GetFileCount() ``` -------------------------------- ### GOG GALAXY SDK - IUtils Header Source: https://docs.gog.com/galaxyapi/files The IUtils.h file provides data structures and interfaces related to common utility functions used across the GOG GALAXY SDK. This header offers helpful tools for various tasks. ```c++ #include "IUtils.h" ``` -------------------------------- ### GOG API Utility Functions Source: https://docs.gog.com/galaxyapi/IUtils_8h_source Provides core utility functions for interacting with the GOG Galaxy overlay and services. Includes functions for checking overlay status, managing notifications, and retrieving image data. ```C++ namespace galaxy { namespace api { // Interface for managing images and overlay features. // Definition: IUtils.h:142 class IUtils { public: // Return current visibility of the overlay. virtual bool IsOverlayVisible() = 0; // Register for notifications of a specified type. virtual void RegisterForNotification(const char *type) = 0; // Shows web page in the overlay. virtual void ShowOverlayWithWebPage(const char *url) = 0; // Reads a specified notification. virtual uint32_t GetNotification(NotificationID notificationID, bool &consumable, char *type, uint32_t typeLength, void *content, uint32_t contentSize) = 0; // Reads width and height of the image of a specified ID. virtual void GetImageSize(uint32_t imageID, int32_t &width, int32_t &height) = 0; // Return current state of the connection to GOG services. virtual GogServicesConnectionState GetGogServicesConnectionState() = 0; // Return current state of the overlay. virtual OverlayState GetOverlayState() = 0; // Disable overlay pop-up notifications. virtual void DisableOverlayPopups(const char *popupGroup) = 0; // Reads the image of a specified ID. virtual void GetImageRGBA(uint32_t imageID, void *buffer, uint32_t bufferLength) = 0; }; } } ``` -------------------------------- ### Get File Size (GalaxyAPI) Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage Retrieves the size of a specified file in bytes. ```C++ virtual uint32_t GetFileSize(const char *fileName) = 0; ``` -------------------------------- ### Get User Persona State Source: https://docs.gog.com/galaxyapi/IFriends_8h_source Retrieves the current persona state of the user. ```cpp virtual PersonaState GetPersonaState()=0 ``` -------------------------------- ### C++: IMatchmaking Interface - RequestLobbyList Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h_source Requests a list of available lobbies. Can optionally include a flag to allow full lobbies and a listener for the results. ```C++ virtual void RequestLobbyList(bool allowFullLobbies = false, ILobbyListListener* const listener = NULL) = 0; ``` -------------------------------- ### C++ Get Persona Name Source: https://docs.gog.com/galaxyapi/IFriends_8h_source Retrieves the persona name of the current user. ```C++ virtual const char* GetPersonaName() = 0; ``` -------------------------------- ### C++: IMatchmaking Interface - Lobby Management Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h_source Includes functions to retrieve lobby IDs by index, join a specific lobby, and leave a lobby. Optional listeners can be provided for join and leave events. ```C++ virtual GalaxyID GetLobbyByIndex(uint32_t index) = 0; virtual void JoinLobby(GalaxyID lobbyID, ILobbyEnteredListener* const listener = NULL) = 0; virtual void LeaveLobby(GalaxyID lobbyID, ILobbyLeftListener* const listener = NULL) = 0; ``` -------------------------------- ### Galaxy API: Get Lobby Type Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h_source Retrieves the type of a specified lobby. ```cpp virtual LobbyType GetLobbyType(GalaxyID lobbyID)=0 ``` -------------------------------- ### Get Lobby Owner Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h_source Retrieves the GalaxyID of the current owner of a specified lobby. ```C++ virtual GalaxyID GetLobbyOwner(GalaxyID lobbyID) = 0; ``` -------------------------------- ### Get ID Token Source: https://docs.gog.com/galaxyapi/IUser_8h_source Retrieves the current ID token as a C-style string. ```C++ virtual const char* GetIDToken() = 0; ``` -------------------------------- ### GOG GALAXY SDK - GalaxyApi Header Source: https://docs.gog.com/galaxyapi/files The GalaxyApi.h file serves as a central include file, bringing in all other necessary files to work with the GOG GALAXY library. This simplifies project setup by providing a single point of inclusion for core SDK functionality. ```c++ #include "GalaxyApi.h" ``` -------------------------------- ### InitOptions Constructor Source: https://docs.gog.com/galaxyapi/structgalaxy_1_1api_1_1InitOptions The constructor for the InitOptions struct, used to set up configuration parameters for initializing the GOG Galaxy API. It accepts client credentials and optional parameters for customization. ```c++ InitOptions(const char *_clientID, const char *_clientSecret, const char *_configFilePath=".", GalaxyAllocator *_galaxyAllocator=NULL, const char *_storagePath=NULL, uint16_t _port=0, IGalaxyThreadFactory *_galaxyThreadFactory=NULL) ``` -------------------------------- ### Get Refresh Token Source: https://docs.gog.com/galaxyapi/IUser_8h_source Retrieves the current refresh token as a C-style string. ```C++ virtual const char* GetRefreshToken() = 0; ``` -------------------------------- ### Galaxy API: Create Lobby Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h_source Creates a new game lobby with specified properties. This function allows configuration of lobby type, maximum members, joinability, and topology. It can also accept listeners for lobby creation and entry events. ```cpp virtual void CreateLobby(LobbyType lobbyType, uint32_t maxMembers, bool joinable, LobbyTopologyType lobbyTopologyType, ILobbyCreatedListener *const lobbyCreatedListener=NULL, ILobbyEnteredListener *const lobbyEnteredListener=NULL)=0 ``` -------------------------------- ### Get Access Token Source: https://docs.gog.com/galaxyapi/IUser_8h_source Retrieves the current access token as a C-style string. ```C++ virtual const char* GetAccessToken() = 0; ``` -------------------------------- ### GOG GALAXY SDK: Utility Functions Source: https://docs.gog.com/galaxyapi/functions_func_s Function for displaying a web page within the GOG GALAXY overlay. ```cpp ShowOverlayWithWebPage() : IUtils ``` -------------------------------- ### Create Lobby (C++) Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IMatchmaking Creates a new game lobby with specified parameters such as type, maximum members, joinability, and topology. This is an asynchronous call, with responses handled by provided listener interfaces. The owning user automatically enters the lobby upon successful creation. ```C++ virtual void CreateLobby(LobbyType _lobbyType, uint32_t _maxMembers, bool _joinable, LobbyTopologyType _lobbyTopologyType, ILobbyCreatedListener *const _lobbyCreatedListener = NULL, ILobbyEnteredListener *const _lobbyEnteredListener = NULL)=0 ``` -------------------------------- ### Get Shared File Size (GalaxyAPI) Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage Retrieves the size of a downloaded shared file. ```C++ virtual uint32_t GetSharedFileSize(SharedFileID sharedFileID) = 0; ``` -------------------------------- ### Login with OpenID Connect Source: https://docs.gog.com/galaxyapi/IUser_8h_source Logs in a user using OpenID Connect. Supports creating an account, encrypted requests, player secrets, and provides a listener for authentication events. ```C++ virtual void LoginWithOpenIDConnect(const char* titleID, const char* connectionID, const char* idToken, bool createAccount = true, const char* encryptedRequest = NULL, const char* playerSecret = NULL, IPlayFabLoginWithOpenIDConnectListener* const listener = NULL) = 0; ``` -------------------------------- ### Get File Timestamp (GalaxyAPI) Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage Retrieves the timestamp of the last modification for a specified file. ```C++ virtual uint32_t GetFileTimestamp(const char *fileName) = 0; ``` -------------------------------- ### InitOptions Class Members Source: https://docs.gog.com/galaxyapi/functions_c Lists members of the InitOptions class, including clientID, clientSecret, and configFilePath. These are configuration parameters for initializing the GOG GALAXY SDK. ```C++ clientID : InitOptions clientSecret : InitOptions configFilePath : InitOptions ``` -------------------------------- ### Get Session ID Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IUser-members Retrieves the unique session ID for the current user session. ```C++ GetSessionID()=0 ``` -------------------------------- ### Get Default Avatar Criteria Source: https://docs.gog.com/galaxyapi/IFriends_8h_source Retrieves the default criteria used for fetching avatars. ```cpp virtual AvatarCriteria GetDefaultAvatarCriteria()=0 ``` -------------------------------- ### PlayFab Login With OpenID Connect Listener Interface Source: https://docs.gog.com/galaxyapi/IUser_8h Defines the IPlayFabLoginWithOpenIDConnectListener interface for handling the event of logging in with an OpenID Connect provider, facilitating authentication through external identity services. ```c++ class IPlayFabLoginWithOpenIDConnectListener { // Listener for the event of logging with an OpenID Connect. More... }; ``` -------------------------------- ### C++ Get Friend Invitation Count Source: https://docs.gog.com/galaxyapi/IFriends_8h_source Retrieves the number of pending friend invitations. ```C++ virtual uint32_t GetFriendInvitationCount() = 0; ``` -------------------------------- ### PlayFab Create OpenID Connection Listener Interface Source: https://docs.gog.com/galaxyapi/IUser_8h Defines the IPlayFabCreateOpenIDConnectionListener interface, which handles the event of creating an OpenID connection, likely for integrating with PlayFab services. ```c++ class IPlayFabCreateOpenIDConnectionListener { // Listener for the event of creating an OpenID connection. More... }; ``` -------------------------------- ### C++ Get Friend Count Source: https://docs.gog.com/galaxyapi/IFriends_8h_source Retrieves the total number of friends the current user has. ```C++ virtual uint32_t GetFriendCount() = 0; ``` -------------------------------- ### GOG GALAXY SDK - ICustomNetworking Header Source: https://docs.gog.com/galaxyapi/files The ICustomNetworking.h file includes data structures and interfaces for communicating with custom endpoints. This is useful for advanced networking scenarios beyond standard peer-to-peer. ```c++ #include "ICustomNetworking.h" ``` -------------------------------- ### C++ Get Friend Persona Name Source: https://docs.gog.com/galaxyapi/IFriends_8h_source Retrieves the persona name of a specific friend. ```C++ virtual const char* GetFriendPersonaName(GalaxyID userID) = 0; ``` -------------------------------- ### Get Achievement Description (C++) Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStats Returns the description string for a specified achievement. This function is not thread-safe. ```C++ virtual const char* GetAchievementDescription (const char * _name_ ) ``` -------------------------------- ### Access GOG GALAXY Matchmaking Module Source: https://docs.gog.com/galaxyapi/GalaxyApi_8h Returns an instance of the IMatchmaking interface, used for managing matchmaking processes and creating game sessions. ```c++ #include "GalaxyExport.h" #include "IMatchmaking.h" GALAXY_DLL_EXPORT IMatchmaking* GALAXY_CALLTYPE Matchmaking(); ``` -------------------------------- ### Get Shared File Count Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage Returns the total number of open downloaded shared files. ```C++ virtual uint32_t GetDownloadedSharedFileCount() ``` -------------------------------- ### GOG GALAXY SDK ILobbyListListener Interface Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h_source Interface for receiving notifications about lobby list retrieval results. It includes a callback for when the lobby list is available. ```c++ class ILobbyListListener : public GalaxyTypeAwareListener { public: virtual void OnLobbyList(uint32_t lobbyCount, LobbyListResult result) = 0; }; typedef SelfRegisteringListener GlobalLobbyListListener; ``` -------------------------------- ### Get Shared File Owner (GalaxyAPI) Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage Retrieves the GalaxyID of the owner of a downloaded shared file. ```C++ virtual GalaxyID GetSharedFileOwner(SharedFileID sharedFileID) = 0; ``` -------------------------------- ### Get File Name by Index (GalaxyAPI) Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage Retrieves the name of a file based on its index in the storage. ```C++ virtual const char* GetFileNameByIndex(uint32_t index) = 0; ``` -------------------------------- ### C++: ILobbyMemberStateListener Interface Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h_source Interface for monitoring changes in lobby member states. Implement this to react to events like members joining or leaving. ```C++ class ILobbyMemberStateListener : public GalaxyTypeAwareListener { public: virtual void OnLobbyMemberStateChanged(const GalaxyID& lobbyID, const GalaxyID& memberID, LobbyMemberStateChange memberStateChange) = 0; }; ``` -------------------------------- ### C++: ILobbyOwnerChangeListener Interface Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h_source Interface for receiving notifications when the owner of a lobby changes. Implement this to track ownership transitions. ```C++ class ILobbyOwnerChangeListener : public GalaxyTypeAwareListener { public: virtual void OnLobbyOwnerChanged(const GalaxyID& lobbyID, const GalaxyID& newOwnerID) = 0; }; ``` -------------------------------- ### Get Total File Count (GalaxyAPI) Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage Returns the total number of files currently stored. ```C++ virtual uint32_t GetFileCount() = 0; ``` -------------------------------- ### InitOptions Constructor Source: https://docs.gog.com/galaxyapi/structgalaxy_1_1api_1_1InitOptions-members The constructor for the InitOptions class. It allows for the initialization of the GOG Galaxy SDK with various parameters such as client ID, client secret, configuration file path, storage path, host, port, and thread factory. ```C++ InitOptions(const char *_clientID, const char *_clientSecret, const char *_configFilePath=".", GalaxyAllocator *_galaxyAllocator=NULL, const char *_storagePath=NULL, const char *_host=NULL, uint16_t _port=0, IGalaxyThreadFactory *_galaxyThreadFactory=NULL) ``` -------------------------------- ### Get Timestamp of Local File - IStorage Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage-members Retrieves the last modification timestamp of a local file. ```C++ GetFileTimestamp(const char *fileName)=0 ``` -------------------------------- ### Get Size of Local File - IStorage Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage-members Returns the size of a specified local file in bytes. ```C++ GetFileSize(const char *fileName)=0 ``` -------------------------------- ### GOG GALAXY SDK: IMatchmaking Interface Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h The primary interface for managing game lobbies within the GOG GALAXY SDK. It provides methods for creating, joining, and managing game lobbies. ```C++ class IMatchmaking { }; ``` -------------------------------- ### Get Persona State Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IFriends Retrieves the current state of a user. This is a pure virtual function. ```C++ virtual PersonaState GetPersonaState() = 0; ``` -------------------------------- ### GOG GALAXY SDK - IStats Header Source: https://docs.gog.com/galaxyapi/files The IStats.h file provides data structures and interfaces related to statistics, achievements, and leaderboards within the GOG GALAXY SDK. This enables game progression tracking and competitive features. ```c++ #include "IStats.h" ``` -------------------------------- ### GOG GALAXY SDK - INetworking Header Source: https://docs.gog.com/galaxyapi/files The INetworking.h file provides data structures and interfaces for communicating with other GOG GALAXY Peers. This is the core header for P2P networking functionalities. ```c++ #include "INetworking.h" ``` -------------------------------- ### C++ Get Friend By Index Source: https://docs.gog.com/galaxyapi/IFriends_8h_source Retrieves a friend's GalaxyID by its index in the friend list. ```C++ virtual GalaxyID GetFriendByIndex(uint32_t index) = 0; ``` -------------------------------- ### SignInLauncher - Authenticate with Launcher Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IUser Authenticates the Galaxy Peer using launcher-specific authentication. This method is for internal use and is asynchronous, with responses directed to an IAuthListener. It takes an optional listener argument. ```C++ virtual void SignInLauncher(IAuthListener *const _listener_ = NULL) ``` -------------------------------- ### Get Leaderboard Entry Count Source: https://docs.gog.com/galaxyapi/IStats_8h_source Returns the total number of entries available for a specified leaderboard. ```C++ virtual uint32_t GetLeaderboardEntryCount(const char *name)=0 ``` -------------------------------- ### Get Listener Type (C++) Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IChatRoomMessagesListener This static function returns the type of the listener. It is inherited from GalaxyTypeAwareListener. ```C++ static ListenerType GetListenerType () ``` -------------------------------- ### GOG Galaxy PlayFab Create OpenID Connection Listener Source: https://docs.gog.com/galaxyapi/IUser_8h_source Listener for events concerning the creation of an OpenID connection with PlayFab. It includes callbacks for both success and failure scenarios, with detailed failure reasons. ```C++ class IPlayFabCreateOpenIDConnectionListener { public: virtual void OnPlayFabCreateOpenIDConnectionSuccess(bool connectionAlreadyExists) = 0; virtual void OnPlayFabCreateOpenIDConnectionFailure(FailureReason failureReason) = 0; enum FailureReason { FAILURE_REASON_UNDEFINED, FAILURE_REASON_CONNECTION_FAILURE }; }; ``` -------------------------------- ### Get Session ID Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IUser Retrieves the session ID for the current PlayFab session. This is a simple getter function. ```C++ virtual SessionID | GetSessionID ()=0 ``` -------------------------------- ### GOG GALAXY SDK - ITelemetry Header Source: https://docs.gog.com/galaxyapi/files The ITelemetry.h file provides data structures and interfaces related to telemetry, which is used for collecting usage data and performance metrics for the GOG GALAXY SDK. ```c++ #include "ITelemetry.h" ``` -------------------------------- ### Get Achievement Description Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStats Returns the description of a specified achievement. This function provides the text explaining the achievement. ```C++ virtual const char *GetAchievementDescription(const char *name) = 0; ``` -------------------------------- ### Initialize GOG GALAXY Game Server Source: https://docs.gog.com/galaxyapi/GalaxyGameServerApi_8h_source Initializes the GOG GALAXY Game Server with the provided initialization options. This function must be called before using other Game Server API functions. ```C++ #include "GalaxyExport.h" #include "InitOptions.h" GALAXY_DLL_EXPORT void GALAXY_CALLTYPE InitGameServer(const InitOptions& initOptions); ``` -------------------------------- ### Galaxy API: Join Lobby Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h_source Joins an existing game lobby specified by its ID. An optional listener can be provided to handle the lobby entry event. ```cpp virtual void JoinLobby(GalaxyID lobbyID, ILobbyEnteredListener *const listener=NULL)=0 ``` -------------------------------- ### Get Shared File Name - IStorage Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage-members Retrieves the name of a shared file using its unique SharedFileID. ```C++ GetSharedFileName(SharedFileID sharedFileID)=0 ``` -------------------------------- ### Get Local File Name by Index - IStorage Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage-members Retrieves the name of a local file using its index. ```C++ GetFileNameByIndex(uint32_uint32_t index)=0 ``` -------------------------------- ### GOG GALAXY SDK: Lobby List Listener Interface Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h Defines the listener interface for receiving a list of lobbies. This is crucial for matchmaking functionalities where clients need to discover available game lobbies. ```C++ class ILobbyListListener { }; ``` -------------------------------- ### Access GOG GALAXY Utils Module Source: https://docs.gog.com/galaxyapi/GalaxyApi_8h Returns an instance of the IUtils interface, offering various utility functions for the GOG GALAXY SDK. ```c++ #include "GalaxyExport.h" #include "IUtils.h" GALAXY_DLL_EXPORT IUtils* GALAXY_CALLTYPE Utils(); ``` -------------------------------- ### Get Count of Downloaded Shared Files - IStorage Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IStorage-members Returns the total number of shared files that have been downloaded. ```C++ GetDownloadedSharedFileCount()=0 ``` -------------------------------- ### ITelemetry.h File Reference Source: https://docs.gog.com/galaxyapi/ITelemetry_8h This C++ header file, ITelemetry.h, is part of the GOG GALAXY SDK and provides interfaces for telemetry functionality. It includes definitions for listeners and the main telemetry interface, along with self-registering listener typedefs. ```c++ #include "IListenerRegistrar.h" // Listener for the event of sending a telemetry event. class ITelemetryEventSendListener { public: virtual ~ITelemetryEventSendListener() = default; virtual void OnTelemetryEventSend(int eventId, int result) = 0; }; // The interface for handling telemetry. class ITelemetry { public: virtual ~ITelemetry() = default; virtual void SendTelemetryEvent(int eventId) = 0; }; // Globally self-registering version of ITelemetryEventSendListener. typedef SelfRegisteringListener< ITelemetryEventSendListener > GlobalTelemetryEventSendListener; // Globally self-registering version of ITelemetryEventSendListener for the Game Server. typedef SelfRegisteringListener< ITelemetryEventSendListener, GameServerListenerRegistrar > GameServerGlobalTelemetryEventSendListener; ``` -------------------------------- ### Get User Persona Name Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IFriends Retrieves the current user's nickname. This function is not thread-safe. ```c++ virtual const char* GetPersonaName() ``` -------------------------------- ### Get Friend Invitation Count Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IFriends Returns the number of retrieved friend invitations. Returns a uint32_t. ```C++ virtual uint32_t GetFriendInvitationCount()=0; ``` -------------------------------- ### GOG GALAXY SDK: Lobby Created Listener Interface Source: https://docs.gog.com/galaxyapi/IMatchmaking_8h Defines the listener interface for events related to the creation of a lobby. This interface is used to handle callbacks when a new game lobby is successfully created. ```C++ class ILobbyCreatedListener { }; ``` -------------------------------- ### Get Listener Type for IOtherSessionStartListener Source: https://docs.gog.com/galaxyapi/classgalaxy_1_1api_1_1IOtherSessionStartListener Retrieves the specific listener type for IOtherSessionStartListener. This is part of the GalaxyTypeAwareListener functionality. ```C++ ListenerType type = IOtherSessionStartListener::GetListenerType(); // type will be OTHER_SESSION_START ```