public void Execute(GameClient <TPlayer> model, PingRequestMessage message) { if (model.localPlayer != null) { model.localPlayer.lastReceivedPingRequest = TimeUtils.CurrentTime(); } model.Send(new PongRequestMessage(message.pingRequestId), Channel.unreliable); }
public void Start(TOutgoingMessage message, NetEndPoint to) { this.message = message; this.to = to; this.retryIndex = 0; this.startedTime = TimeUtils.CurrentTime(); this.Send(); this.started = true; }
public float PongReceived(TPlayer from, long pingRequestId) { from.lastReceivedPongRequest = TimeUtils.CurrentTime(); if (this.pingPlayers.TryGetValue(from.playerId, out PingPlayer <TPlayer> pingPlayer)) { pingPlayer.ReceivedPong(pingRequestId); return(from.mostRecentPingValue); } return(0F); }
private void Send() { this.sender.Send(this.message, this.to); this.startedTime = TimeUtils.CurrentTime(); this.retryIndex++; }
internal void SendingPing() { this.pingSent = true; this.pingSentTime = TimeUtils.CurrentTime(); this.player.Send(new PingRequestMessage(this.pingRequestId++), Channel.unreliable); }
public Player() { this.lastReceivedPongRequest = TimeUtils.CurrentTime(); }