Example #1
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            // Deserialize the command type from the reader stream
            // Execute the RPC
            inputDeps = JobHandle.CombineDependencies(inputDeps, m_ReceiveSystem.LastDriverWriter);
            var execJob = new RpcExecJob
            {
                commandBuffer    = m_Barrier.CreateCommandBuffer().ToConcurrent(),
                entityType       = GetArchetypeChunkEntityType(),
                connectionType   = GetArchetypeChunkComponentType <NetworkStreamConnection>(),
                inBufferType     = GetArchetypeChunkBufferType <IncomingRpcDataStreamBufferComponent>(),
                outBufferType    = GetArchetypeChunkBufferType <OutgoingRpcDataStreamBufferComponent>(),
                execute          = m_RpcData,
                hashToIndex      = m_RpcTypeHashToIndex,
                driver           = m_ReceiveSystem.ConcurrentDriver,
                reliablePipeline = m_ReceiveSystem.ReliablePipeline,
                protocolVersion  = GetSingleton <NetworkProtocolVersion>()
            };
            var handle = execJob.Schedule(m_RpcBufferGroup, inputDeps);

            m_Barrier.AddJobHandleForProducer(handle);
            handle = m_ReceiveSystem.Driver.ScheduleFlushSend(handle);
            m_ReceiveSystem.LastDriverWriter = handle;
            return(handle);
        }
Example #2
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        // Deserialize the command type from the reader stream
        // Execute the RPC
        var execJob = new RpcExecJob();

        execJob.commandBuffer = m_Barrier.CreateCommandBuffer().ToConcurrent();
        execJob.entityType    = GetArchetypeChunkEntityType();
        execJob.bufferType    = GetArchetypeChunkBufferType <IncomingRpcDataStreamBufferComponent>();
        var handle = execJob.Schedule(m_RpcBufferGroup, inputDeps);

        m_Barrier.AddJobHandleForProducer(handle);
        return(handle);
    }
Example #3
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            EntityCommandBuffer.ParallelWriter parallelWriter = _barrier.CreateCommandBuffer().AsParallelWriter();
            NetworkDriver.Concurrent           concurrent     = _receiveSystem.Driver.ToConcurrent();
            NetworkPipeline networkPipeline = _receiveSystem.ReliablePipeline;

            RpcExecJob job = new RpcExecJob
            {
                commandBuffer    = parallelWriter,
                entityType       = GetEntityTypeHandle(),
                connectionType   = GetComponentTypeHandle <NetworkStreamConnection>(),
                InBufferType     = GetBufferTypeHandle <IncomingRpcDataStreamBufferComponent>(),
                OutBufferType    = GetBufferTypeHandle <OutgoingRpcDataStreamBufferComponent>(),
                execute          = _rpcData,
                driver           = concurrent,
                reliablePipeline = networkPipeline
            };

            var jobHandle = job.ScheduleParallel(rpcExecuteGroup, inputDeps);

            _barrier.AddJobHandleForProducer(jobHandle);
            return(jobHandle);
        }
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            // Deserialize the command type from the reader stream
            // Execute the RPC
            inputDeps = JobHandle.CombineDependencies(inputDeps, m_ReceiveSystem.LastDriverWriter);
            var execJob = new RpcExecJob
            {
                commandBuffer    = m_Barrier.CreateCommandBuffer().AsParallelWriter(),
                entityType       = GetEntityTypeHandle(),
                connectionType   = GetComponentTypeHandle <NetworkStreamConnection>(),
                inBufferType     = GetBufferTypeHandle <IncomingRpcDataStreamBufferComponent>(),
                outBufferType    = GetBufferTypeHandle <OutgoingRpcDataStreamBufferComponent>(),
                execute          = m_RpcData,
                hashToIndex      = m_RpcTypeHashToIndex,
                driver           = m_ReceiveSystem.Driver,
                reliablePipeline = m_ReceiveSystem.ReliablePipeline,
                protocolVersion  = GetSingleton <NetworkProtocolVersion>()
            };

            inputDeps.Complete();
            execJob.Run(m_RpcBufferGroup);
            return(inputDeps);
        }
        protected override void OnUpdate()
        {
            // Deserialize the command type from the reader stream
            // Execute the RPC
            Dependency = JobHandle.CombineDependencies(Dependency, m_ReceiveSystem.LastDriverWriter, m_GhostSimulationGroup.LastGhostMapWriter);
            var execJob = new RpcExecJob
            {
                commandBuffer = m_Barrier.CreateCommandBuffer()
                                .AsParallelWriter(),
                entityType          = GetEntityTypeHandle(),
                connectionType      = GetComponentTypeHandle <NetworkStreamConnection>(),
                inBufferType        = GetBufferTypeHandle <IncomingRpcDataStreamBufferComponent>(),
                outBufferType       = GetBufferTypeHandle <OutgoingRpcDataStreamBufferComponent>(),
                errors              = m_RpcErrors.AsParallelWriter(),
                execute             = m_RpcData,
                hashToIndex         = m_RpcTypeHashToIndex,
                ghostMap            = m_GhostSimulationGroup.SpawnedGhostEntityMap,
                driver              = m_ReceiveSystem.ConcurrentDriver,
                reliablePipeline    = m_ReceiveSystem.ReliablePipeline,
                protocolVersion     = GetSingleton <NetworkProtocolVersion>(),
                dynamicAssemblyList = m_DynamicAssemblyList
            };

            Dependency = execJob.Schedule(m_RpcBufferGroup, Dependency);
            m_GhostSimulationGroup.LastGhostMapWriter = Dependency;
            m_Barrier.AddJobHandleForProducer(Dependency);
            Dependency = new RpcErrorReportingJob
            {
                commandBuffer = m_Barrier.CreateCommandBuffer(),
                connections   = GetComponentDataFromEntity <NetworkStreamConnection>(),
                errors        = m_RpcErrors
            }.Schedule(Dependency);
            m_Barrier.AddJobHandleForProducer(Dependency);
            Dependency = m_ReceiveSystem.Driver.ScheduleFlushSend(Dependency);
            m_ReceiveSystem.LastDriverWriter = Dependency;
        }