public static void InvokeGameLogin(GameLoginEventArgs e) { if (GameLogin != null) { GameLogin(e); } }
public static void InvokeGameLogin(GameLoginEventArgs e) { if (EventSink.GameLogin != null) { EventSink.GameLogin.Invoke(e); } }
public static void InvokeGameLogin(GameLoginEventArgs e) => GameLogin?.Invoke(e);
public static void InvokeGameLogin( GameLoginEventArgs e ) { if ( GameLogin != null ) GameLogin( e ); }
public static void EventSink_GameLogin( GameLoginEventArgs e ) { if ( !IPLimiter.SocketBlock && !IPLimiter.Verify( e.State.Address ) ) { e.Accepted = false; Console.WriteLine( "Login: {0}: Past IP limit threshold", e.State ); using ( StreamWriter op = new StreamWriter( "ipLimits.log", true ) ) op.WriteLine( "{0}\tPast IP limit threshold\t{1}", e.State, DateTime.Now ); return; } string un = e.Username; string pw = e.Password; Account acct = Accounts.GetAccount( un ) as Account; if ( acct == null ) { e.Accepted = false; } else if ( !acct.HasAccess( e.State ) ) { Console.WriteLine( "Login: {0}: Access denied for '{1}'", e.State, un ); e.Accepted = false; } else if ( !acct.CheckPassword( pw ) ) { Console.WriteLine( "Login: {0}: Invalid password for '{1}'", e.State, un ); e.Accepted = false; } else if ( acct.Banned ) { Console.WriteLine( "Login: {0}: Banned account '{1}'", e.State, un ); e.Accepted = false; } else { acct.LogAccess( e.State ); Console.WriteLine( "Login: {0}: Account '{1}' at character list", e.State, un ); e.State.Account = acct; e.Accepted = true; e.CityInfo = StartingCities; } if ( !e.Accepted ) AccountAttackLimiter.RegisterInvalidAccess( e.State ); }
public static void EventSink_GameLogin( GameLoginEventArgs e ) { if ( !IPLimiter.SocketBlock && !IPLimiter.Verify( e.State.Address ) ) { e.Accepted = false; Console.WriteLine( "Login: {0}: Past IP limit threshold", e.State ); using ( StreamWriter op = new StreamWriter( "ipLimits.log", true ) ) op.WriteLine( "{0}\tPast IP limit threshold\t{1}", e.State, DateTime.Now ); return; } string un = e.Username; string pw = e.Password; Account acct = Accounts.GetAccount( un ); /*** BEGIN ADDED CODE ***/ SyncDB.PullAccount( un ); acct = Accounts.GetAccount( un ); /* if (acct == null) { Console.WriteLine("pulling {0}", un); System.Reflection.Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies(); foreach (System.Reflection.Assembly assembly in assemblies) { try { Type syncdb = assembly.GetType("Server.Accounting.SyncDB"); if (syncdb != null) { Console.WriteLine("found type SyncDB {0} in {1}", syncdb, assembly); syncdb.InvokeMember("PullAccount", System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public, null, null, new Object[]{ un }); Console.WriteLine("after PullAccount"); break; } } catch (Exception ex) { Console.WriteLine("during PullAccount: {0}", ex); } } acct = Accounts.GetAccount( un ); } */ /*** END ADDED CODE ***/ if ( acct == null ) { e.Accepted = false; } else if ( !acct.HasAccess( e.State ) ) { Console.WriteLine( "Login: {0}: Access denied for '{1}'", e.State, un ); e.Accepted = false; } else if ( !acct.CheckPassword( pw ) ) { Console.WriteLine( "Login: {0}: Invalid password for '{1}'", e.State, un ); e.Accepted = false; } else if ( acct.Banned ) { Console.WriteLine( "Login: {0}: Banned account '{1}'", e.State, un ); e.Accepted = false; } else { acct.LogAccess( e.State ); Console.WriteLine( "Login: {0}: Account '{1}' at character list", e.State, un ); e.State.Account = acct; e.Accepted = true; e.CityInfo = StartingCities; } if ( !e.Accepted ) AccountAttackLimiter.RegisterInvalidAccess( e.State ); }
public static void EventSink_GameLogin( GameLoginEventArgs e ) { if ( !IPLimiter.SocketBlock && !IPLimiter.Verify( e.State.Address ) ) { e.Accepted = false; log.Warn(String.Format("Login: {0}: Past IP limit threshold", e.State)); return; } string un = e.Username; string pw = e.Password; Account acct = Accounts.GetAccount( un ); if ( acct == null ) { e.Accepted = false; } else if ( !acct.HasAccess( e.State ) ) { log.Error(String.Format("Login: {0}: Access denied for '{1}'", e.State, un)); e.Accepted = false; } else if ( !acct.CheckPassword( pw ) ) { log.Error(String.Format("Login: {0}: Invalid password for '{1}'", e.State, un)); e.Accepted = false; } else if ( acct.Banned ) { log.Error(String.Format("Login: {0}: Banned account '{1}'", e.State, un)); e.Accepted = false; } else { acct.LogAccess( e.State ); log.Info(String.Format("Login: {0}: Account '{1}' at character list", e.State, un)); e.State.Account = acct; e.Accepted = true; e.CityInfo = StartingCities; } if ( !e.Accepted ) AccountAttackLimiter.RegisterInvalidAccess( e.State ); }
public static void InvokeGameLogin(GameLoginEventArgs e) { if (GameLogin != null) { foreach (GameLoginEventHandler currentDelegate in GameLogin.GetInvocationList()) { try { currentDelegate.Invoke(e); } catch (Exception ex) { // Log an exception EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); } } } }