예제 #1
0
        public override bool ValidateArgs(BaseCommandImplementor impl, CommandEventArgs e)
        {
            if (e.Length >= 1)
            {
                Type t = ScriptCompiler.FindTypeByName(e.GetString(0));

                if (t == null)
                {
                    e.Mobile.SendMessage("No type with that name was found.");

                    string match = e.GetString(0).Trim();

                    if (match.Length < 3)
                    {
                        e.Mobile.SendMessage("Invalid search string.");
                        e.Mobile.SendGump(new AddGump(e.Mobile, match, 0, Type.EmptyTypes, false));
                    }
                    else
                    {
                        e.Mobile.SendGump(new AddGump(e.Mobile, match, 0, AddGump.Match(match).ToArray(), true));
                    }
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                e.Mobile.SendGump(new CategorizedAddGump(e.Mobile));
            }

            return(false);
        }
        public override bool ValidateArgs( BaseCommandImplementor impl, CommandEventArgs e )
        {
            if ( e.Length >= 1 )
            {
                Type t = ScriptCompiler.FindTypeByName( e.GetString( 0 ) );

                if ( t == null )
                {
                    e.Mobile.SendMessage( "No type with that name was found." );

                    string match = e.GetString( 0 ).Trim();

                    if ( match.Length < 3 )
                    {
                        e.Mobile.SendMessage( "Invalid search string." );
                        e.Mobile.SendGump( new AddGump( e.Mobile, match, 0, Type.EmptyTypes, false ) );
                    }
                    else
                    {
                        e.Mobile.SendGump( new AddGump( e.Mobile, match, 0, AddGump.Match( match ).ToArray(), true ) );
                    }
                }
                else
                {
                    return true;
                }
            }
            else
            {
                e.Mobile.SendGump( new CategorizedAddGump( e.Mobile ) );
            }

            return false;
        }
예제 #3
0
			public override bool ValidateArgs( BaseCommandImplementor impl, CommandEventArgs e )
			{
				if ( e.Arguments.Length >= 1 )
					return true;
				
				e.Mobile.SendMessage( "Usage: " + Usage );
				return false;
			}
예제 #4
0
        public static void Register(BaseCommand command)
        {
            m_AllCommands.Add(command);

            List <BaseCommandImplementor> impls = BaseCommandImplementor.Implementors;

            for (int i = 0; i < impls.Count; ++i)
            {
                BaseCommandImplementor impl = impls[i];

                if ((command.Supports & impl.SupportRequirement) != 0)
                {
                    impl.Register(command);
                }
            }
        }
		public static void Register( BaseCommandImplementor impl )
		{
			m_Implementors.Add( impl );
			impl.Register();
		}
예제 #6
0
 public virtual bool ValidateArgs(BaseCommandImplementor impl, CommandEventArgs e)
 {
     return true;
 }
예제 #7
0
 public static void Register(BaseCommandImplementor impl)
 {
     m_Implementors.Add(impl);
     impl.Register();
 }
예제 #8
0
 public virtual bool ValidateArgs(BaseCommandImplementor impl, CommandEventArgs e)
 {
     return(true);
 }
예제 #9
0
 public virtual bool ValidateArgs(BaseCommandImplementor impl, CommandEventArgs e) => true;
예제 #10
0
			public override bool ValidateArgs( BaseCommandImplementor impl, CommandEventArgs e )
			{
				if ( e.Arguments.Length >= 2 )
				{
					m_augmenttype = SpawnerType.GetType(e.GetString( 0 ));

					if(m_augmenttype == null)
					{
						e.Mobile.SendMessage( "Unknown augment type: " + e.GetString( 0 ));
						return false;
					}

					m_oldversion = -1;
					try
					{
						m_oldversion = int.Parse(e.GetString( 1 ));
					} 
					catch{}

					if(m_oldversion != -1)
					{
						return true;
					}
				}
				
				e.Mobile.SendMessage( "Usage: " + Usage );
				return false;
			}
예제 #11
0
			public override bool ValidateArgs( BaseCommandImplementor impl, CommandEventArgs e )
			{
				if ( e.Arguments.Length >= 1 )
				{
					try
					{
						m_maxsockets = int.Parse(e.GetString( 0 ));
					} 
					catch { e.Mobile.SendMessage( "Usage: " + Usage ); return false; }

					return true;

					
				}
				
				e.Mobile.SendMessage( "Usage: " + Usage );
				return false;
			}