NetworkTickrateHandshake
Inherits: Node
Internal class to manage the tickrate handshake.
Description
Whenever a new peer joins, they exchange their configured tickrate with the host. If the tickrate mismatches, a warning is emitted by default, as this is assumed to be a developer mistake.
However, if this is expected, different actions can be configured.
Properties
| Type | Name | Default |
|---|---|---|
| int | mismatch_action | get_setting(...) |
Methods
| Return Type | Name |
|---|---|
| void | run() |
| void | stop() |
Signals
on_tickrate_mismatch ( int peer, int tickrate )
Emitted when a tickrate mismatch is encountered, and mismatch_action is set to SIGNAL.
Constants
WARN = 0
Emit a warning on tickrate mismatch
DISCONNECT = 1
Disconnect peer on tickrate mismatch
This is enforced by the host.
ADJUST = 2
Adjust tickrate to the host's on mismatch
SIGNAL = 3
Emit on_tickrate_mismatch() on mismatch
This is emitted on both host and client.
Property Descriptions
int mismatch_action = get_setting(...)
Configures what happens on a tickrate mismatch.
Defaults to WARN, based on project settings.
Method Descriptions
void run ( )
Run the tickrate handshake.
This will connect to signals, so that every new peer receives tickrate info from the host.
Called by _NetworkTime, no need to call manually.
void stop ( )
Stop the tickrate handshake.
Called by _NetworkTime, no need to call manually.