Ping🔗
Inherits: Timer
This defines a ping manager.
Description🔗
When added to your scene and connect the synchronized signal to your custom handler in order to receive ping updates on a regular basis (as defined by ping_interval and synchronize the state for each peer.
func _ready() -> void:
$Ping.synchronized.connect(_on_ping_sync)
func _on_ping_sync(state: Dictionary) -> void:
for peer_id in state:
print("peer `%s` latency is %d ms" % [peer_id, state[peer_id]])
Propiedades🔗
|
||
|
||
|
||
|
||
|
Métodos🔗
void |
_ready() |
void |
|
void |
|
void |
set_ping_history(value: int) |
void |
|
void |
|
void |
|
void |
|
void |
_synchronize(state: Dictionary) |
Signals🔗
synchronized(state: Dictionary) 🔗
Emitted when the state is synchronized.
Property Descriptions🔗
void set_ping_history(value: int)
The size of the ping history buffer used to store past ping times for each client.
Dictionary _state = {} 🔗
The ping state being synchronized to connected peers
Dictionary _infos = {} 🔗
The dictionary of PingInfo for each connected peer id
The array of times when a ping request occured
There is currently no description for this property. Please help us by contributing one!
Method Descriptions🔗
void _ready() 🔗
There is currently no description for this method. Please help us by contributing one!
void _on_timeout() 🔗
There is currently no description for this method. Please help us by contributing one!
void clear_pings() 🔗
Clears the ping history array.
void set_ping_history(value: int) 🔗
Sets the size of the ping history buffer and clears existing ping data.
void _add_peer(peer_id: int) 🔗
Adds a new peer to the registry
void _del_peer(peer_id: int) 🔗
Deletes a peer from the registry
There is currently no description for this method. Please help us by contributing one!
There is currently no description for this method. Please help us by contributing one!
void _synchronize(state: Dictionary) 🔗
There is currently no description for this method. Please help us by contributing one!