Server.Commands.CommandHandlers.Help_OnCommand C# (CSharp) Méthode

Help_OnCommand() private méthode

private Help_OnCommand ( Server.Commands.CommandEventArgs e ) : void
e Server.Commands.CommandEventArgs
Résultat void
		public static void Help_OnCommand( CommandEventArgs e )
		{
			Mobile m = e.Mobile;

			List<CommandEntry> list = new List<CommandEntry>();

			foreach ( CommandEntry entry in CommandSystem.Entries.Values )
				if ( m.AccessLevel >= entry.AccessLevel )
					list.Add( entry );

			list.Sort();

			StringBuilder sb = new StringBuilder();

			if ( list.Count > 0 )
				sb.Append( list[0].Command );

			for ( int i = 1; i < list.Count; ++i )
			{
				string v = list[i].Command;

				if ( (sb.Length + 1 + v.Length) >= 256 )
				{
					m.SendAsciiMessage( 0x482, sb.ToString() );
					sb = new StringBuilder();
					sb.Append( v );
				}
				else
				{
					sb.Append( ' ' );
					sb.Append( v );
				}
			}

			if ( sb.Length > 0 )
				m.SendAsciiMessage( 0x482, sb.ToString() );
		}