示例#1
0
            public ClientPlayerManager(NetworkEntityProcessor networkEntityProcessor)
            {
                _networkEntityProcessor = networkEntityProcessor;

                _localPlayers       = new FastList <LocalPlayerDetails>();
                _resimulateEntities = new FastList <MovementSnapshotsInputProcessor.PredictMovementEntityData>();
            }
示例#2
0
            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>();
            }
示例#3
0
        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);
                }
            }
        }