示例#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);
 }
示例#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);
            }
        }
示例#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);
            }
        }
示例#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;
        }
示例#5
0
 protected void SendPacket(RailPacket packet)
 {
     this.interpreter.SendPacket(this.netPeer, packet);
 }