Skip to content

Commit

Permalink
feat: Moves network related events to UOContent using code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman committed Sep 6, 2024
1 parent 4110556 commit 80463d9
Show file tree
Hide file tree
Showing 14 changed files with 189 additions and 298 deletions.
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
5 changes: 3 additions & 2 deletions Projects/UOContent/Accounting/AccountHandler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Net;
using ModernUO.CodeGeneratedEvents;
using Server.Accounting;
using Server.Engines.Help;
using Server.Logging;
Expand Down Expand Up @@ -65,7 +66,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 +348,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;

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

0 comments on commit 80463d9

Please sign in to comment.