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:
parent
4110556e89
commit
47e16a03fe
14 changed files with 207 additions and 309 deletions
36
Projects/UOContent/Network/GatewayServer.cs
Normal file
36
Projects/UOContent/Network/GatewayServer.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using ModernUO.CodeGeneratedEvents;
|
||||
using Server.Accounting;
|
||||
|
||||
namespace Server.Network;
|
||||
|
||||
public static partial class GatewayServer
|
||||
{
|
||||
public class ServerListEventArgs
|
||||
{
|
||||
public ServerListEventArgs(NetState state, IAccount account)
|
||||
{
|
||||
State = state;
|
||||
Account = account;
|
||||
Servers = [];
|
||||
}
|
||||
|
||||
public NetState State { get; }
|
||||
|
||||
public IAccount Account { get; }
|
||||
|
||||
public bool Rejected { get; set; }
|
||||
|
||||
public List<ServerInfo> Servers { get; }
|
||||
|
||||
public void AddServer(string name, IPEndPoint address) => AddServer(name, 0, TimeZoneInfo.Local, address);
|
||||
|
||||
public void AddServer(string name, int fullPercent, TimeZoneInfo tz, IPEndPoint address) =>
|
||||
Servers.Add(new ServerInfo(name, fullPercent, tz, address));
|
||||
}
|
||||
|
||||
[GeneratedEvent(nameof(ServerListEvent))]
|
||||
public static partial void ServerListEvent(ServerListEventArgs e);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue