public override void Simulate() { try { OnStart(); if (IfMineKill) { NiecMod.KillNiec.KillSimNiecX.MineKill(mtarget, mdeathType, mobj, mplayDeathAnim, msleepyes); } } catch (ResetException) { StyledNotification.Show(new StyledNotification.Format("Simulate" + "Failed", StyledNotification.NotificationStyle.kGameMessagePositive)); //throw; } catch (Exception exception) { NiecException.WriteLog(mtarget.Name + " " + NiecException.LogException(exception), true, false, false); } #pragma warning disable 1058 catch { NiecException.PrintMessagePro("Failed to Mono Runtime!\n" + ToString(), false, 10); } #pragma warning restore 1058 finally { OnCleanUp(); Simulator.DestroyObject(ObjectId); } }
internal static void printfm(params string[] messages) { if (messages == null || messages.Length == 0) { NiecException.PrintMessagePro("no message", false, 50); return; } string str = ""; for (int i = 0; i < messages.Length; i++) { str += messages[i] ?? (i + ": no message"); } NiecException.PrintMessagePro(str, false, 50); }
internal static void printfo(object obj) { NiecException.PrintMessagePro(obj != null ? obj.ToString() : "no message", false, 50); }
internal static void printf(string message) { NiecException.PrintMessagePro(message ?? "no message", false, 50); }
public override void Simulate() { //mTaskC = Simulator.CurrentTask; //if (NonRandom) { // base.ObjectId = CurrentTaskID; //} if (errorRuntimeFound) { if (!needNoErrorRuntime) { if (ErrorRuntimeFound != null) { ErrorRuntimeFound.Append("\nDate: " + DateTime.Now.ToString() + "\nFailed to Mono Runtime!\n" + ToString()); } ScriptCore.Simulator.Simulator_DestroyObjectImpl(ObjectId.Value); return; } else { errorRuntimeFound = false; needNoErrorRuntimeNoFound = false; goto r; } } needNoErrorRuntimeNoFound = true; r: try { errorRuntimeFound = true; if (mFunction == null || mFunction.method_info == null || (!mFunction.Method.IsStatic && mFunction.Target == null)) { throw new NotSupportedException("NiecTask: mFunction GC BUG!"); } else { mFunction(); } } catch (Exception exception) { if (exception.StackTrace != null) { NiecException.WriteLog(ToString() + System.Environment.NewLine + System.Environment.NewLine + NiecException.LogException(exception), true, true, false); } if (WaitPerform_WaitingCurrentTask != NiecMod.Helpers.NiecRunCommand.NiecInvalidObjectGuid) { exThrow = exception; } } #pragma warning disable 1058 catch { NiecException.PrintMessagePro("Failed to Mono Runtime!\n" + ToString(), false, 10); } #pragma warning restore 1058 //finally //{ // //ResetFakeObjectId(); // Simulator.DestroyObject(ObjectId); //} finally { if (WaitPerform_WaitingCurrentTask != NiecMod.Helpers.NiecRunCommand.NiecInvalidObjectGuid) { Simulator.Wake(WaitPerform_WaitingCurrentTask); } ScriptCore.Simulator.Simulator_DestroyObjectImpl(ObjectId.Value); //NonOpenDGSID -= 10; } }