feat: Moves network related events to UOContent using code generation (#1945)

### Summary
- Moves `CharacterCreated` event to UOContent using code generated event _CharacterCreatedEvent_.
- Moves `TargetByResourceMacro` event to UOContent using code generated event _TargetByResourceMacro_.
- Moves `GameLogin` event to UOContent using code generated event _GameLoginEvent_.
- Moves `ServerList` event to UOContent using code generated event _ServerListEvent_.
- Streamlines ProfessionInfo


> [!IMPORTANT]
> **Developer Note**
> Custom scripts that use any of these event sinks will need to be updated to use the new code generated events.
This commit is contained in:
Kamron Batman 2024-09-06 16:57:10 -07:00 committed by GitHub
parent 4110556e89
commit 47e16a03fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 207 additions and 309 deletions

View file

@ -1,6 +1,6 @@
/*************************************************************************
* ModernUO *
* Copyright 2019-2023 - ModernUO Development Team *
* Copyright 2019-2024 - ModernUO Development Team *
* Email: hi@modernuo.com *
* File: IncomingExtendedCommandPackets.cs *
* *
@ -15,12 +15,13 @@
using System.Buffers;
using System.Runtime.CompilerServices;
using ModernUO.CodeGeneratedEvents;
using Server.Items;
using Server.Mobiles;
namespace Server.Network;
public static class IncomingExtendedCommandPackets
public static partial class IncomingExtendedCommandPackets
{
private static readonly PacketHandler[] _extendedHandlers = new PacketHandler[0x100];
@ -432,13 +433,16 @@ public static class IncomingExtendedCommandPackets
PlayerMobile.TargetedSkillUse(state.Mobile, World.FindEntity((Serial)reader.ReadUInt32()), skillId);
}
[GeneratedEvent("TargetByResourceMacro")]
public static partial void InvokeTargetByResourceMacro(Mobile m, Item item, short resourceType);
public static void TargetByResourceMacro(NetState state, SpanReader reader)
{
var serial = (Serial)reader.ReadUInt32();
if (serial.IsItem)
{
EventSink.InvokeTargetByResourceMacro(state.Mobile, World.FindItem(serial), reader.ReadInt16());
InvokeTargetByResourceMacro(state.Mobile, World.FindItem(serial), reader.ReadInt16());
}
}
}