public static void ServerDispatch_DeathFilter(object sender, NetworkMessageEventArgs e) { try { int num = e.Message.Type; if (num == 414) { int killed = e.Message.Value <int>("killed"); int killer = e.Message.Value <int>("killer"); if (killed == lib.MyID) { WorldObject obj = lib.MyCore.WorldFilter[killer]; if (lib.Mode == 3) { if (lib.UseAlertDA == true) { Utility.InvokeTextA("Killed by " + obj.Name + " detected, Logging off!"); } lib.reason = "death by " + obj.Name; LogMethod.Logout(); } else if (lib.Mode != 3) { if (lib.MyCore.CharacterFilter.Vitae >= 10) { lib.reason = "death by " + obj.Name; Vitae.VitaeInit(); Report.LogEvent("Death"); } } if (obj.ObjectClass == ObjectClass.Player) { if (DthTmr1.Enabled == true) { DthTmr1.Tick -= DthTmr_Tick; DthTmr1.Stop(); DthTmr1.Dispose(); } if (DthTmr2.Enabled == true) { DthTmr2.Tick -= DthTmr_Tick2; DthTmr2.Stop(); DthTmr2.Dispose(); } if (DthTmr1.Enabled == false) { DthTmr1.Interval = 290000; DthTmr1.Tick += DthTmr_Tick; DthTmr1.Start(); } } } } } catch (Exception ex) { Repo.RecordException(ex); } }
public void Dispose() { lib.MyCore.CharacterFilter.Logoff -= Logoff_Request; lib.MyCore.ChatBoxMessage -= Logoff_Request2; PluginCore.LngTmr.Tick -= Logoff_Tick; Remote.Dispose(); Detection.Dispose(); Inventory.Dispose(); Components.Dispose(); Vitae.Dispose(); Death.Dispose(); lib.LoggingInstance--; }
public void LogInit() { if (lib.LoggingInstance < 1) { PluginCore.LngTmr.Tick += Logoff_Tick; lib.MyCore.CharacterFilter.Logoff += Logoff_Request; lib.MyCore.ChatBoxMessage += Logoff_Request2; Vitae.VitaeInit(); Death.DeathInit(); Components.CompsInit(); Inventory.InventoryInit(); Detection.DetectionInit(); Remote.RemoteInit(); lib.LoggingInstance++; } }