コード例 #1
0
        public static bool InvokeValidatePlayerName(ValidatePlayerNameEventArgs e)
        {
            if (ValidatePlayerName != null)
            {
                return(ValidatePlayerName(e));
            }

            return(false);
        }
コード例 #2
0
        public static bool EventSink_ValidatePlayerName( ValidatePlayerNameEventArgs e )
        {
            NetState state = e.State;
            string name = e.Name;
            string lowername = name.ToLower();

            NameResultMessage result = NameVerification.ValidatePlayerName( lowername, 2, 16, true, false, true, 1, NameVerification.SpaceDashPeriodQuote );

            switch ( result )
            {
                default:
                case NameResultMessage.NotAllowed: SendErrorOnCharacterCreation( state, String.Format( "The name {0} is not allowed.", name ) ); return false;
                case NameResultMessage.InvalidCharacter: SendErrorOnCharacterCreation( state, String.Format( "The name {0} contains invalid characters.", name ) ); return false;
                case NameResultMessage.TooFewCharacters: case NameResultMessage.TooManyCharacters: SendErrorOnCharacterCreation( state, "The name must be between 2-16 characters." ); return false;
                case NameResultMessage.AlreadyExists: SendErrorOnCharacterCreation( state, String.Format( "A player with the name {0} already exists.", name ) ); return false;
                case NameResultMessage.Allowed: return true;
            }
        }
コード例 #3
0
ファイル: EventSink.cs プロジェクト: greeduomacro/UO-Forever
		public static bool InvokeValidatePlayerName(ValidatePlayerNameEventArgs e)
		{
			if (ValidatePlayerName != null)
			{
				return ValidatePlayerName(e);
			}

			return false;
		}