Class: GameSettingsController

GameSettingsController()

Controller for the GUI handling of gamesettings.

Constructor

new GameSettingsController()

Source:

Members

Timeout

Wait (at most) this many milliseconds before sending network messages.
Source:

Methods

getSettings()

Returns the InitAttributes, augmented by GUI-specific data.
Source:

launchGame()

Cheat prevention: 1. Ensure that the host cannot start the game unless all clients agreed on the game settings using the ready system. TODO: 2. Ensure that the host cannot start the game with InitAttributes different from the agreed ones. This may be achieved by: - Determining the seed collectively. - passing the agreed game settings to the engine when starting the game instance - rejecting new game settings from the server after the game launch event
Source:

parseSettings()

Parse the following settings.
Source:

registerLoadingChangeHandler(handler)

Parameters:
Name Type Description
handler will be called when the 'loading' state change.
Source:

registerSettingsChangeHandler(handler)

Parameters:
Name Type Description
handler will be called when any setting change. (this isn't exactly what happens but the behaviour should be similar).
Source:

registerSettingsLoadedHandler(handler)

Parameters:
Name Type Description
handler will be called when the initial settings have been loaded.
Source:

registerUpdateLayoutHandler(handler)

Parameters:
Name Type Description
handler will be called when the layout needs to be updated.
Source:

setNetworkInitAttributes()

This function is to be called when a GUI control has initiated a value change. To avoid an infinite loop, do not call this function when a game setup message was received and the data had only been modified deterministically. This is run on a timer to avoid flooding the network with messages, e.g. when modifying a slider.
Source:

updateLayout()

This should be called whenever the GUI layout needs to be updated. Triggers on the next GUI tick to avoid un-necessary layout.
Source: