feat: Converts player deletion handling to a generated event (#2029)
This commit is contained in:
parent
059f008b48
commit
2bff1d2cbc
15 changed files with 32 additions and 17 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using ModernUO.CodeGeneratedEvents;
|
||||
using Server.Collections;
|
||||
using Server.Mobiles;
|
||||
|
||||
|
|
@ -25,6 +26,7 @@ public class ChampionTitleSystem : GenericPersistence
|
|||
_championTitleTimer.Start();
|
||||
}
|
||||
|
||||
[OnEvent(nameof(PlayerMobile.PlayerDeletedEvent))]
|
||||
public static void OnPlayerDeleted(Mobile m)
|
||||
{
|
||||
if (m is PlayerMobile pm)
|
||||
|
|
|
|||
|
|
@ -620,6 +620,7 @@ namespace Server.Engines.MLQuests
|
|||
context?.HandleDeath();
|
||||
}
|
||||
|
||||
[OnEvent(nameof(PlayerMobile.PlayerDeletedEvent))]
|
||||
public static void HandleDeletion(PlayerMobile pm)
|
||||
{
|
||||
var context = GetContext(pm);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using ModernUO.CodeGeneratedEvents;
|
||||
using Server.Collections;
|
||||
using Server.Logging;
|
||||
using Server.Mobiles;
|
||||
|
|
@ -41,6 +42,7 @@ public class PlayerMurderSystem : GenericPersistence
|
|||
EventSink.Disconnected += OnDisconnected;
|
||||
}
|
||||
|
||||
[OnEvent(nameof(PlayerMobile.PlayerDeletedEvent))]
|
||||
public static void OnPlayerDeleted(Mobile m)
|
||||
{
|
||||
if (m is PlayerMobile pm && _murderContexts.Remove(pm, out var context))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ModernUO.CodeGeneratedEvents;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
|
@ -84,6 +85,7 @@ public class JusticeVirtue
|
|||
VirtueGump.Register(109, OnVirtueUsed);
|
||||
}
|
||||
|
||||
[OnEvent(nameof(PlayerMobile.PlayerDeletedEvent))]
|
||||
public static void OnPlayerDeleted(Mobile m)
|
||||
{
|
||||
if (m is PlayerMobile pm)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue