Fixes body expression style.

This commit is contained in:
Kamron Batman 2018-09-14 08:46:14 -07:00
parent 3f0a72a62f
commit 33f5e77a24
957 changed files with 7424 additions and 15973 deletions

View file

@ -26,7 +26,9 @@ namespace Server.Network
{
private static List<BufferPool> m_Pools = new List<BufferPool>();
public static List<BufferPool> Pools{ get{ return m_Pools; } set{ m_Pools = value; } }
public static List<BufferPool> Pools{ get => m_Pools;
set => m_Pools = value;
}
private string m_Name;

View file

@ -30,7 +30,7 @@ namespace Server.Network
private byte[] m_Buffer;
public int Length{ get{ return m_Size; } }
public int Length => m_Size;
public ByteQueue()
{

View file

@ -243,11 +243,7 @@ namespace Server.Network {
public Compressor32() {
}
public string Version {
get {
return SafeNativeMethods.zlibVersion();
}
}
public string Version => SafeNativeMethods.zlibVersion();
public ZLibError Compress( byte[] dest, ref int destLength, byte[] source, int sourceLength ) {
return SafeNativeMethods.compress(dest, ref destLength, source, sourceLength);
@ -280,11 +276,7 @@ namespace Server.Network {
public Compressor64() {
}
public string Version {
get {
return SafeNativeMethods.zlibVersion();
}
}
public string Version => SafeNativeMethods.zlibVersion();
public ZLibError Compress( byte[] dest, ref int destLength, byte[] source, int sourceLength ) {
return SafeNativeMethods.compress(dest, ref destLength, source, sourceLength);
@ -317,11 +309,7 @@ namespace Server.Network {
public CompressorUnix32() {
}
public string Version {
get {
return SafeNativeMethods.zlibVersion();
}
}
public string Version => SafeNativeMethods.zlibVersion();
public ZLibError Compress( byte[] dest, ref int destLength, byte[] source, int sourceLength ) {
return SafeNativeMethods.compress(dest, ref destLength, source, sourceLength);
@ -354,11 +342,7 @@ namespace Server.Network {
public CompressorUnix64() {
}
public string Version {
get {
return SafeNativeMethods.zlibVersion();
}
}
public string Version => SafeNativeMethods.zlibVersion();
public ZLibError Compress( byte[] dest, ref int destLength, byte[] source, int sourceLength ) {
ulong destLengthLong = (ulong)destLength;

View file

@ -35,28 +35,10 @@ namespace Server.Network
m_OnReceive = onReceive;
}
public int PacketID
{
get
{
return m_PacketID;
}
}
public int PacketID => m_PacketID;
public OnEncodedPacketReceive OnReceive
{
get
{
return m_OnReceive;
}
}
public OnEncodedPacketReceive OnReceive => m_OnReceive;
public bool Ingame
{
get
{
return m_Ingame;
}
}
public bool Ingame => m_Ingame;
}
}

View file

@ -29,13 +29,7 @@ namespace Server.Network
m_Reader = reader;
}
public byte[] Buffer
{
get
{
return m_Reader.Buffer;
}
}
public byte[] Buffer => m_Reader.Buffer;
public void Trace( NetState state )
{

View file

@ -46,8 +46,8 @@ namespace Server.Network
private static IPEndPoint[] m_EndPoints;
public static IPEndPoint[] EndPoints {
get { return m_EndPoints; }
set { m_EndPoints = value; }
get => m_EndPoints;
set => m_EndPoints = value;
}
public Listener( IPEndPoint ipep )

View file

@ -63,8 +63,8 @@ namespace Server.Network
public Listener[] Listeners
{
get{ return m_Listeners; }
set{ m_Listeners = value; }
get => m_Listeners;
set => m_Listeners = value;
}
public void AddListener( Listener l )

View file

@ -73,26 +73,14 @@ namespace Server.Network {
private DateTime m_ConnectedOn;
public DateTime ConnectedOn {
get {
return m_ConnectedOn;
}
}
public DateTime ConnectedOn => m_ConnectedOn;
public TimeSpan ConnectedFor {
get {
return ( DateTime.UtcNow - m_ConnectedOn );
}
}
public TimeSpan ConnectedFor => ( DateTime.UtcNow - m_ConnectedOn );
internal int m_Seed;
internal int m_AuthID;
public IPAddress Address {
get {
return m_Address;
}
}
public IPAddress Address => m_Address;
private ClientFlags m_Flags;
@ -110,56 +98,34 @@ namespace Server.Network {
private IPacketEncoder m_Encoder = null;
public IPacketEncoder PacketEncoder {
get {
return m_Encoder;
}
set {
m_Encoder = value;
}
get => m_Encoder;
set => m_Encoder = value;
}
private static NetStateCreatedCallback m_CreatedCallback;
public static NetStateCreatedCallback CreatedCallback {
get {
return m_CreatedCallback;
}
set {
m_CreatedCallback = value;
}
get => m_CreatedCallback;
set => m_CreatedCallback = value;
}
public bool SentFirstPacket {
get {
return m_SentFirstPacket;
}
set {
m_SentFirstPacket = value;
}
get => m_SentFirstPacket;
set => m_SentFirstPacket = value;
}
public bool BlockAllPackets {
get {
return m_BlockAllPackets;
}
set {
m_BlockAllPackets = value;
}
get => m_BlockAllPackets;
set => m_BlockAllPackets = value;
}
public ClientFlags Flags {
get {
return m_Flags;
}
set {
m_Flags = value;
}
get => m_Flags;
set => m_Flags = value;
}
public ClientVersion Version {
get {
return m_Version;
}
get => m_Version;
set {
m_Version = value;
@ -244,38 +210,26 @@ namespace Server.Network {
Version704565 = Version70331 | NewSecureTrading
}
public bool NewSpellbook { get { return ((_ProtocolChanges & ProtocolChanges.NewSpellbook) != 0); } }
public bool DamagePacket { get { return ((_ProtocolChanges & ProtocolChanges.DamagePacket) != 0); } }
public bool Unpack { get { return ((_ProtocolChanges & ProtocolChanges.Unpack) != 0); } }
public bool BuffIcon { get { return ((_ProtocolChanges & ProtocolChanges.BuffIcon) != 0); } }
public bool NewHaven { get { return ((_ProtocolChanges & ProtocolChanges.NewHaven) != 0); } }
public bool ContainerGridLines { get { return ((_ProtocolChanges & ProtocolChanges.ContainerGridLines) != 0); } }
public bool ExtendedSupportedFeatures { get { return ((_ProtocolChanges & ProtocolChanges.ExtendedSupportedFeatures) != 0); } }
public bool StygianAbyss { get { return ((_ProtocolChanges & ProtocolChanges.StygianAbyss) != 0); } }
public bool HighSeas { get { return ((_ProtocolChanges & ProtocolChanges.HighSeas) != 0); } }
public bool NewCharacterList { get { return ((_ProtocolChanges & ProtocolChanges.NewCharacterList) != 0); } }
public bool NewCharacterCreation { get { return ((_ProtocolChanges & ProtocolChanges.NewCharacterCreation) != 0); } }
public bool ExtendedStatus { get { return ((_ProtocolChanges & ProtocolChanges.ExtendedStatus) != 0); } }
public bool NewMobileIncoming { get { return ((_ProtocolChanges & ProtocolChanges.NewMobileIncoming) != 0); } }
public bool NewSecureTrading { get { return ((_ProtocolChanges & ProtocolChanges.NewSecureTrading) != 0); } }
public bool NewSpellbook => ((_ProtocolChanges & ProtocolChanges.NewSpellbook) != 0);
public bool DamagePacket => ((_ProtocolChanges & ProtocolChanges.DamagePacket) != 0);
public bool Unpack => ((_ProtocolChanges & ProtocolChanges.Unpack) != 0);
public bool BuffIcon => ((_ProtocolChanges & ProtocolChanges.BuffIcon) != 0);
public bool NewHaven => ((_ProtocolChanges & ProtocolChanges.NewHaven) != 0);
public bool ContainerGridLines => ((_ProtocolChanges & ProtocolChanges.ContainerGridLines) != 0);
public bool ExtendedSupportedFeatures => ((_ProtocolChanges & ProtocolChanges.ExtendedSupportedFeatures) != 0);
public bool StygianAbyss => ((_ProtocolChanges & ProtocolChanges.StygianAbyss) != 0);
public bool HighSeas => ((_ProtocolChanges & ProtocolChanges.HighSeas) != 0);
public bool NewCharacterList => ((_ProtocolChanges & ProtocolChanges.NewCharacterList) != 0);
public bool NewCharacterCreation => ((_ProtocolChanges & ProtocolChanges.NewCharacterCreation) != 0);
public bool ExtendedStatus => ((_ProtocolChanges & ProtocolChanges.ExtendedStatus) != 0);
public bool NewMobileIncoming => ((_ProtocolChanges & ProtocolChanges.NewMobileIncoming) != 0);
public bool NewSecureTrading => ((_ProtocolChanges & ProtocolChanges.NewSecureTrading) != 0);
public bool IsUOTDClient {
get {
return ( (m_Flags & ClientFlags.UOTD) != 0 || ( m_Version != null && m_Version.Type == ClientType.UOTD ) );
}
}
public bool IsUOTDClient => ( (m_Flags & ClientFlags.UOTD) != 0 || ( m_Version != null && m_Version.Type == ClientType.UOTD ) );
public bool IsSAClient {
get {
return ( m_Version != null && m_Version.Type == ClientType.SA );
}
}
public bool IsSAClient => ( m_Version != null && m_Version.Type == ClientType.SA );
public List<SecureTrade> Trades {
get {
return m_Trades;
}
}
public List<SecureTrade> Trades => m_Trades;
public void ValidateAllTrades() {
for ( int i = m_Trades.Count - 1; i >= 0; --i ) {
@ -342,68 +296,36 @@ namespace Server.Network {
}
public bool CompressionEnabled {
get {
return m_CompressionEnabled;
}
set {
m_CompressionEnabled = value;
}
get => m_CompressionEnabled;
set => m_CompressionEnabled = value;
}
public int Sequence {
get {
return m_Sequence;
}
set {
m_Sequence = value;
}
get => m_Sequence;
set => m_Sequence = value;
}
public List<Gump> Gumps {
get {
return m_Gumps;
}
}
public List<Gump> Gumps => m_Gumps;
public List<HuePicker> HuePickers {
get {
return m_HuePickers;
}
}
public List<HuePicker> HuePickers => m_HuePickers;
public List<IMenu> Menus {
get {
return m_Menus;
}
}
public List<IMenu> Menus => m_Menus;
private static int m_GumpCap = 512, m_HuePickerCap = 512, m_MenuCap = 512;
public static int GumpCap {
get {
return m_GumpCap;
}
set {
m_GumpCap = value;
}
get => m_GumpCap;
set => m_GumpCap = value;
}
public static int HuePickerCap {
get {
return m_HuePickerCap;
}
set {
m_HuePickerCap = value;
}
get => m_HuePickerCap;
set => m_HuePickerCap = value;
}
public static int MenuCap {
get {
return m_MenuCap;
}
set {
m_MenuCap = value;
}
get => m_MenuCap;
set => m_MenuCap = value;
}
public void WriteConsole( string text ) {
@ -513,39 +435,23 @@ namespace Server.Network {
}
public CityInfo[] CityInfo {
get {
return m_CityInfo;
}
set {
m_CityInfo = value;
}
get => m_CityInfo;
set => m_CityInfo = value;
}
public Mobile Mobile {
get {
return m_Mobile;
}
set {
m_Mobile = value;
}
get => m_Mobile;
set => m_Mobile = value;
}
public ServerInfo[] ServerInfo {
get {
return m_ServerInfo;
}
set {
m_ServerInfo = value;
}
get => m_ServerInfo;
set => m_ServerInfo = value;
}
public IAccount Account {
get {
return m_Account;
}
set {
m_Account = value;
}
get => m_Account;
set => m_Account = value;
}
public override string ToString() {
@ -554,11 +460,7 @@ namespace Server.Network {
private static List<NetState> m_Instances = new List<NetState>();
public static List<NetState> Instances {
get {
return m_Instances;
}
}
public static List<NetState> Instances => m_Instances;
private static BufferPool m_ReceiveBufferPool = new BufferPool( "Receive", 2048, 2048 );
@ -1064,12 +966,8 @@ namespace Server.Network {
private static int m_CoalesceSleep = -1;
public static int CoalesceSleep {
get {
return m_CoalesceSleep;
}
set {
m_CoalesceSleep = value;
}
get => m_CoalesceSleep;
set => m_CoalesceSleep = value;
}
private long m_NextCheckActivity;
@ -1112,7 +1010,7 @@ namespace Server.Network {
private bool m_Disposing;
public bool IsDisposing { get { return m_Disposing; } }
public bool IsDisposing => m_Disposing;
public void Dispose() {
Dispose( true );
@ -1224,32 +1122,16 @@ namespace Server.Network {
}
}
public bool Running {
get {
return m_Running;
}
}
public bool Running => m_Running;
public bool Seeded {
get {
return m_Seeded;
}
set {
m_Seeded = value;
}
get => m_Seeded;
set => m_Seeded = value;
}
public Socket Socket {
get {
return m_Socket;
}
}
public Socket Socket => m_Socket;
public ByteQueue Buffer {
get {
return m_Buffer;
}
}
public ByteQueue Buffer => m_Buffer;
public ExpansionInfo ExpansionInfo {
get {
@ -1265,11 +1147,7 @@ namespace Server.Network {
}
}
public Expansion Expansion {
get {
return ( Expansion ) this.ExpansionInfo.ID;
}
}
public Expansion Expansion => ( Expansion ) this.ExpansionInfo.ID;
public bool SupportsExpansion( ExpansionInfo info, bool checkCoreExpansion ) {
if ( info == null || ( checkCoreExpansion && ( int ) Core.Expansion < info.ID ) )

View file

@ -39,42 +39,18 @@ namespace Server.Network
m_OnReceive = onReceive;
}
public int PacketID
{
get
{
return m_PacketID;
}
}
public int PacketID => m_PacketID;
public int Length
{
get
{
return m_Length;
}
}
public int Length => m_Length;
public OnPacketReceive OnReceive
{
get
{
return m_OnReceive;
}
}
public OnPacketReceive OnReceive => m_OnReceive;
public ThrottlePacketCallback ThrottleCallback
{
get{ return m_ThrottleCallback; }
set{ m_ThrottleCallback = value; }
get => m_ThrottleCallback;
set => m_ThrottleCallback = value;
}
public bool Ingame
{
get
{
return m_Ingame;
}
}
public bool Ingame => m_Ingame;
}
}

View file

@ -64,10 +64,7 @@ namespace Server.Network
private static EncodedPacketHandler[] m_EncodedHandlersLow;
private static Dictionary<int, EncodedPacketHandler> m_EncodedHandlersHigh;
public static PacketHandler[] Handlers
{
get{ return m_Handlers; }
}
public static PacketHandler[] Handlers => m_Handlers;
static PacketHandlers()
{
@ -1488,8 +1485,8 @@ namespace Server.Network
public static bool SingleClickProps
{
get{ return m_SingleClickProps; }
set{ m_SingleClickProps = value; }
get => m_SingleClickProps;
set => m_SingleClickProps = value;
}
public static void LookReq( NetState state, PacketReader pvSrc )
@ -1590,7 +1587,9 @@ namespace Server.Network
128
};
public static int[] ValidAnimations{ get{ return m_ValidAnimations; } set{ m_ValidAnimations = value; } }
public static int[] ValidAnimations{ get => m_ValidAnimations;
set => m_ValidAnimations = value;
}
public static void Animate( NetState state, PacketReader pvSrc )
{
@ -2479,8 +2478,8 @@ namespace Server.Network
public static bool ClientVerification
{
get{ return m_ClientVerification; }
set{ m_ClientVerification = value; }
get => m_ClientVerification;
set => m_ClientVerification = value;
}
internal struct AuthIDPersistence {

View file

@ -37,21 +37,9 @@ namespace Server.Network
m_Index = fixedSize ? 1 : 3;
}
public byte[] Buffer
{
get
{
return m_Data;
}
}
public byte[] Buffer => m_Data;
public int Size
{
get
{
return m_Size;
}
}
public int Size => m_Size;
public void Trace( NetState state )
{

View file

@ -416,39 +416,21 @@ namespace Server.Network
/// <summary>
/// Gets the total stream length.
/// </summary>
public long Length
{
get
{
return m_Stream.Length;
}
}
public long Length => m_Stream.Length;
/// <summary>
/// Gets or sets the current stream position.
/// </summary>
public long Position
{
get
{
return m_Stream.Position;
}
set
{
m_Stream.Position = value;
}
get => m_Stream.Position;
set => m_Stream.Position = value;
}
/// <summary>
/// The internal stream used by this PacketWriter instance.
/// </summary>
public MemoryStream UnderlyingStream
{
get
{
return m_Stream;
}
}
public MemoryStream UnderlyingStream => m_Stream;
/// <summary>
/// Offsets the current position from an origin.

View file

@ -480,21 +480,9 @@ namespace Server.Network
private int m_Number;
private int m_Charges;
public int Number
{
get
{
return m_Number;
}
}
public int Number => m_Number;
public int Charges
{
get
{
return m_Charges;
}
}
public int Charges => m_Charges;
public EquipInfoAttribute( int number ) : this( number, -1 )
{
@ -514,37 +502,13 @@ namespace Server.Network
private bool m_Unidentified;
private EquipInfoAttribute[] m_Attributes;
public int Number
{
get
{
return m_Number;
}
}
public int Number => m_Number;
public Mobile Crafter
{
get
{
return m_Crafter;
}
}
public Mobile Crafter => m_Crafter;
public bool Unidentified
{
get
{
return m_Unidentified;
}
}
public bool Unidentified => m_Unidentified;
public EquipInfoAttribute[] Attributes
{
get
{
return m_Attributes;
}
}
public EquipInfoAttribute[] Attributes => m_Attributes;
public EquipmentInfo( int number, Mobile crafter, bool unidentified, EquipInfoAttribute[] attributes )
{
@ -2391,8 +2355,12 @@ namespace Server.Network
{
private int m_TextEntries, m_Switches;
public int TextEntries { get { return m_TextEntries; } set { m_TextEntries = value; } }
public int Switches { get { return m_Switches; } set { m_Switches = value; } }
public int TextEntries { get => m_TextEntries;
set => m_TextEntries = value;
}
public int Switches { get => m_Switches;
set => m_Switches = value;
}
private Gump m_Gump;
@ -2543,8 +2511,12 @@ namespace Server.Network
private int m_LayoutLength;
public int TextEntries{ get{ return m_TextEntries; } set{ m_TextEntries = value; } }
public int Switches{ get{ return m_Switches; } set{ m_Switches = value; } }
public int TextEntries{ get => m_TextEntries;
set => m_TextEntries = value;
}
public int Switches{ get => m_Switches;
set => m_Switches = value;
}
public DisplayGumpFast( Gump g ) : base( 0xB0 )
{
@ -2831,7 +2803,9 @@ namespace Server.Network
{
private static FeatureFlags m_AdditionalFlags;
public static FeatureFlags Value{ get{ return m_AdditionalFlags; } set{ m_AdditionalFlags = value; } }
public static FeatureFlags Value{ get => m_AdditionalFlags;
set => m_AdditionalFlags = value;
}
public static SupportedFeatures Instantiate( NetState ns )
{
@ -2870,14 +2844,14 @@ namespace Server.Network
public static int Maximum
{
get{ return m_Maximum; }
set{ m_Maximum = value; }
get => m_Maximum;
set => m_Maximum = value;
}
public static bool Enabled
{
get{ return m_Enabled; }
set{ m_Enabled = value; }
get => m_Enabled;
set => m_Enabled = value;
}
public static void Write( PacketWriter stream, int cur, int max )
@ -3917,92 +3891,50 @@ namespace Server.Network
public string City
{
get
{
return m_City;
}
set
{
m_City = value;
}
get => m_City;
set => m_City = value;
}
public string Building
{
get
{
return m_Building;
}
set
{
m_Building = value;
}
get => m_Building;
set => m_Building = value;
}
public int Description
{
get
{
return m_Description;
}
set
{
m_Description = value;
}
get => m_Description;
set => m_Description = value;
}
public int X
{
get
{
return m_Location.X;
}
set
{
m_Location.X = value;
}
get => m_Location.X;
set => m_Location.X = value;
}
public int Y
{
get
{
return m_Location.Y;
}
set
{
m_Location.Y = value;
}
get => m_Location.Y;
set => m_Location.Y = value;
}
public int Z
{
get
{
return m_Location.Z;
}
set
{
m_Location.Z = value;
}
get => m_Location.Z;
set => m_Location.Z = value;
}
public Point3D Location
{
get
{
return m_Location;
}
set
{
m_Location = value;
}
get => m_Location;
set => m_Location = value;
}
public Map Map
{
get{ return m_Map; }
set{ m_Map = value; }
get => m_Map;
set => m_Map = value;
}
}
@ -4086,10 +4018,7 @@ namespace Server.Network
{
private static ThirdPartyFeature m_Disabled = 0;
public static ThirdPartyFeature DisabledFeatures
{
get { return m_Disabled; }
}
public static ThirdPartyFeature DisabledFeatures => m_Disabled;
public static void Disable( ThirdPartyFeature feature )
{
@ -4206,8 +4135,8 @@ namespace Server.Network
public static CharacterListFlags AdditionalFlags
{
get{ return m_AdditionalFlags; }
set{ m_AdditionalFlags = value; }
get => m_AdditionalFlags;
set => m_AdditionalFlags = value;
}
}
@ -4368,50 +4297,26 @@ namespace Server.Network
public string Name
{
get
{
return m_Name;
}
set
{
m_Name = value;
}
get => m_Name;
set => m_Name = value;
}
public int FullPercent
{
get
{
return m_FullPercent;
}
set
{
m_FullPercent = value;
}
get => m_FullPercent;
set => m_FullPercent = value;
}
public int TimeZone
{
get
{
return m_TimeZone;
}
set
{
m_TimeZone = value;
}
get => m_TimeZone;
set => m_TimeZone = value;
}
public IPEndPoint Address
{
get
{
return m_Address;
}
set
{
m_Address = value;
}
get => m_Address;
set => m_Address = value;
}
public ServerInfo( string name, int fullPercent, TimeZone tz, IPEndPoint address )
@ -4517,10 +4422,7 @@ namespace Server.Network
private int m_Length;
private State m_State;
public int PacketID
{
get{ return m_PacketID; }
}
public int PacketID => m_PacketID;
protected Packet( int packetID )
{
@ -4553,13 +4455,7 @@ namespace Server.Network
}
}
public PacketWriter UnderlyingStream
{
get
{
return m_Stream;
}
}
public PacketWriter UnderlyingStream => m_Stream;
private const int CompressorBufferSize = 0x10000;
private static BufferPool m_CompressorBuffers = new BufferPool("Compressor", 4, CompressorBufferSize);

View file

@ -46,29 +46,13 @@ namespace Server.Network {
private byte[] _buffer;
private int _length;
public byte[] Buffer {
get {
return _buffer;
}
}
public byte[] Buffer => _buffer;
public int Length {
get {
return _length;
}
}
public int Length => _length;
public int Available {
get {
return ( _buffer.Length - _length );
}
}
public int Available => ( _buffer.Length - _length );
public bool IsFull {
get {
return ( _length == _buffer.Length );
}
}
public bool IsFull => ( _length == _buffer.Length );
private Gram() {
}
@ -95,9 +79,7 @@ namespace Server.Network {
private static BufferPool m_UnusedBuffers = new BufferPool( "Coalesced", 2048, m_CoalesceBufferSize );
public static int CoalesceBufferSize {
get {
return m_CoalesceBufferSize;
}
get => m_CoalesceBufferSize;
set {
if ( m_CoalesceBufferSize == value )
return;
@ -129,17 +111,9 @@ namespace Server.Network {
private Gram _buffered;
public bool IsFlushReady {
get {
return ( _pending.Count == 0 && _buffered != null );
}
}
public bool IsFlushReady => ( _pending.Count == 0 && _buffered != null );
public bool IsEmpty {
get {
return ( _pending.Count == 0 && _buffered == null );
}
}
public bool IsEmpty => ( _pending.Count == 0 && _buffered == null );
public SendQueue() {
_pending = new Queue<Gram>();