Fusion.Engine.Server.SnapshotQueue.Push C# (CSharp) Method

Push() public method

public Push ( Snapshot snapshot ) : void
snapshot Snapshot
return void
		public void Push ( Snapshot snapshot )
		{
			queue.Add ( snapshot );

			while (queue.Count>capacity) {
				queue.RemoveAt(0);
			}
		}

Same methods

SnapshotQueue::Push ( System.TimeSpan timestamp, byte snapshot ) : void

Usage Example

			/// <summary>
			/// Creates instance of Active client state.
			/// </summary>
			/// <param name="gameClient"></param>
			/// <param name="snapshotId"></param>
			/// <param name="initialSnapshot"></param>
			public Active ( GameClient gameClient, uint snapshotId, byte[] initialSnapshot, long svTicks ) : base(gameClient, ClientState.Active)
			{
				queue	=	new SnapshotQueue(32);
				queue.Push( new Snapshot( new TimeSpan(0), snapshotId, initialSnapshot) );

				lastServerTicks		=	svTicks;
				lastSnapshotID		=	snapshotId;
				lastSnapshotFrame	=	snapshotId;

				Message				=	"";


				#if USE_DEJITTER
				jitter		=	new JitterBuffer( gameClient.Game, svTicks );
				#endif


				stopwatch	=	new Stopwatch();
				stopwatch.Start();
				clientTicks	=	stopwatch.Elapsed.Ticks;


				gameClient.FeedSnapshot( new GameTime(0,svTicks,0L), initialSnapshot, 0 );
			}
All Usage Examples Of Fusion.Engine.Server.SnapshotQueue::Push