/// <summary> /// Records acknowledging information for the packet. /// </summary> protected virtual void ProcessPacket(RailPacket packet) { this.remoteClock.UpdateLatest(packet.SenderTick); foreach (RailEvent evnt in this.FilterIncomingEvents(packet.Events)) { this.ProcessEvent(evnt); } this.CleanOutgoingEvents(packet.AckEventId); }
protected override void ProcessPacket(RailPacket packet) { base.ProcessPacket(packet); RailClientPacket clientPacket = (RailClientPacket)packet; this.scope.IntegrateAcked(clientPacket.View); if (this.PacketReceived != null) { this.PacketReceived.Invoke(this, clientPacket); } }
protected override void ProcessPacket(RailPacket packet) { base.ProcessPacket(packet); RailServerPacket serverPacket = (RailServerPacket)packet; foreach (RailStateDelta delta in serverPacket.Deltas) { this.localView.RecordUpdate( delta.EntityId, packet.SenderTick, delta.IsFrozen); } if (this.PacketReceived != null) { this.PacketReceived.Invoke(serverPacket); } }
protected RailPeer( IRailNetPeer netPeer, RailInterpreter interpreter, RailPacket reusableIncoming, RailPacket reusableOutgoing) { this.netPeer = netPeer; this.interpreter = interpreter; this.controlledEntities = new HashSet <RailEntity>(); this.remoteClock = new RailClock(); this.outgoingEvents = new Queue <RailEvent>(); this.reusableIncoming = reusableIncoming; this.reusableOutgoing = reusableOutgoing; this.lastQueuedEventId = SequenceId.START.Next; this.processedEventHistory = new SequenceWindow(SequenceId.START); this.netPeer.PayloadReceived += this.OnPayloadReceived; }
protected void SendPacket(RailPacket packet) { this.interpreter.SendPacket(this.netPeer, packet); }