Replace the custom ping measurnment code with built-in methods #106

Closed
opened 2021-11-01 14:45:05 +01:00 by unfa · 1 comment

From https://godotengine.org/article/multiplayer-changes-godot-4-0-report-3 :

You can access the underlying ENetConnection (enet host) via the get_host() function.

func set_peers_timeout():
for id in multipler.get_multiplayer_peers():
enet.get_peer(id).set_timeout(1000, 3000, 5000)
And retrieve a connected ENetPacketPeer (enet peer) via the get_peer(id) method.

func get_peer_latency(id):
var peer = enet.get_peer(id)
return peer.get_statistic(ENetPacketPeer.PEER_ROUND_TRIP_TIME)
Most of ENet's generated statistics like average latency, packet loss, etc., are also now exposed via the ENetPacketPeer.get_statistic and ENetConnect.pop_statistic methods.

We should add packet loss to the displayed connection quality as well.

From https://godotengine.org/article/multiplayer-changes-godot-4-0-report-3 : > You can access the underlying ENetConnection (enet host) via the get_host() function. > > func set_peers_timeout(): > for id in multipler.get_multiplayer_peers(): > enet.get_peer(id).set_timeout(1000, 3000, 5000) > And retrieve a connected ENetPacketPeer (enet peer) via the get_peer(id) method. > > func get_peer_latency(id): > var peer = enet.get_peer(id) > return peer.get_statistic(ENetPacketPeer.PEER_ROUND_TRIP_TIME) > Most of ENet's generated statistics like average latency, packet loss, etc., are also now exposed via the ENetPacketPeer.get_statistic and ENetConnect.pop_statistic methods. We should add packet loss to the displayed connection quality as well.
Poster
Owner

Done.

Done.
unfa closed this issue 2021-11-28 19:55:49 +01:00
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: unfa/liblast#106
There is no content yet.