예제 #1
0
파일: Catalogs.cs 프로젝트: xXSicilyXx/Yupi
        /// <summary>
        ///     Checks the name of the pet.
        /// </summary>
        public void CheckPetName()
        {
            string petName = Request.GetString();
            int    i       = 0;

            if (petName.Length > 15)
            {
                i = 1;
            }
            else if (petName.Length < 3)
            {
                i = 2;
            }
            else if (!Yupi.IsValidAlphaNumeric(petName))
            {
                i = 3;
            }

            Response.Init(LibraryParser.OutgoingRequest("CheckPetNameMessageComposer"));
            Response.AppendInteger(i);
            Response.AppendString(petName);
            SendResponse();
        }
예제 #2
0
파일: CatalogManager.cs 프로젝트: sgf/Yupi
 /// <summary>
 ///     Checks the name of the pet.
 /// </summary>
 /// <param name="petName">Name of the pet.</param>
 /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
 internal static bool CheckPetName(string petName) => petName.Length >= 3 && petName.Length <= 15 && Yupi.IsValidAlphaNumeric(petName);