public SyncLastestManager(IGameContexts gameContexts, ISnapshotSelector snapshotSelector) { this.gameContexts = gameContexts; this.snapshotSelector = snapshotSelector; diffHandler = new SyncLatestMapDiffHandler(this); latestCompareAgent = new GameEntitySelfLatestCompareAgent(); }
public AbstractPredictionInfoProvider( ISnapshotSelectorContainer snapshotSelector, IGameContexts gameContexts) { _snapshotSelector = snapshotSelector; _gameContexts = gameContexts; }
public VehiclePredictionProvider(ISnapshotSelector snapshotSelector, IGameContexts gameContexts, VehicleContext vehicleContext, bool serverAuthorative) : base(snapshotSelector, gameContexts) { _vehicleContext = vehicleContext; _serverAuthorative = serverAuthorative; }
public UserPredictionInfoProvider( ISnapshotSelectorContainer snapshotSelector, PlayerContext playerContext, IGameContexts gameContexts) : base(snapshotSelector, gameContexts) { _playerContext = playerContext; }
public void Update(List <IGameEntity> preEntitys, IContexts _newContexts) { try { _contexts = _newContexts; _removeList.Clear(); // _preEntitys_HashSet 进行填充,用于在 Add 函数中判断 是否加入的entity是 上次残留的对象 _preEntitys_HashSet.Clear(); foreach (var entity in preEntitys) { _preEntitys_HashSet.Add(entity.EntityKey); } // 获取 _gameContexts if (_gameContexts == null) { _gameContexts = (_newContexts as Contexts).session.commonSession.GameContexts; } // 遍历残留字典 foreach (var keyValue in _dict) { var entityKey = keyValue.Key; IGameEntity entity = null; //--------------------------------------------------- // 找不到entityKey对应的entity,就标记去除 if (!_gameContexts.TryGetGameEntity(entityKey, out entity)) { _removeList.Add(entityKey); continue; } //--------------------------------------------------- // 不符合条件的就标记去除 if (!keyValue.Value.CanStay(_contexts)) { _removeList.Add(entityKey); continue; } //--------------------------------------------------- preEntitys.Add(entity); } // -----清除被标记的key------------------------------- foreach (var entityKey in _removeList) { _dict.Remove(entityKey); } } catch (Exception e) { _logger.ErrorFormat("当前线程为 {0},异常为:{1}", System.Threading.Thread.CurrentThread.Name, e.Message + "\n" + e.StackTrace); } }
public SyncLatestHandler( ISnapshotSelectorContainer snapshotPool, IGameContexts gameContexts, ISnapshotEntityMapFilter snapshotEntityMapFilter) { _snapshotPool = snapshotPool; _gameContexts = gameContexts; _snapshotEntityMapFilter = snapshotEntityMapFilter; }
public CommoTickImmutabblitySystem( IGameContexts gameContexts) { foreach (var info in gameContexts.AllContexts) { if (info.CanContainComponent <FlagImmutabilityComponent>()) { _groups.Add(info.CreateGameGroup <FlagImmutabilityComponent>()); } } }
public CommonLifeTimeSystem( IGameContexts gameContexts) { foreach (var info in gameContexts.AllContexts) { if (info.CanContainComponent <LifeTimeComponent>()) { _groups.Add(info.CreateGameGroup <LifeTimeComponent>()); } } }
public UserPredictionProvider(ISnapshotSelector snapshotSelector, PlayerContext playerContext, IGameContexts gameContexts) : base(snapshotSelector, gameContexts) { this.playerContext = playerContext; }
public ClientCompensationWorldFactory(IGameContexts gameContexts, IHitBoxEntityManager hitboxHandler) : base(hitboxHandler) { _gameContexts = gameContexts; }
public ClientUpdateLatestManager(IGameContexts gameContexts) { this.gameContexts = gameContexts; }
public UpdateLatestHandler(IGameContexts gameContexts) { _gameContexts = gameContexts; }
public PlaybackInfoProvider(IGameContexts gameContexts) { this.gameContexts = gameContexts; }
public SnapshotFactory(IGameContexts gameContexts) { _gameContexts = gameContexts; }
public OfflineSnapshotSelector(EntityKey self, IGameContexts gameContexts) { _self = self; _snapshotFac = new SnapshotFactory(gameContexts); }
public AbstractPredictionProvider(ISnapshotSelector snapshotSelector, IGameContexts gameContexts) { this.snapshotSelector = snapshotSelector; this.gameContexts = gameContexts; }