SIMPHYNITY Game Plugin
Example game plugin DLL for SIMPHYNITY
 All Classes Files Functions Enumerations
dllmain.cpp File Reference
#include "stdafx.h"
#include "dllmain.h"
#include <TCHAR.H>

Functions

BOOL APIENTRY DllMain (HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
 
DECLDIR void GetDefaultSettings (const GAME_SETTINGS *settings)
 
DECLDIR int GetNumExeNames ()
 
DECLDIR void GetExeName (int index, const TCHAR *exeName)
 
DECLDIR int GetNumParentDirs ()
 
DECLDIR void GetParentDir (int index, const TCHAR *dir)
 
DECLDIR void GetSimphyintyRemoteSettings (const REMOTE_CONFIG *settings)
 
DECLDIR void OnGameDetected ()
 
DECLDIR void OnGameLost ()
 
DECLDIR void GetTelemetryData (const TELEMETRY_DATA *telem)
 

Detailed Description

Contains SIMPHYNITY plugin DLL exported functions.

Function Documentation

DECLDIR void GetDefaultSettings ( const GAME_SETTINGS settings)

Configures the default settings for this game (as configurable by the game settings panel in the Simphynity UI). It is mandatory this structure is correctly configured - for more information see the GAME_SETTINGS structure documentation.

Parameters
settingsThe game settings structure.
DECLDIR void GetExeName ( int  index,
const TCHAR *  exeName 
)

Called by Simphynity to get executable name N for the game (specified by the supplied index). See also GetNumExeNames(...).

Parameters
indexThe index of the executable name requested
exeNameThe buffer to copy the (null-terminated) executable name string into. NB: THIS MUST NOT EXCEED 32 CHARACTERS.
DECLDIR int GetNumExeNames ( )

Called by Simphynity to query the number of possible executable names that exist for this game. E.g. some titles might have separate dx9 and/or dx11 executables with different names. It is the executable name (combined with the parent dirs, see below) that Simphynity uses to determine if the game is running.

Returns
The number of executable names (N). Simphyinty will then call 'GetExeName' N times passing the index of the executable name requested, along with a buffer to copy the name to (see GetExeName(...)) Range must be 1 > N
DECLDIR int GetNumParentDirs ( )

Called by Simphynity to query the number of possible parent sub-directories that exist for this game's executable (.exe) file. E.g. some titles may be installed via different methods (e.g. digital download or DVD), and installed to different paths depending on the method. This gives the possible most deeply-nested install subpaths (not fully qualified paths) for the executable file.

The purpose of this information is to allow Simphynity to better determine that it has detected the game we're actually interested in, and not another process with the same executable name. When Simphynity is idle, it periodically checks all running processes and gets their full installation paths. If the executable name (excluding its path) is matched with one of those returned from 'GetExeName(...)' above, it then proceeds to check the immediate parent directory (or path) of the executable to further determine this is definately the .exe we're interested in. A parent directory can be specified in as many depth levels (starting from the exe name and working upwards through the directory hierarchy) as desired, each depth level being separated via a '/' (or '\', NB '\' will not function as intended)

E.g. 'rFactor.exe' may have the parent directory "bin", or if we want Simphynity to be more scrutinous, "rFactor/bin".

If we don't wish to specify parent dirs (and detect purely by executable name alone), simply return '0' from GetNumParentDirs().

Returns
The number of possible parent directories, or 0 to detect only by executable name. Range 0 > N
DECLDIR void GetParentDir ( int  index,
const TCHAR *  dir 
)

Called by Simphynity to get possible parent directory N for the game (specified by the supplied index). See GetNumParentDirs() for more information.

Parameters
indexThe index of the parent directory requested
exeNameThe buffer to copy the (null-terminated) parent directory string into. NB: THIS MUST NOT EXCEED 128 CHARACTERS.
DECLDIR void GetSimphyintyRemoteSettings ( const REMOTE_CONFIG settings)

Supplied with a REMOTE_CONFIG parameter (containing pre-configured default values) to allow Simphynity Remote to be enabled/disabled and/or configured according to our requirements. See the REMOTE_CONFIG structure documentation for more information regarding its members.

Parameters
settingsThe Simphynity Remote settings for this game.
DECLDIR void GetTelemetryData ( const TELEMETRY_DATA telem)

Called by Simphynity to request the most recent telemetry data available from the game. This is the data used to update any in-game output dials, device output previews and the devices themselves. See the TELEMETRY_DATA structure documentation for more information regarding what needs to be provided here.

Parameters
telemThe structure to update with the latest telemetry data.
DECLDIR void OnGameDetected ( )

Called by Simphynity when our game process has been detected. Perform any actions required upon game detection here.

DECLDIR void OnGameLost ( )

Called by Simphynity when our game process has been lost (i.e. the game has been terminated). Perform any actions required upon game undetection here.