示例#1
0
    public void Update()
    {
        m_Tick++;
        m_UpdateHandle.Complete();

        if (m_PendingDisconnects.IsCreated)
        {
            m_PendingDisconnects.Dispose();
        }

        var acceptJob = new SoakServerAcceptJob
        {
            now         = m_Tick,
            driver      = m_ServerDriver,
            connections = m_Connections
        };
        var soakJob = new SoakServerUpdateClientsJob
        {
            driver      = m_ServerDriver.ToConcurrent(),
            pipeline    = m_Pipeline,
            connections = m_Connections.AsDeferredJobArray()
        };

        /*var time = Time.fixedTime;
         * if (time > m_NextStatsPrint)
         * {
         *  PrintStatistics();
         *  m_NextStatsPrint = time + 10;
         * }*/

        m_UpdateHandle = m_ServerDriver.ScheduleUpdate();
        m_UpdateHandle = acceptJob.Schedule(m_UpdateHandle);
        m_UpdateHandle = soakJob.Schedule(m_Connections, 1, m_UpdateHandle);
    }
示例#2
0
    public void Update()
    {
        m_Tick++;
        m_UpdateHandle.Complete();

        if (m_PendingDisconnects.IsCreated)
        {
            m_PendingDisconnects.Dispose();
        }

        var acceptJob = new SoakServerAcceptJob
        {
            now         = m_Tick,
            driver      = m_ServerDriver,
            connections = m_Connections
        };
        var soakJob = new SoakServerUpdateClientsJob
        {
            driver      = m_ServerDriver.ToConcurrent(),
            connections = m_Connections.ToDeferredJobArray()
        };

        m_UpdateHandle = m_ServerDriver.ScheduleUpdate();
        m_UpdateHandle = acceptJob.Schedule(m_UpdateHandle);
        m_UpdateHandle = soakJob.Schedule(m_Connections, 1, m_UpdateHandle);
    }