You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
private onLobbyTimeReceived(lobbyTime: number) {
// TODO we need to compensate for the RTT/ping
const compensation = 10;
this._createdAt = Date.now() - lobbyTime + compensation;
}
get lobbyTime() {
return Date.time() - this._createdAt;
}
The text was updated successfully, but these errors were encountered:
Hey!
Motivation:
Almost every multiplayer online game has a synced clock aka remoteTime, remoteTicks, roomTime etc.
Its helps to understand when exactly actions be happened and how to handle it on the local side.
Suggestion:
When we create a lobby, we set on the server side:
Then, we send it to the every peer.
On the client side, we have:
network.ts
The text was updated successfully, but these errors were encountered: