Esempio n. 1
0
        public static NiecTask CreateWaitPerformWithExecuteTypeSID(ScriptExecuteType executeType, NiecNraTask.NraFunction func)
        {
            Simulator.CheckYieldingContext(true);
            if (func == null)
            {
                throw new ArgumentNullException("func");
            }

            var niecTask = new NiecTask(executeType, func);

            niecTask.WaitPerform_WaitingCurrentTask = Simulator.CurrentTask;
            niecTask.WaitPerform_CreatedTask        = niecTask.AddToSimulatorSID();
            return(niecTask);
        }
Esempio n. 2
0
        public static object SWaiting(NiecTask niecTask)
        {
            Simulator.CheckYieldingContext(true);
            if (niecTask == null)
            {
                throw new ArgumentNullException("niecTask");
            }

            if (niecTask.WaitPerform_DoneResult == null)
            {
                Simulator.Sleep(uint.MaxValue);
            }

            return(niecTask.WaitPerform_DoneResult);
        }
Esempio n. 3
0
        public static void SSetFakeObjectId(ObjectGuid value, out NiecTask currentTask)
        {
            currentTask = null;

            NiecTask task = Simulator.GetTask(Simulator.CurrentTask) as NiecTask;

            if (task != null)
            {
                currentTask    = task;
                task.mObjectId = value;
            }


            if (Simulator.CurrentTask == value)
            {
                NiecException.WriteLog("DEBUG: SetFakeObjectId ok");
            }
            else
            {
                NiecException.WriteLog("DEBUG: SetFakeObjectId failed");
            }
        }