Beispiel #1
0
 /// <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);
 }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        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;
        }
Beispiel #5
0
 protected void SendPacket(RailPacket packet)
 {
     this.interpreter.SendPacket(this.netPeer, packet);
 }