Adds style cop (#109)
This commit is contained in:
parent
3e715bcb60
commit
556a17aba8
1725 changed files with 33831 additions and 38046 deletions
|
|
@ -33,15 +33,15 @@ namespace Server
|
|||
Password = password;
|
||||
}
|
||||
|
||||
public NetState State{ get; }
|
||||
public NetState State { get; }
|
||||
|
||||
public string Username{ get; }
|
||||
public string Username { get; }
|
||||
|
||||
public string Password{ get; }
|
||||
public string Password { get; }
|
||||
|
||||
public bool Accepted{ get; set; }
|
||||
public bool Accepted { get; set; }
|
||||
|
||||
public ALRReason RejectReason{ get; set; }
|
||||
public ALRReason RejectReason { get; set; }
|
||||
}
|
||||
|
||||
public static partial class EventSink
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace Server
|
|||
{
|
||||
public class AggressiveActionEventArgs : EventArgs
|
||||
{
|
||||
private static Queue<AggressiveActionEventArgs> m_Pool = new Queue<AggressiveActionEventArgs>();
|
||||
private static readonly Queue<AggressiveActionEventArgs> m_Pool = new Queue<AggressiveActionEventArgs>();
|
||||
|
||||
private AggressiveActionEventArgs(Mobile aggressed, Mobile aggressor, bool criminal)
|
||||
{
|
||||
|
|
@ -35,11 +35,11 @@ namespace Server
|
|||
Criminal = criminal;
|
||||
}
|
||||
|
||||
public Mobile Aggressed{ get; private set; }
|
||||
public Mobile Aggressed { get; private set; }
|
||||
|
||||
public Mobile Aggressor{ get; private set; }
|
||||
public Mobile Aggressor { get; private set; }
|
||||
|
||||
public bool Criminal{ get; private set; }
|
||||
public bool Criminal { get; private set; }
|
||||
|
||||
public static AggressiveActionEventArgs Create(Mobile aggressed, Mobile aggressor, bool criminal)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,50 +51,50 @@ namespace Server
|
|||
Race = race;
|
||||
}
|
||||
|
||||
public NetState State{ get; }
|
||||
public NetState State { get; }
|
||||
|
||||
public IAccount Account{ get; }
|
||||
public IAccount Account { get; }
|
||||
|
||||
public Mobile Mobile{ get; set; }
|
||||
public Mobile Mobile { get; set; }
|
||||
|
||||
public string Name{ get; }
|
||||
public string Name { get; }
|
||||
|
||||
public bool Female{ get; }
|
||||
public bool Female { get; }
|
||||
|
||||
public int Hue{ get; }
|
||||
public int Hue { get; }
|
||||
|
||||
public int Str{ get; }
|
||||
public int Str { get; }
|
||||
|
||||
public int Dex{ get; }
|
||||
public int Dex { get; }
|
||||
|
||||
public int Int{ get; }
|
||||
public int Int { get; }
|
||||
|
||||
public CityInfo City{ get; }
|
||||
public CityInfo City { get; }
|
||||
|
||||
public SkillNameValue[] Skills{ get; }
|
||||
public SkillNameValue[] Skills { get; }
|
||||
|
||||
public int ShirtHue{ get; }
|
||||
public int ShirtHue { get; }
|
||||
|
||||
public int PantsHue{ get; }
|
||||
public int PantsHue { get; }
|
||||
|
||||
public int HairID{ get; }
|
||||
public int HairID { get; }
|
||||
|
||||
public int HairHue{ get; }
|
||||
public int HairHue { get; }
|
||||
|
||||
public int BeardID{ get; }
|
||||
public int BeardID { get; }
|
||||
|
||||
public int BeardHue{ get; }
|
||||
public int BeardHue { get; }
|
||||
|
||||
public int Profession{ get; set; }
|
||||
public int Profession { get; set; }
|
||||
|
||||
public Race Race{ get; }
|
||||
public Race Race { get; }
|
||||
}
|
||||
|
||||
public struct SkillNameValue
|
||||
{
|
||||
public SkillName Name{ get; }
|
||||
public SkillName Name { get; }
|
||||
|
||||
public int Value{ get; }
|
||||
public int Value { get; }
|
||||
|
||||
public SkillNameValue(SkillName name, int value)
|
||||
{
|
||||
|
|
@ -103,7 +103,8 @@ namespace Server
|
|||
}
|
||||
}
|
||||
|
||||
public static partial class EventSink {
|
||||
public static partial class EventSink
|
||||
{
|
||||
public static event Action<CharacterCreatedEventArgs> CharacterCreated;
|
||||
public static void InvokeCharacterCreated(CharacterCreatedEventArgs e) => CharacterCreated?.Invoke(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ namespace Server
|
|||
{
|
||||
public CreateGuildEventArgs(uint id) => Id = id;
|
||||
|
||||
public uint Id{ get; set; }
|
||||
public uint Id { get; set; }
|
||||
|
||||
public BaseGuild Guild{ get; set; }
|
||||
public BaseGuild Guild { get; set; }
|
||||
}
|
||||
|
||||
public static partial class EventSink
|
||||
|
|
|
|||
|
|
@ -52,10 +52,14 @@ namespace Server
|
|||
public static void InvokeOpenSpellbookRequest(Mobile m, int type) => OpenSpellbookRequest?.Invoke(m, type);
|
||||
|
||||
public static event Action<Mobile, int, Item> CastSpellRequest;
|
||||
public static void InvokeCastSpellRequest(Mobile m, int spellID, Item book) => CastSpellRequest?.Invoke(m, spellID, book);
|
||||
|
||||
public static void InvokeCastSpellRequest(Mobile m, int spellID, Item book) =>
|
||||
CastSpellRequest?.Invoke(m, spellID, book);
|
||||
|
||||
public static event Action<Mobile, Item, Mobile> BandageTargetRequest;
|
||||
public static void InvokeBandageTargetRequest(Mobile m, Item bandage, Mobile target) => BandageTargetRequest?.Invoke(m, bandage, target);
|
||||
|
||||
public static void InvokeBandageTargetRequest(Mobile m, Item bandage, Mobile target) =>
|
||||
BandageTargetRequest?.Invoke(m, bandage, target);
|
||||
|
||||
public static event Action<Mobile, string> AnimateRequest;
|
||||
public static void InvokeAnimateRequest(Mobile m, string action) => AnimateRequest?.Invoke(m, action);
|
||||
|
|
@ -70,16 +74,22 @@ namespace Server
|
|||
public static void InvokeDisconnected(Mobile m) => Disconnected?.Invoke(m);
|
||||
|
||||
public static event Action<Mobile, Mobile, string> RenameRequest;
|
||||
public static void InvokeRenameRequest(Mobile from, Mobile target, string name) => RenameRequest?.Invoke(from, target, name);
|
||||
|
||||
public static void InvokeRenameRequest(Mobile from, Mobile target, string name) =>
|
||||
RenameRequest?.Invoke(from, target, name);
|
||||
|
||||
public static event Action<Mobile> PlayerDeath;
|
||||
public static void InvokePlayerDeath(Mobile m) => PlayerDeath?.Invoke(m);
|
||||
|
||||
public static event Action<Mobile, Mobile> VirtueGumpRequest;
|
||||
public static void InvokeVirtueGumpRequest(Mobile beholder, Mobile beheld) => VirtueGumpRequest?.Invoke(beholder, beheld);
|
||||
|
||||
public static void InvokeVirtueGumpRequest(Mobile beholder, Mobile beheld) =>
|
||||
VirtueGumpRequest?.Invoke(beholder, beheld);
|
||||
|
||||
public static event Action<Mobile, Mobile, int> VirtueItemRequest;
|
||||
public static void InvokeVirtueItemRequest(Mobile beholder, Mobile beheld, int gumpID) => VirtueItemRequest?.Invoke(beholder, beheld, gumpID);
|
||||
|
||||
public static void InvokeVirtueItemRequest(Mobile beholder, Mobile beheld, int gumpID) =>
|
||||
VirtueItemRequest?.Invoke(beholder, beheld, gumpID);
|
||||
|
||||
public static event Action<Mobile, int> VirtueMacroRequest;
|
||||
public static void InvokeVirtueMacroRequest(Mobile mobile, int virtueID) => VirtueMacroRequest?.Invoke(mobile, virtueID);
|
||||
|
|
@ -87,18 +97,17 @@ namespace Server
|
|||
public static event Action<Mobile> ChatRequest;
|
||||
public static void InvokeChatRequest(Mobile m) => ChatRequest?.Invoke(m);
|
||||
|
||||
|
||||
public static event Action<Mobile, Mobile> PaperdollRequest;
|
||||
public static void InvokePaperdollRequest(Mobile beholder, Mobile beheld) => PaperdollRequest?.Invoke(beholder ,beheld);
|
||||
public static void InvokePaperdollRequest(Mobile beholder, Mobile beheld) => PaperdollRequest?.Invoke(beholder, beheld);
|
||||
|
||||
public static event Action<Mobile, Mobile> ProfileRequest;
|
||||
public static void InvokeProfileRequest(Mobile beholder, Mobile beheld) => ProfileRequest?.Invoke(beholder, beheld);
|
||||
|
||||
public static event Action<Mobile, Mobile, string> ChangeProfileRequest;
|
||||
|
||||
public static void InvokeChangeProfileRequest(Mobile beholder, Mobile beheld, string text) =>
|
||||
ChangeProfileRequest?.Invoke(beholder, beheld, text);
|
||||
|
||||
|
||||
public static event Action<NetState, int> DeleteRequest;
|
||||
public static void InvokeDeleteRequest(NetState state, int index) => DeleteRequest?.Invoke(state, index);
|
||||
|
||||
|
|
@ -121,9 +130,12 @@ namespace Server
|
|||
public static void InvokeQuestGumpRequest(Mobile m) => QuestGumpRequest?.Invoke(m);
|
||||
|
||||
public static event Action<NetState, ClientVersion> ClientVersionReceived;
|
||||
public static void InvokeClientVersionReceived(NetState state, ClientVersion cv) => ClientVersionReceived?.Invoke(state, cv);
|
||||
|
||||
public static void InvokeClientVersionReceived(NetState state, ClientVersion cv) =>
|
||||
ClientVersionReceived?.Invoke(state, cv);
|
||||
|
||||
public static event Action<Mobile, List<Serial>> EquipMacro;
|
||||
|
||||
public static void InvokeEquipMacro(Mobile m, List<Serial> list)
|
||||
{
|
||||
if (list?.Count > 0)
|
||||
|
|
@ -139,12 +151,18 @@ namespace Server
|
|||
}
|
||||
|
||||
public static event Action<Mobile, IEntity, int> TargetedSpell;
|
||||
public static void InvokeTargetedSpell(Mobile m, IEntity target, int spellId) => TargetedSpell?.Invoke(m, target, spellId);
|
||||
|
||||
public static void InvokeTargetedSpell(Mobile m, IEntity target, int spellId) =>
|
||||
TargetedSpell?.Invoke(m, target, spellId);
|
||||
|
||||
public static event Action<Mobile, IEntity, int> TargetedSkillUse;
|
||||
public static void InvokeTargetedSkillUse(Mobile m, IEntity target, int skillId) => TargetedSkillUse?.Invoke(m, target, skillId);
|
||||
|
||||
public static void InvokeTargetedSkillUse(Mobile m, IEntity target, int skillId) =>
|
||||
TargetedSkillUse?.Invoke(m, target, skillId);
|
||||
|
||||
public static event Action<Mobile, Item, short> TargetByResourceMacro;
|
||||
public static void InvokeTargetByResourceMacro(Mobile m, Item item, short resourceType) => TargetByResourceMacro?.Invoke(m, item, resourceType);
|
||||
|
||||
public static void InvokeTargetByResourceMacro(Mobile m, Item item, short resourceType) =>
|
||||
TargetByResourceMacro?.Invoke(m, item, resourceType);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ namespace Server
|
|||
Blocked = false;
|
||||
}
|
||||
|
||||
public NetState NetState{ get; }
|
||||
public NetState NetState { get; }
|
||||
|
||||
public bool Blocked{ get; set; }
|
||||
public bool Blocked { get; set; }
|
||||
}
|
||||
|
||||
public static partial class EventSink
|
||||
|
|
|
|||
|
|
@ -33,15 +33,15 @@ namespace Server
|
|||
Password = pw;
|
||||
}
|
||||
|
||||
public NetState State{ get; }
|
||||
public NetState State { get; }
|
||||
|
||||
public string Username{ get; }
|
||||
public string Username { get; }
|
||||
|
||||
public string Password{ get; }
|
||||
public string Password { get; }
|
||||
|
||||
public bool Accepted{ get; set; }
|
||||
public bool Accepted { get; set; }
|
||||
|
||||
public CityInfo[] CityInfo{ get; set; }
|
||||
public CityInfo[] CityInfo { get; set; }
|
||||
}
|
||||
|
||||
public static partial class EventSink
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace Server
|
|||
{
|
||||
public class MovementEventArgs : EventArgs
|
||||
{
|
||||
private static Queue<MovementEventArgs> m_Pool = new Queue<MovementEventArgs>();
|
||||
private static readonly Queue<MovementEventArgs> m_Pool = new Queue<MovementEventArgs>();
|
||||
|
||||
public MovementEventArgs(Mobile mobile, Direction dir)
|
||||
{
|
||||
|
|
@ -34,11 +34,11 @@ namespace Server
|
|||
Direction = dir;
|
||||
}
|
||||
|
||||
public Mobile Mobile{ get; private set; }
|
||||
public Mobile Mobile { get; private set; }
|
||||
|
||||
public Direction Direction{ get; private set; }
|
||||
public Direction Direction { get; private set; }
|
||||
|
||||
public bool Blocked{ get; set; }
|
||||
public bool Blocked { get; set; }
|
||||
|
||||
public static MovementEventArgs Create(Mobile mobile, Direction dir)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ namespace Server
|
|||
{
|
||||
public ServerCrashedEventArgs(Exception e) => Exception = e;
|
||||
|
||||
public Exception Exception{ get; }
|
||||
public Exception Exception { get; }
|
||||
|
||||
public bool Close{ get; set; }
|
||||
public bool Close { get; set; }
|
||||
}
|
||||
|
||||
public static partial class EventSink
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ namespace Server
|
|||
Servers = new List<ServerInfo>();
|
||||
}
|
||||
|
||||
public NetState State{ get; }
|
||||
public NetState State { get; }
|
||||
|
||||
public IAccount Account{ get; }
|
||||
public IAccount Account { get; }
|
||||
|
||||
public bool Rejected{ get; set; }
|
||||
public bool Rejected { get; set; }
|
||||
|
||||
public List<ServerInfo> Servers{ get; }
|
||||
public List<ServerInfo> Servers { get; }
|
||||
|
||||
public void AddServer(string name, IPEndPoint address)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ namespace Server
|
|||
AllowConnection = true;
|
||||
}
|
||||
|
||||
public ConnectionContext Context{ get; }
|
||||
public ConnectionContext Context { get; }
|
||||
|
||||
public bool AllowConnection{ get; set; }
|
||||
public bool AllowConnection { get; set; }
|
||||
}
|
||||
|
||||
public static partial class EventSink
|
||||
|
|
|
|||
|
|
@ -14,23 +14,23 @@ namespace Server
|
|||
Keywords = keywords;
|
||||
}
|
||||
|
||||
public Mobile Mobile{ get; }
|
||||
public Mobile Mobile { get; }
|
||||
|
||||
public string Speech{ get; set; }
|
||||
public string Speech { get; set; }
|
||||
|
||||
public MessageType Type{ get; }
|
||||
public MessageType Type { get; }
|
||||
|
||||
public int Hue{ get; }
|
||||
public int Hue { get; }
|
||||
|
||||
public int[] Keywords{ get; }
|
||||
public int[] Keywords { get; }
|
||||
|
||||
public bool Handled{ get; set; }
|
||||
public bool Handled { get; set; }
|
||||
|
||||
public bool Blocked{ get; set; }
|
||||
public bool Blocked { get; set; }
|
||||
|
||||
public bool HasKeyword(int keyword)
|
||||
{
|
||||
for (int i = 0; i < Keywords.Length; ++i)
|
||||
for (var i = 0; i < Keywords.Length; ++i)
|
||||
if (Keywords[i] == keyword)
|
||||
return true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue