check fc with ' '

This commit is contained in:
D1GQ committed 2024-08-13 21:00:53 -05:00
1 parent b0abb854f9
commit 485a1e3b89
1 file changed
+4 -1
+4 -1
View File
@@ -106,7 +106,10 @@ class PlayerControlPatch
string pattern = @"^[a-zA-Z0-9#]+$";
string hashtagPattern = @"^#[0-9]{4}$";
string friendCode = player.Data.FriendCode;
string friendCodeColor = (Regex.Replace(friendCode, hashtagPattern, string.Empty).Length is > 10 or < 5 || !Regex.IsMatch(friendCode, pattern) || !Regex.IsMatch(friendCode, hashtagPattern)) ? "#00f7ff" : "#ff0000";
string friendCodeColor = (Regex.Replace(friendCode, hashtagPattern, string.Empty).Length is > 10 or < 5
|| !Regex.IsMatch(friendCode, pattern)
|| !Regex.IsMatch(friendCode, hashtagPattern)
|| friendCode.Contains(' ')) ? "#00f7ff" : "#ff0000";
if (string.IsNullOrEmpty(friendCode) || friendCode == "")
{
friendCode = "???";