overwolf.games

Provides information about the currently running game.

Methods

getRunningGameInfo(callback )

Version added: 0.78

Returns an object with information about the currently running game (or active games, if more than one), or null if no game is running.

  • Parameter: callback <function>

    Called with the currently running or active game info (GameInfo).

Callback argument:
{
    "isInFocus": true,
    "isRunning": true,
    "allowsVideoCapture": true,
    "title": "Counter-Strike: Global Offensive",
    "id": 77641,
    "width": 1920,
    "height": 1080,
    "logicalWidth": 1920,
    "logicalHeight": 1080,
    "renderers": [
        "D3D9"
    ],
    "detectedRenderer": "D3D9",
    "executionPath": "D://Steam/steamapp/scommon/Counter-Strike Global Offensive/csgo.exe",
    "sessionId": "1a1b96a9d8bb439d8f21abc21faa1184",
    "commandLine": "D://Steam/steamapps/common/Counter-Strike Global Offensive/csgo.exe" -steam -novid +mat_vignette_enable 0"
}

getGameInfo(gameClassId, callback)

Version added: 0.93.1

Returns information about a game with a given game id.

Note: Game info will be returned only if the game is installed on the local machine.

  • Parameter: gameClassId <int>

    The class id of the game.

  • Parameter: callback <function>

    Called with the info about the game.

Callback argument:
{
    "status": "success",
    "gameInfo": {
        "GameInfoClassID": 7764,
        "GameInfoID": 77641,
        "ProcessPath": "D:SteamSteamAppscommonCounter-Strike Global Offensivecsgo.exe",
        "LauncherPath": "D:Steamsteam.exe",
        "LauncherCommandLineParams": "-applaunch 730",
        "LastTimeVerified": "2016-04-25T06:56:18.180Z",
        "ManuallyAdded": false,
        "WasAutoAddedByProcessDetection": false,
        "GameInfo": {
            "ID": 77641,
            "GameTitle": "Counter-Strike: Global Offensive",
            "DisplayName": "CS: GO",
            "ProcessNames": [
                "SteamApps*Counter-Strike Global Offensivecsgo.exe"
            ],
            "LuancherNames": [
                "steam.exe"
            ],
            "CommandLine": null,
            ...
        }
    }
}

getGameDBInfo(gameClassId, callback)

Version added: 0.112.1

This method is similar to getGameInfo() except that it can return two different results:

  1. If the game is detected as installed, then the installedGameInfo 
    member of the result will be set and the gameInfo member will be null.

    Example:

    {  
       "status":"success",
       "gameInfo":null,
       "installedGameInfo":{  
          "GameInfoClassID":10906,
          "GameInfoID":109062,
          "ProcessPath":"E:/Steam Games/steamapps/common/PUBG/TslGame/Binaries/Win64/TslGame.exe",
          "LauncherPath":"c:/program files (x86)/steam/Steam.exe",
          "LauncherCommandLineParams":"-applaunch 578080",
          "LastTimeVerified":"2018-03-14T12:02:06.686Z",
          "ManuallyAdded":false,
          "WasAutoAddedByProcessDetection":true,
          "GameInfo":{  
             "ID":109062,
             "NativeID":10906,
              ...
          }
       }
    }
  2. If the game is NOT detected as installed, then the returned JSON will be:
    {"status":"error","reason":"game not found"}
  • Parameter: gameClassId <int>

    The class id of the game

  • Parameter: callback <function>

    Called with the info about the game

Callback argument:
{  
   "status":"success",
   "gameInfo":null,
   "installedGameInfo":{  
      "GameInfoClassID":10906,
      "GameInfoID":109062,
      "ProcessPath":"E:/Steam Games/steamapps/common/PUBG/TslGame/Binaries/Win64/TslGame.exe",
      "LauncherPath":"c:/program files (x86)/steam/Steam.exe",
      "LauncherCommandLineParams":"-applaunch 578080",
      "LastTimeVerified":"2018-03-14T12:02:06.686Z",
      "ManuallyAdded":false,
      "WasAutoAddedByProcessDetection":true,
      "GameInfo":{  
         "ID":109062,
         "NativeID":10906,
         "Type":0,
         "LauncherGameClassId":0,
         "GameTitle":"PLAYERUNKNOWN'S BATTLEGROUNDS",
         "ShortTitle":null,
         "DisplayName":"PUBG",
         "ProcessNames":[  
            "TslGame.exe"
         ],
         "LauncherNames":[  
            "Steam.exe"
         ],
         "CommandLine":null,
         "GameRenderers":82,
         "ActualDetectedRenderers":0,
         "FirstGameResolutionHeight":null,
         "FirstGameResolutionWidth":null,
         "GameGenres":"Action_Survival-Horror",
         "InjectionDecision":1,
         "SupportedScheme":null,
         "UnsupportedScheme":"5/1",
         "LauncherDirectoryRegistryKey":"HKEY_LOCAL_MACHINESOFTWAREValveSteamInstallPath",
         "LaunchParams":"-applaunch 578080",
		 ...
      }
   }
}

