public ClientPlayerManager(NetworkEntityProcessor networkEntityProcessor) { _networkEntityProcessor = networkEntityProcessor; _localPlayers = new FastList <LocalPlayerDetails>(); _resimulateEntities = new FastList <MovementSnapshotsInputProcessor.PredictMovementEntityData>(); }
public ServerPlayerManager(int initialCapacity, NetworkEntityProcessor networkEntityProcessor) { PendingRemotePlayers = new FastList <ServerPendingRemotePlayer>(initialCapacity); ActiveRemotePlayers = new FastList <ServerActiveRemotePlayer>(initialCapacity); ActiveLocalPlayers = new FastList <ServerActiveLocalPlayer>(initialCapacity); _networkEntityProcessor = networkEntityProcessor; _workingUpdateEntities = new List <EntityExistenceDetails>(); _workingUpdateEntityInputs = new List <EntityUpdateInputAction>(); }
private void UpdateCurrentSceneInstance(SceneInstance newSceneInstance) { if (newSceneInstance == null) { _networkEntityProcessor = null; } // Set the current scene _currentSceneInstance = newSceneInstance; if (_currentSceneInstance != null) { _networkEntityProcessor ??= _currentSceneInstance.Processors.FirstOrDefault(x => x is NetworkEntityProcessor) as NetworkEntityProcessor; if (_networkEntityProcessor == null) { // Create this NetworkEntityProcessor if it doesn't exist _networkEntityProcessor = new NetworkEntityProcessor(); _currentSceneInstance.Processors.Add(_networkEntityProcessor); } } }