ACR_ServerCommunicator.ACR_ServerCommunicator.DrainCommandQueue C# (CSharp) Method

DrainCommandQueue() private method

This method drains items from the IPC thread command queue, i.e. those actions that must be performed in a script context because they need to call script APIs.
private DrainCommandQueue ( ) : void
return void
        private void DrainCommandQueue()
        {
            //
            // If we were requested by script to pause updates, then stop now.
            //

            WorldManager.PauseUpdates = (GetGlobalInt("ACR_SERVER_IPC_PAUSED") != 0);

            //
            // Opportunistically avoid taking the lock if we think that there
            // won't be a reason to.  This allows the world manager to batch up
            // large amounts of data fetches while under the lock, and then
            // avoid needlessly blocking the main thread until things have
            // become (more) quiescent.
            //

            if (!WorldManager.IsEventPending())
                return;

            lock (WorldManager)
            {
                if (WorldManager.IsEventQueueEmpty())
                    return;

                WorldManager.RunQueue(this, Database);
            }
        }
ACR_ServerCommunicator