Exemplo n.º 1
0
 public void SetPeer(IRailNetPeer netPeer)
 {
     RailDebug.Assert(this.serverPeer == null, "Overwriting peer");
     this.serverPeer = new RailClientPeer(netPeer, this.Interpreter);
     this.serverPeer.PacketReceived += this.OnPacketReceived;
     this.serverPeer.EventReceived  += base.OnEventReceived;
 }
Exemplo n.º 2
0
        public RailClient()
        {
            RailConnection.IsServer = false;
            this.serverPeer         = null;
            this.localTick          = Tick.START;
            this.Room.Initialize(Tick.INVALID);

            this.pendingEntities =
                new Dictionary <EntityId, RailEntity>(EntityId.Comparer);
            this.knownEntities =
                new Dictionary <EntityId, RailEntity>(EntityId.Comparer);

            this.toRemove = new List <RailEntity>();
        }