Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 0 additions & 93 deletions Projects/Server/Events/CharacterCreatedEvent.cs

This file was deleted.

5 changes: 0 additions & 5 deletions Projects/Server/Events/EventSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,4 @@ public static void InvokePaperdollRequest(Mobile beholder, Mobile beheld) =>

public static event Action ServerStarted;
public static void InvokeServerStarted() => ServerStarted?.Invoke();

public static event Action<Mobile, Item, short> TargetByResourceMacro;

public static void InvokeTargetByResourceMacro(Mobile m, Item item, short resourceType) =>
TargetByResourceMacro?.Invoke(m, item, resourceType);
}
48 changes: 0 additions & 48 deletions Projects/Server/Events/GameLoginEvent.cs

This file was deleted.

59 changes: 0 additions & 59 deletions Projects/Server/Events/ServerListEvent.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Projects/Server/Mobiles/Mobile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class DamageEntry
}

[Flags]
public enum StatType
public enum StatType : byte
{
Str = 1,
Dex = 2,
Expand Down
6 changes: 4 additions & 2 deletions Projects/UOContent/Accounting/AccountHandler.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.Net;
using ModernUO.CodeGeneratedEvents;
using Server.Accounting;
using Server.Engines.CharacterCreation;
using Server.Engines.Help;
using Server.Logging;
using Server.Network;
Expand Down Expand Up @@ -65,7 +67,6 @@ public static void Configure()
public static void Initialize()
{
EventSink.AccountLogin += EventSink_AccountLogin;
EventSink.GameLogin += EventSink_GameLogin;
}

[Usage("Password <newPassword> <repeatPassword>")]
Expand Down Expand Up @@ -348,7 +349,8 @@ public static void EventSink_AccountLogin(AccountLoginEventArgs e)
}
}

public static void EventSink_GameLogin(GameLoginEventArgs e)
[OnEvent(nameof(GameServer.GameServerLoginEvent))]
public static void OnGameServerLogin(GameServer.GameLoginEventArgs e)
{
var un = e.Username;
var pw = e.Password;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using Server.Accounting;
using Server.Network;

namespace Server.Engines.CharacterCreation;

Check notice on line 4 in Projects/UOContent/Engines/Character Creation/CharacterCreatedEvent.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Namespace does not correspond to file location

Namespace does not correspond to file location, must be: 'Server.Engines.Character_Creation'

public class CharacterCreatedEventArgs(
NetState state, IAccount a, string name, bool female,
int hue, byte[] stats, CityInfo city, (SkillName, byte)[] skills,
int shirtHue, int pantsHue, int hairId, int hairHue,
int beardId, int beardHue, int profession, Race race
)
{
public NetState State { get; } = state;

public IAccount Account { get; } = a;

public Mobile Mobile { get; set; }

public string Name { get; } = name;

public bool Female { get; } = female;

public int Hue { get; } = hue;

public byte[] Stats { get; } = stats;

public CityInfo City { get; } = city;

public (SkillName, byte)[] Skills { get; } = skills;

public int ShirtHue { get; } = shirtHue;

public int PantsHue { get; } = pantsHue;

public int HairID { get; } = hairId;

public int HairHue { get; } = hairHue;

public int BeardID { get; } = beardId;

public int BeardHue { get; } = beardHue;

public int Profession { get; set; } = profession;

public Race Race { get; } = race;
}
Loading
Loading