The core Game instance which encapsulates the data, settings, and states relevant for managing the game experience. The singleton instance of the Game class is available as the global variable game.
The named view which is active for this game instance.
An object of all the World data vended by the server when the client first connects
The ID of the currently active client session retrieved from the browser cookie
The open web-socket which should be used to transact game-state data
The named view which is currently active. Game views include: join, setup, players, license, game, stream
The object of world data passed from the server
The Release data for this version of Foundry
The id of the active World user, if any
A mapping of WorldCollection instances, one per primary Document type.
A mapping of CompendiumCollection instances, one per Compendium pack.
A singleton web Worker manager.
The Keyboard Manager
The Mouse Manager
The Gamepad Manager
The New User Experience manager.
The user role permissions setting
The client session id which is currently active
Client settings which are used to configure application behavior
Client keybindings which are used to configure application behavior
A reference to the open Socket.io connection
A singleton GameTime instance which manages the progression of time within the game world.
A singleton reference to the Canvas object which may be used.
A singleton instance of the Audio Helper class
A singleton instance of the Video Helper class
A singleton instance of the TooltipManager class
A singleton instance of the Clipboard Helper class.
A singleton instance of the Tour collection class
The global document index.
Whether the Game is running in debug mode
A flag for whether texture assets for the game canvas are currently loading
A flag for whether the Game has successfully reached the "ready" hook
The game World which is currently active.
The System which is used to power this game World.
A Map of active Modules which are currently eligible to be enabled in this World. The subset of Modules which are designated as active are currently enabled.
Returns the current version of the Release, usable for comparisons using isNewerVersion
Is the current session user authenticated as an application administrator?
The currently connected User document, or null if Users is not yet initialized
A convenience accessor for the currently viewed Combat encounter
A state variable which tracks whether the game session is currently paused
A convenient reference to the currently active canvas tool
Configure package data that is currently enabled for this world
Game data provided by the server socket
Return the named scopes which can exist for packages. Scopes are returned in the prioritization order that their content is loaded.
An array of string package scopes
Initialize the Game for the current window location
Shut down the currently active Game. Requires GameMaster user permission.
Fully set up the game state, initializing Documents, UI applications, and the Canvas
Initialize game state data by creating WorldCollection instances for every primary Document type
Initialize the Compendium packs which are present within this Game Create a Collection which maps each Compendium pack using it's collection ID
Initialize the WebRTC implementation
Initialize core UI elements
Initialize the game Canvas
Initialize Keyboard controls
Initialize Mouse controls
Initialize Gamepad controls
Register core game settings
Register core Tours
Toggle the pause state of the game
pauseGame Hook when the paused state changes
The desired pause state; true for paused, false for un-paused
The new paused state
Open Character sheet for current token or controlled actor
The ActorSheet which was toggled, or null if the User has no character
Log out of the game session by returning to the Join screen
Scale the base font size according to the user's settings.
Activate Socket event listeners which are used to transact game state data with the server
Activate Event Listeners which apply to every Game View
Display certain usability error messages which are likely to result in the player having a bad experience.
On left mouse clicks, check if the element is contained in a valid hyperlink and open it in a new tab.
Prevent starting a drag and drop workflow on elements within the document unless the element has the draggable attribute explicitly defined or overrides the dragstart handler.
The initiating drag start event
Disallow dragging of external content onto anything but a file input element
The requested drag event
Disallow dropping of external content onto anything but a file input element
The requested drag event
On a left-click event, remove any currently displayed inline roll tooltip
The mousedown pointer event
Fallback handling for mouse-up events which aren't handled further upstream.
The mouseup pointer event
Handle resizing of the game window by adjusting the canvas and repositioning active interface applications.
The window resize event which has occurred
Handle window unload operations to clean up any data which may be pending a final save
The window unload event which is about to occur
Handle cases where the browser window loses focus to reset detection of currently pressed keys
The originating window.blur event
Initialize elements required for the current view
Initialization steps for the primary Game view
Initialization steps for the Stream helper view
Fetch World data and return a Game instance
The named view being created
The current sessionId of the connecting client
A Promise which resolves to the created Game instance
Establish a live connection to the game server through the socket.io URL
The client session ID with which to establish the connection
A promise which resolves to the connected socket, if successful
Retrieve the cookies which are attached to the client session
The session cookies
Request World data from server and return it
The active socket connection
The view for which data is being requested
Get the current World status upon initial connection.
The active client socket connection
Support mousewheel control for range type input elements
A Mouse Wheel scroll event