Events How to use events

onGameInfoUpdated

Version added: 0.78

Fired when the game info is updated, including game name, game running, game terminated, game changing focus, etc. Passes a GameInfoChangeData object.

Event value:
{
    "gameInfo": {
        "isInFocus": true,
        "isRunning": true,
        "allowsVideoCapture": true,
        "title": "Dota 2",
        "id": 73143,
        "width": 1920,
        "height": 1080,
        "logicalWidth": 1920,
        "logicalHeight": 1080,
        "renderers": [
            "D3D9",
            "D3D11"
        ],
        "detectedRenderer": "D3D9",
        "executionPath": "D:/Steam/steamapps/common/dota2/game/bin/win64/dota2.exe",
        "sessionId": "9b163a0c0ca74d2c8f01f85d4fade07f",
        "commandLine": "D:/Steam/steamapps/common/dota2/game/bin/win64/dota2.exe -steam"
    },
    "resolutionChanged": false,
    "focusChanged": true,
    "runningChanged": false,
    "gameChanged": false
}

onGameLaunched

Version added: 0.78

Fired when a game is launched.

Event value:
{
    "isInFocus": false,
    "isRunning": true,
    "allowsVideoCapture": true,
    "title": "Dota 2",
    "id": 73143,
    "width": 1920,
    "height": 1080,
    "logicalWidth": 1920,
    "logicalHeight": 1080,
    "renderers": [
        "D3D9",
        "D3D11"
    ],
    "detectedRenderer": "Unknown",
    "executionPath": "D:/Steam/steamapps/common/dota2/game/bin/win64/dota2.exe",
    "sessionId": "9b163a0c0ca74d2c8f01f85d4fade07f",
    "commandLine": "D:/Steam/steamapps/common/dota2/game/bin/win64/dota2.exe -steam"
}

onMajorFrameRateChange

Version added: 0.79

Fired when the rendering frame rate of the currently injected game changes dramatically. The “fps_status” field can be “None”, “Stable”, “Drop” and “Increase”.

Event value:
{
    "fps_status": "Increase",
    "fps": 35
}

onGameRendererDetected

Version added: 0.89.102

Fired when the rendering method of the game has been detected.

Event value:
{
    "detectedRenderer": "D3D9"
}

Types

GameInfo

Properties

isInFocus

Version added: 0.78

Returns whether the game represented is currently in focus.

Type: bool

isRunning

Version added: 0.78

Returns whether the game represented is currently running.

Type: bool

allowsVideoCapture

Version added: 0.78

Returns whether the game represented allows video to be captured.

Type: bool

title

Version added: 0.78

Returns the title of the represented game.

Type: string

id

Version added: 0.78

Returns the id of the represented game.

Type: int

width

Version added: 0.78

Returns the pixel width of the represented game window.

Type: int

height

Version added: 0.78

Returns the pixel height of the represented game window.

Type: int

logicalWidth

Version added: 0.78

Returns the game reported (logical) pixel width of the represented game window.

Type: int

logicalHeight

Version added: 0.78

Returns the game reported (logical) pixel height of the represented game window.

Type: int

renderers

Version added: 0.78

Returns an array of the rendering technology names supported by the running game.

Type: string[]

detectedRenderer

Version added: 0.89.102

Returns the rendering technology detected by the running game.

Type: string

commandLine

Version added: 0.78

Returns the game process commandline.

Type: string

GameInfoChangeData

An object containing the game info object in addition to a set of flags indicating the change from the last time that data was updated.

Properties

gameInfo

Version added: 0.78

The new game info data.

Type: GameInfo

resolutionChanged

Version added: 0.78

Indicates if there was a change in resolution (i.e. the width or height properties were changed).

Type: bool

focusChanged

Version added: 0.78

Indicates if there was a change in the game focus status.

Type: bool

runningChanged

Version added: 0.78

Indicates if there was a change in the game running status.

Type: bool

gameChanged

Version added: 0.78

Indicates if the gameInfo property represents a different game than before.

Type: bool