Upgrades code style - First batch (#22)

This commit is contained in:
Kamron Batman 2018-08-14 06:16:50 +08:00 committed by GitHub
parent 8ee42c8ea2
commit 632e8b4757
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1834 changed files with 10245 additions and 10437 deletions

View file

@ -147,13 +147,13 @@ namespace Server.RemoteAdmin
{
Timer.DelayCall( TimeSpan.FromSeconds( 15.0 ), new TimerStateCallback( Disconnect ), state );
}
private static void Disconnect( object state )
{
m_Auth.Remove( state );
((NetState)state).Dispose();
}
public static void Authenticate( NetState state, PacketReader pvSrc )
{
string user = pvSrc.ReadString( 30 );
@ -181,7 +181,7 @@ namespace Server.RemoteAdmin
else if ( a.AccessLevel < AccessLevel.Administrator || a.Banned )
{
Console.WriteLine( "ADMIN: Account '{0}' does not have admin access. Connection Denied.", user );
state.Send( new Login( LoginResponse.NoAccess ) );
state.Send( new Login( LoginResponse.NoAccess ) );
DelayedDisconnect( state );
}
else
@ -244,7 +244,7 @@ namespace Server.RemoteAdmin
}
}
}
public class EventTextWriter : System.IO.TextWriter
{
public delegate void OnConsoleChar( char ch );
@ -280,6 +280,6 @@ namespace Server.RemoteAdmin
m_OnLine( line );
}
public override System.Text.Encoding Encoding{ get{ return System.Text.Encoding.ASCII; } }
public override System.Text.Encoding Encoding => System.Text.Encoding.ASCII;
}
}

View file

@ -16,7 +16,7 @@ namespace Server.RemoteAdmin
public static bool Enabled { get { return m_Enabled; } set { m_Enabled = value; } }
public static StreamWriter Output { get { return m_Output; } }
public static StreamWriter Output => m_Output;
private static bool Initialized = false;
public static void LazyInitialize()