Server.Gumps.AdminGump.RemoveLoginIP_Callback C# (CSharp) Méthode

RemoveLoginIP_Callback() public static méthode

public static RemoveLoginIP_Callback ( Server.Mobile from, bool okay, object state ) : void
from Server.Mobile
okay bool
state object
Résultat void
		public static void RemoveLoginIP_Callback( Mobile from, bool okay, object state )
		{
			if ( from.AccessLevel < AccessLevel.Administrator )
				return;

			object[] states = (object[])state;

			Account a = (Account)states[0];
			IPAddress ip = (IPAddress)states[1];

			string notice;

			if ( okay )
			{
				IPAddress[] ips = a.LoginIPs;

				if ( ips.Length != 0 && ip == ips[0] && AccountHandler.IPTable.ContainsKey( ips[0] ) )
					--AccountHandler.IPTable[ip];

				List<IPAddress> newList = new List<IPAddress>( ips );
				newList.Remove( ip );
				a.LoginIPs = newList.ToArray();

				notice = String.Format( "{0} : Removed address.", ip );
			}
			else
			{
				notice = "You have chosen not to remove the address.";
			}

			from.SendGump( new AdminGump( from, AdminGumpPage.AccountDetails_Access_ClientIPs, 0, null, notice, a ) );
		}