Exemple #1
0
 public FrameBuffer(SimulatorService _simulatorService, INetworkService networkService, int bufferSize, int snapshotFrameInterval, int maxClientPredictFrameCount)
 {
     this._simulatorService           = _simulatorService;
     this._predictHelper              = new FrameBuffer.PredictCountHelper(_simulatorService, this);
     this._bufferSize                 = bufferSize;
     this._networkService             = networkService;
     this._maxClientPredictFrameCount = maxClientPredictFrameCount;
     this._spaceRollbackNeed          = snapshotFrameInterval * 2;
     this._maxServerOverFrameCount    = bufferSize - this._spaceRollbackNeed;
     this._serverBuffer               = new ServerFrame[bufferSize];
     this._clientBuffer               = new ServerFrame[bufferSize];
 }
Exemple #2
0
        public void _DoAwake(IServiceContainer serviceContainer)
        {
            _simulatorService  = serviceContainer.GetService <ISimulatorService>() as SimulatorService;
            _networkService    = serviceContainer.GetService <INetworkService>() as NetworkService;
            _constStateService = serviceContainer.GetService <IConstStateService>();
            _constStateService = serviceContainer.GetService <IConstStateService>();

            if (IsVideoMode)
            {
                _constStateService.SnapshotFrameInterval = 20;
                //OpenRecordFile(RecordPath);
            }
        }
 public PredictCountHelper(SimulatorService simulatorService, FrameBuffer cmdBuffer)
 {
     this._cmdBuffer        = cmdBuffer;
     this._simulatorService = simulatorService;
 }
Exemple #4
0
 public SimulatorService()
 {
     Instance = this;
 }