/// <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(); }
/// <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);